diff --git a/lib/clacks_web/templates/frontend/_post_form.html.eex b/lib/clacks_web/templates/frontend/_post_form.html.eex new file mode 100644 index 0000000..c3cfa82 --- /dev/null +++ b/lib/clacks_web/templates/frontend/_post_form.html.eex @@ -0,0 +1,9 @@ +<%= form_tag Routes.frontend_path(@conn, :post_status), method: :post, class: "compose-status" do %> + <%= if assigns[:in_reply_to] do %> + + <% end %> + <% placeholder = assigns[:placeholder] || "What's up?" %> + <% content = assigns[:content] || "" %> + + <%= submit "Post" %> +<% end %> diff --git a/lib/clacks_web/templates/frontend/home.html.eex b/lib/clacks_web/templates/frontend/home.html.eex index 4dc9569..c5cf90e 100644 --- a/lib/clacks_web/templates/frontend/home.html.eex +++ b/lib/clacks_web/templates/frontend/home.html.eex @@ -1,9 +1,6 @@

Home

-<%= form_tag Routes.frontend_path(@conn, :post_status), method: :post, class: "compose-status" do %> - - <%= submit "Post" %> -
-<% end %> +<%= render "_post_form.html", conn: @conn %> +
<%= render "_timeline.html", conn: @conn, statuses_with_authors: @statuses_with_authors %> diff --git a/lib/clacks_web/templates/frontend/status.html.eex b/lib/clacks_web/templates/frontend/status.html.eex index ca4eb18..c0efd2b 100644 --- a/lib/clacks_web/templates/frontend/status.html.eex +++ b/lib/clacks_web/templates/frontend/status.html.eex @@ -3,10 +3,6 @@ <%= unless is_nil(@current_user) do %>
- <%= form_tag Routes.frontend_path(@conn, :post_status), method: :post, class: "compose-status" do %> - "> - - <%= submit "Post" %> -
- <% end %> + <%= render "_post_form.html", conn: @conn, in_reply_to: @status.data["object"]["id"], placeholder: "Reply", content: mentions_for_replying_to(@conn, @status) %> +
<% end %>