diff options
Diffstat (limited to 'app/views/characters')
-rw-r--r-- | app/views/characters/rankings/index.html.erb | 36 | ||||
-rw-r--r-- | app/views/characters/show.html.erb | 5 |
2 files changed, 40 insertions, 1 deletions
diff --git a/app/views/characters/rankings/index.html.erb b/app/views/characters/rankings/index.html.erb new file mode 100644 index 0000000..8f41bd2 --- /dev/null +++ b/app/views/characters/rankings/index.html.erb @@ -0,0 +1,36 @@ +<h1 class="text-2xl">Rankings for <%= render "application/components/text/name_and_title", character: @character %></h1> + +<div class="my-2"> + <%= link_to "Refresh", character_rankings_path %> +</div> + +<div class="my-2"> + <p>Total Level: <%= @character.total_level %> (Rank <%= @character.total_level_rank %>)</p> + <p>Total XP: <%= @character.total_xp %> (Rank <%= @character.total_xp_rank %>)</p> +</div> + +<div class="my-2"> + <div> + <table class="table-auto"> + <thead> + <tr> + <th class="table-header-padded">Skill</th> + <th class="table-header-padded">Rank</th> + <th class="table-header-padded">Level</th> + <th class="table-header-padded">XP</th> + </tr> + </thead> + <tbody> + <% Skill.all.each do |skill| %> + <% character_skill = @character.character_skills.find_by(skill: skill) %> + <tr> + <td class="table-cell-padded"><%= skill.name %></td> + <td class="table-cell-padded"><%= character_skill.rank %></td> + <td class="table-cell-padded"><%= character_skill.level %></td> + <td class="table-cell-padded"><%= character_skill.xp %></td> + </tr> + <% end %> + </tbody> + </table> + </div> +</div> diff --git a/app/views/characters/show.html.erb b/app/views/characters/show.html.erb index ce1c2db..1b5439a 100644 --- a/app/views/characters/show.html.erb +++ b/app/views/characters/show.html.erb @@ -3,7 +3,10 @@ </h1> <div class="text-lg mb-4"> - <%= link_to "Titles", character_titles_path(@character) %> + <ul class="flex flex-row"> + <li class="mr-2"><%= link_to "Titles", character_titles_path(@character) %></li> + <li class="mr-2"><%= link_to "Rankings", character_rankings_path(@character) %></li> + </ul> </div> <p class="mb-4">First entered the planes |