summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorAndrewMurrell <amurrel@purdue.edu>2014-04-23 13:19:56 -0400
committerAndrewMurrell <amurrel@purdue.edu>2014-04-23 13:19:56 -0400
commit9d6dc1e5959590eeca5f9ea19cf731d73c735bd6 (patch)
treefd135e0f543a7f78388c91992fcfa85b5b7564dd /app/views
parentb2ceff6667461a6db587c4077ef56bdb4fe9f44b (diff)
parent21d6ddb3b2e85fa24f331dbf547133a34b0d37bd (diff)
Merge branch 'master' of http://github.com/LukeShu/leaguer
Diffstat (limited to 'app/views')
-rw-r--r--app/views/layouts/application.html.erb11
-rw-r--r--app/views/matches/index.html.erb20
-rw-r--r--app/views/matches/show.html.erb28
-rw-r--r--app/views/search/go.html.erb23
-rw-r--r--app/views/tournaments/show.html.erb31
5 files changed, 36 insertions, 77 deletions
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index eca33b8..c45fb20 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -4,15 +4,12 @@
<title>Leaguer</title>
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
+ <%= javascript_include_tag "#{params[:controller]}", "data-turbolinks-track" => true %>%>
+ <%= javascript_include_tag "#{params[:controller]}_#{params[:action]}", "data-turbolinks-track" => true %>%>
<%= csrf_meta_tags %>
<%= yield :head %>
</head>
<body>
-<script>
- window.onload = function() {
- BetterDragSort.makeListSortable(document.getElementById("boxes"));
- };
-</script>
<header>
<nav>
<%# This is the logo %>
@@ -21,8 +18,8 @@
<%# This is the search bar #%>
<div>
<%= form_tag("/search", method: "get", :class => "search") do %>
- <%= text_field_tag(:query, nil, :placeholder => "Search") %>
- <%= submit_tag("Go", :name=>nil) %>
+ <%= text_field_tag(:query, params[:query]) %>
+ <%= submit_tag("Search", :name=>nil) %>
<% end %>
</div>
diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb
index fda8582..8a50fee 100644
--- a/app/views/matches/index.html.erb
+++ b/app/views/matches/index.html.erb
@@ -2,16 +2,16 @@
<table id="matches-table" class="table">
- <thead>
- <tr>
- <th>Name</th>
- <th>Status</th>
- <th>Winner</th>
- <th></th>
- </tr>
- </thead>
-
- <tbody class="table-hover">
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th>Status</th>
+ <th>Winner</th>
+ <th><!-- link to --></th>
+ <th><!-- start button --></th>
+ </tr>
+ </thead>
+ <tbody>
<% @tournament.stages_ordered.keys.sort.each do |stage_key| %>
<% stage = @tournament.stages_ordered[stage_key] %>
<% stage.matches_ordered.keys.sort.reverse.each do |match_key| %><tr>
diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb
index a10139f..e61d6b3 100644
--- a/app/views/matches/show.html.erb
+++ b/app/views/matches/show.html.erb
@@ -1,3 +1,17 @@
+<script type="text/javascript">
+function score_peers() {
+ //get each player in order and assign score here!
+ var $lisp = $('ol#boxes');
+ var comma = ","
+ for(var i=0; i < $lisp.length; i++) {
+ if ( i == lisp.length-1) {
+ comma = "";
+ }
+ $('review_action').value += $('ol#boxes:eq(' + i + ')').text() + comma;
+ }
+}
+</script>
+
<p>
<strong>Status:</strong>
<%= @match.status %>
@@ -113,17 +127,3 @@
<% end # case %>
<% end # form %>
</div>
-
-<script type="text/javascript">
-function score_peers() {
- //get each player in order and assign score here!
- var $lisp = $('ol#boxes');
- var comma = ","
- for(var i=0; i < $lisp.length; i++) {
- if ( i == lisp.length-1) {
- comma = "";
- }
- $('review_action').value += $('ol#boxes:eq(' + i + ')').text() + comma;
- }
-}
-</script>
diff --git a/app/views/search/go.html.erb b/app/views/search/go.html.erb
index 6e48b07..d2bf8f3 100644
--- a/app/views/search/go.html.erb
+++ b/app/views/search/go.html.erb
@@ -1,6 +1,11 @@
-<h5 id="search-down">&#x25B2; Advanced Search &#x25B2;</h5>
-<div id="advanced-search">
- <p> This is where the search will go </p>
+<div id="advanced_search" class="collapsible">
+ <div class="collapsed">
+ <h5><a href="#advanced_search">Advanced Search [show]</a></h5>
+ </div>
+ <div class="expanded">
+ <h5><a href="#collapse">Advanced Search [hide]</a></h5>
+ <p>This is where the advancedsearch will go.</p>
+ </div>
</div>
<%# Show search results if a query was not nill %>
@@ -26,15 +31,3 @@
<% end %>
<% end %>
-
-<script type="text/javascript" language="javascript">
-
- $(document).ready(function() {
-
- $("#search-down").click(function(){
- $("#search-down").text("▼ Advanced Search ▼").html();
- $("#advanced-search").slideDown( 'slow');
- });
-
- });
-</script> \ No newline at end of file
diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb
index a4983f7..3f8552e 100644
--- a/app/views/tournaments/show.html.erb
+++ b/app/views/tournaments/show.html.erb
@@ -106,34 +106,3 @@
<%end %>
</div>
-
-<script>
-function donehandle( tournament ) {
- if ( console && console.log ) {
- var here = tournament["players"].length;
- var needed = (tournament["min_teams_per_match"] * tournament["min_players_per_team"]);
- var pct_complete = here / needed;
- $("#prog-bar").width( (pct_complete * 100) +"%");
- $("#players-needed").text(here + " " + (here==1?"player has":"players have") + " signed up. " + needed + " players needed. ");
- players = "";
-
- //creates the present user list
- for (var i = 0; i < tournament["players"].length; i++) {
- players = players+"<li><span class=\"black\">"+tournament["players"][i]["user_name"]+"</span></li>"
- }
-
- //updates the user list
- $("#tournament-users").html(players);
-
- //if there are enough players to start, enable the button, else disable it.
- $("input[value=\"Start Tournament\"]").prop('disabled', (pct_complete >= 1)? false : true);
-
- if (tournament["status"] == 1)
- window.location.reload(true);
- }
- setTimeout(function(){$.ajax({url: "<%= url_for @tournament %>.json"}).done(donehandle)}, 2000);
-}
-
-$.ajax({url: "<%= url_for @tournament %>.json"})
- .done(donehandle);
-</script>