changeset 2781:d99532983599

refresh user settings only when theme is changed, change tab order to put appearance first
author RogerHaase <haaserd@gmail.com>
date Fri, 05 Sep 2014 14:06:27 -0700
parents 49184fa45ed7
children d63def457cc5
files MoinMoin/static/js/common.js MoinMoin/templates/usersettings_forms.html MoinMoin/themes/basic/templates/usersettings.html MoinMoin/themes/basic/templates/usersettings_forms.html
diffstat 4 files changed, 27 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/static/js/common.js	Fri Sep 05 14:02:51 2014 -0700
+++ b/MoinMoin/static/js/common.js	Fri Sep 05 14:06:27 2014 -0700
@@ -390,7 +390,10 @@
             newform.data('initialForm', newform.serialize());
             // replace the old form with the new one
             form.replaceWith(newform);
-            location.reload(true);
+            if (ev.currentTarget.name === 'usersettings_ui') {
+                // theme has changed, show user the new theme
+                location.reload(true);
+            }
         }, 'json');
         return false;
     }
--- a/MoinMoin/templates/usersettings_forms.html	Fri Sep 05 14:02:51 2014 -0700
+++ b/MoinMoin/templates/usersettings_forms.html	Fri Sep 05 14:06:27 2014 -0700
@@ -97,30 +97,30 @@
 {# javascript functions within common.js are dependent upon the structure, classes and ids defined here #}
 {% macro all_usersettings_forms(form_objs) %}
     <div id="moin-usersettings">
-        <div id="personal" class="moin-tab-body moin-form">
-            <h2 class="moin-settings-head"><a href="#personal">{{ _("Personal") }}</a></h2>
-            {{ personal(form_objs.personal) }}
+        <div id="ui" class="moin-tab-body moin-form">
+            <h2 class="moin-settings-head"><a href="#ui">{{ _("Appearance") }}</a></h2>
+            {{ ui(form_objs.ui) }}
         </div>
         <div id="password" class="moin-tab-body moin-form">
             <h2 class="moin-settings-head"><a href="#password">{{ _("Change Password") }}</a></h2>
             {{ password(form_objs.password) }}
         </div>
+        <div id="navigation" class="moin-tab-body moin-form">
+            <h2 class="moin-settings-head"><a href="#navigation">{{ _("Navigation") }}</a></h2>
+            {{ navigation(form_objs.navigation) }}
+        </div>
         <div id="notification" class="moin-tab-body moin-form">
             <h2 class="moin-settings-head"><a href="#notification">{{ _("Notifications") }}</a></h2>
             {{ notification(form_objs.notification) }}
         </div>
-        <div id="ui" class="moin-tab-body moin-form">
-            <h2 class="moin-settings-head"><a href="#ui">{{ _("Appearance") }}</a></h2>
-            {{ ui(form_objs.ui) }}
-        </div>
-        <div id="navigation" class="moin-tab-body moin-form">
-            <h2 class="moin-settings-head"><a href="#navigation">{{ _("Navigation") }}</a></h2>
-            {{ navigation(form_objs.navigation) }}
-        </div>
         <div id="options" class="moin-tab-body moin-form">
             <h2 class="moin-settings-head"><a href="#options">{{ _("Options") }}</a></h2>
             {{ options(form_objs.options) }}
         </div>
+        <div id="personal" class="moin-tab-body moin-form">
+            <h2 class="moin-settings-head"><a href="#personal">{{ _("Personal") }}</a></h2>
+            {{ personal(form_objs.personal) }}
+        </div>
         <div id="subscriptions" class="moin-tab-body moin-form">
             <h2 class="moin-settings-head"><a href="#subscriptions">{{ _("Subscriptions") }}</a></h2>
             {{ subscriptions(form_objs.subscriptions) }}
--- a/MoinMoin/themes/basic/templates/usersettings.html	Fri Sep 05 14:02:51 2014 -0700
+++ b/MoinMoin/themes/basic/templates/usersettings.html	Fri Sep 05 14:06:27 2014 -0700
@@ -2,14 +2,14 @@
 {% import theme("usersettings_forms.html") as user_forms %}
 
 {% block content %}
-    <h2>{{ _("User Settings") }}</h2>
+    <h1>{{ _("User Settings") }}</h1>
     <ul class="moin-nav nav-tabs moin-shadow">
-        <li class="active"><a href="#personal" data-toggle="tab">{{ _("Personal") }}</a></li>
+        <li class="active"><a href="#ui" data-toggle="tab">{{ _("Appearance") }}</a></li>
         <li><a href="#password" data-toggle="tab">{{ _("Change Password") }}</a></li>
+        <li><a href="#navigation" data-toggle="tab">{{ _("Navigation") }}</a></li>
         <li><a href="#notification" data-toggle="tab">{{ _("Notifications") }}</a></li>
-        <li><a href="#ui" data-toggle="tab">{{ _("Appearance") }}</a></li>
-        <li><a href="#navigation" data-toggle="tab">{{ _("Navigation") }}</a></li>
         <li><a href="#options" data-toggle="tab">{{ _("Options") }}</a></li>
+        <li><a href="#personal" data-toggle="tab">{{ _("Personal") }}</a></li>
         <li><a href="#subscriptions" data-toggle="tab">{{ _("Subscriptions") }}</a></li>
     </ul>
     {{ user_forms.all_usersettings_forms(form_objs) }}
--- a/MoinMoin/themes/basic/templates/usersettings_forms.html	Fri Sep 05 14:02:51 2014 -0700
+++ b/MoinMoin/themes/basic/templates/usersettings_forms.html	Fri Sep 05 14:06:27 2014 -0700
@@ -174,24 +174,24 @@
         <div class="row">
             <div class="col-lg-4">
                 <div class="tab-content">
-                    <div id="personal" class="tab-pane active">
-                        {{ personal(form_objs.personal) }}
+                    <div id="ui" class="tab-pane active">
+                        {{ ui(form_objs.ui) }}
                     </div>
                     <div id="password" class="tab-pane active">
                         {{ password(form_objs.password) }}
                     </div>
+                    <div id="navigation" class="tab-pane active">
+                        {{ navigation(form_objs.navigation) }}
+                    </div>
                     <div id="notification" class="tab-pane active">
                         {{ notification(form_objs.notification) }}
                     </div>
-                    <div id="ui" class="tab-pane active">
-                        {{ ui(form_objs.ui) }}
-                    </div>
-                    <div id="navigation" class="tab-pane active">
-                        {{ navigation(form_objs.navigation) }}
-                    </div>
                     <div id="options" class="tab-pane active">
                         {{ options(form_objs.options) }}
                     </div>
+                    <div id="personal" class="tab-pane active">
+                        {{ personal(form_objs.personal) }}
+                    </div>
                     <div id="subscriptions" class="tab-pane active">
                         {{ subscriptions(form_objs.subscriptions) }}
                     </div>