Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
katalyst-content (3.0.0)
katalyst-content (3.0.1)
active_storage_validations
activerecord
katalyst-govuk-formbuilder
Expand Down
28 changes: 14 additions & 14 deletions app/helpers/katalyst/content/editor_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,39 @@ def content_editor_rich_text_attributes(attributes = {})
end

module Builder
def content_heading_fieldset(legend: { text: "Heading" })
def content_heading_fieldset(legend: { text: t("activerecord.attributes.katalyst/content/item.heading") })
govuk_fieldset(legend:) do
concat(content_heading_field(label: { text: "Heading", class: "govuk-visually-hidden" }))
concat(content_heading_field(label: { class: "govuk-visually-hidden" }))
concat(content_heading_style_field)
end
end

def content_heading_field(label: { text: "Heading" }, **)
govuk_text_field(:heading, label:, **)
def content_heading_field(**)
govuk_text_field(:heading, **)
end

def content_heading_style_field(legend: { text: "Style" }, **)
govuk_enum_radio_buttons(:heading_style, legend:, **)
def content_heading_style_field(**)
govuk_enum_radio_buttons(:heading_style, **)
end

def content_url_field(label: { text: "URL" }, **)
govuk_text_field(:url, label:, **)
def content_url_field(**)
govuk_text_field(:url, **)
end

def content_http_method_field(label: { text: "HTTP method" }, **)
govuk_enum_select(:http_method, label:, **)
def content_http_method_field(**)
govuk_enum_select(:http_method, **)
end

def content_target_field(label: { text: "HTTP target" }, **)
govuk_enum_select(:target, label:, **)
def content_target_field(**)
govuk_enum_select(:target, **)
end

def content_theme_field(options: { include_blank: true }, **)
govuk_enum_select(:theme, options:, **)
end

def content_visible_field(label: { text: "Visible?" }, **)
govuk_check_box_field(:visible, label:, **)
def content_visible_field(**)
govuk_check_box_field(:visible, **)
end
end

Expand Down
7 changes: 7 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
en:
activerecord:
attributes:
katalyst/content/item:
heading: "Heading"
heading_style: "Style"
url: "URL"
http_method: "HTTP method"
http_target: "HTTP target"
visible: "Visible"
katalyst/content/figure:
heading: "Alternate text"
errors:
Expand Down
2 changes: 1 addition & 1 deletion katalyst-content.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |spec|
spec.name = "katalyst-content"
spec.version = "3.0.0"
spec.version = "3.0.1"
spec.authors = ["Katalyst Interactive"]
spec.email = ["developers@katalyst.com.au"]

Expand Down
Loading