Changeset 8496
- Timestamp:
- 03/24/2019 03:15:29 PM (6 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/locale-projects.php
r7617 r8496 86 86 <div class="sort-bar"> 87 87 <form id="sort-filter" action="" method="GET"> 88 <input type="hidden" name="s" value="<?php echo esc_attr( $search ?? '' ); ?>" 88 89 <input type="hidden" name="page" value="1"> 90 91 <?php if ( 'waiting' === $project->slug && is_user_logged_in() ) { ?> 92 <input id="filter-without-editors" type="checkbox" name="without-editors" value="1"<?php checked( isset( $_GET['without-editors'] ) ); ?>> 93 <label for="filter-without-editors">Limit to projects without editors</label> 94 <span class="filter-sep" aria-hidden="true">|</span> 95 <?php } ?> 96 97 <label for="filter">Filter:</label> 89 98 <select id="filter" name="filter"> 90 99 <?php … … 111 120 ?> 112 121 </select> 122 <button type="submit">Submit</button> 113 123 </form> 114 124 </div> 115 <script>116 var filterForm = document.getElementById( 'sort-filter' );117 var filterSelect = document.getElementById( 'filter' );118 filterSelect.addEventListener( 'change', function() {119 filterForm.submit()120 } );121 </script>122 123 125 <div id="projects" class="projects"> 124 126 <?php -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/style.css
r7371 r8496 1428 1428 border: 1px solid #dfdfdf; 1429 1429 border-top: none; 1430 } 1431 1432 .sort-bar label { 1433 font-size: 12px; 1434 line-height: 14px; 1435 } 1436 1437 .sort-bar .filter-sep { 1438 color: #ccc; 1430 1439 } 1431 1440 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-locale.php
r7770 r8496 47 47 $search = gp_get( 's', '' ); 48 48 $filter = gp_get( 'filter', false ); 49 $without_editors = gp_get( 'without-editors', false ); 49 50 50 51 $locale = GP_Locales::by_slug( $locale_slug ); … … 100 101 'search' => $search, 101 102 'filter' => $filter, 103 'without_editors' => $without_editors, 102 104 'set_slug' => $set_slug, 103 105 'locale' => $locale_slug, … … 698 700 699 701 $defaults = array( 700 'per_page' => 20, 701 'page' => 1, 702 'search' => false, 703 'set_slug' => '', 704 'locale' => '', 705 'filter' => false, 702 'per_page' => 20, 703 'page' => 1, 704 'search' => false, 705 'set_slug' => '', 706 'locale' => '', 707 'filter' => false, 708 'without_editors' => false, 706 709 ); 707 710 $r = wp_parse_args( $args, $defaults ); … … 744 747 // Check to see if they have any special approval permissions. 745 748 $allowed_projects = array(); 749 $allowed_base_level_projects = array(); 746 750 if ( ! $can_approve_for_all && $role = $this->roles_adapter->is_approver_for_locale( $user_id, $locale ) ) { 747 751 $allowed_projects = $this->roles_adapter->get_project_id_access_list( $user_id, $locale ); … … 761 765 $parent_project_sql = 'AND ( stats.waiting > 0 OR stats.fuzzy > 0 )'; 762 766 $parent_project_sql .= $base_level_project_sql; 763 764 767 } elseif ( $allowed_projects || $allowed_base_level_projects ) { 765 $parent_project_sql = 'AND stats.waiting > 0AND ( (';768 $parent_project_sql = 'AND ( stats.waiting > 0 OR stats.fuzzy > 0 ) AND ( ('; 766 769 767 770 if ( $allowed_projects ) { … … 795 798 $parent_project_sql = 'AND 0=1'; 796 799 800 } 801 802 // Exclude projects which have an assigned editor. 803 if ( $without_editors ) { 804 $project_ids_with_editor = $wpdb->get_col( $wpdb->prepare( 805 "SELECT DISTINCT(project_id) FROM `translate_translation_editors` WHERE (locale = %s OR locale = 'all-locales') AND project_id != 0 AND user_id != %d", 806 $locale, 807 $user_id 808 ) ); 809 if ( $project_ids_with_editor ) { 810 $project_ids_with_editor = implode( ', ', array_map( 'intval', $project_ids_with_editor ) ); 811 $parent_project_sql .= " AND tp.id NOT IN( $project_ids_with_editor )"; 812 } 797 813 } 798 814 }
Note: See TracChangeset
for help on using the changeset viewer.