2014-04-15 22:04:43 +00:00
|
|
|
<div id="agenda" class="tabbed">
|
|
|
|
<ul id="agenda-nav" class="tabs">
|
2014-03-23 00:22:25 +00:00
|
|
|
<li><a href="#teams">Teams</a></li>
|
|
|
|
<li><a href="#matches">Matches</a></li>
|
|
|
|
<li><a href="#articles">Articles</a></li>
|
|
|
|
<li><a href="#movies">Movies</a></li>
|
|
|
|
<li><a href="#servers">Servers</a></li>
|
|
|
|
<li><a href="#issues">Issues</a></li>
|
|
|
|
<li><a href="#bans">Bans</a></li>
|
|
|
|
</ul>
|
|
|
|
|
2014-04-15 22:04:43 +00:00
|
|
|
<div class="tabbed-contents">
|
2014-03-23 00:22:25 +00:00
|
|
|
<div class="tab" id="teams">
|
2014-04-15 22:04:43 +00:00
|
|
|
<h4>Your Teams</h4>
|
|
|
|
|
|
|
|
<table class="teams">
|
2014-03-23 00:22:25 +00:00
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Comment</th>
|
|
|
|
<th>Rank</th>
|
|
|
|
<th>Actions</th>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<% @user.teamers.active.each do |teamer| %>
|
|
|
|
<tr>
|
2014-04-15 22:04:43 +00:00
|
|
|
<td class="<%= 'current' if teamer.team == @user.team %>">
|
2014-03-23 00:22:25 +00:00
|
|
|
<%= link_to (h teamer.team.name), teamer.team %>
|
|
|
|
</td>
|
2014-04-17 07:55:19 +00:00
|
|
|
<td><%=h teamer.comment %></td>
|
|
|
|
<td><%=h teamer.ranks[teamer.rank] %></td>
|
2014-03-23 00:22:25 +00:00
|
|
|
<td>
|
|
|
|
<% if @user.team != teamer.team %>
|
2014-05-09 21:38:14 +00:00
|
|
|
<%= form_for @user, html: { class: 'inline' } do |u| %>
|
|
|
|
<%= link_to "Set as Primary", user_path(@user, user: { team_id: teamer.team.id }), method: :put, confirm: "Are you sure?", class: 'button tiny' %>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2014-04-15 22:04:43 +00:00
|
|
|
|
|
|
|
<%= link_to 'Leave', teamer, confirm: 'Are you sure?', method: :delete, class: 'button tiny' %>
|
2014-03-23 00:22:25 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<% if @user.teamers.joining.count == 0 %>
|
|
|
|
<%= form_for @teamer do |f| %>
|
|
|
|
<%= f.error_messages %>
|
|
|
|
<%= f.hidden_field :user_id %>
|
2014-04-15 22:04:43 +00:00
|
|
|
|
|
|
|
<h4>Join an existing team</h4>
|
|
|
|
|
|
|
|
<div class="fields inline">
|
|
|
|
<%= f.select :team_id, Team.active.collect {|t| [t.name, t.id]} %>
|
|
|
|
</div>
|
|
|
|
<div class="controls inline">
|
|
|
|
<%= f.submit "Join", class: 'button' %>
|
|
|
|
</div>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end %>
|
|
|
|
<% else %>
|
2014-04-15 22:04:43 +00:00
|
|
|
<div class="flash warning">
|
2014-05-13 23:54:51 +00:00
|
|
|
<p>You can only request to join one team at a time.</p>
|
2014-04-15 22:04:43 +00:00
|
|
|
<p>Currently you are trying to join <%= namelink @user.teamers.joining.first.team %></p>
|
|
|
|
<p>You can cancel this request by clicking "Cancel Request"</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<%= link_to "Cancel Request", @user.teamers.joining.first, method: :delete, class: 'button' %>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end %>
|
|
|
|
|
2014-04-15 22:04:43 +00:00
|
|
|
<%= link_to 'Create a new team', new_team_path, class: 'button' %>
|
2014-03-23 00:22:25 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="tab" id="matches">
|
|
|
|
<% if @user.challenges_received.future.pending.count > 0 %>
|
2014-04-15 22:04:43 +00:00
|
|
|
<h4>Pending challenges for your response</h4>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
|
|
|
<table class="data">
|
|
|
|
<tr>
|
|
|
|
<td>Actions</td>
|
|
|
|
<th>Opponent</th>
|
|
|
|
<th>Match time</th>
|
|
|
|
<th>Default time</th>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<% @user.challenges_received.future.pending.each do |challenge| %>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<%= link_to ("Open"), challenge %>
|
2014-04-15 22:04:43 +00:00
|
|
|
<%= link_to "Send a PM", controller: "messages", action: "new", id: "Team", id2: challenge.contester1.team %>
|
2014-03-23 00:22:25 +00:00
|
|
|
</td>
|
|
|
|
<td><%= namelink challenge.contester1 %></td>
|
|
|
|
<td><%= longtime challenge.match_time %></td>
|
|
|
|
<td>
|
|
|
|
<% challenge.mandatory ? longtime(challenge.default_time) : "--" %>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
</table>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% if @user.challenges_sent.future.count > 0 %>
|
2014-04-15 22:04:43 +00:00
|
|
|
<h4>Sent challenges</h4>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
|
|
|
<table class="data">
|
|
|
|
<tr>
|
|
|
|
<th>Actions</th>
|
|
|
|
<th>Opponent</th>
|
|
|
|
<th>Match time</th>
|
|
|
|
<th>Default time</th>
|
|
|
|
<th>Status</th>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<% @user.challenges_sent.future.each do |challenge| %>
|
|
|
|
<tr>
|
|
|
|
<td><%= link_to ("Open"), challenge %></td>
|
|
|
|
<td><%= namelink challenge.contester2 %></td>
|
|
|
|
<td><%= shorttime challenge.match_time %></td>
|
|
|
|
<td>
|
|
|
|
<% if challenge.mandatory %>
|
|
|
|
<%= shorttime challenge.default_time %>
|
|
|
|
<% else %>
|
|
|
|
--
|
|
|
|
<% end %>
|
|
|
|
</td>
|
|
|
|
<td><%= challenge.statuses[challenge.status] %></td>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
</table>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% if @user.ref? and Match.future.unreffed.ordered.count > 0 %>
|
2014-04-15 22:04:43 +00:00
|
|
|
<h4>Matches without referee</h4>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
|
|
|
<table class="data">
|
|
|
|
<tr>
|
|
|
|
<th>Teams</th>
|
|
|
|
<th>Date</th>
|
|
|
|
<th>Actions</th>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<% Match.future.unreffed.ordered.each do |match| %>
|
|
|
|
<tr>
|
|
|
|
<td><%= namelink match %></td>
|
|
|
|
<td><%= shorttime match.match_time %></td>
|
|
|
|
<td>
|
|
|
|
<%= link_to 'Referee this match',
|
2014-04-15 22:04:43 +00:00
|
|
|
remote: true,
|
|
|
|
url: {
|
|
|
|
controller: "matches", action: "update", id: match.id,
|
|
|
|
match: {
|
|
|
|
referee_id: @user.id
|
|
|
|
}
|
|
|
|
},
|
|
|
|
method: "put",
|
|
|
|
loading: "$('matchlink_#{match.id}').parentNode.innerHTML='Processing..';",
|
|
|
|
success: "$('matchlink_#{match.id}').parentNode.innerHTML='Complete';",
|
|
|
|
html: { id: "matchlink_#{match.id}" } %>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end %>
|
2014-04-15 22:04:43 +00:00
|
|
|
</table>
|
|
|
|
<% end %>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-15 22:04:43 +00:00
|
|
|
<% if @user.upcoming_matches.length > 0 # TODO: fix this %>
|
|
|
|
<h4>Upcoming matches for your concern</h4>
|
|
|
|
|
|
|
|
<table class="data">
|
|
|
|
<tr>
|
|
|
|
<th>Teams</th>
|
|
|
|
<th>Date</th>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<% @user.upcoming_matches.each do |match| %>
|
|
|
|
<tr>
|
|
|
|
<td><%= namelink match %></td>
|
|
|
|
<td><%= shorttime match.match_time %>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end %>
|
2014-04-15 22:04:43 +00:00
|
|
|
</table>
|
|
|
|
<% end %>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-15 22:04:43 +00:00
|
|
|
<% if @user.past_matches.length > 0 %>
|
|
|
|
<h4>Past matches waiting for scoring or lineup</h4>
|
|
|
|
|
|
|
|
<table class="data">
|
|
|
|
<tr>
|
|
|
|
<th>Teams</th>
|
|
|
|
<th>Date</th>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<% @user.past_matches.each do |match| %>
|
|
|
|
<tr>
|
|
|
|
<td><%= namelink match %></td>
|
|
|
|
<td><%= shorttime match.match_time %>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end %>
|
2014-04-15 22:04:43 +00:00
|
|
|
</table>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-15 22:04:43 +00:00
|
|
|
<div class="tab" id="articles">
|
|
|
|
<% if @user.articles.size > 0 %>
|
|
|
|
<%= render partial: "articles/list", locals: { articles: @user.articles } %>
|
|
|
|
<% end %>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-15 22:04:43 +00:00
|
|
|
<%= link_to 'New article', new_article_path, class: 'button' %>
|
|
|
|
</div>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-15 22:04:43 +00:00
|
|
|
<div class="tab" id="movies">
|
|
|
|
<%= render partial: "movies/movie", collection: @user.movies %>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-15 22:04:43 +00:00
|
|
|
<%= link_to "New Movie", { controller: "data_files", action: "new", id: Directory::MOVIES }, { class: 'button' } %>
|
|
|
|
</div>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-15 22:04:43 +00:00
|
|
|
<div class="tab" id="servers">
|
|
|
|
<%= render partial: "servers/server", collection: @user.servers %>
|
|
|
|
|
2014-05-09 21:38:14 +00:00
|
|
|
<%= link_to 'New Server', new_server_path, class: 'button' %>
|
2014-04-15 22:04:43 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="tab" id="issues">
|
|
|
|
<% if @user.issues.size > 0 %>
|
|
|
|
<h4>Issues created by you</h4>
|
|
|
|
<%= render partial: "issues/list", locals: { issues: @user.issues } %>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% if @user.open_issues.size > 0 %>
|
|
|
|
<h4>Open issues assigned to you</h4>
|
|
|
|
<%= render partial: "issues/list", locals: { issues: @user.open_issues } %>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<%= link_to 'New issue', new_issue_path, class: 'button' %>
|
2014-03-23 00:22:25 +00:00
|
|
|
</div>
|
|
|
|
|
2014-04-15 22:04:43 +00:00
|
|
|
<div class="tab" id="bans">
|
|
|
|
<% if @user.bans.effective.size > 0 %>
|
|
|
|
<%= render partial: "bans/list", locals: { bans: @user.bans.effective } %>
|
|
|
|
<% else %>
|
|
|
|
<p>You have no effective bans currently.</p>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
new Yetii({
|
|
|
|
id: 'agenda'
|
|
|
|
});
|
|
|
|
</script>
|