summaryrefslogtreecommitdiff
path: root/app/views/leaderboard/index.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/leaderboard/index.html.erb')
-rw-r--r--app/views/leaderboard/index.html.erb95
1 files changed, 95 insertions, 0 deletions
diff --git a/app/views/leaderboard/index.html.erb b/app/views/leaderboard/index.html.erb
new file mode 100644
index 0000000..006def1
--- /dev/null
+++ b/app/views/leaderboard/index.html.erb
@@ -0,0 +1,95 @@
+<h1 class="text-2xl">Leaderboard</h1>
+<p>These rankings are not meant to declare the best characters, only those
+with the most XP. XP is far from the only indicator of achievement in Esoterra.</p>
+
+<% if current_char %>
+ <div class="my-2">
+ <%= link_to "View rankings for #{current_char.name}", character_rankings_path(current_char) %>
+ </div>
+<% end %>
+
+<div class="my-2">
+ <%= link_to "Refresh", leaderboard_path %>
+</div>
+
+<div class="grid grid-cols-12 gap-2">
+ <div class="col-span-12 sm:col-span-6">
+ <div>
+ <h2 class="text-xl">Total Level</h2>
+ <table class="table-auto">
+ <thead>
+ <tr>
+ <th class="table-header-padded">Rank</th>
+ <th class="table-header-padded">Character</th>
+ <th class="table-header-padded">Total Level</th>
+ </tr>
+ </thead>
+ <tbody>
+ <% @top_total_level.each_with_index do |c, index| %>
+ <tr>
+ <td class="table-cell-padded"><%= index + 1 %></td>
+ <td class="table-cell-padded"><%= link_to c.name, character_rankings_path(c) %></td>
+ <td class="table-cell-padded"><%= c.total_level %></td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <div class="col-span-12 sm:col-span-6">
+ <div>
+ <h2 class="text-xl">Total XP</h2>
+ <table class="table-auto">
+ <thead>
+ <tr>
+ <th class="table-header-padded">Rank</th>
+ <th class="table-header-padded">Character</th>
+ <th class="table-header-padded">Total XP</th>
+ </tr>
+ </thead>
+ <tbody>
+ <% @top_total_xp.each_with_index do |c, index| %>
+ <tr>
+ <td class="table-cell-padded"><%= index + 1 %></td>
+ <td class="table-cell-padded"><%= link_to c.name, character_rankings_path(c) %></td>
+ <td class="table-cell-padded"><%= c.total_xp %></td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+
+
+ </div>
+</div>
+
+<div class="mt-4">
+ <h2 class="text-xl">Skill XP Totals</h2>
+ <div class="grid grid-cols-12 gap-2">
+ <% @top_per_skill.each do |skill_name, skill_trainings| %>
+ <div class="col-span-12 sm:col-span-6">
+ <h3 class="text-lg my-1"><%= skill_name %></h3>
+ <table class="table-auto">
+ <thead>
+ <tr>
+ <th class="table-header-padded">Rank</th>
+ <th class="table-header-padded">Character</th>
+ <th class="table-header-padded">Level</th>
+ <th class="table-header-padded">XP</th>
+ </tr>
+ </thead>
+ <tbody>
+ <% skill_trainings.each_with_index do |st, index| %>
+ <tr>
+ <td class="table-cell-padded"><%= index + 1 %></td>
+ <td class="table-cell-padded"><%= link_to st.character.name, character_rankings_path(st.character) %></td>
+ <td class="table-cell-padded"><%= st.level %></td>
+ <td class="table-cell-padded"><%= st.xp %></td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ <% end %>
+ </div>
+</div>