From cff1a71813d4356be24d408d395026b244b3eebf Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 13:40:05 +0200 Subject: [PATCH 01/29] Fixes #160, #162 --- css/responsive.css | 3 + .../templates/page-profiles-list-page.php | 161 ++++++++++++------ post-types/templates/single-profiles.php | 11 +- utils/utils.php | 9 +- wp-odm_profile_pages.php | 2 +- 5 files changed, 132 insertions(+), 54 deletions(-) diff --git a/css/responsive.css b/css/responsive.css index 387d973..df45ab3 100644 --- a/css/responsive.css +++ b/css/responsive.css @@ -10,6 +10,9 @@ only screen and (max-width: 800px), #profiles_wrapper, .dataTables_scrollHead, .dataTables_scrollBody { width: 97vw !important; } + .section-title{ + border-bottom: 1px solid #999 !important; + } } @media diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index b4e2cc0..81386fc 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -119,54 +119,118 @@ -
-
-
-
-
-

- -
- -
- -
-

-
- -
-
-

-
    - -
  • - -
  • - -
-
- -
- -
-

-
- -
- -
-
-
-
-
+ is_desktop()): ?> + +
+
+ + +
+
+ +
+
+
+ +
+
+
+
+ +
+ +
+

+
+ +
+
+

+
    + +
  • + +
  • + +
+
+ +
+ +
+

+
+ +
+ +
+
+
+ + + +
+
+
+
+
+

+ +
+ +
+ +
+

+
+ +
+
+

+
    + +
  • + +
  • + +
+
+ +
+ +
+

