From 3a58c6824df45b937861db4af75dcf5f32259e5a Mon Sep 17 00:00:00 2001 From: Antonin Delpeuch Date: Sun, 4 Mar 2018 10:55:47 +0000 Subject: [PATCH] Prettify the UI and add a token to the edit summaries --- .../module/images/Wikidata-logo-en.svg | 7 +++ .../wikidata/module/images/wikidata.png | Bin 0 -> 2522 bytes .../wikidata/module/langs/translation-en.json | 13 +++-- .../dialogs/manage-account-dialog.html | 11 +++-- .../scripts/dialogs/manage-account-dialog.js | 24 ++++----- .../scripts/dialogs/perform-edits-dialog.html | 2 +- .../scripts/dialogs/perform-edits-dialog.js | 46 ++++++++++-------- .../dialogs/schema-alignment-dialog.js | 4 ++ .../module/scripts/warningsrenderer.js | 3 +- .../styles/dialogs/manage-account-dialog.less | 9 ++++ .../PreviewWikibaseSchemaCommand.java | 36 ++------------ .../PerformWikibaseEditsOperation.java | 7 ++- 12 files changed, 89 insertions(+), 73 deletions(-) create mode 100644 extensions/wikidata/module/images/Wikidata-logo-en.svg create mode 100644 extensions/wikidata/module/images/wikidata.png diff --git a/extensions/wikidata/module/images/Wikidata-logo-en.svg b/extensions/wikidata/module/images/Wikidata-logo-en.svg new file mode 100644 index 000000000..fbb40e4d0 --- /dev/null +++ b/extensions/wikidata/module/images/Wikidata-logo-en.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extensions/wikidata/module/images/wikidata.png b/extensions/wikidata/module/images/wikidata.png new file mode 100644 index 0000000000000000000000000000000000000000..d0aa6d80265fc61d6b2cf62911b1e3ec8ef81078 GIT binary patch literal 2522 zcmb_e`#Tf*A0KnvHs!LA%fWI9Cznuio!ZERbT*2KBpoUo!(4{p2)PusQnN%xhTLOh z^rbS_Q?4_HbXpS2eT@0;Jm>j7&-nws&-;15-_P@UKA+DI@7L@7d|sL7-JE2kRips` zfQ<85_yu7P{5vJZg*E&W5hZNm0WMB(!2aLytiAlc5RnQ$dkG5wfE4~t5x|o|Wg#dL z>FkP-m=hIO(iOYkUbrSacHJ57fQp%1BFATA(CY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OfrF>@m`S0Es^Q^Ut9#ayBaV#_K8B!e$F_OT*=+U+Ihu*bmz&M%_DAxfJ-oce=VT_h?(6$&gKm1^_gqMu zPa54}j!sT;a;T`_UH_$6_AMI5O(E-x`pP+xheRYL#DEymk`qv;Oc`FtO15uvuB|FB z=VawnHPE>o-}nMu^t32OW#)sry1L=}ckhgV-he}S?f`kQWWa@L&%1zVk%h9dvKwU~ zrNV345+dk!@I4bS0#5ejsn$SR9&1c)>GDeruqz zLD@oX;{jteensYHpEh}n=L^-Ho^twaKRksSkD0abcY+`)g{;2E2t56LN9_IYXZosuew?dYv^jb&iJ7B@GPD(6F2h;mFMy zEB)J`X7RU9mD1m|V4rea!wrZ?ImCzMTfdDZm?O&kUxG>>M-HVuChex_T4iB4&L`Jw6LHXv%?5&mf*Oy!Vw9pFM+u5*4 zH+$UQ802{qyENIvkcB}IBk3eZJvUh~@PPwvFMK+PiMuQB^}rE!Mc4Cdz1Jw47H})u zYei)sPJ(*J*2YF%0zdlp?c2HoEE-nt#`w!7vnamZ=Tt+!^!UFWi+J}xpZ32@jCgk> bY(oQg<=X|lT-alw3j;VK+~6-y`=|UD^d80_ literal 0 HcmV?d00001 diff --git a/extensions/wikidata/module/langs/translation-en.json b/extensions/wikidata/module/langs/translation-en.json index 3a339637f..a8d3b5cd5 100644 --- a/extensions/wikidata/module/langs/translation-en.json +++ b/extensions/wikidata/module/langs/translation-en.json @@ -48,7 +48,7 @@ }, "wikidata-account": { "dialog-header": "Wikidata account", - "explain-log-in": "Logging in to Wikidata will allow you to perform edits directly from OpenRefine.", + "explain-log-in": "Logging in to Wikidata lets you to perform edits directly from OpenRefine.", "username-label": "Username:", "username-placeholder": "Enter your username", "password-label": "Password:", @@ -57,20 +57,23 @@ "close": "Close", "log-in": "Log in", "logged-in-as": "You are logged in as:", - "log-out": "Log out" + "log-out": "Log out", + "connecting-to-wikidata": "Connecting to Wikidata..." }, "perform-wikidata-edits": { "dialog-header": "Perform edits on Wikidata", - "review-your-edits": "Please review your edits before pushing them to Wikidata. Consider requesting feedback at the Data Import Hub for large datasets.", + "review-your-edits": "Please check your edits carefully before pushing them to Wikidata. Large edit batches should be submitted for bot review first.", "logged-in-as": "You are logged in as", "edit-summary-label": "Edit summary:", + "edit-summary-placeholder": "a few words to describe your edits", "perform-edits": "Perform edits", - "cancel": "Cancel" + "cancel": "Cancel", + "analyzing-edits": "Analyzing your edits..." }, "warnings-messages": { "new-item-created": { "title": "This batch will create new Wikidata items.", - "body": "Please make sure that these items do not exist yet and are suitable for inclusion in Wikidata." + "body": "Please make sure that these items do not exist yet and are suitable for inclusion in Wikidata." }, "new-item-without-labels-or-aliases": { "title": "New items created without any label or alias.", diff --git a/extensions/wikidata/module/scripts/dialogs/manage-account-dialog.html b/extensions/wikidata/module/scripts/dialogs/manage-account-dialog.html index cb9356eed..0a5679b65 100644 --- a/extensions/wikidata/module/scripts/dialogs/manage-account-dialog.html +++ b/extensions/wikidata/module/scripts/dialogs/manage-account-dialog.html @@ -1,8 +1,12 @@
-

-

+ + + + +
diff --git a/extensions/wikidata/module/scripts/dialogs/manage-account-dialog.js b/extensions/wikidata/module/scripts/dialogs/manage-account-dialog.js index 915e86536..f319f1158 100644 --- a/extensions/wikidata/module/scripts/dialogs/manage-account-dialog.js +++ b/extensions/wikidata/module/scripts/dialogs/manage-account-dialog.js @@ -1,12 +1,6 @@ var ManageAccountDialog = {}; -/* - $.post( - "command/core/get-all-preferences", - null, - populatePreferences, - "json" - ); -*/ + +ManageAccountDialog.firstLogin = true; ManageAccountDialog.launch = function(logged_in_username, callback) { $.post( @@ -23,10 +17,10 @@ ManageAccountDialog.display = function(logged_in_username, saved_credentials, ca var self = this; var frame = $(DOM.loadHTML("wikidata", "scripts/dialogs/manage-account-dialog.html")); var elmts = this._elmts = DOM.bind(frame); - console.log(saved_credentials); + ManageAccountDialog.firstLaunch = false; this._elmts.dialogHeader.text($.i18n._('wikidata-account')["dialog-header"]); - this._elmts.explainLogIn.text($.i18n._('wikidata-account')["explain-log-in"]); + this._elmts.explainLogIn.html($.i18n._('wikidata-account')["explain-log-in"]); this._elmts.usernameLabel.text($.i18n._('wikidata-account')["username-label"]); this._elmts.usernameInput.attr("placeholder", $.i18n._('wikidata-account')["username-placeholder"]); this._elmts.passwordLabel.text($.i18n._('wikidata-account')["password-label"]); @@ -51,7 +45,9 @@ ManageAccountDialog.display = function(logged_in_username, saved_credentials, ca elmts.logoutArea.hide(); } - elmts.loggedInUsername.text(logged_in_username); + elmts.loggedInUsername + .text(logged_in_username) + .attr('href', 'https://www.wikidata.org/wiki/User:'+logged_in_username); frame.find('.cancel-button').click(function() { dismiss(); @@ -88,9 +84,15 @@ ManageAccountDialog.display = function(logged_in_username, saved_credentials, ca }; ManageAccountDialog.isLoggedIn = function(callback) { + var discardWaiter = function() { }; + if(ManageAccountDialog.firstLogin) { + discardWaiter = DialogSystem.showBusy($.i18n._('wikidata-account')["connecting-to-wikidata"]); + } $.get( "command/wikidata/login", function(data) { + discardWaiter(); + ManageAccountDialog.firstLogin = false; callback(data.username); }); }; diff --git a/extensions/wikidata/module/scripts/dialogs/perform-edits-dialog.html b/extensions/wikidata/module/scripts/dialogs/perform-edits-dialog.html index 1ca7d1f88..32b2e2e40 100644 --- a/extensions/wikidata/module/scripts/dialogs/perform-edits-dialog.html +++ b/extensions/wikidata/module/scripts/dialogs/perform-edits-dialog.html @@ -6,7 +6,7 @@
-

.

+

.