changeset 805:c6e9bcda69b8

About Window
author Dustin Demuth <dustin@intevation.de>
date Fri, 22 May 2015 14:35:18 +0200
parents 0840c4cf2273
children d369a7eb0a7f
files app.js app/view/window/About.js resources/i18n/Lada_de-DE.properties
diffstat 3 files changed, 42 insertions(+), 75 deletions(-) [+]
line wrap: on
line diff
--- 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');
             }
         });
     },
--- 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;
     }
 });
--- 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

http://lada.wald.intevation.org