r113694 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113693‎ | r113694 | r113695 >
Date:00:22, 13 March 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
ui follow up to r113687
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.i18n.php (modified) (history)
  • /trunk/extensions/EducationProgram/EducationProgram.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPArticleTable.php (modified) (history)
  • /trunk/extensions/EducationProgram/resources/ep.articletable.js (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/EducationProgram.php
@@ -503,7 +503,7 @@
504504 'ep-articletable-remarticle-button',
505505 'ep-articletable-remarticle-cancel',
506506 'ep-articletable-remarticle-text',
507 - 'ep-articletable-remarticle-text-course',
 507+ 'ep-articletable-remarticle-text-self',
508508 ),
509509 );
510510
Index: trunk/extensions/EducationProgram/includes/EPArticleTable.php
@@ -302,6 +302,12 @@
303303 'class' => 'ep-rem-article',
304304 );
305305
 306+ $user = $this->getUser();
 307+
 308+ if ( $user->getId() !== $article->getField( 'user_id' ) ) {
 309+ $attr['data-student-name'] = $user->getName();
 310+ }
 311+
306312 if ( array_key_exists( 'course_id', $this->articleConds ) && is_integer( $this->articleConds['course_id'] ) ) {
307313 $attr['data-course-name'] = $this->getCourseName();
308314
@@ -310,7 +316,7 @@
311317 'returnto' => $this->getTitle()->getFullText(),
312318 ) );
313319
314 - if ( $article->userCanRemove( $this->getUser() ) ) {
 320+ if ( $article->userCanRemove( $user ) ) {
315321 $html .= ' (' . Html::element(
316322 'a',
317323 $attr,
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php
@@ -342,8 +342,8 @@
343343 'ep-articletable-remarticle-title' => 'Remove article $1',
344344 'ep-articletable-remarticle-button' => 'Remove article',
345345 'ep-articletable-remarticle-cancel' => 'Cancel',
346 - 'ep-articletable-remarticle-text' => 'You are about to remove article $1 from the list of articles you are working on.',
347 - '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.',
 346+ '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.',
 347+ '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.',
348348
349349 // Article pager
350350 'ep-articles-noresults' => 'There are no articles to list.',
Index: trunk/extensions/EducationProgram/resources/ep.articletable.js
@@ -126,15 +126,19 @@
127127
128128 function removeArticle() {
129129 var $this = $( this ),
130 - courseName = $this.attr( 'data-course-name' );
 130+ courseName = $this.attr( 'data-course-name' ),
 131+ isSelf = $this.attr( 'data-student-name' ) === undefined,
 132+ selfSuffix = isSelf ? '-self' : '',
 133+ studentName = isSelf ? mw.user.name : $this.attr( 'data-student-name' );
131134
132135 var $form = $( '<form>' ).attr( {
133136 'method': 'post',
134137 'action': $this.attr( 'data-remove-target' )
135138 } ).msg(
136 - 'ep-articletable-remarticle-text-course',
 139+ 'ep-articletable-remarticle-text' + selfSuffix,
137140 $( '<b>' ).text( $this.attr( 'data-article-name' ) ),
138 - $( '<b>' ).text( courseName )
 141+ $( '<b>' ).text( courseName ),
 142+ $( '<b>' ).text( studentName )
139143 );
140144
141145 $form.append( $( '<input>' ).attr( {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r113687allow certain people to delete article associations from studentsjeroendedauw23:58, 12 March 2012

Status & tagging log