Styling and information improvements

This commit is contained in:
Trevor Vallender 2024-06-05 18:49:34 +01:00
parent 9684dd39dd
commit 9fe186a08d
6 changed files with 101 additions and 3 deletions

View File

@ -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: "";
}
}
}
}

View File

@ -5,6 +5,8 @@
--header-text-color: #fff;
--header-height: 200px;
--secondary-text-color: #777;
--inset-bg-color: #eee;
--border-radius: .5em;

View File

@ -1,4 +1,7 @@
<div id=<%= dom_id(character) %>>
<h6><%= link_to character.name, character %></h6>
<p><%= character.game_system.name %></p>
<div id=<%= dom_id(character) %> class="character">
<h5><%= link_to character.name, character %></h5>
<ul>
<li><%= character.game_system.name %></li>
<li><%= character.user.username %></li>
</ul>
</div>

View File

@ -12,6 +12,24 @@
<dd><%= @table.owner.username %></dd>
</dl>
<h4><%= t(".characters") %></h4>
<% if @table.characters.any? %>
<ul><%= render @table.characters %></ul>
<% else %>
<p><%= t(".no_characters") %></p>
<% end %>
<h4><%= t(".users") %></h4>
<% if @table.users.any? %>
<ul>
<% @table.users.each do |user| %>
<li><%= link_to user.username, user %></li>
<% end %>
</ul>
<% else %>
<p><%= t(".no_users") %></p>
<% end %>
<% if @table_invites.any? %>
<h4>Pending invites</h4>
<ul>

40
config/brakeman.ignore Normal file
View File

@ -0,0 +1,40 @@
{
"ignored_warnings": [
{
"warning_type": "Dynamic Render Path",
"warning_code": 15,
"fingerprint": "42478896b621fa561e9866e0bc1339d9864fea72109e83c02b194967272202cc",
"check_name": "Render",
"message": "Render path contains parameter value",
"file": "app/views/tables/show.html.erb",
"line": 17,
"link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
"code": "render(action => Current.user.tables.find(params[:id]).characters, {})",
"render_path": [
{
"type": "controller",
"class": "TablesController",
"method": "show",
"line": 12,
"file": "app/controllers/tables_controller.rb",
"rendered": {
"name": "tables/show",
"file": "app/views/tables/show.html.erb"
}
}
],
"location": {
"type": "template",
"template": "tables/show"
},
"user_input": "params[:id]",
"confidence": "Weak",
"cwe_id": [
22
],
"note": ""
}
],
"updated": "2024-06-05 18:49:27 +0100",
"brakeman_version": "6.1.2"
}

View File

@ -161,6 +161,10 @@ en:
game_system: Game system
owner: Owner
invite_user: Invite a new player
no_characters: This table doesnt have any characters yet
no_users: This table doesnt have any players yet
users: Players
characters: Characters
new:
new_table: New table
create_table: Create table