allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [43/50] [abbrv] allura git commit: [#7924] ticket:836 Update perm_delete
Date Mon, 19 Oct 2015 11:38:08 GMT
[#7924] ticket:836 Update perm_delete


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

Branch: refs/heads/ib/7924
Commit: 9068b7e0c7676aa67272865b42e12700d1e52ab3
Parents: dcc208e
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Thu Aug 13 16:13:19 2015 +0300
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Thu Oct 15 15:08:32 2015 +0000

----------------------------------------------------------------------
 .../ext/admin/templates/admin_widgets/card_field.html | 13 +++++--------
 Allura/allura/ext/admin/templates/project_groups.html | 14 ++++++++++----
 Allura/allura/lib/app_globals.py                      |  2 +-
 Allura/allura/public/nf/js/project_groups.js          |  9 ++++++---
 4 files changed, 22 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/9068b7e0/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/admin_widgets/card_field.html b/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
index 47475fd..657f6a0 100644
--- a/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
+++ b/Allura/allura/ext/admin/templates/admin_widgets/card_field.html
@@ -22,11 +22,10 @@
     <li class="tcenter">
       <h3>{{name}}</h3>
       {% if settings_href %}
-      <a href="{{settings_href}}" class="admin_modal" title="{{name}} Settings">
-        <small
-           data-icon="{{g.icons.perm_tool.char}}"
-           class="ico-r admin_modal {{g.icons.perm_tool.css}}"></small>
-      </a>
+      {{ g.icons['perm_tool'].render(
+          href=settings_href,
+          extra_css='admin_modal',
+          title='{} Settings'.format(name)) }}
       {% endif %}
       <p style="padding-bottom: 0">{{ g.icons[icon_name].render(tag='b', style='font-size:24px;')
}}</p>
       {% if desc %}
@@ -46,9 +45,7 @@
           {{ widget.item_display(item) }}
           <input type="hidden" name="card-{{index}}.value"
                  {{ widget.j2_attrs(dict(value=widget.item_id(item))) }} />
-          <small data-icon="{{g.icons['perm_delete'].char}}"
-                 class="ico-r {{g.icons['perm_delete'].css}}"
-                 title="Remove"></small>
+          {{ g.icons['perm_delete'].render(tag='small') }}
         </a>
     </li>
     {% endfor %}

http://git-wip-us.apache.org/repos/asf/allura/blob/9068b7e0/Allura/allura/ext/admin/templates/project_groups.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/project_groups.html b/Allura/allura/ext/admin/templates/project_groups.html
index 57d37e2..7169b60 100644
--- a/Allura/allura/ext/admin/templates/project_groups.html
+++ b/Allura/allura/ext/admin/templates/project_groups.html
@@ -71,9 +71,11 @@
           {% endfor %}
           {% for r in role.users_with_role() %}
           <li class="deleter" data-user="{{r.user.username}}">
-            <b data-icon="{{g.icons['perm_delete'].char}}"
-               class="ico {{g.icons['perm_delete'].css}} deleter" data-user="{{r.user.username}}"></b>
-            {{ r.user.display_name }} ({{r.user.username}})
+            {{ g.icons['perm_delete'].render(
+                title='{} ({})'.format(r.user.display_name, r.user.username),
+                show_title=True,
+                extra_css='deleter',
+                **{'data-user': r.user.username}) }}
           </li>
           {% endfor %}
           <li class="new-item">
@@ -115,6 +117,10 @@
 <script type="text/javascript">
   // these icons are used in the js, so set them up now
   var spinner_img = '<img src="{{g.forge_static('images/spinner.gif')}}">';
-  var perm_delete_ico = '<b data-icon="{{g.icons['perm_delete'].char}}" class="ico {{g.icons['perm_delete'].css}}"></b>';
+  {% set perm_delete_ico = g.icons['perm_delete'].render(
+                title='',
+                show_title=True,
+                extra_css='deleter') %}
+  var perm_delete_ico = '{{perm_delete_ico}}';
 </script>
 {% endblock %}

http://git-wip-us.apache.org/repos/asf/allura/blob/9068b7e0/Allura/allura/lib/app_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py
index 528423a..49fa366 100644
--- a/Allura/allura/lib/app_globals.py
+++ b/Allura/allura/lib/app_globals.py
@@ -258,7 +258,7 @@ class Globals(object):
             perm_update=Icon('0', 'ico-sync'),
             perm_create=Icon('e', 'ico-config'),
             perm_register=Icon('e', 'ico-config'),
-            perm_delete=Icon('-', 'ico-minuscirc'),
+            perm_delete=Icon('fa fa-minus-circle', 'Remove'),
             perm_tool=Icon('x', 'ico-config'),
             perm_admin=Icon('(', 'ico-lock'),
             perm_has_yes=Icon('3', 'ico-check'),

http://git-wip-us.apache.org/repos/asf/allura/blob/9068b7e0/Allura/allura/public/nf/js/project_groups.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/project_groups.js b/Allura/allura/public/nf/js/project_groups.js
index 99ecd12..858d1ac 100644
--- a/Allura/allura/public/nf/js/project_groups.js
+++ b/Allura/allura/public/nf/js/project_groups.js
@@ -53,6 +53,7 @@ $(function() {
   });
   // remove user from group
   var delete_user = function(evt){
+    evt.preventDefault();
     var user_holder =  $(this).parent();
     if(confirm("Are you sure you want to remove the user "+user_holder.data('user')+"?")){
         var params = {'role_id': user_holder.closest('tr').data('group'),
@@ -70,7 +71,7 @@ $(function() {
       }
     });
   }};
-  $('#usergroup_admin b.deleter').click(delete_user);
+  $('#usergroup_admin a.deleter').click(delete_user);
   // add user to group
   $('#usergroup_admin tr').delegate("form.add_user", "submit", function(evt){
     evt.preventDefault();
@@ -87,8 +88,9 @@ $(function() {
       }
       else{
         holder.attr('data-user', data.username).addClass('deleter');
-        holder.html(perm_delete_ico+' '+data.displayname+' ('+data.username+')');
-        holder.children('b').click(delete_user);
+        holder.html(perm_delete_ico);
+        holder.find('span').html('&nbsp;' + data.displayname + ' (' + data.username +
')');
+        holder.children('a.deleter').click(delete_user);
       }
     });
   });
@@ -166,6 +168,7 @@ $(function() {
       newitem.remove();
       newitem.removeClass('new-item');
       adder.click(function(evt) {
+          evt.preventDefault();
           newitem.clone().insertBefore(adder.closest('li')).find('input:text').focus();
       });
   });


Mime
View raw message