[TASK] Optimize UI of language packs management 98/61398/4
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Thu, 1 Aug 2019 16:11:47 +0000 (18:11 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 2 Aug 2019 08:12:04 +0000 (10:12 +0200)
The UI of the "Manage Language Packs" modal is optimized:

- Buttons are grouped into a `btn-group`
- Language name is rendered next to the buttons
- Space is added between extension icon and title

Resolves: #88885
Releases: master
Change-Id: I728ef22a5983ae7d419f88b7ceffd552ef2a1b33
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61398
Tested-by: Josef Glatz <josefglatz@gmail.com>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Josef Glatz <josefglatz@gmail.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/LanguagePacks.ts
typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/LanguagePacks.js

index c492f5f..6e3e09a 100644 (file)
@@ -331,38 +331,42 @@ class LanguagePacks extends AbstractInteractableModule {
       if (active) {
         $tbody.append(
           $tr.append(
-            $('<td>').append(
-              $('<a>', {
-                'class': 'btn btn-default t3js-languagePacks-deactivateLanguage',
-                'data-iso': language.iso,
-                'data-toggle': 'tooltip',
-                'title': 'Deactivate',
-              }).append(deactivateIcon),
-              $('<a>', {
-                'class': 'btn btn-default t3js-languagePacks-update',
-                'data-iso': language.iso,
-                'data-toggle': 'tooltip',
-                'title': 'Download language packs',
-              }).append(updateIcon),
+            $('<td>').text(' ' + language.name).prepend(
+              $('<div />', {class: 'btn-group'}).append(
+                $('<a>', {
+                  'class': 'btn btn-default t3js-languagePacks-deactivateLanguage',
+                  'data-iso': language.iso,
+                  'data-toggle': 'tooltip',
+                  'title': 'Deactivate',
+                }).append(deactivateIcon),
+                $('<a>', {
+                  'class': 'btn btn-default t3js-languagePacks-update',
+                  'data-iso': language.iso,
+                  'data-toggle': 'tooltip',
+                  'title': 'Download language packs',
+                }).append(updateIcon),
+              ),
             ),
           ),
         );
       } else {
         $tbody.append(
           $tr.addClass('t3-languagePacks-inactive t3js-languagePacks-inactive').css({'display': 'none'}).append(
-            $('<td>').append(
-              $('<a>', {
-                'class': 'btn btn-default t3js-languagePacks-activateLanguage',
-                'data-iso': language.iso,
-                'data-toggle': 'tooltip',
-                'title': 'Activate',
-              }).append(activateIcon),
+            $('<td>').text(' ' + language.name).prepend(
+              $('<div />', {class: 'btn-group'}).append(
+                $('<a>', {
+                  'class': 'btn btn-default t3js-languagePacks-activateLanguage',
+                  'data-iso': language.iso,
+                  'data-toggle': 'tooltip',
+                  'title': 'Activate',
+                }).append(activateIcon),
+              ),
             ),
           ),
         );
       }
+
       $tr.append(
-        $('<td>').text(language.name),
         $('<td>').text(language.iso),
         $('<td>').text(language.dependencies.join(', ')),
         $('<td>').text(language.lastUpdate === null ? '' : language.lastUpdate),
@@ -375,16 +379,17 @@ class LanguagePacks extends AbstractInteractableModule {
         $('<thead>').append(
           $('<tr>').append(
             $('<th>').append(
-              $('<button>', {'class': 'btn btn-default t3js-languagePacks-addLanguage-toggle', 'type': 'button'}).append(
-                $('<span>').append(activateIcon),
-                ' Add language',
-              ),
-              $('<button>', {'class': 'btn btn-default t3js-languagePacks-update', 'type': 'button'}).append(
-                $('<span>').append(updateIcon),
-                ' Update all',
+              $('<div />', {class: 'btn-group'}).append(
+                $('<button>', {'class': 'btn btn-default t3js-languagePacks-addLanguage-toggle', 'type': 'button'}).append(
+                  $('<span>').append(activateIcon),
+                  ' Add language',
+                ),
+                $('<button>', {'class': 'btn btn-default t3js-languagePacks-update', 'type': 'button'}).append(
+                  $('<span>').append(updateIcon),
+                  ' Update all',
+                ),
               ),
             ),
-            $('<th>').text('Language'),
             $('<th>').text('Locale'),
             $('<th>').text('Dependencies'),
             $('<th>').text('Last update'),
@@ -445,7 +450,7 @@ class LanguagePacks extends AbstractInteractableModule {
             'src': '../' + extension.icon,
             'alt': extension.title,
           }),
-          $('<span>').text(extension.title),
+          $('<span>').text(' ' + extension.title),
         );
       } else {
         extensionTitle = $('<span>').text(extension.title);
index 471aa66..4cce0a0 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var e in a)a.hasOwnProperty(e)&&(t[e]=a[e])};return function(a,e){function n(){this.constructor=a}t(a,e),a.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}();define(["require","exports","../AbstractInteractableModule","jquery","../../Router","../../Renderable/FlashMessage","../../Renderable/ProgressBar","../../Renderable/InfoBox","../../Renderable/Severity","bootstrap"],function(t,a,e,n,s,o,i,c,d){"use strict";return new(function(t){function a(){var a=null!==t&&t.apply(this,arguments)||this;return a.selectorOutputContainer=".t3js-languagePacks-output",a.selectorContentContainer=".t3js-languagePacks-mainContent",a.selectorActivateLanguage=".t3js-languagePacks-activateLanguage",a.selectorActivateLanguageIcon="#t3js-languagePacks-activate-icon",a.selectorAddLanguageToggle=".t3js-languagePacks-addLanguage-toggle",a.selectorLanguageInactive=".t3js-languagePacks-inactive",a.selectorDeactivateLanguage=".t3js-languagePacks-deactivateLanguage",a.selectorDeactivateLanguageIcon="#t3js-languagePacks-deactivate-icon",a.selectorUpdate=".t3js-languagePacks-update",a.selectorLanguageUpdateIcon="#t3js-languagePacks-languageUpdate-icon",a.selectorExtensionPackMissesIcon="#t3js-languagePacks-extensionPack-misses-icon",a.selectorNotifications=".t3js-languagePacks-notifications",a.activeLanguages=[],a.activeExtensions=[],a.packsUpdateDetails={toHandle:0,handled:0,updated:0,new:0,failed:0},a.notifications=[],a}return __extends(a,t),a.prototype.initialize=function(t){var a=this;this.currentModal=t,this.getData(),t.on("click",this.selectorAddLanguageToggle,function(){t.find(a.selectorContentContainer+" "+a.selectorLanguageInactive).toggle()}),t.on("click",this.selectorActivateLanguage,function(t){var e=n(t.target).closest(a.selectorActivateLanguage).data("iso");t.preventDefault(),a.activateLanguage(e)}),t.on("click",this.selectorDeactivateLanguage,function(t){var e=n(t.target).closest(a.selectorDeactivateLanguage).data("iso");t.preventDefault(),a.deactivateLanguage(e)}),t.on("click",this.selectorUpdate,function(t){var e=n(t.target).closest(a.selectorUpdate).data("iso"),s=n(t.target).closest(a.selectorUpdate).data("extension");t.preventDefault(),a.updatePacks(e,s)})},a.prototype.getData=function(){var t=this,a=this.getModalBody();n.ajax({url:s.getUrl("languagePacksGetData"),cache:!1,success:function(e){if(!0===e.success){t.activeLanguages=e.activeLanguages,t.activeExtensions=e.activeExtensions,a.empty().append(e.html);var s=a.parent().find(t.selectorContentContainer);s.empty(),s.append(t.languageMatrixHtml(e)),s.append(t.extensionMatrixHtml(e)),n('[data-toggle="tooltip"]').tooltip({container:s})}else{var o=c.render(d.error,"Something went wrong","");t.addNotification(o)}t.renderNotifications()},error:function(t){s.handleAjaxError(t,a)}})},a.prototype.activateLanguage=function(t){var a=this,e=this.getModalBody(),l=this.findInModal(this.selectorOutputContainer),r=i.render(d.loading,"Loading...","");l.empty().append(r),n.ajax({url:s.getUrl(),method:"POST",context:this,data:{install:{action:"languagePacksActivateLanguage",token:this.getModuleContent().data("language-packs-activate-language-token"),iso:t}},cache:!1,beforeSend:function(){a.getNotificationBox().empty()},success:function(t){if(l.empty(),!0===t.success&&Array.isArray(t.status))t.status.forEach(function(t){var e=c.render(t.severity,t.title,t.message);a.addNotification(e)});else{var e=o.render(d.error,"Something went wrong","");a.addNotification(e)}a.getData()},error:function(t){s.handleAjaxError(t,e)}})},a.prototype.deactivateLanguage=function(t){var a=this,e=this.getModalBody(),l=this.findInModal(this.selectorOutputContainer),r=i.render(d.loading,"Loading...","");l.empty().append(r),n.ajax({url:s.getUrl(),method:"POST",context:this,data:{install:{action:"languagePacksDeactivateLanguage",token:this.getModuleContent().data("language-packs-deactivate-language-token"),iso:t}},cache:!1,beforeSend:function(){a.getNotificationBox().empty()},success:function(t){if(l.empty(),!0===t.success&&Array.isArray(t.status))t.status.forEach(function(t){var e=c.render(t.severity,t.title,t.message);a.addNotification(e)});else{var e=o.render(d.error,"Something went wrong","");a.addNotification(e)}a.getData()},error:function(t){s.handleAjaxError(t,e)}})},a.prototype.updatePacks=function(t,a){var e=this,o=this.findInModal(this.selectorOutputContainer),i=this.findInModal(this.selectorContentContainer),c=void 0===t?this.activeLanguages:[t],d=!0,l=this.activeExtensions;void 0!==a&&(l=[a],d=!1),this.packsUpdateDetails={toHandle:c.length*l.length,handled:0,updated:0,new:0,failed:0},o.empty().append(n("<div>",{class:"progress"}).append(n("<div>",{class:"progress-bar progress-bar-info",role:"progressbar","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,style:"width: 0;"}).append(n("<span>",{class:"text-nowrap"}).text("0 of "+this.packsUpdateDetails.toHandle+" language packs updated")))),i.empty(),c.forEach(function(t){l.forEach(function(a){n.ajax({url:s.getUrl(),method:"POST",context:e,data:{install:{action:"languagePacksUpdatePack",token:e.getModuleContent().data("language-packs-update-pack-token"),iso:t,extension:a}},cache:!1,beforeSend:function(){e.getNotificationBox().empty()},success:function(t){!0===t.success?(e.packsUpdateDetails.handled++,"new"===t.packResult?e.packsUpdateDetails.new++:"update"===t.packResult?e.packsUpdateDetails.updated++:e.packsUpdateDetails.failed++,e.packUpdateDone(d,c)):(e.packsUpdateDetails.handled++,e.packsUpdateDetails.failed++,e.packUpdateDone(d,c))},error:function(){e.packsUpdateDetails.handled++,e.packsUpdateDetails.failed++,e.packUpdateDone(d,c)}})})})},a.prototype.packUpdateDone=function(t,a){var e=this,i=this.getModalBody(),l=this.findInModal(this.selectorOutputContainer);if(this.packsUpdateDetails.handled===this.packsUpdateDetails.toHandle){var r=c.render(d.ok,"Language packs updated",this.packsUpdateDetails.new+" new language packs downloaded, "+this.packsUpdateDetails.updated+" language packs updated, "+this.packsUpdateDetails.failed+" language packs not available");this.addNotification(r),!0===t?n.ajax({url:s.getUrl(),method:"POST",context:this,data:{install:{action:"languagePacksUpdateIsoTimes",token:this.getModuleContent().data("language-packs-update-iso-times-token"),isos:a}},cache:!1,success:function(t){if(!0===t.success)e.getData();else{var a=o.render(d.error,"Something went wrong","");e.addNotification(a)}},error:function(t){s.handleAjaxError(t,i)}}):this.getData()}else{var p=this.packsUpdateDetails.handled/this.packsUpdateDetails.toHandle*100;l.find(".progress-bar").css("width",p+"%").attr("aria-valuenow",p).find("span").text(this.packsUpdateDetails.handled+" of "+this.packsUpdateDetails.toHandle+" language packs updated")}},a.prototype.languageMatrixHtml=function(t){var a=this.findInModal(this.selectorActivateLanguageIcon).html(),e=this.findInModal(this.selectorDeactivateLanguageIcon).html(),s=this.findInModal(this.selectorLanguageUpdateIcon).html(),o=n("<div>"),i=n("<tbody>");return t.languages.forEach(function(t){var o=t.active,c=n("<tr>");o?i.append(c.append(n("<td>").append(n("<a>",{class:"btn btn-default t3js-languagePacks-deactivateLanguage","data-iso":t.iso,"data-toggle":"tooltip",title:"Deactivate"}).append(e),n("<a>",{class:"btn btn-default t3js-languagePacks-update","data-iso":t.iso,"data-toggle":"tooltip",title:"Download language packs"}).append(s)))):i.append(c.addClass("t3-languagePacks-inactive t3js-languagePacks-inactive").css({display:"none"}).append(n("<td>").append(n("<a>",{class:"btn btn-default t3js-languagePacks-activateLanguage","data-iso":t.iso,"data-toggle":"tooltip",title:"Activate"}).append(a)))),c.append(n("<td>").text(t.name),n("<td>").text(t.iso),n("<td>").text(t.dependencies.join(", ")),n("<td>").text(null===t.lastUpdate?"":t.lastUpdate)),i.append(c)}),o.append(n("<h3>").text("Active languages"),n("<table>",{class:"table table-striped table-bordered"}).append(n("<thead>").append(n("<tr>").append(n("<th>").append(n("<button>",{class:"btn btn-default t3js-languagePacks-addLanguage-toggle",type:"button"}).append(n("<span>").append(a)," Add language"),n("<button>",{class:"btn btn-default t3js-languagePacks-update",type:"button"}).append(n("<span>").append(s)," Update all")),n("<th>").text("Language"),n("<th>").text("Locale"),n("<th>").text("Dependencies"),n("<th>").text("Last update"))),i)),o.html()},a.prototype.extensionMatrixHtml=function(t){var a,e=this.findInModal(this.selectorExtensionPackMissesIcon).html(),s=this.findInModal(this.selectorLanguageUpdateIcon).html(),o="",i=!0,l=0,r=n("<div>"),p=n("<tr>");p.append(n("<th>").text("Extension"),n("<th>").text("Key")),t.activeLanguages.forEach(function(t){p.append(n("<th>").append(n("<a>",{class:"btn btn-default t3js-languagePacks-update","data-iso":t,"data-toggle":"tooltip",title:"Download and update all language packs"}).append(n("<span>").append(s)," "+t)))});var g=n("<tbody>");return t.extensions.forEach(function(t){if(i=!0,t.packs.forEach(function(t){!1===t.exists&&(i=!1)}),!0!==i){l++,a=""!==t.icon?n("<span>").append(n("<img>",{style:"max-height: 16px; max-width: 16px;",src:"../"+t.icon,alt:t.title}),n("<span>").text(t.title)):n("<span>").text(t.title);var s=n("<tr>");s.append(n("<td>").html(a.html()),n("<td>").text(t.key)),t.packs.forEach(function(a){!0!==a.exists&&(o=null!==a.lastUpdate?"No language pack available when tried at "+a.lastUpdate+". Click to re-try.":"Language pack not downloaded. Click to download",s.append(n("<td>").append(n("<a>",{class:"btn btn-default t3js-languagePacks-update","data-extension":t.key,"data-iso":a.iso,"data-toggle":"tooltip",title:o}).append(e))))}),g.append(s)}}),r.append(n("<h3>").text("Translation status"),n("<table>",{class:"table table-striped table-bordered"}).append(n("<thead>").append(p),g)),0===l?c.render(d.ok,"Language packs have been found for every installed extension.","To download the latest changes, use the refresh button in the list above."):r.html()},a.prototype.getNotificationBox=function(){return this.findInModal(this.selectorNotifications)},a.prototype.addNotification=function(t){this.notifications.push(t)},a.prototype.renderNotifications=function(){for(var t=this.getNotificationBox(),a=0;a<this.notifications.length;++a)t.append(this.notifications[a]);this.notifications=[]},a}(e.AbstractInteractableModule))});
\ No newline at end of file
+var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var e in a)a.hasOwnProperty(e)&&(t[e]=a[e])};return function(a,e){function n(){this.constructor=a}t(a,e),a.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}();define(["require","exports","../AbstractInteractableModule","jquery","../../Router","../../Renderable/FlashMessage","../../Renderable/ProgressBar","../../Renderable/InfoBox","../../Renderable/Severity","bootstrap"],function(t,a,e,n,s,o,i,d,c){"use strict";return new(function(t){function a(){var a=null!==t&&t.apply(this,arguments)||this;return a.selectorOutputContainer=".t3js-languagePacks-output",a.selectorContentContainer=".t3js-languagePacks-mainContent",a.selectorActivateLanguage=".t3js-languagePacks-activateLanguage",a.selectorActivateLanguageIcon="#t3js-languagePacks-activate-icon",a.selectorAddLanguageToggle=".t3js-languagePacks-addLanguage-toggle",a.selectorLanguageInactive=".t3js-languagePacks-inactive",a.selectorDeactivateLanguage=".t3js-languagePacks-deactivateLanguage",a.selectorDeactivateLanguageIcon="#t3js-languagePacks-deactivate-icon",a.selectorUpdate=".t3js-languagePacks-update",a.selectorLanguageUpdateIcon="#t3js-languagePacks-languageUpdate-icon",a.selectorExtensionPackMissesIcon="#t3js-languagePacks-extensionPack-misses-icon",a.selectorNotifications=".t3js-languagePacks-notifications",a.activeLanguages=[],a.activeExtensions=[],a.packsUpdateDetails={toHandle:0,handled:0,updated:0,new:0,failed:0},a.notifications=[],a}return __extends(a,t),a.prototype.initialize=function(t){var a=this;this.currentModal=t,this.getData(),t.on("click",this.selectorAddLanguageToggle,function(){t.find(a.selectorContentContainer+" "+a.selectorLanguageInactive).toggle()}),t.on("click",this.selectorActivateLanguage,function(t){var e=n(t.target).closest(a.selectorActivateLanguage).data("iso");t.preventDefault(),a.activateLanguage(e)}),t.on("click",this.selectorDeactivateLanguage,function(t){var e=n(t.target).closest(a.selectorDeactivateLanguage).data("iso");t.preventDefault(),a.deactivateLanguage(e)}),t.on("click",this.selectorUpdate,function(t){var e=n(t.target).closest(a.selectorUpdate).data("iso"),s=n(t.target).closest(a.selectorUpdate).data("extension");t.preventDefault(),a.updatePacks(e,s)})},a.prototype.getData=function(){var t=this,a=this.getModalBody();n.ajax({url:s.getUrl("languagePacksGetData"),cache:!1,success:function(e){if(!0===e.success){t.activeLanguages=e.activeLanguages,t.activeExtensions=e.activeExtensions,a.empty().append(e.html);var s=a.parent().find(t.selectorContentContainer);s.empty(),s.append(t.languageMatrixHtml(e)),s.append(t.extensionMatrixHtml(e)),n('[data-toggle="tooltip"]').tooltip({container:s})}else{var o=d.render(c.error,"Something went wrong","");t.addNotification(o)}t.renderNotifications()},error:function(t){s.handleAjaxError(t,a)}})},a.prototype.activateLanguage=function(t){var a=this,e=this.getModalBody(),l=this.findInModal(this.selectorOutputContainer),r=i.render(c.loading,"Loading...","");l.empty().append(r),n.ajax({url:s.getUrl(),method:"POST",context:this,data:{install:{action:"languagePacksActivateLanguage",token:this.getModuleContent().data("language-packs-activate-language-token"),iso:t}},cache:!1,beforeSend:function(){a.getNotificationBox().empty()},success:function(t){if(l.empty(),!0===t.success&&Array.isArray(t.status))t.status.forEach(function(t){var e=d.render(t.severity,t.title,t.message);a.addNotification(e)});else{var e=o.render(c.error,"Something went wrong","");a.addNotification(e)}a.getData()},error:function(t){s.handleAjaxError(t,e)}})},a.prototype.deactivateLanguage=function(t){var a=this,e=this.getModalBody(),l=this.findInModal(this.selectorOutputContainer),r=i.render(c.loading,"Loading...","");l.empty().append(r),n.ajax({url:s.getUrl(),method:"POST",context:this,data:{install:{action:"languagePacksDeactivateLanguage",token:this.getModuleContent().data("language-packs-deactivate-language-token"),iso:t}},cache:!1,beforeSend:function(){a.getNotificationBox().empty()},success:function(t){if(l.empty(),!0===t.success&&Array.isArray(t.status))t.status.forEach(function(t){var e=d.render(t.severity,t.title,t.message);a.addNotification(e)});else{var e=o.render(c.error,"Something went wrong","");a.addNotification(e)}a.getData()},error:function(t){s.handleAjaxError(t,e)}})},a.prototype.updatePacks=function(t,a){var e=this,o=this.findInModal(this.selectorOutputContainer),i=this.findInModal(this.selectorContentContainer),d=void 0===t?this.activeLanguages:[t],c=!0,l=this.activeExtensions;void 0!==a&&(l=[a],c=!1),this.packsUpdateDetails={toHandle:d.length*l.length,handled:0,updated:0,new:0,failed:0},o.empty().append(n("<div>",{class:"progress"}).append(n("<div>",{class:"progress-bar progress-bar-info",role:"progressbar","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,style:"width: 0;"}).append(n("<span>",{class:"text-nowrap"}).text("0 of "+this.packsUpdateDetails.toHandle+" language packs updated")))),i.empty(),d.forEach(function(t){l.forEach(function(a){n.ajax({url:s.getUrl(),method:"POST",context:e,data:{install:{action:"languagePacksUpdatePack",token:e.getModuleContent().data("language-packs-update-pack-token"),iso:t,extension:a}},cache:!1,beforeSend:function(){e.getNotificationBox().empty()},success:function(t){!0===t.success?(e.packsUpdateDetails.handled++,"new"===t.packResult?e.packsUpdateDetails.new++:"update"===t.packResult?e.packsUpdateDetails.updated++:e.packsUpdateDetails.failed++,e.packUpdateDone(c,d)):(e.packsUpdateDetails.handled++,e.packsUpdateDetails.failed++,e.packUpdateDone(c,d))},error:function(){e.packsUpdateDetails.handled++,e.packsUpdateDetails.failed++,e.packUpdateDone(c,d)}})})})},a.prototype.packUpdateDone=function(t,a){var e=this,i=this.getModalBody(),l=this.findInModal(this.selectorOutputContainer);if(this.packsUpdateDetails.handled===this.packsUpdateDetails.toHandle){var r=d.render(c.ok,"Language packs updated",this.packsUpdateDetails.new+" new language packs downloaded, "+this.packsUpdateDetails.updated+" language packs updated, "+this.packsUpdateDetails.failed+" language packs not available");this.addNotification(r),!0===t?n.ajax({url:s.getUrl(),method:"POST",context:this,data:{install:{action:"languagePacksUpdateIsoTimes",token:this.getModuleContent().data("language-packs-update-iso-times-token"),isos:a}},cache:!1,success:function(t){if(!0===t.success)e.getData();else{var a=o.render(c.error,"Something went wrong","");e.addNotification(a)}},error:function(t){s.handleAjaxError(t,i)}}):this.getData()}else{var p=this.packsUpdateDetails.handled/this.packsUpdateDetails.toHandle*100;l.find(".progress-bar").css("width",p+"%").attr("aria-valuenow",p).find("span").text(this.packsUpdateDetails.handled+" of "+this.packsUpdateDetails.toHandle+" language packs updated")}},a.prototype.languageMatrixHtml=function(t){var a=this.findInModal(this.selectorActivateLanguageIcon).html(),e=this.findInModal(this.selectorDeactivateLanguageIcon).html(),s=this.findInModal(this.selectorLanguageUpdateIcon).html(),o=n("<div>"),i=n("<tbody>");return t.languages.forEach(function(t){var o=t.active,d=n("<tr>");o?i.append(d.append(n("<td>").text(" "+t.name).prepend(n("<div />",{class:"btn-group"}).append(n("<a>",{class:"btn btn-default t3js-languagePacks-deactivateLanguage","data-iso":t.iso,"data-toggle":"tooltip",title:"Deactivate"}).append(e),n("<a>",{class:"btn btn-default t3js-languagePacks-update","data-iso":t.iso,"data-toggle":"tooltip",title:"Download language packs"}).append(s))))):i.append(d.addClass("t3-languagePacks-inactive t3js-languagePacks-inactive").css({display:"none"}).append(n("<td>").text(" "+t.name).prepend(n("<div />",{class:"btn-group"}).append(n("<a>",{class:"btn btn-default t3js-languagePacks-activateLanguage","data-iso":t.iso,"data-toggle":"tooltip",title:"Activate"}).append(a))))),d.append(n("<td>").text(t.iso),n("<td>").text(t.dependencies.join(", ")),n("<td>").text(null===t.lastUpdate?"":t.lastUpdate)),i.append(d)}),o.append(n("<h3>").text("Active languages"),n("<table>",{class:"table table-striped table-bordered"}).append(n("<thead>").append(n("<tr>").append(n("<th>").append(n("<div />",{class:"btn-group"}).append(n("<button>",{class:"btn btn-default t3js-languagePacks-addLanguage-toggle",type:"button"}).append(n("<span>").append(a)," Add language"),n("<button>",{class:"btn btn-default t3js-languagePacks-update",type:"button"}).append(n("<span>").append(s)," Update all"))),n("<th>").text("Locale"),n("<th>").text("Dependencies"),n("<th>").text("Last update"))),i)),o.html()},a.prototype.extensionMatrixHtml=function(t){var a,e=this.findInModal(this.selectorExtensionPackMissesIcon).html(),s=this.findInModal(this.selectorLanguageUpdateIcon).html(),o="",i=!0,l=0,r=n("<div>"),p=n("<tr>");p.append(n("<th>").text("Extension"),n("<th>").text("Key")),t.activeLanguages.forEach(function(t){p.append(n("<th>").append(n("<a>",{class:"btn btn-default t3js-languagePacks-update","data-iso":t,"data-toggle":"tooltip",title:"Download and update all language packs"}).append(n("<span>").append(s)," "+t)))});var g=n("<tbody>");return t.extensions.forEach(function(t){if(i=!0,t.packs.forEach(function(t){!1===t.exists&&(i=!1)}),!0!==i){l++,a=""!==t.icon?n("<span>").append(n("<img>",{style:"max-height: 16px; max-width: 16px;",src:"../"+t.icon,alt:t.title}),n("<span>").text(" "+t.title)):n("<span>").text(t.title);var s=n("<tr>");s.append(n("<td>").html(a.html()),n("<td>").text(t.key)),t.packs.forEach(function(a){!0!==a.exists&&(o=null!==a.lastUpdate?"No language pack available when tried at "+a.lastUpdate+". Click to re-try.":"Language pack not downloaded. Click to download",s.append(n("<td>").append(n("<a>",{class:"btn btn-default t3js-languagePacks-update","data-extension":t.key,"data-iso":a.iso,"data-toggle":"tooltip",title:o}).append(e))))}),g.append(s)}}),r.append(n("<h3>").text("Translation status"),n("<table>",{class:"table table-striped table-bordered"}).append(n("<thead>").append(p),g)),0===l?d.render(c.ok,"Language packs have been found for every installed extension.","To download the latest changes, use the refresh button in the list above."):r.html()},a.prototype.getNotificationBox=function(){return this.findInModal(this.selectorNotifications)},a.prototype.addNotification=function(t){this.notifications.push(t)},a.prototype.renderNotifications=function(){for(var t=this.getNotificationBox(),a=0;a<this.notifications.length;++a)t.append(this.notifications[a]);this.notifications=[]},a}(e.AbstractInteractableModule))});
\ No newline at end of file