Skip to content

Commit

Permalink
Sorting ACLs by action. Added comment on relations.
Browse files Browse the repository at this point in the history
  • Loading branch information
gaspard committed Jan 20, 2012
1 parent df93d14 commit 3934f4f
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 13 deletions.
1 change: 1 addition & 0 deletions History.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* Fixed 'unknown this' bug in [calendar] when rendering in a [block].
* Enabled 'alt_class' to work on multiple elements ([each]).
* Fixed ajax bugs with dom_ids in nested partials.
* Better Acl display, comments on relations.

== 1.1.3 2011-11-09

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/acls_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class AclsController < ApplicationController

def index
secure(Acl) do
@acls = Acl.paginate(:all, :order => 'priority DESC, name ASC', :per_page => 20, :page => params[:page])
@acls = Acl.paginate(:all, :order => 'action ASC, priority DESC, name ASC', :per_page => 20, :page => params[:page])
end
@acl = Acl.new

Expand Down
12 changes: 11 additions & 1 deletion app/views/acls/index.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
<th><%= _('exec group') %></th>
<th><%= _('exec skin') %></th>
</tr>
<%= render :partial=>'acls/li', :collection => @acls %>

<% action = nil; @acls.each do |acl| -%>
<% if acl.action != action; action= acl.action -%>
<tr>
<th class='nav sub constant' colspan='9'>
<%= action %>
</th>
</tr>
<% end -%>
<%= render :partial=>'acls/li', :collection=>[acl] %>
<% end -%>
<%= render :partial=>'acls/add' %>
</table>
4 changes: 2 additions & 2 deletions app/views/relations/_add.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<tr id='add_relation' class='btn_add'>
<td class='add'><%= link_to_function _('btn_relation_add'), "['add_relation', 'add_relation_form'].each(Element.toggle); $('relation_source_role').focus();" %></td>
<td colspan='3' class='add_relation'></td>
<td colspan='4' class='add_relation'></td>
</tr>
<tr id='add_relation_form' style='display:none;'>
<%= render :partial=>'relations/form' %>
</tr>
</tr>
7 changes: 5 additions & 2 deletions app/views/relations/_form.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
link_to_function _('btn_x'), "['add_relation', 'add_relation_form'].each(Element.toggle)"
end %>
</td>
<td class="add" colspan="3">
<td class="add" colspan="4">
<div id='relation_errors'><%= error_messages_for(:relation, :object => @relation) %></div>
<% unless @relation.new_record? %>
<%= form_remote_tag(:url => relation_path(@relation), :method => :put ) %>
Expand Down Expand Up @@ -36,6 +36,9 @@
<td class="light" ><%= text_field('relation', 'target_icon', :size=>18 ) %></td>
<td class="dark" ><%= text_field('relation', 'source_icon', :size=>18 ) %></td>
</tr>
<tr><td colspan='3'>
<%= text_area('relation', 'comment', :rows => 2, :cols => 40) %></td>
</td></tr>
<tr><td colspan='3'><p class='btn_validate'><input type='submit' value='<%= _('validate') %>'/></p></td></tr>
</table>
</form>
Expand All @@ -44,4 +47,4 @@
<p class='destroy'><%= _('destroy relation (with all links)') %> <input type='submit' value='<%= _('destroy') %>'></p>
</form>
<% end -%>
</td>
</td>
5 changes: 4 additions & 1 deletion app/views/relations/_li.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@
</td>
<% end -%>
</td>
</tr>
<td class='comment zazen'>
<%= li.comment ? zazen(li.comment) : '' %>
</td>
</tr>
6 changes: 3 additions & 3 deletions app/views/relations/index.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<h2 class='title'><%= _('relations') %></h2>
<table id='relation_list' class='admin' cellspacing="0">
<tr><th class='nav' colspan='4'><%= will_paginate @relations %></th></tr>
<tr><th class='nav' colspan='5'><%= will_paginate @relations %></th></tr>
<% @classes.keys.sort.each do |kpath| -%>
<tr class='virtual_class'>
<th class='nav sub constant' colspan='4'>
<th class='nav sub constant' colspan='5'>
<span class='kpath'><%= kpath %></span> <%= VirtualClass.find_by_kpath(kpath).to_s %>
</th>
</tr>
Expand All @@ -12,4 +12,4 @@
<% end -%>
<% end -%>
<%= render :partial=>'relations/add' %>
</table>
</table>
4 changes: 2 additions & 2 deletions app/views/zafu/default/Node-+search.zafu
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

<ul id='search_results' do='search_results'>
<li class='result_entry' do='each'>
<p class='result_image' do='Document'>
<p class='result_image' do='Document?'>
<r:link format='data' do='img' alt_src='icon' mode='pv'/>
<r:else do='link' do='img' alt_src='icon' mode='pv'/>
</p>
<p class='result_name'><r:link/></p>
<p class='result_path'><r:show attr='short_path'/></p>
<r:summary/>
<r:zazen attr='summary'/>
<div class='clear'></div>
</li>
<r:else>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class AddCommentToRelations < ActiveRecord::Migration
def self.up
add_column :relations, :comment, :text
end

def self.down
remove_column :relations, :comment
end
end
6 changes: 5 additions & 1 deletion public/stylesheets/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,14 @@ ul.actions select { width:186px; }
/* forms */
label { font-size:0.9em; font-weight:bold; display:block; color:#5C1515; margin:10px 0 5px; clear:left;}

.comment { font-style:italic; color:#777}
.comment strong {font-weight:bold; font-style:italic;}
.comment a {color:#55a}

/* roles */
.constant {font-weight:bold;}
.real_class .constant {color:#999;}
.virtual_class .constant {color: #07F;}
.virtual_class .nav.constant {color: #003F9D;}
.role .constant {color:#0C9616;}
.role .nav.constant {color:#05540B;}
.role .nav.constant {color:#05540B;}

0 comments on commit 3934f4f

Please sign in to comment.