Making WordPress.org

Changeset 2228


Ignore:
Timestamp:
12/28/2015 12:38:09 PM (9 years ago)
Author:
ocean90
Message:

Rosetta Roles: Display slugs of projects because project names are not unique.

Also decode entities in project names because the data is exported to JavaScript.

Fixes #1499.

Location:
sites/trunk/global.wordpress.org/public_html/wp-content/mu-plugins/roles
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/global.wordpress.org/public_html/wp-content/mu-plugins/roles/css/rosetta-roles-rtl.css

    r1792 r2228  
    2323}
    2424
    25 #projects-list label {
     25#projects-list > li label {
    2626    margin: 0 !important;
    2727}
     
    5656}
    5757
     58#projects-list .sub-projects-wrapper label {
     59    display: block;
     60    margin-right: 24px !important;
     61    padding-top: 3px;
     62    padding-bottom: 3px;
     63}
     64
     65.sub-projects-wrapper label > input {
     66    margin-left: 4px;
     67    margin-right: -24px;
     68}
     69
    5870.sub-projects-search {
    5971    width: 100%;
     
    6375.sub-projects-list {
    6476    margin: 0 2px 0 0;
     77}
     78
     79.project-checkbox .project-slug {
     80    display: none;
     81    color: #666;
     82    font-size: 13px;
     83}
     84
     85.sub-projects-wrapper .project-checkbox .project-slug {
     86    display: inline;
    6587}
    6688
  • sites/trunk/global.wordpress.org/public_html/wp-content/mu-plugins/roles/css/rosetta-roles.css

    r1786 r2228  
    2323}
    2424
    25 #projects-list label {
     25#projects-list > li label {
    2626    margin: 0 !important;
    2727}
     
    5656}
    5757
     58#projects-list .sub-projects-wrapper label {
     59    display: block;
     60    margin-left: 24px !important;
     61    padding-top: 3px;
     62    padding-bottom: 3px;
     63}
     64
     65.sub-projects-wrapper label > input {
     66    margin-right: 4px;
     67    margin-left: -24px;
     68}
     69
    5870.sub-projects-search {
    5971    width: 100%;
     
    6375.sub-projects-list {
    6476    margin: 0 0 0 2px;
     77}
     78
     79.project-checkbox .project-slug {
     80    display: none;
     81    color: #666;
     82    font-size: 13px;
     83}
     84
     85.sub-projects-wrapper .project-checkbox .project-slug {
     86    display: inline;
    6587}
    6688
  • sites/trunk/global.wordpress.org/public_html/wp-content/mu-plugins/roles/js/rosetta-roles.js

    r2197 r2228  
    192192
    193193        prepare: function() {
    194             return _.pick( this.model.toJSON(), 'id', 'name', 'checked', 'checkedSubProjects' );
     194            return _.pick( this.model.toJSON(), 'id', 'name', 'slug', 'checked', 'checkedSubProjects' );
    195195        },
    196196
  • sites/trunk/global.wordpress.org/public_html/wp-content/mu-plugins/roles/rosetta-roles.php

    r2197 r2228  
    194194    public function enqueue_styles() {
    195195        $suffix = is_rtl() ? '-rtl' : '';
    196         wp_enqueue_style( 'rosetta-roles', plugins_url( "/css/rosetta-roles$suffix.css", __FILE__ ), array(), '2' );
     196        wp_enqueue_style( 'rosetta-roles', plugins_url( "/css/rosetta-roles$suffix.css", __FILE__ ), array(), '3' );
    197197    }
    198198
     
    214214                    />
    215215                    {{data.name}}
     216                    <span class="project-slug">({{data.slug}})</span>
    216217                </label>
    217218            <# } else { #>
    218219                <label>
    219220                    <input type="radio" class="input-radio" checked="checked" /> {{data.name}}
     221                    <span class="project-slug">({{data.slug}})</span>
    220222                </label>
    221223            <# } #>
     
    772774        $projects = array();
    773775        foreach ( $_projects as $project ) {
     776            $project->name = html_entity_decode( $project->name, ENT_QUOTES, 'UTF-8' );
    774777            $projects[ $project->id ] = $project;
    775778        }
Note: See TracChangeset for help on using the changeset viewer.