lockdown 0.5.9 → 0.5.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. data/History.txt +8 -0
  2. data/Manifest.txt +1 -2
  3. data/bin/lockdown +3 -1
  4. data/config/hoe.rb +1 -1
  5. data/lib/lockdown/classy-inheritance.rb +153 -0
  6. data/lib/lockdown/version.rb +1 -1
  7. data/rails_generators/lockdown/lockdown_generator.rb +12 -12
  8. data/rails_generators/lockdown/templates/app/controllers/user_groups_controller.rb +1 -1
  9. data/rails_generators/lockdown/templates/app/controllers/users_controller.rb +0 -5
  10. data/rails_generators/lockdown/templates/app/helpers/user_groups_helper.rb +3 -3
  11. data/rails_generators/lockdown/templates/app/helpers/users_helper.rb +12 -12
  12. data/rails_generators/lockdown/templates/app/models/user.rb +8 -11
  13. data/rails_generators/lockdown/templates/app/views/permissions/_data.html.erb +3 -3
  14. data/rails_generators/lockdown/templates/app/views/permissions/index.html.erb +4 -4
  15. data/rails_generators/lockdown/templates/app/views/permissions/show.html.erb +2 -2
  16. data/rails_generators/lockdown/templates/app/views/user_groups/_data.html.erb +29 -5
  17. data/rails_generators/lockdown/templates/app/views/user_groups/_form.html.erb +6 -6
  18. data/rails_generators/lockdown/templates/app/views/user_groups/edit.html.erb +3 -3
  19. data/rails_generators/lockdown/templates/app/views/user_groups/index.html.erb +7 -7
  20. data/rails_generators/lockdown/templates/app/views/user_groups/new.html.erb +2 -2
  21. data/rails_generators/lockdown/templates/app/views/user_groups/show.html.erb +5 -5
  22. data/rails_generators/lockdown/templates/app/views/users/_data.html.erb +34 -10
  23. data/rails_generators/lockdown/templates/app/views/users/_form.html.erb +7 -7
  24. data/rails_generators/lockdown/templates/app/views/users/edit.html.erb +3 -3
  25. data/rails_generators/lockdown/templates/app/views/users/index.html.erb +8 -8
  26. data/rails_generators/lockdown/templates/app/views/users/new.html.erb +2 -2
  27. data/rails_generators/lockdown/templates/app/views/users/show.html.erb +3 -3
  28. data/rails_generators/lockdown/templates/db/migrate/create_admin_user.rb +6 -8
  29. data/website/index.html +8 -264
  30. data/website/index.txt +6 -244
  31. metadata +5 -7
  32. data/website/generator.html +0 -264
  33. data/website/generator.txt +0 -188
data/History.txt CHANGED
@@ -1,3 +1,11 @@
1
+ == 0.5.10 2008-06-24
2
+ * Modified: Classy Inheritance is now bundled with Lockdown to simplify the user management screens.
3
+ * Fixed: Templates: Use m.template with views to test for rails version for action_name issue
4
+ * Added: Templates: Missing javascript for do_highlight
5
+ * Fixed: Templates: Usage of ul for permissions and user groups.
6
+ * Clean: Templates: Removed unnecessary :locals => {:f => f} attribute in _form partials
7
+ * Clean: Templates: Changed text_field_tag to text_field.
8
+
1
9
  == 0.5.9 2008-06-19
2
10
  * Fixed: Added url.strip! to account for spaces. URI::split(url) was bombing if url contained spaces.
3
11
 
data/Manifest.txt CHANGED
@@ -13,6 +13,7 @@ bin/lockdown
13
13
  config/hoe.rb
14
14
  config/requirements.rb
15
15
  lib/lockdown.rb
16
+ lib/lockdown/classy-inheritance.rb
16
17
  lib/lockdown/controller.rb
17
18
  lib/lockdown/controller_inspector.rb
18
19
  lib/lockdown/helper.rb
@@ -68,8 +69,6 @@ test/test_lockdown.rb
68
69
  test/test_lockdown_all_generator.rb
