philomena/lib/philomena_web/templates/topic/new.html.slime

46 lines
1.8 KiB
Text
Raw Normal View History

2019-11-19 04:38:22 +01:00
= form_for @changeset, Routes.forum_topic_path(@conn, :create, @forum), fn f ->
= if @changeset.action do
.alert.alert-danger
p Oops, something went wrong! Please check the errors below.
.block
.block__header.block__header--js-tabbed
a.selected href="#" data-click-tab="write"
2019-12-06 22:38:36 +01:00
i.fas.fa-pencil-alt>
2019-11-19 04:38:22 +01:00
' Create a Topic
a href="#" data-click-tab="preview"
i.fa.fa-eye>
' Preview
.block__tab.communication-edit__tab.selected data-tab="write"
.field
= text_input f, :title, class: "input input--wide", placeholder: "Title"
= error_tag f, :title
= error_tag f, :slug
= inputs_for f, :posts, fn fp ->
.field
= render PhilomenaWeb.TextileView, "_help.html", conn: @conn
= render PhilomenaWeb.TextileView, "_toolbar.html", conn: @conn
2019-11-19 04:38:22 +01:00
= textarea fp, :body, class: "input input--wide input--text js-preview-input js-toolbar-input", placeholder: "Please read the site rules before posting and use [spoiler][/spoiler] for NSFW stuff in SFW forums.", required: true
= error_tag fp, :body
= if @conn.assigns.current_user do
.field
=> checkbox f, :anonymous, value: anonymous_by_default?(@conn)
= label f, :anonymous, "Post anonymously"
2019-11-19 04:38:22 +01:00
= inputs_for f, :poll, fn fp ->
#add-poll
input.toggle-box id="add_poll" name="add_poll" type="checkbox"
label for="add_poll" Add a poll
.toggle-box-container
= render PhilomenaWeb.Topic.PollView, "_form.html", Map.put(assigns, :f, fp)
2019-11-19 04:38:22 +01:00
.block__tab.communication-edit__tab.hidden data-tab="preview"
' [Loading preview...]
.block__content.communication-edit__actions
2019-12-07 21:51:31 +01:00
= submit "Post", class: "button", data: [disable_with: raw("Posting…")]