+
+ +
+ +
+
+
+
+
+ +
@@ -353,6 +417,7 @@ "sDom": 'T<"H"lf>t<"F"ip>', processing: true, lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]], + iDisplayLength: 10, displayLength: -1 , columnDefs: [ { diff --git a/post-types/templates/single-profiles.php b/post-types/templates/single-profiles.php index 0a7c50f..1c62685 100644 --- a/post-types/templates/single-profiles.php +++ b/post-types/templates/single-profiles.php @@ -37,26 +37,29 @@ $sub_navigation = get_post_meta($post->ID, '_page_with_sub_navigation', true); ?> +

- +
+ +
+ if(!empty($dataset)): ?>
+ elseif (odm_screen_manager()->is_desktop()): ?>
diff --git a/utils/utils.php b/utils/utils.php index f9e1198..41e80f0 100644 --- a/utils/utils.php +++ b/utils/utils.php @@ -271,8 +271,15 @@ function echo_metadata_button($dataset){ function echo_download_button_link_to_datapage($dataset_id){ ?> - /dataset/?id="> + /dataset/?id="> + + is_desktop()): + _e('Download and Metadata', 'wp-odm_profile_pages'); + endif; ?> + diff --git a/wp-odm_profile_pages.php b/wp-odm_profile_pages.php index bc47710..961ca9f 100644 --- a/wp-odm_profile_pages.php +++ b/wp-odm_profile_pages.php @@ -3,7 +3,7 @@ * Plugin Name: ODM Profile Pages * Plugin URI: http://github.com/OpenDevelopmentMekong/odm_profile_pages * Description: Internal wordpress plugin for exposing custom content type for profile pages - * Version: 2.4.0 + * Version: 2.4.1 * Author: Alex Corbi (mail@lifeformapps.com) * Author URI: http://www.lifeformapps.com * License: GPLv3. From 5df87412cc8b413a6b99e6cc700e5fff4733d1f7 Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 13:58:49 +0200 Subject: [PATCH 02/29] enabling responsive on datatables --- post-types/templates/page-profiles-list-page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index 81386fc..601e187 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -413,7 +413,7 @@ }); oTable = $("#profiles").dataTable({ scrollX: true, - responsive: false, + responsive: true, "sDom": 'T<"H"lf>t<"F"ip>', processing: true, lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]], From 84a3ca181b196513e1c139722dbb9a7244f3de9d Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 14:42:27 +0200 Subject: [PATCH 03/29] enabling resonsive only when !in_desktop --- .../templates/page-profiles-list-page.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index 601e187..8f22fc2 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -387,11 +387,12 @@ } }; - - var get_od_selector_height = $('#od-selector').height(); - var get_filter_container_height = $('.filter-container').height(); - var get_position_profile_table = $('.filter-container').offset().top; - var table_fixed_position = get_od_selector_height +get_filter_container_height +40; + + var get_od_selector_height = $('#od-selector').height(); + var get_filter_container_height = $('.filter-container').height(); + var get_position_profile_table = $('.filter-container').offset().top; + var table_fixed_position = get_od_selector_height +get_filter_container_height +40; $(window).scroll(function() { if ($(document).scrollTop() >= get_position_profile_table) { @@ -413,8 +414,12 @@ }); oTable = $("#profiles").dataTable({ scrollX: true, + is_desktop()): ?> responsive: true, - "sDom": 'T<"H"lf>t<"F"ip>', + + sDom: 'T<"H"lf>t<"F"ip>', processing: true, lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]], iDisplayLength: 10, From cc1189762c2a074e60a2be68135d5a54485f9452 Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 15:06:11 +0200 Subject: [PATCH 04/29] better filter button --- css/profile-pages.css | 64 ++++++++++++++++++- .../templates/page-profiles-list-page.php | 18 ++++-- 2 files changed, 72 insertions(+), 10 deletions(-) diff --git a/css/profile-pages.css b/css/profile-pages.css index ff7f935..78a6d25 100644 --- a/css/profile-pages.css +++ b/css/profile-pages.css @@ -1,6 +1,7 @@ #profiles{ min-width: 98%; } + #profiles td { line-height: 16px; } @@ -61,9 +62,11 @@ table.dataTable thead th .th-value { .dataTables_length { margin-top: 8px; } + .dataTables_length .select2-container{ width: auto !important; } + .dataTables_info { margin-top: 2px; } @@ -134,7 +137,6 @@ table.dataTable thead .sorting_desc_disabled { display: none; } - .top { display: block; height: auto; @@ -153,32 +155,40 @@ table.dataTable thead .sorting_desc_disabled { .page-template-page-profiles .single-post .row { margin-top: 0; } + .single-profiles .post-meta { margin-top: 0 !important; } + .single-profiles #post-content img{ max-width: 100% !important; } + .single-profiles .twelve #post-content img.size-full { padding: 10px; max-width: 855px !important; } + .single-profiles #post-content .wp-caption img { padding: 0; margin-top: 0; border: 0; } + .single-profiles .twelve #post-content .wp-caption { width: 865px !important; } + .single-profiles .twelve #post-content .wp-caption img.size-full { max-width: 855px !important; padding: 0; } + .metadata_button { padding: 3px 10px !important; border-radius: 6px; } + #profiles_map { height: 400px; } @@ -230,6 +240,7 @@ table.dataTable thead .sorting_desc_disabled { .profile-metadata { padding-top: 15px; } + #profiles td .td-value ul { display: inline-block; margin-bottom: 0; @@ -267,9 +278,11 @@ table.dataTable thead .sorting_desc_disabled { padding: 5px 10px !important; margin-bottom: 0 !important; } + .total_listed ul{ margin: 0 !important } + .total_listed li{ display: inline-block; padding: 0; @@ -286,23 +299,32 @@ table.dataTable thead .sorting_desc_disabled { width: 100%; display: inline-block; } + .filter-container .panel{ width: 100%; padding: 10px 0 !important; float: left; } + .filter-container p, .filter-container ul, .filter-container li { margin-bottom: 5px; } -.filter-container #search_all{ - width: 90%; + +.mobile-filter-container{ + +} + +.filter-container #search_all, .mobile-filter-container #search_all{ + width: 100%; margin: 0 } + .fixed-filter-container { position: fixed; top: 37px; z-index: 99; } + .fixed_datatable_tool_bar { display: none; float: right; @@ -335,11 +357,13 @@ table.dataTable thead .sorting_desc_disabled { width: 100%; display: inline-block; } + #filter_by_classification .filter_by{ display: inline-block; margin-right: 1em; margin-bottom: 7px; } + #filter_by_classification .filter_by:last-child{ margin-right: 0 } @@ -347,24 +371,30 @@ table.dataTable thead .sorting_desc_disabled { font-size: 14px; z-index: 99; } + #filter_by_classification .label { display: inline; } + #filter_by_classification select { display: inline; margin: 0; padding: 2px 2px; } + .loading_icon{ background: #fff url('/wp-content/themes/wp-odm_theme/img/loading.gif') no-repeat right 5px center !important; background-size: 16px 16px !important; } + .twelve #filter_by_classification select { width: 200px; } + .seven #filter_by_classification select { width: 220px; } + .fixed_top_bar{ display: none; height: 50px; @@ -374,18 +404,22 @@ table.dataTable thead .sorting_desc_disabled { z-index: 99; margin-left: 20px; } + .fixed_top_bar div{ display: inline; } + .fixed_top_bar .dataTables_filter{ margin-top: 12px; margin-right: 10px; display: inline-block;; float: right; } + .fixed_top_bar .dataTables_filter input{ margin-left: 5px; } + .show_list_format { display: none; padding: 2px 15px; @@ -505,6 +539,7 @@ table.dataTable thead .sorting_desc_disabled { width: 100%; margin-right: 10px; } + .circular { border-radius: 50%; -webkit-border-radius: 50%; @@ -514,6 +549,7 @@ table.dataTable thead .sorting_desc_disabled { display: table-cell; vertical-align: middle; } + .circular img , .single #post-content .circular img { border: none; text-align: center; @@ -521,9 +557,11 @@ table.dataTable thead .sorting_desc_disabled { margin: auto; float: none; } + .dark-gray { background: #333; } + .smallest-size{ width: 50px; height: 50px; @@ -535,26 +573,33 @@ div.table-wrapper { overflow-x: auto; margin-bottom:20px; } + div.table-wrapper table.spreadsheet{ margin-bottom: 0; } + table.spreadsheet { width: 100%; border-bottom: 0; hyphens: none; } + table.spreadsheet tbody tr:nth-child(2n+1){ background-color: #fff; } + table.spreadsheet tbody tr:nth-child(2n+2){ background-color: #e8e8e8; } + table.spreadsheet tr{ border-right: 1px solid #efefef; } + table.spreadsheet th{ padding: 10px; } + table.spreadsheet td{ border: 0; padding: 10px; @@ -566,6 +611,7 @@ table.spreadsheet td{ table.no-bgcolor { hyphens: none;​ } + table.no-bgcolor tr td { hyphens: none; background-color: #fff; @@ -575,10 +621,12 @@ table.no-bgcolor tr td { table.no-bgcolor tr th { border-left: 1px solid #ddd; } + table.no-bgcolor tr td{ border-left: 1px solid #ccc; border-bottom: 1px solid #ccc; } + table.no-bgcolor tr{ border-right: 1px solid #ccc; } @@ -587,6 +635,7 @@ table.no-bgcolor tr{ #od-menu.od-submenu { position: relative; } + .od-submenu-bg { position: relative; opacity: 0.6; @@ -594,12 +643,14 @@ table.no-bgcolor tr{ height: 40px; width: 100%; } + .od-submenu .container { position: absolute; left: 0; right: 0; z-index: 2; } + #od-menu.od-submenu ul { text-align: right; margin: 0; @@ -618,6 +669,7 @@ table.no-bgcolor tr{ margin: 0; padding: 0 8px; } + #od-menu.od-submenu li:hover { background: #f1f1f1; } @@ -630,6 +682,7 @@ table.no-bgcolor tr{ margin: 0 0 0 6px; vertical-align: top; } + #od-menu.od-submenu li ul.sub-menu{ display: none; background: #f1f1f1; @@ -642,18 +695,23 @@ table.no-bgcolor tr{ #od-menu.od-submenu li ul.sub-menu li{ min-width: 150px; } + #od-menu.od-submenu li:hover ul{ display: block; } + #od-menu.od-submenu li > ul > li:hover{ background: #ddd; } + .od-submenu h1{ margin: 3px 0 0; } + .full-width-content ul{ padding: 5px 0; } + .full-width-content.above-map{ margin-bottom: 1em; } diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index 8f22fc2..c63b0a5 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -121,16 +121,20 @@ is_desktop()): ?> + if (odm_screen_manager()->is_desktop()): ?> -
-
- - -
+
+
+ +
+
+ + + +
-
+
From 41c10b81e9e9289d37ca7351ea449f4facca9afb Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 15:18:45 +0200 Subject: [PATCH 05/29] better markup --- .../templates/page-profiles-list-page.php | 177 +++++++++--------- 1 file changed, 89 insertions(+), 88 deletions(-) diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index c63b0a5..a491850 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -14,9 +14,9 @@
@@ -30,100 +30,100 @@
- - - -
-
- - if($array_map_profile){ - $count_project = array_count_values($array_map_profile); - } - ?> - - 1) { - $show_total_value .= "
  • "; + +
    +
    + + + 1): + $show_total_value .= "
  • "; + if(odm_language_manager()->get_current_language() == "km"): + $show_total_value .= __("Total", "wp-odm_profile_pages").get_the_title(). __("Listed", "wp-odm_profile_pages"). __(":", "wp-odm_profile_pages"); + $show_total_value .= $count_project==""? convert_to_kh_number("0"):convert_to_kh_number(count($count_project)); + else: + $show_total_value .= __("Total", "wp-odm_profile_pages")." ".get_the_title(). __(" listed", "wp-odm_profile_pages"). __(": ", "wp-odm_profile_pages"); + $show_total_value .= $count_project==""? "0":count($count_project); + endif; + $show_total_value .= "
  • "; + endif; + $explode_total_number_by_attribute_name = explode("\r\n", $total_number_by_attribute_name); + if($total_number_by_attribute_name!=""): + foreach ($explode_total_number_by_attribute_name as $key => $total_attribute_name): + if($total_attribute_name != $id ): + //check if total number require to list by Specific value + $total_attributename = trim($total_attribute_name); + if (strpos($total_attribute_name, '[') !== FALSE): + $split_field_name_and_value = explode("[", $total_attributename); + $total_attributename = trim($split_field_name_and_value[0]); //eg. data_class + $total_by_specifit_value = str_replace("]", "", $split_field_name_and_value[1]); + $specifit_value = explode(',', $total_by_specifit_value);// explode to get: Government data complete + endif; + $GLOBALS['total_attribute_name'] = $total_attributename; + $map_value = array_map(function($value){ return $value[$GLOBALS['total_attribute_name']];}, $profiles); + $count_number_by_attr = array_count_values($map_value); ?> + + 0): + foreach ($specifit_value as $field_value): + $field_value = trim(str_replace('"', "",$field_value)); + $show_total_value .= '
  • '.__($field_value, "wp-odm_profile_pages"). __(": ", "wp-odm_profile_pages"); + if(isset($count_number_by_attr[$field_value])): + $show_total_value .= ''. $count_number_by_attr[$field_value]==""? convert_to_kh_number("0"):convert_to_kh_number($count_number_by_attr[$field_value]).'
  • '; + endif; + endforeach; + else: + if($total_attribute_name != $id ): + $show_total_value .= "
  • "; if(odm_language_manager()->get_current_language() == "km"): - $show_total_value .= __("Total", "wp-odm_profile_pages").get_the_title(). __("Listed", "wp-odm_profile_pages"). __(":", "wp-odm_profile_pages"); - $show_total_value .= $count_project==""? convert_to_kh_number("0"):convert_to_kh_number(count($count_project)); + $show_total_value .= __("Total", "wp-odm_profile_pages").$DATASET_ATTRIBUTE[$total_attributename].__("Listed", "wp-odm_profile_pages").__(":", "wp-odm_profile_pages"); + $show_total_value .= ''.$total_attributename==""? convert_to_kh_number("0"):convert_to_kh_number(count($count_number_by_attr)).''; else: - $show_total_value .= __("Total", "wp-odm_profile_pages")." ".get_the_title(). __(" listed", "wp-odm_profile_pages"). __(": ", "wp-odm_profile_pages"); - $show_total_value .= $count_project==""? "0":count($count_project); + $show_total_value .= __("Total", "wp-odm_profile_pages")." ".$DATASET_ATTRIBUTE[$total_attributename]." ". __(" listed", "wp-odm_profile_pages").__(": ", "wp-odm_profile_pages"); + $show_total_value .= ''.$total_attributename==""? "0": count($count_number_by_attr).''; endif; - $show_total_value .= "
  • "; - } - $explode_total_number_by_attribute_name = explode("\r\n", $total_number_by_attribute_name); - if($total_number_by_attribute_name!=""){ - foreach ($explode_total_number_by_attribute_name as $key => $total_attribute_name) { - if($total_attribute_name != $id ){ - //check if total number require to list by Specific value - $total_attributename = trim($total_attribute_name); - if (strpos($total_attribute_name, '[') !== FALSE){ //if march - $split_field_name_and_value = explode("[", $total_attributename); - $total_attributename = trim($split_field_name_and_value[0]); //eg. data_class - $total_by_specifit_value = str_replace("]", "", $split_field_name_and_value[1]); - $specifit_value = explode(',', $total_by_specifit_value);// explode to get: Government data complete - } //end strpos - $GLOBALS['total_attribute_name'] = $total_attributename; - $map_value = array_map(function($value){ return $value[$GLOBALS['total_attribute_name']];}, $profiles); - $count_number_by_attr = array_count_values($map_value); - ?> - - 0){ - foreach ($specifit_value as $field_value) { - $field_value = trim(str_replace('"', "",$field_value)); - $show_total_value .= '
  • '.__($field_value, "wp-odm_profile_pages"). __(": ", "wp-odm_profile_pages"); - if(isset($count_number_by_attr[$field_value])){ - $show_total_value .= ''. $count_number_by_attr[$field_value]==""? convert_to_kh_number("0"):convert_to_kh_number($count_number_by_attr[$field_value]).'
  • '; - } - }//end foreach - }else { //count number by field name/attribute name: eg. map_id/developer - if($total_attribute_name != $id ){ - $show_total_value .= "
  • "; - if(odm_language_manager()->get_current_language() == "km"): - $show_total_value .= __("Total", "wp-odm_profile_pages").$DATASET_ATTRIBUTE[$total_attributename].__("Listed", "wp-odm_profile_pages").__(":", "wp-odm_profile_pages"); - $show_total_value .= ''.$total_attributename==""? convert_to_kh_number("0"):convert_to_kh_number(count($count_number_by_attr)).''; - else: - $show_total_value .= __("Total", "wp-odm_profile_pages")." ".$DATASET_ATTRIBUTE[$total_attributename]." ". __(" listed", "wp-odm_profile_pages").__(": ", "wp-odm_profile_pages"); - $show_total_value .= ''.$total_attributename==""? "0": count($count_number_by_attr).''; - endif; - $show_total_value .= "
  • "; - } - }//end if $specifit_value - }//if not map_id - }//foreach $explode_total_number_by_attribute_name - }//if exist - if($show_total_value){ - echo '
    '; - echo "
      "; - echo $show_total_value; - echo "
    "; - echo "
    "; - } - - ?> + $show_total_value .= ""; + endif; + endif; + endif; + endforeach; + endif; + if($show_total_value): + echo '
    '; + echo "
      "; + echo $show_total_value; + echo "
    "; + echo "
    "; + endif; ?>
    is_desktop()): ?> + if (!odm_screen_manager()->is_desktop()): ?> -
    +
    @@ -134,7 +134,7 @@
    -
    +
    @@ -361,7 +361,8 @@
    - +
    From 3d3d3b7aa8c67cb886b3d02f75c1721a3a8eb71e Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 15:35:12 +0200 Subject: [PATCH 06/29] fixing js --- .../templates/page-profiles-list-page.php | 81 ++++++++++--------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index a491850..5bd2c9c 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -435,51 +435,52 @@ "visible": false } ] - get_current_language() == 'km') { ?> - , "oLanguage": { - "sLengthMenu": 'បង្ហាញចំនួន ក្នុងមួយទំព័រ', - "sZeroRecords": "ព័ត៌មានពុំអាចរកបាន", - "sInfo": "បង្ហាញពីទី _START_ ដល់ _END_ នៃទិន្នន័យចំនួន _TOTAL_", - "sInfoEmpty": "បង្ហាញពីទី 0 ដល់ 0 នៃទិន្នន័យចំនួន 0", - "sInfoFiltered": "(ទាញចេញពីទិន្នន័យសរុបចំនួន _MAX_)", - "sSearch":"ស្វែងរក", - "oPaginate": { - "sFirst": "ទំព័រដំបូង", - "sLast": "ចុងក្រោយ", - "sPrevious": "មុន", - "sNext": "បន្ទាប់" - } + get_current_language() == 'km'): ?> + ,"oLanguage": { + "sLengthMenu": 'បង្ហាញចំនួន ក្នុងមួយទំព័រ', + "sZeroRecords": "ព័ត៌មានពុំអាចរកបាន", + "sInfo": "បង្ហាញពីទី _START_ ដល់ _END_ នៃទិន្នន័យចំនួន _TOTAL_", + "sInfoEmpty": "បង្ហាញពីទី 0 ដល់ 0 នៃទិន្នន័យចំនួន 0", + "sInfoFiltered": "(ទាញចេញពីទិន្នន័យសរុបចំនួន _MAX_)", + "sSearch":"ស្វែងរក", + "oPaginate": { + "sFirst": "ទំព័រដំបូង", + "sLast": "ចុងក្រោយ", + "sPrevious": "មុន", + "sNext": "បន្ទាប់" + } } + endif; ?> + if (isset($group_data_by_column_index) && !empty($group_data_by_column_index)): ?> , "aaSortingFixed": [[, 'asc' ]] //sort data in Data Classifications first before grouping - , "drawCallback": function ( settings ) { //Group colums - var api = this.api(); - var rows = api.rows( {page:'current'} ).nodes(); - var last=null; - - api.column(, {page:'current'} ).data().each( function ( group, i ) { - if ( last !== group ) { - $(rows).eq( i ).before( - ''+group+'' - ); - last = group; - } - } ); - - align_width_td_and_th(); - } + endif; ?> + , "drawCallback": function ( settings ) { //Group colums + var api = this.api(); + var rows = api.rows( {page:'current'} ).nodes(); + var last=null; + + api.column(, {page:'current'} ).data().each( function ( group, i ) { + if ( last !== group ) { + $(rows).eq( i ).before( + ''+group+'' + ); + last = group; + } + } ); + + align_width_td_and_th(); + } }); Date: Mon, 24 Jul 2017 15:56:30 +0200 Subject: [PATCH 07/29] better js --- post-types/templates/page-profiles-list-page.php | 4 ++-- post-types/templates/single-profiles.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index 5bd2c9c..67483cb 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -569,13 +569,13 @@ function create_filter_by_column_index(col_index){ if (odm_language_manager()->get_current_language() == 'km') { ?> var div_filter = $('
    '); div_filter.appendTo( $('#filter_by_classification')); - var select = $(''); var div_filter = $('
    '); div_filter.appendTo( $('#filter_by_classification')); - var select = $(''); + var select = $(''); select.appendTo( $('.filter_by_column_index_'+columnIndex) ) diff --git a/post-types/templates/single-profiles.php b/post-types/templates/single-profiles.php index 1c62685..b25f0c6 100644 --- a/post-types/templates/single-profiles.php +++ b/post-types/templates/single-profiles.php @@ -95,7 +95,7 @@ jQuery(document).ready(function($) { - $('select').select2(); + $('.filter_box').select2(); Date: Mon, 24 Jul 2017 16:12:30 +0200 Subject: [PATCH 08/29] using filter-container --- .../templates/page-profiles-list-page.php | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index 67483cb..86262c3 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -5,13 +5,13 @@ $full_width_position = get_post_meta(get_the_ID(), '_full_width_content_position', true); if($full_width_content && $full_width_position): ?> -
    -
    - ".$full_width_content."
    "; ?> -
    -
    +
    +
    + ".$full_width_content."
    "; ?> +
    +
    -
    +
    is_desktop()): ?> -
    +
    @@ -134,9 +134,12 @@
    -
    -
    -
    +
    +
    + +
    +
    +
    @@ -409,8 +412,7 @@ $('.filter-container').addClass("fixed-filter-container"); $('.dataTables_scrollBody').css('margin-top', 10+'em'); $('.fixed_datatable_tool_bar').css('display','inline-block'); - } - else { + }else { $('.dataTables_scrollHead').css('position','static'); $('.fixed-filter-container').css('position','static'); $('.fixed_datatable_tool_bar').hide(); @@ -484,18 +486,18 @@ }); - create_filter_by_column_index(); - + create_filter_by_column_index(); + //Set width of table header and body equally function align_width_td_and_th(){ From 07adbfdfe775a73fe479b168c3662b12e397a180 Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 16:18:59 +0200 Subject: [PATCH 09/29] Fixes #160 --- post-types/templates/page-profiles-list-page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index 86262c3..3b36441 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -134,7 +134,7 @@
    -
    +
    From e1bb8ac2d9ac9292b14776c90feddb5370c0d4b8 Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 17:41:04 +0200 Subject: [PATCH 10/29] better css --- css/profile-pages.css | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/css/profile-pages.css b/css/profile-pages.css index 78a6d25..639d0df 100644 --- a/css/profile-pages.css +++ b/css/profile-pages.css @@ -311,7 +311,7 @@ table.dataTable thead .sorting_desc_disabled { } .mobile-filter-container{ - + background-color: #fff; } .filter-container #search_all, .mobile-filter-container #search_all{ @@ -367,10 +367,6 @@ table.dataTable thead .sorting_desc_disabled { #filter_by_classification .filter_by:last-child{ margin-right: 0 } -.select2-container { - font-size: 14px; - z-index: 99; -} #filter_by_classification .label { display: inline; @@ -395,31 +391,6 @@ table.dataTable thead .sorting_desc_disabled { width: 220px; } -.fixed_top_bar{ - display: none; - height: 50px; - position: fixed; - top: 0; - background: #fff; - z-index: 99; - margin-left: 20px; -} - -.fixed_top_bar div{ - display: inline; -} - -.fixed_top_bar .dataTables_filter{ - margin-top: 12px; - margin-right: 10px; - display: inline-block;; - float: right; -} - -.fixed_top_bar .dataTables_filter input{ - margin-left: 5px; -} - .show_list_format { display: none; padding: 2px 15px; From 14a02478d92f2d313df03bb7d517321a0f38b8d2 Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 17:53:24 +0200 Subject: [PATCH 11/29] moving .loading_icon to theme --- css/profile-pages.css | 5 ----- 1 file changed, 5 deletions(-) diff --git a/css/profile-pages.css b/css/profile-pages.css index 639d0df..29f2dd7 100644 --- a/css/profile-pages.css +++ b/css/profile-pages.css @@ -378,11 +378,6 @@ table.dataTable thead .sorting_desc_disabled { padding: 2px 2px; } -.loading_icon{ - background: #fff url('/wp-content/themes/wp-odm_theme/img/loading.gif') no-repeat right 5px center !important; - background-size: 16px 16px !important; -} - .twelve #filter_by_classification select { width: 200px; } From 877b58270daa8786d58efa54edc60c5cd610c3d4 Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 17:59:10 +0200 Subject: [PATCH 12/29] Fixes #160 --- post-types/templates/single-profiles.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/post-types/templates/single-profiles.php b/post-types/templates/single-profiles.php index b25f0c6..ea432ad 100644 --- a/post-types/templates/single-profiles.php +++ b/post-types/templates/single-profiles.php @@ -42,9 +42,7 @@

    -
    - -
    +
    From ff1555c2ac263f8621938396a36daaffd701d2fe Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 18:02:37 +0200 Subject: [PATCH 13/29] better echo_download_button_link_to_datapage --- utils/utils.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/utils/utils.php b/utils/utils.php index 41e80f0..ad66c8f 100644 --- a/utils/utils.php +++ b/utils/utils.php @@ -273,10 +273,9 @@ function echo_download_button_link_to_datapage($dataset_id){ ?> /dataset/?id="> - is_desktop()): - _e('Download and Metadata', 'wp-odm_profile_pages'); - endif; ?> +
    + +
    Date: Mon, 24 Jul 2017 18:03:44 +0200 Subject: [PATCH 14/29] better echo_download_button_link_to_datapage --- utils/utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/utils.php b/utils/utils.php index ad66c8f..5644a3d 100644 --- a/utils/utils.php +++ b/utils/utils.php @@ -273,7 +273,7 @@ function echo_download_button_link_to_datapage($dataset_id){ ?> /dataset/?id="> -
    +
    From 05357b75be225f49ed850cf572cdf185ea880e97 Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 18:08:16 +0200 Subject: [PATCH 15/29] better title --- css/responsive.css | 4 +-- post-types/templates/single-profiles.php | 42 ++++++++++++------------ 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/css/responsive.css b/css/responsive.css index df45ab3..917eded 100644 --- a/css/responsive.css +++ b/css/responsive.css @@ -10,9 +10,7 @@ only screen and (max-width: 800px), #profiles_wrapper, .dataTables_scrollHead, .dataTables_scrollBody { width: 97vw !important; } - .section-title{ - border-bottom: 1px solid #999 !important; - } + } @media diff --git a/post-types/templates/single-profiles.php b/post-types/templates/single-profiles.php index ea432ad..20859c1 100644 --- a/post-types/templates/single-profiles.php +++ b/post-types/templates/single-profiles.php @@ -39,27 +39,27 @@
    -
    -
    -

    - -
    - -
    - -
    - is_desktop()): ?> -
    - -
    - -
    +
    +
    +

    + +
    + +
    + +
    + is_desktop()): ?> +
    + +
    + +
    From d370ca64b8b8d117c2a07ced7260073a0b0e2563 Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 18:28:14 +0200 Subject: [PATCH 16/29] better css --- css/profile-pages.css | 3 +-- css/responsive.css | 2 +- post-types/templates/page-profiles-list-page.php | 5 ++++- utils/utils.php | 7 ++++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/css/profile-pages.css b/css/profile-pages.css index 29f2dd7..be87f9f 100644 --- a/css/profile-pages.css +++ b/css/profile-pages.css @@ -412,7 +412,6 @@ table.dataTable thead .sorting_desc_disabled { box-sizing: border-box; display: inline-block; min-width: 1.5em; - //padding: 0.5em 1em; margin-left: 2px; text-align: center; text-decoration: none !important; @@ -575,7 +574,7 @@ table.spreadsheet td{ } table.no-bgcolor { - hyphens: none;​ + hyphens: none; } table.no-bgcolor tr td { diff --git a/css/responsive.css b/css/responsive.css index 917eded..a7a0537 100644 --- a/css/responsive.css +++ b/css/responsive.css @@ -10,7 +10,7 @@ only screen and (max-width: 800px), #profiles_wrapper, .dataTables_scrollHead, .dataTables_scrollBody { width: 97vw !important; } - + } @media diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index 3b36441..c84570e 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -398,7 +398,10 @@ var get_od_selector_height = $('#od-selector').height(); - var get_filter_container_height = $('.filter-container').height(); + var get_filter_container_height = 0; + $('.filter-container').each(function(index){ + get_filter_container_height += $(this).height(); + }); var get_position_profile_table = $('.filter-container').offset().top; var table_fixed_position = get_od_selector_height +get_filter_container_height +40; diff --git a/utils/utils.php b/utils/utils.php index 5644a3d..41e80f0 100644 --- a/utils/utils.php +++ b/utils/utils.php @@ -273,9 +273,10 @@ function echo_download_button_link_to_datapage($dataset_id){ ?> /dataset/?id="> -
    - -
    + is_desktop()): + _e('Download and Metadata', 'wp-odm_profile_pages'); + endif; ?>
    Date: Mon, 24 Jul 2017 18:32:42 +0200 Subject: [PATCH 17/29] etter js --- post-types/templates/page-profiles-list-page.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index c84570e..2f16c55 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -400,7 +400,9 @@ var get_od_selector_height = $('#od-selector').height(); var get_filter_container_height = 0; $('.filter-container').each(function(index){ - get_filter_container_height += $(this).height(); + if ($(this).css("display") !== 'none'){ + get_filter_container_height += $(this).height(); + } }); var get_position_profile_table = $('.filter-container').offset().top; var table_fixed_position = get_od_selector_height +get_filter_container_height +40; From 187d1fc8a86f5ad879e92c531e163d63d5c5a542 Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 18:48:34 +0200 Subject: [PATCH 18/29] better responsive --- post-types/templates/page-profiles-list-page.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index 2f16c55..911855c 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -428,7 +428,11 @@ scrollX: true, is_desktop()): ?> - responsive: true, + responsive: { + details: { + type: 'column' + } + }, sDom: 'T<"H"lf>t<"F"ip>', From 9ca5c4944b086313fd5486cd4ea87569443ec5f0 Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 18:51:05 +0200 Subject: [PATCH 19/29] better responsive --- post-types/templates/page-profiles-list-page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index 911855c..6565b2d 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -430,7 +430,7 @@ if (!odm_screen_manager()->is_desktop()): ?> responsive: { details: { - type: 'column' + type: 'inline' } }, Date: Mon, 24 Jul 2017 18:56:43 +0200 Subject: [PATCH 20/29] ying responsive class --- post-types/templates/page-profiles-list-page.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index 6565b2d..fe57e6a 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -242,7 +242,7 @@
    - +
    @@ -425,16 +425,7 @@ } }); oTable = $("#profiles").dataTable({ - scrollX: true, - is_desktop()): ?> - responsive: { - details: { - type: 'inline' - } - }, - + scrollX: true, sDom: 'T<"H"lf>t<"F"ip>', processing: true, lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]], From 1f858285b2c4e6c6201bd8c0ee273b37af58eb06 Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 18:58:30 +0200 Subject: [PATCH 21/29] Fixes #160 --- post-types/templates/page-profiles-list-page.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index fe57e6a..2f16c55 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -242,7 +242,7 @@
    -
    +
    @@ -425,7 +425,12 @@ } }); oTable = $("#profiles").dataTable({ - scrollX: true, + scrollX: true, + is_desktop()): ?> + responsive: true, + sDom: 'T<"H"lf>t<"F"ip>', processing: true, lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]], From 1d476d0b3afab21a260cac59d5d925b59d158b4a Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 19:00:25 +0200 Subject: [PATCH 22/29] better layout --- post-types/templates/page-profiles-list-page.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index 2f16c55..c9d6143 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -124,10 +124,10 @@ if (!odm_screen_manager()->is_desktop()): ?>
    -
    +
    -
    +
    From 8abf4b9bad68100b56ae8cf333ed7259957f6ac8 Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 19:02:41 +0200 Subject: [PATCH 23/29] better layout --- post-types/templates/page-profiles-list-page.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index c9d6143..6d1a165 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -124,14 +124,12 @@ if (!odm_screen_manager()->is_desktop()): ?>
    -
    - -
    -
    - + + +
    From 6325837ad1b95f75a1690d7d2e721ec62a5ecbe7 Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 19:11:15 +0200 Subject: [PATCH 24/29] better css --- css/profile-pages.css | 3 ++- post-types/templates/page-profiles-list-page.php | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/css/profile-pages.css b/css/profile-pages.css index be87f9f..3100179 100644 --- a/css/profile-pages.css +++ b/css/profile-pages.css @@ -312,11 +312,12 @@ table.dataTable thead .sorting_desc_disabled { .mobile-filter-container{ background-color: #fff; + display: inline-flex !important; } .filter-container #search_all, .mobile-filter-container #search_all{ width: 100%; - margin: 0 + margin: 0 10px 0 0; } .fixed-filter-container { diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index 6d1a165..d753178 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -121,14 +121,14 @@ is_desktop()): ?> + if (odm_screen_manager()->is_desktop()): ?> -
    -
    +
    +
    + -
    From a4991919648f279a0b40d79fc172b54accc112d8 Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 19:12:00 +0200 Subject: [PATCH 25/29] Fixes #160 --- post-types/templates/page-profiles-list-page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index d753178..93629d6 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -121,7 +121,7 @@ is_desktop()): ?> + if (!odm_screen_manager()->is_desktop()): ?>
    From e0f5755e2d4c3a023c567aeb92cbf4259c4bac6d Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Mon, 24 Jul 2017 19:16:34 +0200 Subject: [PATCH 26/29] Fixes #160 --- post-types/templates/page-profiles-list-page.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index 93629d6..a1cc81f 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -129,7 +129,8 @@ -
    +
    +
    From 0566adbe5c1d941401155af94b609f613e670bf2 Mon Sep 17 00:00:00 2001 From: Alex Corbi Date: Tue, 25 Jul 2017 16:20:46 +0200 Subject: [PATCH 27/29] added hideOnDestop to filter-container --- post-types/templates/page-profiles-list-page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/post-types/templates/page-profiles-list-page.php b/post-types/templates/page-profiles-list-page.php index a1cc81f..90b94f4 100644 --- a/post-types/templates/page-profiles-list-page.php +++ b/post-types/templates/page-profiles-list-page.php @@ -123,7 +123,7 @@ if (!odm_screen_manager()->is_desktop()): ?> -