From 88bd4f77db3a4372c118a9faef613615db66bc52 Mon Sep 17 00:00:00 2001 From: David Gay Date: Sat, 22 May 2021 14:32:38 -0400 Subject: Titles --- app/views/characters/show.html.erb | 4 ++++ app/views/characters/titles/index.html.erb | 32 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 app/views/characters/titles/index.html.erb (limited to 'app/views/characters') diff --git a/app/views/characters/show.html.erb b/app/views/characters/show.html.erb index 4f2ae2e..819881b 100644 --- a/app/views/characters/show.html.erb +++ b/app/views/characters/show.html.erb @@ -2,6 +2,10 @@ <%= @character.name %> +
+ <%= link_to "Titles", character_titles_path(@character) %> +
+

First entered the planes <%= pluralize((Date.current - @character.created_at.to_date).to_i, "day") %> ago.

diff --git a/app/views/characters/titles/index.html.erb b/app/views/characters/titles/index.html.erb new file mode 100644 index 0000000..3fb2781 --- /dev/null +++ b/app/views/characters/titles/index.html.erb @@ -0,0 +1,32 @@ +

Titles

+ +

Here are the titles you've earned. Though they are forever yours until the end of these realms, + you may only display one at a time. How do you wish to be known?

+ + + + + + + + + + + <% @title_awards.each do |title_award| %> + + + + + + <% end %> + +
Displayed?Title
<%= title_award.title == @character.active_title ? "Yes️" : "" %> + <%= render "application/components/text/title", title: title_award.title %> + + <%= button_to "Display", character_title_activate_path(title_id: title_award.title.id) %> +
+ +<% unless @title_awards.any? %> +

You haven't earned any titles, but fret not. The time has come for champions of all kinds. + Your hour is not far off.

+<% end %> -- cgit v1.2.3