From 9fe186a08dc16bac4b9c316a0495ebc9767c4214 Mon Sep 17 00:00:00 2001 From: Trevor Vallender Date: Wed, 5 Jun 2024 18:49:34 +0100 Subject: [PATCH] Styling and information improvements --- app/assets/stylesheets/characters.css | 31 ++++++++++++++++++ app/assets/stylesheets/colors.css | 2 ++ app/views/characters/_character.html.erb | 9 ++++-- app/views/tables/show.html.erb | 18 +++++++++++ config/brakeman.ignore | 40 ++++++++++++++++++++++++ config/locales/en.yml | 4 +++ 6 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 app/assets/stylesheets/characters.css create mode 100644 config/brakeman.ignore diff --git a/app/assets/stylesheets/characters.css b/app/assets/stylesheets/characters.css new file mode 100644 index 0000000..146a709 --- /dev/null +++ b/app/assets/stylesheets/characters.css @@ -0,0 +1,31 @@ +.character { + background-color: var(--inset-bg-color); + border-radius: var(--border-radius); + padding: 1em; + + h5 { + font-size: 1.1em; + margin: 0; + } + + h5 a:link, h5 a:visited { + color: inherit; + text-decoration: none; + } + + > ul { + padding: 0; + li { + list-style-type: none; + display: inline; + color: var(--secondary-text-color); + font-size: .8em; + &:after { + content: " • "; + } + &:last-child:after { + content: ""; + } + } + } +} diff --git a/app/assets/stylesheets/colors.css b/app/assets/stylesheets/colors.css index 48c1727..786241a 100644 --- a/app/assets/stylesheets/colors.css +++ b/app/assets/stylesheets/colors.css @@ -5,6 +5,8 @@ --header-text-color: #fff; --header-height: 200px; + --secondary-text-color: #777; + --inset-bg-color: #eee; --border-radius: .5em; diff --git a/app/views/characters/_character.html.erb b/app/views/characters/_character.html.erb index ad913dc..62f0560 100644 --- a/app/views/characters/_character.html.erb +++ b/app/views/characters/_character.html.erb @@ -1,4 +1,7 @@ -
> -
<%= link_to character.name, character %>
-

<%= character.game_system.name %>

+
class="character"> +
<%= link_to character.name, character %>
+
    +
  • <%= character.game_system.name %>
  • +
  • <%= character.user.username %>
  • +
diff --git a/app/views/tables/show.html.erb b/app/views/tables/show.html.erb index 6b188c8..6e57ce7 100644 --- a/app/views/tables/show.html.erb +++ b/app/views/tables/show.html.erb @@ -12,6 +12,24 @@
<%= @table.owner.username %>
+

<%= t(".characters") %>

+<% if @table.characters.any? %> + +<% else %> +

<%= t(".no_characters") %>

+<% end %> + +

<%= t(".users") %>

+<% if @table.users.any? %> + +<% else %> +

<%= t(".no_users") %>

+<% end %> + <% if @table_invites.any? %>

Pending invites