Sha256: 686de1a639fd1a8e64b7f3fa0fb7463b145af29aa970b41ba3edf503d3d3ef4d

Contents?: true

Size: 1.05 KB

Versions: 23

Compression:

Stored size: 1.05 KB

Contents

module UserGroupsHelper
  def user_group_name_value
    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"
       @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}/>&nbsp;&nbsp;#{perm.name}
						</label>
					</li>
				HTML
       end
			 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/>")
  end
end

Version data entries

23 entries across 22 versions & 1 rubygems

Version Path
lockdown-0.3.11 rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb
lockdown-0.3.12 rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb
lockdown-0.3.14 rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb
lockdown-0.3.13 rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb
lockdown-0.3.10 rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb
lockdown-0.4.3 rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb
lockdown-0.4.4 rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb
lockdown-0.3.6 rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb
lockdown-0.3.7 rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb
lockdown-0.3.8 rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb
lockdown-0.3.9 rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb
lockdown-0.4.0 rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb
lockdown-0.4.1 rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb
lockdown-0.4.2 rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb
lockdown-0.3.15 rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb
lockdown-0.3.5 rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb
lockdown-0.5.1 rails_generators/lockdown/templates/app/helpers/user_groups_helper.rb
lockdown-0.4.5 rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb
lockdown-0.5.0 rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb
lockdown-0.4.6 rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb