Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cleanup of permissions editing / show_rule

  • Loading branch information...
commit 6ec66fa72abf734853d72c64e3681ac625f65b60 1 parent 87d6611
@ethn ethn authored
View
8 app/assets/stylesheets/card.css
@@ -566,8 +566,12 @@ div.search-result-list .search-result-item {
/*------- permissions ------------------*/
-.perm-group h5 {
- margin-top: 0px;
+.perm-section {
+ margin-bottom: 20px;
+}
+.perm-section h5 {
+ margin: 0 0 10px 0;
+
}
View
15 app/assets/stylesheets/settings.css
@@ -17,9 +17,12 @@
.set-rules th,
.set-rules td.rule-cell {
text-align: left;
- border-bottom: 1px solid #eee;
padding: 2px 5px;
}
+.set-rules th,
+.set-rules td.rule-cell {
+ border-bottom: 1px solid #eee;
+}
.rule-setting {
font-weight: bold;
}
@@ -40,7 +43,6 @@ td.rule-setting {
.closed-rule td {
vertical-align: middle;
}
-.rule-placeholder,
.closed-rule .rule-content {
width: 350px;
}
@@ -61,16 +63,16 @@ td.missing-rule {
background-color: #eee;
border-bottom: 1px solid #fff;
}
-.show-rule div.rule-setting,
-.edit-rule .rule-setting {
+.rule-setting {
padding-top: 4px;
+}
+.edit-rule .rule-setting {
float: left;
width: 30%;
}
.rule-placeholder {
float: left;
}
-.show-rule .card-body,
.edit-rule .card-editor {
clear: both;
padding: 5px;
@@ -98,3 +100,6 @@ td.missing-rule {
.rule-delete-section {
float: right;
}
+.show-rule .rule-set {
+ margin-bottom: 10px;
+}
View
2  lib/wagn/renderer/html.rb
@@ -266,7 +266,7 @@ def content_field form, options={}
editor_wrap :content do
%{
#{ revision_tracking }
- #{ _render_editor }
+ #{ _render_editor options }
}
end
end
View
38 lib/wagn/set/right/permissions.rb
@@ -20,7 +20,17 @@ module Set::Right::Permissions
#{ form.hidden_field :content, :class=>'card-content' }
<div class="perm-editor">
- <div class="perm-group perm-vals">
+ #{ if inheritable; %{
+ <div class="perm-inheritance perm-section">
+ #{ check_box_tag 'inherit', 'inherit', inheriting }
+ <label>
+ #{ core_inherit_content args.merge(:target=>'wagn_role') }
+ #{ content_tag( :a, :title=>"use left's #{card.cardname.tag} rule") { '?' } }
+ </label>
+ </div>
+ } end }
+
+ <div class="perm-group perm-vals perm-section">
<h5>Groups</h5>
#{
group_options.map do |option|
@@ -28,28 +38,18 @@ module Set::Right::Permissions
%{
<div class="group-option">
#{ check_box_tag( "#{option.key}-perm-checkbox", option.name, checked, :class=>'perm-checkbox-button' ) }
- <label>#{ link_to_page option.name }</label>
+ <label>#{ link_to_page option.name, nil, :target=>'wagn_role' }</label>
</div>
}
end * "\n"
}
</div>
- <div class="perm-indiv perm-vals">
+ <div class="perm-indiv perm-vals perm-section">
<h5>Individuals</h5>
#{ _render_list :items=>item_names, :extra_css_class=>'perm-indiv-ul' }
</div>
-
- #{
- if inheritable
- %{
- <h5>Inheritance</h5>
- #{ check_box_tag 'inherit', 'inherit', inheriting }
- #{ content_tag( :a, :title=>"use #{card.cardname.tag} rule for left card") { '?' } }
- }
- end
- }
-
+
</div>
}
end
@@ -79,16 +79,16 @@ def core_inherit_content args={}
task = card.tag.codename
ancestor = Card[sc.trunk_name.trunk_name]
links = ancestor.who_can( task.to_sym ).map do |card_id|
- link_to_page Card[card_id].name
+ link_to_page Card[card_id].name, nil, :target=>args[:target]
end*", "
- "#{links} (inherit)"
+ "Inherit ( #{links} )"
rescue
- '(Inherit)'
+ 'Inherit'
end
else
- '(Inherit from left card)'
+ 'Inherit from left card'
end
- %{<div class="inherit-perm">#{text}</div>}
+ %{<span class="inherit-perm">#{text}</span>}
end
end
end
View
27 lib/wagn/set/right/rstar.rb
@@ -54,10 +54,13 @@ module Set::Rstar
set_selected = card_args[:name].to_name.left_name.to_s
end
- edit_mode = !params[:success] and card.ok?( card.new_card? ? :create : :update )
+ edit_mode = !params[:success] && card.ok?( ( card.new_card? ? :create : :update ) )
+
opts = { :open_rule => card, :setting_name=> setting_name }
rule_view = edit_mode ? :edit_rule : :show_rule
+
+
if edit_mode
opts.merge!( {
:fallback_set => false,
@@ -103,14 +106,20 @@ module Set::Rstar
:class=>'close-rule-link slotter', :path_opts=>{ :card=>args[:open_rule] } }
</div>
- <div class="rule-placeholder">&nbsp;</div>
-
- <div class="rule-set">
- #{ card.trunk.label }
- </div>
-
<div class="card-body">
- #{ render_core }
+ #{
+ if !card.new_card?
+ set = card.trunk
+ %{
+ <div class="rule-set">
+ <label>Applies to</label> #{ link_to_page set.label, set.name }:
+ </div>
+ #{ _render_core :set_context=>args[:open_rule].cardname.trunk_name }
+ }
+ else
+ 'No Current Rule'
+ end
+ }
</div>
}
end
@@ -142,7 +151,7 @@ module Set::Rstar
end )
}
- #{ fieldset 'content', content_field( form, :skip_rev_id=>true ) }
+ #{ fieldset 'content', content_field( form, :skip_rev_id=>true, :set_context=>open_rule.cardname.trunk_name ) }
#{ fieldset 'set', ( editor_wrap 'set' do
option_items = args[:set_options].map do |set_name|
Please sign in to comment.
Something went wrong with that request. Please try again.