1. Panayiotis Lipiridis
  2. gae-init-pro

Commits

Panayiotis Lipiridis  committed bab2e27

Better handling of the amdin users and droped the form-horizontal in the forms

  • Participants
  • Parent commits 36fd308
  • Branches default

Comments (0)

Files changed (4)

File main/auth.py

View file
  • Ignore whitespace
 def retrieve_user_from_google(google_user):
   user_db = model.User.retrieve_one_by('federated_id', google_user.user_id())
   if user_db:
+    if not user_db.admin and users.is_current_user_admin():
+      user_db.admin = True
+      user_db.put()
     return user_db
   user_db = model.User(
       federated_id=google_user.user_id(),

File main/templates/admin/config_update.html

View file
  • Ignore whitespace
     </h1>
   </div>
   <div class="row">
-    <div class="span7">
+    <div class="span4">
       <div class="alert">
         <strong>Heads Up!</strong>
         For most of the settings you will have to restart the
           instances.
         </a>
       </div>
-      <form class="form-horizontal" method="POST" action=".">
+      <form class="form" method="POST" action=".">
         <fieldset>
           {{form.csrf}}
 
           {% set form_field = form.flask_secret_key %}
           {% include 'bit/form_text_field.html' %}
 
-          <div class="form-actions">
-            <button type="submit" class="btn btn-primary btn-loading" data-loading-text="Updating Config..">
-              Update Config
-            </button>
-          </div>
+          <button type="submit" class="btn btn-primary btn-block btn-loading" data-loading-text="Updating Config..">
+            Update Config
+          </button>
         </fieldset>
       </form>
     </div>

File main/templates/feedback.html

View file
  • Ignore whitespace
     </h1>
   </div>
   <div class="row">
-    <div class="span7">
-      <form class="form-horizontal" method="POST" action=".">
+    <div class="span4">
+      <form class="form" method="POST" action=".">
         <fieldset>
           {{form.csrf}}
 
           {% set form_field = form.email %}
           {% include 'bit/form_text_field.html' %}
 
-          <div class="form-actions">
-            <button type="submit" class="btn btn-primary btn-loading" data-loading-text="Sending Feedback..">
-              Send Feedback
-            </button>
-          </div>
+          <button type="submit" class="btn btn-primary btn-block btn-loading" data-loading-text="Sending Feedback..">
+            Send Feedback
+          </button>
         </fieldset>
       </form>
     </div>
-    <div class="span5">
-      <div class="well">
-        <p>
-          The feedback form is sending an email if you set the <strong>Feedback Email</strong>
-          in the admin console.
-        </p>
-        <p>
-          The <strong>email</strong> in this form is optional and provide it if
-          you would like a reply from us.
-        </p>
-
-      </div>
-    </div>
   </div>
 {% endblock %}

File main/templates/profile.html

View file
  • Ignore whitespace
   <div class="row">
     <div class="span2">
       <a class="thumbnail" href="http://gravatar.com" target="_blank">
-        <img src="{{user_db.avatar_url}}&amp;s=130" alt="Gravatar photo of {{user_db.name}}">
+        <img src="{{user_db.avatar_url}}&amp;s=170" alt="Gravatar photo of {{user_db.name}}">
       </a>
     </div>
-    <div class="span6">
-      <form class="form-horizontal" method="POST" action=".">
+    <div class="span4">
+      <form class="form" method="POST" action=".">
         <fieldset>
           {{form.csrf}}
 
           {% set form_field = form.email %}
           {% include 'bit/form_text_field.html' %}
 
-          <div class="form-actions">
-            <button type="submit" class="btn btn-primary btn-loading" data-loading-text="Updating Profile..">
-              Update Profile
-            </button>
-          </div>
+          <button type="submit" class="btn btn-primary btn-block btn-loading" data-loading-text="Updating Profile..">
+            Update Profile
+          </button>
         </fieldset>
       </form>
     </div>