ensl.org/app/views/groups/edit.html.erb

82 lines
2.4 KiB
Text
Raw Normal View History

2014-04-27 00:34:38 +00:00
<div id="group">
<h1 class="title">Editing Group: <%= h @group.name %></h1>
2014-04-27 00:34:38 +00:00
<div id="group" class="tabbed">
<ul id="group-nav" class="tabs">
<li><a href="#general">General</a></li>
<li><a href="#members">Members</a></li>
</ul>
2014-04-27 00:34:38 +00:00
<div class="tabbed-contents">
<div class="tab" id="general">
<%= form_for(@group, html: { class: 'square' }) do |f| %>
<%= render 'shared/errors', messages: @group.errors.full_messages %>
2014-04-27 00:34:38 +00:00
<div class="fields horizontal">
<%= f.label :name %>
<%= f.text_field :name %>
</div>
<div class="controls">
<%= f.submit 'Update' %>
</div>
<% end %>
</div>
2014-04-27 00:34:38 +00:00
<div class="tab" id="members">
<table class="roles striped">
<tr>
<th class="username">Username</th>
<th class="name">Real Name</th>
<th class="role">Task</th>
</tr>
<% @group.groupers.each do |grouper| %>
<tr>
<td><%= namelink grouper.user %></td>
<td><%= h grouper.user.realname %></td>
2014-04-27 00:34:38 +00:00
<td class="actions">
<%= form_for grouper do |g| %>
<div class="fields inline">
<%= g.text_field :task, size: 20 %>
</div>
<div class="controls">
<%= g.submit 'Update', class: 'button tiny' %>
<%= link_to 'Remove', grouper, method: :delete, class: 'button remove' %>
</div>
<% end %>
</td>
2014-04-27 00:34:38 +00:00
</tr>
<% end %>
</table>
2014-04-27 00:34:38 +00:00
<div class="add">
<h3>Add a Member</h3>
<%= form_for @group.groupers.build, html: { class: 'square' } do |f| %>
<%= f.hidden_field :group_id %>
<div class="fields horizontal">
<%= f.label :username %>
<%= f.text_field :username %>
</div>
<div class="fields horizontal">
<%= f.label :task, "Role" %>
<%= f.text_field :task %>
</div>
2014-04-27 00:34:38 +00:00
<div class="controls">
<%= f.submit 'Add Member' %>
</div>
<% end %>
</div>
</div>
</div>
</div>
2014-04-27 00:34:38 +00:00
<script type="text/javascript">
new Yetii({
id: 'group'
});
</script>
</div>