Sha256: 7b876df3a4ff7e3fd635c2c8eefebdb13bd45ac7cf7975b81fd97428f6af9763
Contents?: true
Size: 1.22 KB
Versions: 13
Compression:
Stored size: 1.22 KB
Contents
module <%= "#{namespace.camelcase}::" unless namespace.blank? %>UserGroupsHelper def user_group_name_value if <%= action_name %> == "show" h @user_group.name else text_field :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}" id="li_#{input_id}"> <label 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>" end end def user_group_users_value @user_group.all_users.collect{|u| link_to_or_show(u.full_name, <%= namespace.blank? ? 'u' : "#{namespace}_user_path(u)" %>)}.join("<br/>") end end
Version data entries
13 entries across 13 versions & 1 rubygems