mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-24 08:13:38 +00:00
Show 'view terms' when we can't figure out the license
...since there probably still is one, and our failure to parse it just makes it more important that we direct the user to the file page. Change-Id: Id31f95021f059ccf4bf9893b1146f3807dcabdcb
This commit is contained in:
parent
b00eca6ade
commit
c1b2b1bb2c
|
@ -548,14 +548,20 @@
|
|||
MPP.setLicense = function ( license, filePageUrl ) {
|
||||
var message, shortName, url, isCc;
|
||||
|
||||
message = 'multimediaviewer-license-' + ( license.internalName || '' );
|
||||
if ( mw.messages.exists( message ) ) {
|
||||
shortName = mw.message( message ).text();
|
||||
if ( license ) {
|
||||
message = 'multimediaviewer-license-' + ( license.internalName || '' );
|
||||
if ( mw.messages.exists( message ) ) {
|
||||
shortName = mw.message( message ).text();
|
||||
} else {
|
||||
shortName = mw.message( 'multimediaviewer-license-default' ).text();
|
||||
}
|
||||
url = license.deedUrl || filePageUrl;
|
||||
isCc = license.isCc();
|
||||
} else {
|
||||
shortName = mw.message( 'multimediaviewer-license-default' ).text();
|
||||
url = filePageUrl;
|
||||
isCc = false;
|
||||
}
|
||||
url = license.deedUrl || filePageUrl;
|
||||
isCc = license.isCc();
|
||||
|
||||
this.$license
|
||||
.text( shortName )
|
||||
|
@ -691,9 +697,7 @@
|
|||
this.description.set( imageData.description, image.caption );
|
||||
this.categories.set( repoData.getArticlePath(), imageData.categories );
|
||||
|
||||
if ( imageData.license ) {
|
||||
this.setLicense( imageData.license, imageData.descriptionUrl );
|
||||
}
|
||||
this.setLicense( imageData.license, imageData.descriptionUrl );
|
||||
|
||||
if ( imageData.permission ) {
|
||||
this.setPermission( imageData.permission );
|
||||
|
|
|
@ -152,7 +152,8 @@
|
|||
|
||||
assert.strictEqual( panel.$title.text(), title, 'Title is correctly set' );
|
||||
assert.ok( panel.$credit.hasClass( 'empty' ), 'Credit is empty' );
|
||||
assert.ok( panel.$license.hasClass( 'empty' ), 'License is empty' );
|
||||
assert.strictEqual( panel.$license.prop( 'href' ), imageData.descriptionUrl,
|
||||
'User is directed to file page for license information' );
|
||||
assert.ok( panel.$usernameLi.hasClass( 'empty' ), 'Username is empty' );
|
||||
assert.ok( panel.$datetimeLi.hasClass( 'empty' ), 'Date/Time is empty' );
|
||||
assert.ok( panel.$locationLi.hasClass( 'empty' ), 'Location is empty' );
|
||||
|
|
Loading…
Reference in a new issue