You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2014/09/12 12:29:19 UTC

[05/28] git commit: [#7585] ticket:639 fixed macros for html, formated js code

[#7585] ticket:639 fixed macros for html, formated js code


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

Branch: refs/heads/je/42cc_4905
Commit: 2b781a49f0432e47d4357f993c3637e25235495d
Parents: 61656c4
Author: discort <le...@bk.ru>
Authored: Thu Aug 21 20:58:31 2014 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Tue Aug 26 19:24:58 2014 +0000

----------------------------------------------------------------------
 Allura/allura/templates/jinja_master/lib.html |   6 +-
 Allura/allura/templates/user_prefs.html       | 124 +++++++++++----------
 2 files changed, 72 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/2b781a49/Allura/allura/templates/jinja_master/lib.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/lib.html b/Allura/allura/templates/jinja_master/lib.html
index b3a5bf4..e4b1eb3 100644
--- a/Allura/allura/templates/jinja_master/lib.html
+++ b/Allura/allura/templates/jinja_master/lib.html
@@ -130,10 +130,14 @@
   <input type="text" id="{{name}}" name="{{name}}" class="text" value="{{value}}"/><br/>
 {% endmacro %}
 
-{% macro hidden_field(name, label, value='') %}
+{% macro password_field(name, label, value='') %}
   {% if label %}
   <label for="{{name}}">{{label}}</label><br/>
   {% endif %}
+  <input type="password" id="{{name}}" name="{{name}}" class="text" value="{{value}}"/><br/>
+{% endmacro %}
+
+{% macro hidden_field(name, value='') %}
   <input type="hidden" id="{{name}}" name="{{name}}" class="text" value="{{value}}"/><br/>
 {% endmacro %}
 

http://git-wip-us.apache.org/repos/asf/allura/blob/2b781a49/Allura/allura/templates/user_prefs.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/user_prefs.html b/Allura/allura/templates/user_prefs.html
index b3cfb6e..9c477f6 100644
--- a/Allura/allura/templates/user_prefs.html
+++ b/Allura/allura/templates/user_prefs.html
@@ -24,6 +24,7 @@
 {% block header %}User Preferences for {{c.user.username}}{% endblock %}
 
 {% block content %}
+{% do g.register_js('js/jquery.lightbox_me.js') %}
   {{ super() }}
   <div class="grid-23">
     <h2>Preferences</h2>
@@ -159,16 +160,15 @@
           </form>
         </fieldset>
       {% endif %}
-      {% do g.register_js('js/jquery.lightbox_me.js') %}
+      
       <form class="cur_password">
-        <h1><span class="log-in">Enter password</span></h1>
-        <p class="float">
-            <label for="password"><i class="icon-lock"></i>Current password:</label>
-            <input type="password" name="current_password" placeholder="Password">
+        <h1>Enter password</h1>
+        <p>
+          {{lib.password_field('current_password', 'Current password:')}}
         </p>
-        <p class="clearfix">  
-            <input type="submit" name="enter_pass_submit" value="Ok">
-            <input type="button" name="cancel_lightbox" value="Cancel">
+        <p>  
+          <input type="submit" name="enter_pass_submit" value="Ok">
+          <input type="button" name="cancel_lightbox" value="Cancel">
         </p>
       </form>
     {% endblock %}
@@ -198,73 +198,83 @@
     border: 0;
   }
   .cur_password {
-    width: 250px;
-    margin: 60px auto 30px;
-    padding: 15px;
-    position: relative;
     display:none;
-    background: #fffaf6;
+    width: 500px;
+    float: left;
+    overflow: hidden;
+    margin: 0 10px;
+    padding: 15px;
+
+    left: 50%;
+    margin-left: -311px;
+    z-index: 1002;
+    position: fixed;
+    top: 40px;
+    margin-top: 0px;
+    background: #636363;
     border-radius: 4px;
-    color: #7e7975;
+    color: #ffffff;
     box-shadow:
-        0 2px 2px rgba(0,0,0,0.2),        
+        0 1px 2px rgba(0,0,0,0.2),        
         0 1px 5px rgba(0,0,0,0.2),        
-        0 0 0 12px rgba(255,255,255,0.4);
+        0 0 0 5px rgba(0,0,0,0.4); 
   }
   .cur_password h1 {
-    font-size: 15px;
+    font-size: 18px;
+    line-height: 36px;
     font-weight: bold;
-    color: #bdb5aa;
+    color: #ffffff;
     padding-bottom: 8px;
     border-bottom: 1px solid #EBE6E2;
-    text-shadow: 0 2px 0 rgba(255,255,255,0.8);
-    box-shadow: 0 1px 0 rgba(255,255,255,0.8);
   }
 </style>
 {% endblock %}
 
 {% block extra_js %}
-   <script type="text/javascript">
-    $(function() {
+  <script type="text/javascript">
+      $(function() {
+          $("input[name='enter_pass_submit']").click(function (e) {
+            $("input[name='password']").val(
+                $("input[name='current_password']").val()
+              );
+            $("form[name='update-email']").submit();
+            e.preventDefault();
+          });
 
-                $("input[name='enter_pass_submit']").click(function (e) {
-                  $("input[name='password']").val(
-                      $("input[name='current_password']").val()
-                    );
-                  $("form[name='update-email']").submit();
-                  e.preventDefault();
-                });
+          $("input[name='cancel_lightbox']").click(function(){
+            $('.cur_password').trigger('close');
+            return false;
+          });
 
-                $("input[name='cancel_lightbox']").click(function(){
-                  $('.cur_password').trigger('close');
-                  return false;
-                });
-
-                function launch() {
-                     $('.cur_password').lightbox_me({
-                      centered: true, 
-                      onLoad: function() { 
-                        $('.cur_password').find('input:first').focus();
-                      }
-                  });
+          function launch() {
+               $('.cur_password').lightbox_me({
+                centered: true, 
+                onLoad: function() { 
+                  $('.cur_password').find('input:first').focus();
                 }
+            });
+          }
 
-                $("input[name='new_addr.claim'], input[name='addr-save']").click(function(e) {
-                  if ($("input[name='password']").val() == ''){
-                    e.preventDefault();
-                  }
-                  launch();
-                });
+          $("input[name='new_addr.claim'], input[name='addr-save']").click(function(e) {
+            if ($("input[name='password']").val() == ''){
+              e.preventDefault();
+            }
+            if ($("input[name='new_addr.addr']").val().length != 0){
+              launch();
+            }
+          });
 
-                $('input:submit', ".addr-delete").click(function(e) {
-                  if ($("input[name='password']").val() == ''){
-                    e.preventDefault();
-                  }
-                  var attr_del = $(this).attr('name')
-                  $(document.getElementById(attr_del)).val("1");
-                  launch();
-                });
+          $('input:submit', ".addr-delete").click(function(e) {
+            if ($("input[name='password']").val() == ''){
+              e.preventDefault();
+            }
+            $('input:hidden', ".addr-delete").val("");
+            var attr_del = $(this).attr('name')
+            $(document.getElementById(attr_del)).val("1");
+            //$('#' + attr_del).val("1");
+            launch();
+          });
 
-            });
-   </script>
+      });
+  </script>
  {% endblock %}
\ No newline at end of file