mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
unrequire editor fields that weren't previously required
This commit is contained in:
parent
2684c3f83b
commit
27af96fe3a
6 changed files with 8 additions and 5 deletions
|
@ -65,7 +65,7 @@
|
|||
.field
|
||||
.block
|
||||
.communication-edit__wrap
|
||||
= render PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, action_icon: "pencil-alt", action_text: "Description", placeholder: "Describe this image in plain words - this should generally be info about the image that doesn't belong in the tags or source."
|
||||
= render PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, action_icon: "pencil-alt", action_text: "Description", placeholder: "Describe this image in plain words - this should generally be info about the image that doesn't belong in the tags or source.", required: false
|
||||
|
||||
= render PhilomenaWeb.MarkdownView, "_anon_checkbox.html", conn: @conn, f: f, label: "Post anonymously"
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
= render PhilomenaWeb.MarkdownView, "_toolbar.html", conn: @conn
|
||||
|
||||
.field
|
||||
= textarea form, field_name, class: "input input--wide input--text input--resize-vertical js-toolbar-input js-preview-input", placeholder: field_placeholder, required: true
|
||||
= textarea form, field_name, class: "input input--wide input--text input--resize-vertical js-toolbar-input js-preview-input", placeholder: field_placeholder, required: required?(@conn)
|
||||
= error_tag form, field_name
|
||||
|
||||
.block__tab.communication-edit__tab.hidden.js-preview-content data-tab="preview"
|
||||
|
|
|
@ -15,7 +15,7 @@ h1 Updating Profile Description
|
|||
|
||||
.block
|
||||
div
|
||||
= render PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, action_text: "About Me", placeholder: "Description (up to 10000 characters)", name: :description
|
||||
= render PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, action_text: "About Me", placeholder: "Description (up to 10000 characters)", name: :description, required: false
|
||||
|
||||
.block__content.communication-edit__actions
|
||||
=> submit "Update", class: "button"
|
||||
|
|
|
@ -6,7 +6,7 @@ h1 Updating Moderation Scratchpad
|
|||
p Oops, something went wrong! Please check the errors below.
|
||||
.block
|
||||
div
|
||||
= render PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, action_text: "Scratchpad", placeholder: "Scratchpad Contents", name: :scratchpad
|
||||
= render PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, action_text: "Scratchpad", placeholder: "Scratchpad Contents", name: :scratchpad, required: false
|
||||
|
||||
.block__content.communication-edit__actions
|
||||
=> submit "Update", class: "button"
|
||||
|
|
|
@ -45,7 +45,7 @@ p
|
|||
.field
|
||||
= select f, :category, report_categories(), class: "input"
|
||||
.block
|
||||
= render PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, placeholder: "Provide anything else we should know here.", name: :reason
|
||||
= render PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, placeholder: "Provide anything else we should know here.", name: :reason, required: false
|
||||
|
||||
= render PhilomenaWeb.CaptchaView, "_captcha.html", name: "report", conn: @conn
|
||||
|
||||
|
|
|
@ -4,4 +4,7 @@ defmodule PhilomenaWeb.MarkdownView do
|
|||
def anonymous_by_default?(conn) do
|
||||
conn.assigns.current_user.anonymous_by_default
|
||||
end
|
||||
|
||||
def required?(%{assigns: %{required: false}}), do: nil
|
||||
def required?(_), do: true
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue