You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2014/06/13 20:34:46 UTC

[04/17] git commit: [#7436] ticket:599 Make forms visually separate

[#7436] ticket:599 Make forms visually separate


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/5255b5bb
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/5255b5bb
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/5255b5bb

Branch: refs/heads/db/7406
Commit: 5255b5bb811427a2a9d77b3f516c12dc99b8faf6
Parents: ab2dc85
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Jun 5 14:47:44 2014 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Jun 12 19:38:41 2014 +0000

----------------------------------------------------------------------
 Allura/allura/templates/user_prefs.html | 167 +++++++++++++++------------
 1 file changed, 93 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/5255b5bb/Allura/allura/templates/user_prefs.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/user_prefs.html b/Allura/allura/templates/user_prefs.html
index 7d32333..b5f7edd 100644
--- a/Allura/allura/templates/user_prefs.html
+++ b/Allura/allura/templates/user_prefs.html
@@ -28,107 +28,126 @@
   <div class="grid-23">
     <h2>Preferences</h2>
     {% block info %}
-      <p>Username: {{ c.user.username }}</p>
+    <fieldset>
+      <legend>Username: {{ c.user.username }}</legend>
       <p><a href="{{ c.user.private_project().url() }}">My profile and my projects</a></p>
       <p><a href="{{ c.user.private_project().url() }}admin/overview">Set avatar icon</a></p>
+      {% if h.asbool(tg.config.get('auth.allow_user_to_disable_account', False)) %}
+        <p><a href="/auth/disable">Disable account</a></p>
+      {% endif %}
+    </fieldset>
     {% endblock info %}
 
     {% block edit_prefs_form %}
       {% if h.asbool(tg.config.get('auth.allow_edit_prefs', False)) %}
       <form action="update" method="post">
-        <label class="grid-4">Display Name</label>
-        <div class="grid-18">
-          <input name="preferences.display_name" value="{{c.user.display_name}}" type="text">
-        </div>
-        <label class="grid-4">Page Size</label>
-        <div class="grid-18">
-          <select name="preferences.results_per_page">
-            {% for per_page in [25, 50, 100, 250] %}
-                <option {% if per_page == c.user.preferences.results_per_page %}selected="selected"{% endif %}
-                   value="{{per_page}}">{{per_page}}</option>
-            {% endfor %}
-          </select>
-        </div>
+        <fieldset>
+          <legend>General and Email Settings</legend>
+          <label class="grid-4">Display Name</label>
+          <div class="grid-18">
+            <input name="preferences.display_name" value="{{c.user.display_name}}" type="text">
+          </div>
+          <label class="grid-4">Page Size</label>
+          <div class="grid-18">
+            <select name="preferences.results_per_page">
+              {% for per_page in [25, 50, 100, 250] %}
+                  <option {% if per_page == c.user.preferences.results_per_page %}selected="selected"{% endif %}
+                     value="{{per_page}}">{{per_page}}</option>
+              {% endfor %}
+            </select>
+          </div>
 
-        {% for a in c.user.email_addresses %}
-          <input name="addr-{{loop.index0}}.ord" value="{{loop.index0}}" type="hidden"/>
-        {% endfor %}
-        {% if c.user.email_addresses %}
-          <h3 class="grid-18">Email Addresses</h3>
-          <table class="grid-18">
-            <tr>
-              <th>Primary?</th>
-              <th>Address</th>
-              <th>Confirmed</th>
-              <th></th>
-            </tr>
-            {% for a in c.user.email_addresses %}
-            <tr>
-              {% set obj = c.user.address_object(a) %}
-              <td>{{lib.radio_button('primary_addr', None, a, c.user.preferences.email_address)}}</td>
-              <td>{{a}}</td>
-              {% if obj %}
-              <td>
-                {% if obj.confirmed %}
-                  yes
+          {% for a in c.user.email_addresses %}
+            <input name="addr-{{loop.index0}}.ord" value="{{loop.index0}}" type="hidden"/>
+          {% endfor %}
+          {% if c.user.email_addresses %}
+            <h3 class="grid-18">Email Addresses</h3>
+            <table class="grid-18">
+              <tr>
+                <th>Primary?</th>
+                <th>Address</th>
+                <th>Confirmed</th>
+                <th></th>
+              </tr>
+              {% for a in c.user.email_addresses %}
+              <tr>
+                {% set obj = c.user.address_object(a) %}
+                <td>{{lib.radio_button('primary_addr', None, a, c.user.preferences.email_address)}}</td>
+                <td>{{a}}</td>
+                {% if obj %}
+                <td>
+                  {% if obj.confirmed %}
+                    yes
+                  {% else %}
+                    no (<a href="{{g.url('/auth/send_verification_link', a=a)}}">verify</a>)
+                  {% endif %}
+                </td>
                 {% else %}
-                  no (<a href="{{g.url('/auth/send_verification_link', a=a)}}">verify</a>)
+                  <td>Unknown addr obj {{a}}</td>
                 {% endif %}
-              </td>
-              {% else %}
-                <td>Unknown addr obj {{a}}</td>
-              {% endif %}
-              <td>{{lib.submit_button('Delete', 'addr-%s.delete' % loop.index0)}}</td>
-            </tr>
-            {% endfor %}
-          </table>
-        {% endif %}
-        <div class="grid-18">
-          {{lib.text_field('new_addr.addr', 'New Email Address')}}
-          {{lib.submit_button('Claim Address', name='new_addr.claim')}}
-        </div>
-        <div class="grid-18">
-          {{lib.submit_button('Save Changes')}}
-        </div>
-        {{lib.csrf_token()}}
+                <td>{{lib.submit_button('Delete', 'addr-%s.delete' % loop.index0)}}</td>
+              </tr>
+              {% endfor %}
+            </table>
+          {% endif %}
+          <div class="grid-18">
+            {{lib.text_field('new_addr.addr', 'New Email Address')}}
+            {{lib.submit_button('Claim Address', name='new_addr.claim')}}
+          </div>
+          <div class="grid-18">
+            {{lib.submit_button('Save Changes')}}
+          </div>
+          {{lib.csrf_token()}}
+        </fieldset>
       </form>
       {% endif %}  {# allow_edit_prefs #}
     {% endblock edit_prefs_form %}
 
     {% if g.theme.password_change_form %}
-    <div class="grid-20">
-      <h2>Change Password</h2>
-      {{ g.theme.password_change_form.display() }}
-    </div>
+      <fieldset>
+        <legend>Change Password</legend>
+        {{ g.theme.password_change_form.display() }}
+      </fieldset>
     {% endif %}
 
     {% if g.theme.upload_key_form %}
-    <div class="grid-20">
-      <h2>Upload ssh public key</h2>
-      {{ g.theme.upload_key_form.display() }}
-    </div>
+      <fieldset>
+        <legend>Upload ssh public key</legend>
+        {{ g.theme.upload_key_form.display() }}
+      </fieldset>
     {% endif %}
 
-
-    <div class="grid-20">
-      <h2>User Messages</h2>
+    <fieldset>
+      <legend>User Messages</legend>
       <form method="POST" action="user_message">
-      <div class="grid-19">
+      <div class="grid-10">
           <input type="checkbox" id="allow_user_messages" name="allow_user_messages" {% if not c.user.get_pref('disable_user_messages') %} checked {% endif %}>
           <label for="allow_user_messages">Allow another user to send me direct email messages</label>
       </div>
-      <label class="grid-4">&nbsp;</label>
-      <div class="grid-19">
+      <div class="grid-2">
           <input class="submit" type="submit" value="Save">
       </div>
       {{ lib.csrf_token() }}
       </form>
-    </div>
-
-    {% if h.asbool(tg.config.get('auth.allow_user_to_disable_account', False)) %}
-      <div class="grid-20">
-        <p><a href="/auth/disable">Disable account</a></p>
-      </div>
-    {% endif %}
+    </fieldset>
   </div>
 {% endblock %}
+
+{% block extra_css %}
+{{ super() }}
+<style>
+  fieldset {
+    margin-bottom: 2em;
+    border: 1px solid silver;
+    padding: 8px;
+    -webkit-border-radius: 4px;
+    -moz-border-radius: 4px;
+    border-radius: 4px;
+  }
+  legend {
+    margin: .2em;
+    padding: .2em;
+    font-size: 1.5em;
+  }
+</style>
+{% endblock %}