https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113694

Revision: 113694
Author:   jeroendedauw
Date:     2012-03-13 00:22:08 +0000 (Tue, 13 Mar 2012)
Log Message:
-----------
ui follow up to r113687

Modified Paths:
--------------
    trunk/extensions/EducationProgram/EducationProgram.i18n.php
    trunk/extensions/EducationProgram/EducationProgram.php
    trunk/extensions/EducationProgram/includes/EPArticleTable.php
    trunk/extensions/EducationProgram/resources/ep.articletable.js

Modified: trunk/extensions/EducationProgram/EducationProgram.i18n.php
===================================================================
--- trunk/extensions/EducationProgram/EducationProgram.i18n.php 2012-03-13 
00:21:12 UTC (rev 113693)
+++ trunk/extensions/EducationProgram/EducationProgram.i18n.php 2012-03-13 
00:22:08 UTC (rev 113694)
@@ -342,8 +342,8 @@
        'ep-articletable-remarticle-title' => 'Remove article $1',
        'ep-articletable-remarticle-button' => 'Remove article',
        'ep-articletable-remarticle-cancel' => 'Cancel',
-       'ep-articletable-remarticle-text' => 'You are about to remove article 
$1 from the list of articles you are working on.',
-       'ep-articletable-remarticle-text-course' => 'You are about to remove 
article $1 from the list of articles you are working on as part of course $2.',
+       'ep-articletable-remarticle-text-self' => 'You are about to remove 
article $1 from the list of articles you are working on as part of course $2.',
+       'ep-articletable-remarticle-text' => 'You are about to remove article 
$1 from the list of articles $3 is working on as part of course $2.',
 
        // Article pager
        'ep-articles-noresults' => 'There are no articles to list.',

Modified: trunk/extensions/EducationProgram/EducationProgram.php
===================================================================
--- trunk/extensions/EducationProgram/EducationProgram.php      2012-03-13 
00:21:12 UTC (rev 113693)
+++ trunk/extensions/EducationProgram/EducationProgram.php      2012-03-13 
00:22:08 UTC (rev 113694)
@@ -503,7 +503,7 @@
                'ep-articletable-remarticle-button',
                'ep-articletable-remarticle-cancel',
                'ep-articletable-remarticle-text',
-               'ep-articletable-remarticle-text-course',
+               'ep-articletable-remarticle-text-self',
        ),
 );
 

Modified: trunk/extensions/EducationProgram/includes/EPArticleTable.php
===================================================================
--- trunk/extensions/EducationProgram/includes/EPArticleTable.php       
2012-03-13 00:21:12 UTC (rev 113693)
+++ trunk/extensions/EducationProgram/includes/EPArticleTable.php       
2012-03-13 00:22:08 UTC (rev 113694)
@@ -302,6 +302,12 @@
                        'class' => 'ep-rem-article',
                );
 
+               $user = $this->getUser();
+
+               if ( $user->getId() !== $article->getField( 'user_id' ) ) {
+                       $attr['data-student-name'] = $user->getName();
+               }
+
                if ( array_key_exists( 'course_id', $this->articleConds ) && 
is_integer( $this->articleConds['course_id'] ) ) {
                        $attr['data-course-name'] = $this->getCourseName();
 
@@ -310,7 +316,7 @@
                                'returnto' => $this->getTitle()->getFullText(),
                        ) );
 
-                       if ( $article->userCanRemove( $this->getUser() ) ) {
+                       if ( $article->userCanRemove( $user ) ) {
                                $html .= ' (' . Html::element(
                                        'a',
                                        $attr,

Modified: trunk/extensions/EducationProgram/resources/ep.articletable.js
===================================================================
--- trunk/extensions/EducationProgram/resources/ep.articletable.js      
2012-03-13 00:21:12 UTC (rev 113693)
+++ trunk/extensions/EducationProgram/resources/ep.articletable.js      
2012-03-13 00:22:08 UTC (rev 113694)
@@ -126,15 +126,19 @@
        
        function removeArticle() {
                var $this = $( this ),
-               courseName = $this.attr( 'data-course-name' );
+               courseName = $this.attr( 'data-course-name' ),
+               isSelf = $this.attr( 'data-student-name' ) === undefined,
+               selfSuffix = isSelf ? '-self' : '',
+               studentName = isSelf ? mw.user.name : $this.attr( 
'data-student-name' );
 
                var $form = $( '<form>' ).attr( {
                        'method': 'post',
                        'action': $this.attr( 'data-remove-target' )
                } ).msg(
-                       'ep-articletable-remarticle-text-course',
+                       'ep-articletable-remarticle-text' + selfSuffix,
                        $( '<b>' ).text( $this.attr( 'data-article-name' ) ),
-                       $( '<b>' ).text( courseName )
+                       $( '<b>' ).text( courseName ),
+                       $( '<b>' ).text( studentName )
                );
 
                $form.append( $( '<input>' ).attr( {


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to