-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release 0.5.4: Modification for Rails 2.1. Bug fix in users controlle…
…r template - missing instance var.
- Loading branch information
Andrew Stone
committed
Jun 5, 2008
1 parent
fa1dd3c
commit 326070e
Showing
10 changed files
with
53 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
rails_generators/lockdown/templates/app/helpers/permissions_helper.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
module PermissionsHelper | ||
def permission_name_value | ||
h @permission.name | ||
h @permission.name | ||
end | ||
|
||
def permission_access_rights_value | ||
Lockdown::System.access_rights_for_permission(@permission).collect{|r| r}.join("<br/>") | ||
end | ||
|
||
def permission_users_value | ||
@permission.all_users.collect{|u| link_to_or_show(u.full_name, u)}.join("<br/>") | ||
def permission_users_value | ||
@permission.all_users.collect{|u| link_to_or_show(u.full_name, u)}.join("<br/>") | ||
end | ||
end |
36 changes: 18 additions & 18 deletions
36
rails_generators/lockdown/templates/app/helpers/user_groups_helper.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
module UserGroupsHelper | ||
def user_group_name_value | ||
if @action_name == "show" | ||
if <%= action_name %> == "show" | ||
h @user_group.name | ||
else | ||
text_field_tag "user_group[name]", @user_group.name | ||
end | ||
end | ||
def user_group_permissions_value | ||
if @action_name == "show" | ||
if <%= action_name %> == "show" | ||
@user_group.permissions.collect{|p| p.name + "<br/>"} | ||
else | ||
rvalue = %{<ul id="all_permissions" class="checklist">} | ||
@all_permissions.each_with_index do |perm,i| | ||
bg = ( i % 2 == 0 ) ? "even" : "odd" | ||
input_id = "perm_#{perm.id}" | ||
checked = (@user_group.permission_ids.include?(perm.id) ? "checked" : "") | ||
bg << "_" << checked if checked.length > 0 | ||
rvalue << <<-HTML | ||
<li class="#{bg}"> | ||
<label id="lbl_#{input_id}" for="#{input_id}" onclick="do_highlight('#{input_id}')"> | ||
<input id="#{input_id}" name="#{input_id}" type="checkbox" #{checked}/> #{perm.name} | ||
</label> | ||
</li> | ||
HTML | ||
rvalue = %{<ul id="all_permissions" class="checklist">} | ||
@all_permissions.each_with_index do |perm,i| | ||
bg = ( i % 2 == 0 ) ? "even" : "odd" | ||
input_id = "perm_#{perm.id}" | ||
checked = (@user_group.permission_ids.include?(perm.id) ? "checked" : "") | ||
bg << "_" << checked if checked.length > 0 | ||
rvalue << <<-HTML | ||
<li class="#{bg}"> | ||
<label id="lbl_#{input_id}" for="#{input_id}" onclick="do_highlight('#{input_id}')"> | ||
<input id="#{input_id}" name="#{input_id}" type="checkbox" #{checked}/> #{perm.name} | ||
</label> | ||
</li> | ||
HTML | ||
end | ||
rvalue << "</ul>" | ||
rvalue << "</ul>" | ||
end | ||
end | ||
|
||
def user_group_users_value | ||
@user_group.all_users.collect{|u| link_to_or_show(u.full_name, u)}.join("<br/>") | ||
def user_group_users_value | ||
@user_group.all_users.collect{|u| link_to_or_show(u.full_name, u)}.join("<br/>") | ||
end | ||
end |
14 changes: 7 additions & 7 deletions
14
rails_generators/lockdown/templates/app/helpers/users_helper.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters