diff --git a/app/assets/stylesheets/characters.css b/app/assets/stylesheets/characters.css index 6dde42a..b14232c 100644 --- a/app/assets/stylesheets/characters.css +++ b/app/assets/stylesheets/characters.css @@ -61,7 +61,7 @@ display: flex; flex-direction: column; border-radius: var(--border-radius); - h6 { + h6, .feature-edit-buttons { font-size: .8em; text-align: center; background-color: var(--background-color); @@ -97,3 +97,10 @@ padding: auto; } } + +.feature-edit-buttons { + a:link, a:visited { + color: inherit; + text-decoration: none; + } +} diff --git a/app/assets/stylesheets/layout.css b/app/assets/stylesheets/layout.css index 68a1fcc..42a3a60 100644 --- a/app/assets/stylesheets/layout.css +++ b/app/assets/stylesheets/layout.css @@ -1,3 +1,5 @@ +@import "https://www.nerdfonts.com/assets/css/webfont.css"; + * { box-sizing: border-box; } diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 57ca030..7018ae7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -8,4 +8,9 @@ module ApplicationHelper object.errors.full_messages_for(attr).join(". ") end end + + def icon_link_to(icon_name, path, data: {}) + icon = content_tag(:i, nil, class: "nf nf-#{icon_name}").html_safe + link_to icon, path, data: data + end end diff --git a/app/models/counter.rb b/app/models/counter.rb index 109efe1..b8999e0 100644 --- a/app/models/counter.rb +++ b/app/models/counter.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class Counter < ApplicationRecord - has_one :character_sheet_feature, as: :featurable + has_one :character_sheet_feature, as: :featurable, dependent: :destroy has_one :character_sheet_section, through: :character_sheet_feature accepts_nested_attributes_for :character_sheet_feature, allow_destroy: true diff --git a/app/models/stat.rb b/app/models/stat.rb index 7748a3d..a7073b5 100644 --- a/app/models/stat.rb +++ b/app/models/stat.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class Stat < ApplicationRecord - has_one :character_sheet_feature, as: :featurable + has_one :character_sheet_feature, as: :featurable, dependent: :destroy has_one :character_sheet_section, through: :character_sheet_feature accepts_nested_attributes_for :character_sheet_feature, allow_destroy: true diff --git a/app/models/text_field.rb b/app/models/text_field.rb index c5b8efe..4c4317e 100644 --- a/app/models/text_field.rb +++ b/app/models/text_field.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class TextField < ApplicationRecord - has_one :character_sheet_feature, as: :featurable + has_one :character_sheet_feature, as: :featurable, dependent: :destroy has_one :character_sheet_section, through: :character_sheet_feature accepts_nested_attributes_for :character_sheet_feature, allow_destroy: true diff --git a/app/views/counters/_counter.html.erb b/app/views/counters/_counter.html.erb index 847980a..941ac76 100644 --- a/app/views/counters/_counter.html.erb +++ b/app/views/counters/_counter.html.erb @@ -1,7 +1,13 @@