[Lada-commits] [PATCH 2 of 2] Added Logininformation to a Popup in Viewport

Wald Commits scm-commit at wald.intevation.org
Wed Apr 8 17:04:21 CEST 2015


# HG changeset patch
# User Dustin Demuth <dustin at intevation.de>
# Date 1428505439 -7200
# Node ID b400629a2575d279dc1c86275fd19153c8fcd1b1
# Parent  605bc34b45a057b9c8b90cf8087a5136186c9cfc
Added Logininformation to a Popup in Viewport

diff -r 605bc34b45a0 -r b400629a2575 app.js
--- a/app.js	Wed Apr 08 15:28:25 2015 +0200
+++ b/app.js	Wed Apr 08 17:03:59 2015 +0200
@@ -19,10 +19,6 @@
     // references!
     name: 'Lada',
 
-    username: '',
-    userroles: '',
-    logintime: '',
-
     // Setting up translations. This is done using a ext-plgin which can be
     // found on https://github.com/elmasse/Ext.i18n.Bundle
     requires: [
@@ -60,6 +56,10 @@
 
     // Start the application.
     launch: function() {
+        Lada.username = '';
+        Lada.userroles = '';
+        Lada.logintime = '';
+
         var queryString = document.location.href.split('?')[1];
         if (queryString) {
             Lada.openIDParams = queryString;
@@ -110,9 +110,9 @@
 
         /* Parse Username and Timestamp */
         var json = Ext.decode(response.responseText);
-        this.username = json.data.username;
-        this.userroles = json.data.roles;
-        this.logintime = json.data.servertime;
+        Lada.username = json.data.username;
+        Lada.userroles = json.data.roles;
+        Lada.logintime = json.data.servertime;
 
         Ext.create('Lada.store.Datenbasis', {
             storeId: 'datenbasis'
diff -r 605bc34b45a0 -r b400629a2575 app/view/Viewport.js
--- a/app/view/Viewport.js	Wed Apr 08 15:28:25 2015 +0200
+++ b/app/view/Viewport.js	Wed Apr 08 17:03:59 2015 +0200
@@ -45,16 +45,28 @@
                                 text: 'About',
                                 action: 'about'
                             }, {
-                                text: 'Zeit',
+                                text: 'Anmeldeinformationen',
                                 handler: function(){
-                                    thetime = new Date();
-                                    Ext.Msg.alert("Zeit", "Laut Ihrer lokalen Systemuhr ist es\n"+
-                                            thetime.toString() + "\n\n" +
-                                          "Das entspricht der Serverzeit:\n" +
-                                            thetime.toUTCString() + "\n\n" +
-                                          "Alle Messwerte werden in GMT/UTC auf dem Server gespeichert. " + 
-                                          "Ihr Webbrowser rechnet diese automatisch um."
-                                         );
+                                    logintime = new Date(Lada.logintime);
+                                    Ext.Msg.alert("Anmeldeinformationen",
+                                        "<p>"
+                                        + "Sie sind angemeldet mit der Kennung:"
+                                        + "<br />"
+                                        + Lada.username
+                                        + "</p>"
+                                        + "<p>"
+                                        + "Sie sind Mitglied der folgenden "
+                                        + "Gruppen:"
+                                        + "<br />"
+                                        + Lada.userroles
+                                        + "</p>"
+                                        + "<p>"
+                                        + "<br/>"
+                                        + "Die Anmeldung wurde durchgeführt um:"
+                                        + "<br />"
+                                        +  Ext.Date.format(logintime, 'd.m.Y H:i:s P')
+                                        + "</p>"
+                                       );
                                 }
                             }
                             ]


More information about the Lada-commits mailing list