changeset 716:b400629a2575

Added Logininformation to a Popup in Viewport
author Dustin Demuth <dustin@intevation.de>
date Wed, 08 Apr 2015 17:03:59 +0200
parents 605bc34b45a0
children f124d24c8ade
files app.js app/view/Viewport.js
diffstat 2 files changed, 28 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- 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'
--- 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>"
+                                       );
                                 }
                             }
                             ]

http://lada.wald.intevation.org