[Lada-commits] [PATCH 5 of 9] About Window

Wald Commits scm-commit at wald.intevation.org
Fri May 22 16:14:39 CEST 2015


# HG changeset patch
# User Dustin Demuth <dustin at intevation.de>
# Date 1432298118 -7200
# Node ID c6e9bcda69b84842a3dd3ca1b9f8bd921dc6b1b2
# Parent  0840c4cf2273c69df5555e746c051a77fa4f0b9e
About Window

diff -r 0840c4cf2273 -r c6e9bcda69b8 app.js
--- a/app.js	Fri May 22 13:16:48 2015 +0200
+++ b/app.js	Fri May 22 14:35:18 2015 +0200
@@ -61,7 +61,8 @@
         Lada.userroles = '';
         Lada.logintime = '';
         Lada.mst = [];
-        Lada.clientversion = '2.0beta2';
+        Lada.clientVersion = '2.0-beta2';
+        Lada.serverVersion = '';
 
         var queryString = document.location.href.split('?')[1];
         if (queryString) {
@@ -174,13 +175,13 @@
             },
             success: function(response) {
                 var json = Ext.decode(response.responseText);
-                return json.data;
+                Lada.serverVersion = json.data;
             },
             failure: function(response) {
                 console.log('Error in retrieving the server version.'
                     + ' It might be lower than 2.0-beta2'
                     + ' Or something is broken...');
-                return i18n.getMsg('err.msg.generic.title');
+                Lada.serverVersion = i18n.getMsg('err.msg.generic.title');
             }
         });
     },
diff -r 0840c4cf2273 -r c6e9bcda69b8 app/view/window/About.js
--- a/app/view/window/About.js	Fri May 22 13:16:48 2015 +0200
+++ b/app/view/window/About.js	Fri May 22 14:35:18 2015 +0200
@@ -37,80 +37,46 @@
         this.items = [{
             border: 0,
             autoscroll: 'true',
-            layout: 'vbox',
             items: [{
-                xtype: 'text',
-                style: {
-                    width: '95%',
-                    marginBottom: '5px'
-                },
-                text: i18n.getMsg('about.window.text.login')
-            }, {
-                xtype: 'text',
-                style: {
-                    width: '95%',
-                    marginBottom: '5px'
-                },
-                text: Lada.username
-            }, {
-                xtype: 'text',
-                style: {
-                    width: '95%',
-                    marginBottom: '5px'
-                },
-                text: i18n.getMsg('about.window.text.roles')
-            }, {
-                xtype: 'text',
-                style: {
-                    width: '95%',
-                    marginBottom: '5px'
-                },
-                text: Lada.userroles
-            }, {
-                xtype: 'text',
-                style: {
-                    width: '95%',
-                    marginBottom: '5px'
-                },
-                text: i18n.getMsg('about.window.text.logintime')
-            }, {
-                xtype: 'text',
-                style: {
-                    width: '95%',
-                    marginBottom: '5px'
-                },
-                text: Ext.Date.format(new Date(Lada.logintime), 'd.m.Y H:i:s P')
-            }, {
-                xtype: 'text',
-                style: {
-                    width: '95%',
-                    marginBottom: '5px'
-                },
-                text: i18n.getMsg('about.window.text.serverversion')
-            }, {
-                xtype: 'text',
-                style: {
-                    width: '95%',
-                    marginBottom: '5px'
-                },
-                text: Lada.serverversion
-            }, {
-                xtype: 'text',
-                style: {
-                    width: '95%',
-                    marginBottom: '5px'
-                },
-                text: i18n.getMsg('about.window.text.clientversion')
-            }, {
-                xtype: 'text',
-                style: {
-                    width: '95%',
-                    marginBottom: '5px'
-                },
-                text: Lada.clientversion
+                xtype: 'panel',
+                border: 0,
+                layout: 'fit',
+                bodyPadding: 20,
+                html: '<p>'
+                    + i18n.getMsg('about.window.text.login')
+                    + '<br />'
+                    + Lada.username
+                    + '</p>'
+                    + '<p>'
+                    + i18n.getMsg('about.window.text.roles')
+                    + this.rolesToHtml()
+                    + '</p>'
+                    + '<p>'
+                    + i18n.getMsg('about.window.text.logintime')
+                    + '<br />'
+                    + Ext.Date.format(new Date(Lada.logintime), 'd.m.y h:i:s P')
+                    + '</p>'
+                    + '<p>'
+                    + i18n.getMsg('about.window.text.serverversion')+ ' '
+                    + Lada.serverVersion
+                    + '</p>'
+                    + '<p>'
+                    + i18n.getMsg('about.window.text.clientversion')+' '
+                    + Lada.clientVersion
+                    + '</p>'
             }]
         }];
 
         this.callParent(arguments);
+    },
+
+    rolesToHtml: function() {
+        var roles = '';
+        var r = Lada.userroles.split(',');
+        var i;
+        for (i in r){
+            roles += '<br />' + r[i];
+        }
+        return roles;
     }
 });
diff -r 0840c4cf2273 -r c6e9bcda69b8 resources/i18n/Lada_de-DE.properties
--- a/resources/i18n/Lada_de-DE.properties	Fri May 22 13:16:48 2015 +0200
+++ b/resources/i18n/Lada_de-DE.properties	Fri May 22 14:35:18 2015 +0200
@@ -94,8 +94,8 @@
 about.window.text.login:Sie sind angemeldet mit der Kennung:
 about.window.text.roles:Sie sind Mitglied der folgenden Gruppen:
 about.window.text.logintime:Die Anmeldung wurde durchgeführt um:
-about.window.text.serverversion:Der Server läuft mit Softwareversion:
-about.window.text.clientversion:Der Client läuft mit Softwareversion:
+about.window.text.serverversion:Serverversion:
+about.window.text.clientversion:Clientversion:
 
 # Actions
 add:Hinzufügen


More information about the Lada-commits mailing list