69
70
  test/test_lockdown_generator.rb
70
71
  test/test_lockdown_models_generator.rb
71
- website/generator.html
72
- website/generator.txt
73
72
  website/index.html
74
73
  website/index.txt
75
74
  website/javascripts/rounded_corners_lite.inc.js
data/bin/lockdown CHANGED
@@ -95,9 +95,11 @@ begin
95
95
  RubiGen::Scripts::Generate.new.run(ARGV, :generator => 'lockdown', :framework => @framework)
96
96
 
97
97
  File.open(config_file, "a") do |f|
98
+ require_classy = %Q(require "lockdown/classy-inheritance")
98
99
  require_lockdown = %Q(require "lockdown/init")
99
100
 
100
- f << %Q(\n\n#{require_lockdown}\n\n) unless configuration_file_has?(require_lockdown)
101
+ f << %Q(\n#{require_classy}\n) unless configuration_file_has?(require_classy)
102
+ f << %Q(\n#{require_lockdown}\n) unless configuration_file_has?(require_lockdown)
101
103
  end
102
104
  rescue Exception => e
103
105
  puts e.backtrace.join("\n")
data/config/hoe.rb CHANGED
@@ -2,7 +2,7 @@ require 'lockdown/version'
2
2
 
3
3
  AUTHOR = 'Andrew Stone' # can also be an array of Authors
4
4
  EMAIL = "andrew.n.stone@gmail.com"
5
- DESCRIPTION = "Authorization/Authentication system for RubyOnRails and Merb"
5
+ DESCRIPTION = "Authorization/Authentication system for RubyOnRails"
6
6
  GEM_NAME = 'lockdown' # what ppl will type to install your gem
7
7
  RUBYFORGE_PROJECT = 'lockdown' # The unix name for your project
8
8
  HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
@@ -0,0 +1,153 @@
1
+ $:.unshift(File.dirname(__FILE__)) unless
2
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
+
4
+ module ActiveRecord::Validations::ClassMethods
5
+ def validates_associated(association, options = {})
6
+ class_eval do
7
+ validates_each(association) do |record, associate_name, value|
8
+ associate = record.send(associate_name)
9
+ if associate && !associate.valid?
10
+ associate.errors.each do |key, value|
11
+ record.errors.add(key, value)
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+
19
+ module Stonean
20
+ module ClassyInheritance
21
+ def self.included(base)
22
+ base.extend Stonean::ClassyInheritance::ClassMethods
23
+ end
24
+
25
+ module ClassMethods
26
+ def depends_on(model_sym, options = {})
27
+ define_relationship(model_sym,options)
28
+
29
+ validates_presence_of model_sym
30
+ validates_associated model_sym
31
+
32
+ # Before save functionality to create/update the requisite object
33
+ define_save_method(model_sym, options[:as])
34
+
35
+ # Adds a find_with_<model_sym> class method
36
+ define_find_with_method(model_sym)
37
+
38
+ if options[:as]
39
+ define_can_be_method_on_requisite_class(model_sym, options[:as])
40
+ end
41
+
42
+ options[:attrs].each{|attr| define_accessors(model_sym, attr, options[:prefix])}
43
+ end
44
+
45
+
46
+ def can_be(model_sym, options = {})
47
+ unless options[:as]
48
+ raise ArgumentError, ":as attribute required when calling can_be"
49
+ end
50
+
51
+ klass = model_sym.to_s.classify
52
+
53
+ define_method "is_a_#{model_sym}?" do
54
+ eval("self.#{options[:as]}_type == '#{klass}'")
55
+ end
56
+
57
+ find_with_method = "find_with_#{self.name.underscore}"
58
+
59
+ define_method "as_a_#{model_sym}" do
60
+ eval("#{klass}.send(:#{find_with_method},self.#{options[:as]}_id)")
61
+ end
62
+ end
63
+
64
+ private
65
+
66
+ def define_relationship(model_sym, options)
67
+ opts = options.dup
68
+ opts.delete(:attrs)
69
+ if opts[:as]
70
+ as_opt = opts.delete(:as)
71
+ opts = polymorphic_constraints(as_opt).merge(opts)
72
+ has_one model_sym, opts
73
+ else
74
+ belongs_to model_sym, opts
75
+ end
76
+ end
77
+
78
+ def define_save_method(model_sym, polymorphic_name = nil)
79
+ define_method "save_requisite_#{model_sym}" do
80
+ if polymorphic_name
81
+ eval("self.#{model_sym}.#{polymorphic_name}_type = self.class.name")
82
+ eval("self.#{model_sym}.#{polymorphic_name}_id = self.id")
83
+ end
84
+
85
+ if polymorphic_name
86
+ eval <<-SAVEIT
87
+ unless self.#{model_sym}.new_record?
88
+ self.#{model_sym}.save
89
+ end
90
+ SAVEIT
91
+ else
92
+ eval("self.#{model_sym}.save")
93
+ end
94
+ end
95
+
96
+ before_save "save_requisite_#{model_sym}".to_sym
97
+ end
98
+
99
+ def define_find_with_method(model_sym)
100
+ self.class.send :define_method, "find_with_#{model_sym}" do |*args|
101
+ eval <<-CODE
102
+ if args[1] && args[1].is_a?(Hash)
103
+ if args[1].has_key?(:include)
104
+ inc_val = args[1][:include]
105
+ new_val = inc_val.is_a?(Array) ? inc_val.push(:#{:model_sym}) : [inc_val, :#{model_sym}]
106
+ args[1][:include] = new_val
107
+ else
108
+ args[1].merge!({:include => :#{model_sym}})
109
+ end
110
+ else
111
+ args << {:include => :#{model_sym}}
112
+ end
113
+ find(*args)
114
+ CODE
115
+ end
116
+ end
117
+
118
+ def define_accessors(model_sym, attr, prefix)
119
+ accessor_method_name = ( prefix ? "#{model_sym}_#{attr}" : attr)
120
+
121
+ define_method accessor_method_name do
122
+ eval("self.#{model_sym} ? self.#{model_sym}.#{attr} : nil")
123
+ end
124
+
125
+ define_method "#{accessor_method_name}=" do |val|
126
+ model_defined = eval("self.#{model_sym}")
127
+
128
+ unless model_defined
129
+ klass = model_sym.to_s.classify
130
+ eval("self.#{model_sym} = #{klass}.new")
131
+ end
132
+
133
+ eval("self.#{model_sym}.#{attr}= val")
134
+ end
135
+ end
136
+
137
+ def define_can_be_method_on_requisite_class(model_sym, polymorphic_name)
138
+ klass = model_sym.to_s.classify
139
+ requisite_klass = eval(klass)
140
+ unless requisite_klass.respond_to?(self.name.underscore.to_sym)
141
+ requisite_klass.send :can_be, self.name.underscore,
142
+ :as => polymorphic_name
143
+ end
144
+ end
145
+
146
+ def polymorphic_constraints(polymorphic_name)
147
+ { :foreign_key => "#{polymorphic_name}_id",
148
+ :conditions => "#{polymorphic_name}_type = '#{self.name}'"}
149
+ end
150
+ end # ClassMethods
151
+ end # ClassyInheritance module
152
+ end # Stonean module
153
+ ActiveRecord::Base.send :include, Stonean::ClassyInheritance
@@ -2,7 +2,7 @@ module Lockdown #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 5
5
- TINY = 9
5
+ TINY = 10
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -48,13 +48,13 @@ class LockdownGenerator < Rails::Generator::Base
48
48
  m.directory 'app/views/user_groups'
49
49
  m.directory 'app/views/permissions'
50
50
 
51
- m.file "app/controllers/permissions_controller.rb",
51
+ m.template "app/controllers/permissions_controller.rb",
52
52
  "app/controllers/permissions_controller.rb"
53
53
 
54
- m.file "app/controllers/users_controller.rb",
54
+ m.template "app/controllers/users_controller.rb",
55
55
  "app/controllers/users_controller.rb"
56
56
 
57
- m.file "app/controllers/user_groups_controller.rb",
57
+ m.template "app/controllers/user_groups_controller.rb",
58
58
  "app/controllers/user_groups_controller.rb"
59
59
 
60
60
  m.template "app/helpers/permissions_helper.rb",
@@ -70,13 +70,13 @@ class LockdownGenerator < Rails::Generator::Base
70
70
 
71
71
  copy_views(m, "user_groups")
72
72
 
73
- m.file "app/views/permissions/_data.html.erb",
73
+ m.template "app/views/permissions/_data.html.erb",
74
74
  "app/views/permissions/_data.html.erb"
75
75
 
76
- m.file "app/views/permissions/index.html.erb",
76
+ m.template "app/views/permissions/index.html.erb",
77
77
  "app/views/permissions/index.html.erb"
78
78
 
79
- m.file "app/views/permissions/show.html.erb",
79
+ m.template "app/views/permissions/show.html.erb",
80
80
  "app/views/permissions/show.html.erb"
81
81
 
82
82
  m.route_resources "permissions"
@@ -158,12 +158,12 @@ class LockdownGenerator < Rails::Generator::Base
158
158
  end # add_migrations
159
159
 
160
160
  def copy_views(m, vw)
161
- m.file "app/views/#{vw}/_data.html.erb", "app/views/#{vw}/_data.html.erb"
162
- m.file "app/views/#{vw}/_form.html.erb", "app/views/#{vw}/_form.html.erb"
163
- m.file "app/views/#{vw}/index.html.erb", "app/views/#{vw}/index.html.erb"
164
- m.file "app/views/#{vw}/show.html.erb", "app/views/#{vw}/show.html.erb"
165
- m.file "app/views/#{vw}/edit.html.erb", "app/views/#{vw}/edit.html.erb"
166
- m.file "app/views/#{vw}/new.html.erb", "app/views/#{vw}/new.html.erb"
161
+ m.template "app/views/#{vw}/_data.html.erb", "app/views/#{vw}/_data.html.erb"
162
+ m.template "app/views/#{vw}/_form.html.erb", "app/views/#{vw}/_form.html.erb"
163
+ m.template "app/views/#{vw}/index.html.erb", "app/views/#{vw}/index.html.erb"
164
+ m.template "app/views/#{vw}/show.html.erb", "app/views/#{vw}/show.html.erb"
165
+ m.template "app/views/#{vw}/edit.html.erb", "app/views/#{vw}/edit.html.erb"
166
+ m.template "app/views/#{vw}/new.html.erb", "app/views/#{vw}/new.html.erb"
167
167
  end
168
168
 
169
169
  def add_login_permissions(m)
@@ -89,7 +89,7 @@ class UserGroupsController < ApplicationController
89
89
 
90
90
  def find_user_group
91
91
  @user_group = UserGroup.find(params[:id])
92
- if @action_name != "show" && Lockdown::System.has_user_group?(@user_group)
92
+ if <%= action_name %> != "show" && Lockdown::System.has_user_group?(@user_group)
93
93
  raise SecurityError,"Invalid attempt to modify user group."
94
94
  end
95
95
  end
@@ -25,7 +25,6 @@ class UsersController < ApplicationController
25
25
  # GET /users/new.xml
26
26
  def new
27
27
  @user = User.new
28
- @profile = Profile.new
29
28
  @user_groups_for_user = Lockdown::System.user_groups_assignable_for_user(current_user)
30
29
  respond_to do |format|
31
30
  format.html # new.html.erb
@@ -42,9 +41,7 @@ class UsersController < ApplicationController
42
41
  # POST /users.xml
43
42
  def create
44
43
  @user = User.new(params[:user])
45
- @profile = Profile.new(params[:profile])
46
44
 
47
- @user.profile = @profile
48
45
  if @user.save
49
46
  flash[:notice] = "Thanks for signing up!"
50
47
  redirect_to(users_path)
@@ -58,7 +55,6 @@ class UsersController < ApplicationController
58
55
  # PUT /users/1
59
56
  # PUT /users/1.xml
60
57
  def update
61
- @user.profile.attributes = params[:profile]
62
58
  @user.attributes = params[:user]
63
59
 
64
60
  respond_to do |format|
@@ -101,7 +97,6 @@ class UsersController < ApplicationController
101
97
  end
102
98
  @user = User.find(params[:id])
103
99
  raise SecurityError.new if @user.nil?
104
- @profile = @user.profile
105
100
  end
106
101
 
107
102
  def update_user_groups
@@ -3,7 +3,7 @@ module UserGroupsHelper
3
3
  if <%= action_name %> == "show"
4
4
  h @user_group.name
5
5
  else
6
- text_field_tag "user_group[name]", @user_group.name
6
+ text_field :user_group, :name
7
7
  end
8
8
  end
9
9
 
@@ -18,8 +18,8 @@ module UserGroupsHelper
18
18
  checked = (@user_group.permission_ids.include?(perm.id) ? "checked" : "")
19
19
  bg << "_" << checked if checked.length > 0
20
20
  rvalue << <<-HTML
21
- <li class="#{bg}">
22
- <label id="lbl_#{input_id}" for="#{input_id}" onclick="do_highlight('#{input_id}')">
21
+ <li class="#{bg}" id="li_#{input_id}">
22
+ <label for="#{input_id}" onclick="do_highlight('#{input_id}')">
23
23
  <input id="#{input_id}" name="#{input_id}" type="checkbox" #{checked}/>&nbsp;&nbsp;#{perm.name}
24
24
  </label>
25
25
  </li>
@@ -1,25 +1,25 @@
1
1
  module UsersHelper
2
- def profile_first_name_value
2
+ def user_first_name_value
3
3
  if <%= action_name %> == "show"
4
- h @profile.first_name
4
+ h @user.first_name
5
5
  else
6
- text_field_tag "profile[first_name]", @profile.first_name
6
+ text_field :user, :first_name
7
7
  end
8
8
  end
9
9
 
10
- def profile_last_name_value
10
+ def user_last_name_value
11
11
  if <%= action_name %> == "show"
12
- h @profile.last_name
12
+ h @user.last_name
13
13
  else
14
- text_field_tag "profile[last_name]", @profile.last_name
14
+ text_field :user, :last_name
15
15
  end
16
16
  end
17
17
 
18
- def profile_email_value
18
+ def user_email_value
19
19
  if <%= action_name %> == "show"
20
- h @profile.email
20
+ h @user.email
21
21
  else
22
- text_field_tag "profile[email]", @profile.email
22
+ text_field :user, :email
23
23
  end
24
24
  end
25
25
 
@@ -27,7 +27,7 @@ module UsersHelper
27
27
  if <%= action_name %> == "show"
28
28
  h @user.login
29
29
  else
30
- text_field_tag "user[login]", @user.login
30
+ text_field :user, :login
31
31
  end
32
32
  end
33
33
 
@@ -63,8 +63,8 @@ module UsersHelper
63
63
  checked = (@user.user_group_ids.include?(ug.id) ? "checked" : "")
64
64
  bg << "_" << checked if checked.length > 0
65
65
  rvalue << <<-HTML
66
- <li class="#{bg}">
67
- <label id="lbl_#{input_id}" for="#{input_id}" onclick="do_highlight('#{input_id}')">
66
+ <li class="#{bg}" id="li_#{input_id}">
67
+ <label for="#{input_id}" onclick="do_highlight('#{input_id}')">
68
68
  <input id="#{input_id}" name="#{input_id}" type="checkbox" #{checked}/>&nbsp;&nbsp;#{ug.name}
69
69
  </label>
70
70
  </li>
@@ -1,7 +1,11 @@
1
1
  require 'digest/sha1'
2
2
  class User < ActiveRecord::Base
3
3
  has_and_belongs_to_many :user_groups
4
- belongs_to :profile
4
+ # depends_on functionality is from the classy-inheritance gem
5
+ # that is bundled with lockdown.
6
+ # For more info: http://stonean.com
7
+ #
8
+ depends_on :profile, :attrs => [:first_name, :last_name, :email]
5
9
 
6
10
  # Virtual attributes
7
11
  attr_accessor :password
@@ -14,12 +18,10 @@ class User < ActiveRecord::Base
14
18
  validates_length_of :login, :within => 3..40
15
19
  validates_uniqueness_of :login, :case_sensitive => false
16
20
 
17
- validates_presence_of :profile
18
- validates_associated :profile
19
-
20
21
  before_save :prepare_for_save
21
22
 
22
- attr_accessible :login, :password, :password_confirmation
23
+ attr_accessible :login, :password, :password_confirmation,
24
+ :first_name, :last_name, :email
23
25
 
24
26
  # Authenticates a user by their login name and unencrypted password.
25
27
  # Returns the user or nil.
@@ -42,19 +44,14 @@ class User < ActiveRecord::Base
42
44
  crypted_password == encrypt(password)
43
45
  end
44
46
 
45
- def email
46
- self.profile.email
47
- end
48
-
49
47
  def full_name
50
- self.profile.first_name + " " + self.profile.last_name
48
+ self.first_name + " " + self.last_name
51
49
  end
52
50
 
53
51
  protected
54
52
 
55
53
  def prepare_for_save
56
54
  encrypt_password
57
- self.profile.save
58
55
  end
59
56
 
60
57
  def encrypt_password
@@ -1,13 +1,13 @@
1
1
  <p>
2
2
  <b>Name</b><br />
3
- <%= permission_name_value %>
3
+ <%%= permission_name_value %>
4
4
  </p>
5
5
  <p>
6
6
  <b>Access rights:</b><br />
7
- <%= permission_access_rights_value %>
7
+ <%%= permission_access_rights_value %>
8
8
  </p>
9
9
  <p>
10
10
  <b>Users with permission:</b><br />
11
- <%= permission_users_value %>
11
+ <%%= permission_users_value %>
12
12
  </p>
13
13
 
@@ -5,12 +5,12 @@
5
5
  <th>Name</th>
6
6
  </tr>
7
7
 
8
- <% for permission in @permissions %>
8
+ <%% for permission in @permissions %>
9
9
  <tr>
10
- <td><%=h permission.name %></td>
11
- <td><%= link_to 'Show', permission %></td>
10
+ <td><%%=h permission.name %></td>
11
+ <td><%%= link_to 'Show', permission %></td>
12
12
  </tr>
13
- <% end %>
13
+ <%% end %>
14
14
  </table>
15
15
 
16
16
  <br />
@@ -1,3 +1,3 @@
1
- <%= render :partial => "data", :locals => {:f => nil} %>
1
+ <%%= render :partial => "data" %>
2
2
 
3
- <%= link_to 'Back', permissions_path %>
3
+ <%%= link_to 'Back', permissions_path %>
@@ -8,6 +8,7 @@ without this, the user group selection is just no good
8
8
  border: 1px solid #ccc;
9
9
  list-style: none;
10
10
  height: 300px;
11
+ height: 600px;
11
12
  text-align: left;
12
13
  list-style: none;
13
14
  margin-left: 12px;
@@ -30,15 +31,38 @@ li.odd_checked{
30
31
 
31
32
  <p>
32
33
  <b>Name</b><br />
33
- <%= user_group_name_value %>
34
+ <%%= user_group_name_value %>
34
35
  </p>
35
36
  <p>
36
37
  <b>Permissions</b><br />
37
- <%= user_group_permissions_value %>
38
+ <%%= user_group_permissions_value %>
38
39
  </p>
39
- <% if @action_name == "show" %>
40
+ <%% if <%= action_name %> == "show" %>
40
41
  <p>
41
42
  <b>Users in user group:</b><br />
42
- <%= user_group_users_value %>
43
+ <%%= user_group_users_value %>
43
44
  </p>
44
- <% end%>
45
+ <%% end%>
46
+
47
+ <!--
48
+ Take this out and place in your application.js.
49
+ This is duplicated in users/_data.html.erb
50
+ -->
51
+ <script type="text/javascript">
52
+
53
+ function do_highlight(id){
54
+ li = document.getElementById("li_"+id);
55
+ i = document.getElementById(id);
56
+ if (i.checked){
57
+ li.style.backgroundColor = "#ddd";
58
+ li.style.color = "#fff";
59
+ }else{
60
+ if (li.className == "odd"){
61
+ li.style.backgroundColor = "#fff";
62
+ }else{
63
+ li.style.backgroundColor = "#ccc";
64
+ }
65
+ li.style.color = "#000";
66
+ }
67
+ }
68
+ </script>
@@ -1,11 +1,11 @@
1
- <%
1
+ <%%
2
2
  submit_label = "Update"
3
3
  submit_label = "Create" if @user_group.new_record?
4
4
  -%>
5
5
 
6
- <%= error_messages_for :user_group %>
6
+ <%%= error_messages_for :user_group %>
7
7
 
8
- <% form_for(@user_group) do |f| %>
9
- <%= render :partial => "data", :locals => {:f => f} %>
10
- <p> <%= f.submit submit_label %> </p>
11
- <% end %>
8
+ <%% form_for(@user_group) do |f| %>
9
+ <%%= render :partial => "data" %>
10
+ <p> <%%= f.submit submit_label %> </p>
11
+ <%% end %>
@@ -1,6 +1,6 @@
1
1
  <h1>Editing Usergroup</h1>
2
2
 
3
- <%= render :partial => "form" %>
3
+ <%%= render :partial => "form" %>
4
4
 
5
- <%= link_to 'Show', @user_group %> |
6
- <%= link_to 'Back', user_groups_path %>
5
+ <%%= link_to 'Show', @user_group %> |
6
+ <%%= link_to 'Back', user_groups_path %>
@@ -5,16 +5,16 @@
5
5
  <th>Name</th>
6
6
  </tr>
7
7
 
8
- <% for user_group in @user_groups %>
8
+ <%% for user_group in @user_groups %>
9
9
  <tr>
10
- <td><%=h user_group.name %></td>
11
- <td><%= link_to 'Show', user_group %></td>
12
- <td><%= link_to('Edit', edit_user_group_path(user_group)) unless Lockdown::System.has_user_group?(user_group) %></td>
13
- <td><%= link_to('Destroy', user_group, :confirm => 'Are you sure?', :method => :delete) unless Lockdown::System.has_user_group?(user_group) %></td>
10
+ <td><%%=h user_group.name %></td>
11
+ <td><%%= link_to 'Show', user_group %></td>
12
+ <td><%%= link_to('Edit', edit_user_group_path(user_group)) unless Lockdown::System.has_user_group?(user_group) %></td>
13
+ <td><%%= link_to('Destroy', user_group, :confirm => 'Are you sure?', :method => :delete) unless Lockdown::System.has_user_group?(user_group) %></td>
14
14
  </tr>
15
- <% end %>
15
+ <%% end %>
16
16
  </table>
17
17
 
18
18
  <br />
19
19
 
20
- <%= link_to 'New User Group', new_user_group_path %>
20
+ <%%= link_to 'New User Group', new_user_group_path %>
@@ -1,5 +1,5 @@
1
1
  <h1>New Usergroup</h1>
2
2
 
3
- <%= render :partial => "form" %>
3
+ <%%= render :partial => "form" %>
4
4
 
5
- <%= link_to 'Back', user_groups_path %>
5
+ <%%= link_to 'Back', user_groups_path %>
@@ -1,6 +1,6 @@
1
- <%= render :partial => "data", :locals => {:f => nil} %>
1
+ <%%= render :partial => "data" %>
2
2
 
3
- <% unless Lockdown::System.has_user_group?(@user_group) %>
4
- <%= link_to 'Edit', edit_user_group_path(@user_group) %> |
5
- <% end %>
6
- <%= link_to 'Back', user_groups_path %>
3
+ <%% unless Lockdown::System.has_user_group?(@user_group) %>
4
+ <%%= link_to 'Edit', edit_user_group_path(@user_group) %> |
5
+ <%% end %>
6
+ <%%= link_to 'Back', user_groups_path %>