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

115 lines
3.4 KiB
Text
Raw Normal View History

2014-04-17 20:26:25 +00:00
<div id="teams" class="tabbed edit">
<h1>Manage Team: <%=h @team.name %></h1>
2014-04-17 20:26:25 +00:00
<ul id="teams-nav" class="tabs">
<li><a href="#details">Details</a></li>
<li><a href="#members">Members</a></li>
<li><a href="#contests">Contests</a></li>
</ul>
2014-04-17 20:26:25 +00:00
<div class="tabbed-contents">
<div id="details" class="tab">
<%= form_for @team, html: { multipart: true, class: 'square' } do |f| %>
<%= f.error_messages %>
2014-04-17 20:26:25 +00:00
<div class="fields horizontal">
<%= f.label :name %>
<%= f.text_field :name %>
2014-04-17 20:26:25 +00:00
</div>
<div class="fields horizontal">
<%= f.label :irc %>
<%= f.text_field :irc %>
2014-04-17 20:26:25 +00:00
</div>
<div class="fields horizontal">
<%= f.label :web %>
<%= f.text_field :web %>
2014-04-17 20:26:25 +00:00
</div>
<div class="fields horizontal">
<%= f.label :tag %>
<%= f.text_field :tag %>
2014-04-17 20:26:25 +00:00
</div>
<div class="fields horizontal">
<%= f.label :country %>
<%= country_select :user, :country, include_blank: true %>
2014-04-17 20:26:25 +00:00
</div>
<div class="fields horizontal">
<%= f.label :comment %>
<%= f.text_field :comment %>
2014-04-17 20:26:25 +00:00
</div>
<div class="fields horizontal">
<%= f.label :recruiting %>
<div class="inputs">
<%= f.text_field :recruiting %>
<p>Leave empty if you are not recruiting, or enter your recruiting criteria above.</p>
2014-04-17 20:26:25 +00:00
</div>
</div>
<div class="fields horizontal">
<%= f.label :logo %>
<%= f.file_field :logo %>
</div>
<div class="controls">
<%= f.submit "Update" %>
2014-04-17 20:26:25 +00:00
</div>
<% end %>
</div>
2014-04-17 20:26:25 +00:00
<div id="members" class="tab">
<%= form_for @team do |f| %>
<table class="data">
<tr>
<th>Name</th>
<th>Comment</th>
<th>Rank</th>
<th>Actions</th>
</tr>
<% @team.teamers.present.each do |member| %>
2014-04-17 20:26:25 +00:00
<tr class="fields">
<td id="<%= 'primary' if member.team_id == member.user.team_id %>">
<%= link_to (h member.user.username), member.user %>
</td>
<td>
<%= text_field_tag "comment[#{member.id}]", (h member.comment) %>
</td>
<td>
<%= select_tag "rank[#{member.id}]", options_for_select(member.ranks.invert, member.rank) %>
</td>
<td>
2014-04-17 20:26:25 +00:00
<%= link_to member, confirm: 'Are you sure?', method: :delete, class: 'button tiny' do %>
<%= icon 'times' %> Remove
<% end %>
</td>
</tr>
<% end %>
</table>
2014-04-17 20:26:25 +00:00
<div class="controls">
<%= f.submit "Update" %>
2014-04-17 20:26:25 +00:00
</div>
<% end %>
</div>
2014-04-17 20:26:25 +00:00
<div id="contests" class="tab">
<p>
2014-04-17 20:26:25 +00:00
<%= form_for @team.contesters.build, html: { class: 'square' } do |f| %>
<%= f.hidden_field :team_id %>
2014-04-17 20:26:25 +00:00
<div class="fields inline">
<%= f.collection_select :contest_id, Contest.active, :id, :name %>
</div>
<div class="controls inline">
<%= f.submit "Join" %>
</div>
<% end %>
</p>
</div>
</div>
</div>
<script type="text/javascript">
2014-04-17 20:26:25 +00:00
new Yetii({
id: 'teams'
});
</script>
2014-04-17 20:26:25 +00:00
<%= link_to 'Show', @team, class: 'button' %>
<%= link_to 'Back', teams_path, class: 'button' %>