Use the same template for posting statuses

This commit is contained in:
Shadowfacts 2020-05-25 19:30:17 -04:00
parent aae48b2500
commit 39b48eb52d
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
3 changed files with 13 additions and 11 deletions

View File

@ -0,0 +1,9 @@
<%= form_tag Routes.frontend_path(@conn, :post_status), method: :post, class: "compose-status" do %>
<%= if assigns[:in_reply_to] do %>
<input type="hidden" name="in_reply_to" value="<%= @in_reply_to %>">
<% end %>
<% placeholder = assigns[:placeholder] || "What's up?" %>
<% content = assigns[:content] || "" %>
<textarea id="content" name="content" rows="5" placeholder="<%= placeholder %>"><%= content %></textarea>
<%= submit "Post" %>
<% end %>

View File

@ -1,9 +1,6 @@
<h1>Home</h1>
<%= form_tag Routes.frontend_path(@conn, :post_status), method: :post, class: "compose-status" do %>
<textarea id="content" name="content" rows="5" placeholder="What's up?" required></textarea>
<%= submit "Post" %>
<hr>
<% end %>
<%= render "_post_form.html", conn: @conn %>
<hr>
<%= render "_timeline.html", conn: @conn, statuses_with_authors: @statuses_with_authors %>

View File

@ -3,10 +3,6 @@
<%= unless is_nil(@current_user) do %>
<hr>
<%= form_tag Routes.frontend_path(@conn, :post_status), method: :post, class: "compose-status" do %>
<input type="hidden" name="in_reply_to" value="<%= @status.data["object"]["id"] %>">
<textarea id="content" name="content" rows="5" placeholder="Reply" required><%= mentions_for_replying_to(@conn, @status) %></textarea>
<%= submit "Post" %>
<hr>
<% end %>
<%= render "_post_form.html", conn: @conn, in_reply_to: @status.data["object"]["id"], placeholder: "Reply", content: mentions_for_replying_to(@conn, @status) %>
<hr>
<% end %>