[#5909] Split Preferences and Personal Info off from Subscriptions page

Signed-off-by: Cory Johns johnsca@geek.net

Cory Johns Cory Johns 2013-03-13

added Allura/allura/templates/user_info.html
added Allura/allura/templates/user_subs.html
changed Allura/allura/controllers/auth.py
changed Allura/allura/lib/plugin.py
changed Allura/allura/nf/allura/css/site_style.css
changed Allura/allura/templates/jinja_master/theme_macros.html
changed Allura/allura/templates/oauth_authorize_ok.html
changed Allura/allura/templates/trovecategories.html
changed Allura/allura/templates/user_availability.html
changed Allura/allura/templates/user_contacts.html
changed Allura/allura/templates/user_skills.html
changed Allura/allura/tests/functional/test_auth.py
copied Allura/allura/templates/user_preferences.html -> Allura/allura/templates/user_prefs.html
Allura/allura/templates/user_info.html Diff Switch to side-by-side view
Loading...
Allura/allura/templates/user_subs.html Diff Switch to side-by-side view
Loading...
Allura/allura/controllers/auth.py Diff Switch to side-by-side view
Loading...
Allura/allura/lib/plugin.py Diff Switch to side-by-side view
Loading...
Allura/allura/nf/allura/css/site_style.css Diff Switch to side-by-side view
Loading...
Allura/allura/templates/jinja_master/theme_macros.html Diff Switch to side-by-side view
Loading...
Allura/allura/templates/oauth_authorize_ok.html Diff Switch to side-by-side view
Loading...
Allura/allura/templates/trovecategories.html Diff Switch to side-by-side view
Loading...
Allura/allura/templates/user_availability.html Diff Switch to side-by-side view
Loading...
Allura/allura/templates/user_contacts.html Diff Switch to side-by-side view
Loading...
Allura/allura/templates/user_skills.html Diff Switch to side-by-side view
Loading...
Allura/allura/tests/functional/test_auth.py Diff Switch to side-by-side view
Loading...
Allura/allura/templates/user_preferences.html to Allura/allura/templates/user_prefs.html
--- a/Allura/allura/templates/user_preferences.html
+++ b/Allura/allura/templates/user_prefs.html
@@ -17,40 +17,98 @@
       {%- endfor %}
    </ul>
 
-  <div style="clear:both" class="grid-20">
-    <h2>Personal Settings</h2>
-    {{g.theme.personal_data_form.display(action="/auth/prefs/change_personal_data", user=c.user)}} 
+  <div class="grid-23">
+      <h2>Preferences</h2>
+      <form action="update" method="post">
+            {% if tg.config.get('auth.method', 'local') == 'local' %}
+            <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>
+            {% endif %}
+
+        {% if tg.config.get('auth.method', 'local') == 'local' %}
+          {% 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 %}
+                  <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>
+
+            {% if c.user.open_ids %}
+            <h3 class="grid-18">OpenIDs Claimed</h3>
+            <table class="grid-18">
+              <tr>
+                <th>OpenID</th>
+                <th></th>
+              </tr>
+              {% for oid in c.user.open_ids %}
+                {% set obj = c.user.openid_object(oid) %}
+              <tr>
+                <td>{{oid}}</td>
+                <td>{{lib.submit_button('Delete', 'oid-%s.delete' % loop.index0)}}</td>
+              </tr>
+              {% endfor %}
+            </table>
+            {% endif %}
+            <div class="grid-18">
+            <a href="/auth/claim_oid">Claim New OpenID</a>
+            </div>
+        {% endif %}
+        <div class="grid-18">
+        {{lib.submit_button('Save Changes')}}
+        </div>
+      </form>
   </div>
 
-  <div style="clear:both" class="grid-20">
-    <a name="Contacts"></a>
-    <h2>Personal Contacts</h2>
-    <p>
-      If you want, you can set your contacts allowing other members to contact you or you can set your personal website allowing other members to introduce your self.
-    </p>
-    <ul><li><a href="/auth/prefs/user_contacts">Click here to check and change your contacts</a></li></ul>
-  </div>
-
-  <a name="Availability"></a>
-  <div style="clear:both" class="grid-20">
-    <h2>Availability</h2>
-    <p>
-      If you want, you can set the weekly timeslot during which you are usually available to support other users of the forge. (If you didn't set any timezone, your timeslots could be meaningless to other users, therefore they will be ignored!)
-    </p>
-    <ul><li><a href="/auth/prefs/user_availability">Click here to check and change your availability slots</a></li></ul>
-  </div>
-
-  <div class="grid-20">
-    <h2>Skills list</h2>
-    <ul><li><a href="/auth/prefs/user_skills">Click here to check and change your skills list</a></li></ul>
-  </div>
-
+   <div style="clear:both"></div>
   {% if g.theme.password_change_form %}
   <div class="grid-20">
     <h2>Change Password</h2>
     {{ g.theme.password_change_form.display() }}
   </div>
   {% endif %}
+
   {% if g.theme.upload_key_form %}
   <div class="grid-20">
     <h2>Upload ssh public key</h2>
@@ -59,7 +117,7 @@
   {% endif %}
 
   {% if tg.config.get('auth.method', 'local') == 'local' %}
-      <br style="clear:both"/>
+  <div class="grid-20">
       <h2>API Token</h2>
       {% if api_token %}
         <p>
@@ -77,119 +135,6 @@
       <form method="POST" action="gen_api_token" class="grid-18">
         <input type="submit" value="(Re)generate API Token">
       </form>
+  </div>
   {% endif %}
-
-  <div style="clear:both"></div>
-
-  <h2>Authorized Third-party Applications</h2>
-  {% for access_tok in authorized_applications %}
-    <div>
-      <h3>{{access_tok.consumer_token.name}}</h3>
-      {{access_tok.consumer_token.description_html}}
-      {{ c.revoke_access.display(value=access_tok) }}
-      <br style="clear:both"/>
-  </div>
- {% endfor %}
-    {% if not authorized_applications %}<p>No authorized third-party applications</p>{% endif %}
-
-
-  <h2>Subscriptions</h2>
-  {% if subscriptions %}
-    <p><em>Mark tools that you want to subscribe to. Unmark tools that you want to unsubscribe from. Press 'Save' button.</em></p>
-    {{c.form.display(action='update_subscriptions', value=dict(subscriptions=subscriptions))}}
-  {% else%}
-    <p>No subscriptions.</p>
-  {% endif %}
-  <hr/>
-  <div style="clear:both">&nbsp;</div>
-  <form action="update" method="post">
-        {% if tg.config.get('auth.method', 'local') == 'local' %}
-        <label class="grid-4">Display Name</label>
-        <div class="grid-18">
-          <input name="preferences.display_name" value="{{c.user.display_name}}" type="text">
-        </div>
-        {% endif %}
-        <label class="grid-4">Email Format</label>
-        <div class="grid-18">
-          <select name="preferences.email_format">
-            <option value="plain" {{'selected' if c.user.preferences.email_format == 'plain' else ''}}>Plain Text</option>
-            <option value="html" {{'selected' if c.user.preferences.email_format == 'html' else ''}}>HTML</option>
-            <option value="both" {{'selected' if c.user.preferences.email_format == 'both' else ''}}>Combined</option>
-          </select>
-        </div>
-        {% if tg.config.get('auth.method', 'local') == 'local' %}
-        <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>
-        {% endif %}
-
-    {% if tg.config.get('auth.method', 'local') == 'local' %}
-      {% 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 %}
-              <td>Unknown addr obj {{a}}</td>
-            {% endif %}
-            <td>{{lib.submit_button('Delete', 'addr-%s.delete' % i)}}</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>
-
-        {% if c.user.open_ids %}
-        <h3 class="grid-18">OpenIDs Claimed</h3>
-        <table class="grid-18">
-          <tr>
-            <th>OpenID</th>
-            <th></th>
-          </tr>
-          {% for oid in c.user.open_ids %}
-            {% set obj = c.user.openid_object(oid) %}
-          <tr>
-            <td>{{oid}}</td>
-            <td>{{lib.submit_button('Delete', 'oid-%s.delete' % loop.index0)}}</td>
-          </tr>
-          {% endfor %}
-        </table>
-        {% endif %}
-        <div class="grid-18">
-        <a href="/auth/claim_oid">Claim New OpenID</a>
-        </div>
-    {% endif %}
-    <div class="grid-18">
-    {{lib.submit_button('Save Changes')}}
-    </div>
-  </form>
 {% endblock %}