Compare commits
No commits in common. "64b1515b46118a4ebc8b9123e4c88fc42185ae68" and "de7a1e617d4a0ae62792407bb34895dae725de38" have entirely different histories.
64b1515b46
...
de7a1e617d
|
@ -189,16 +189,6 @@ ul.notifications-list {
|
||||||
// we want 100% width to include the border
|
// we want 100% width to include the border
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.compose-status-options {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.spacer {
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-form {
|
.search-form {
|
||||||
|
|
|
@ -274,13 +274,13 @@ defmodule ClacksWeb.FrontendController do
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
def post_status(conn, %{"content" => content, "content_type" => content_type} = params) do
|
def post_status(conn, %{"content" => content} = params) do
|
||||||
current_user = conn.assigns[:user] |> Repo.preload(:actor)
|
current_user = conn.assigns[:user] |> Repo.preload(:actor)
|
||||||
|
|
||||||
UserActionsHelper.post_status(
|
UserActionsHelper.post_status(
|
||||||
current_user,
|
current_user,
|
||||||
content,
|
content,
|
||||||
content_type,
|
"text/plain",
|
||||||
Map.get(params, "in_reply_to")
|
Map.get(params, "in_reply_to")
|
||||||
)
|
)
|
||||||
|> case do
|
|> case do
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
<%= 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>
|
|
||||||
|
|
||||||
<div class="compose-status-options">
|
|
||||||
<select name="content_type">
|
|
||||||
<option value="text/plain">Plain</option>
|
|
||||||
<option value="text/markdown">Markdown</option>
|
|
||||||
<option value="text/html">HTML</option>
|
|
||||||
</select>
|
|
||||||
<div class="spacer"></div>
|
|
||||||
<%= submit "Post" %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
|
@ -1,6 +1,9 @@
|
||||||
<h1>Home</h1>
|
<h1>Home</h1>
|
||||||
|
|
||||||
<%= render "_post_form.html", conn: @conn %>
|
<%= form_tag Routes.frontend_path(@conn, :post_status), method: :post, class: "compose-status" do %>
|
||||||
<hr>
|
<textarea id="content" name="content" rows="5" placeholder="What's up?" required></textarea>
|
||||||
|
<%= submit "Post" %>
|
||||||
|
<hr>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<%= render "_timeline.html", conn: @conn, statuses_with_authors: @statuses_with_authors %>
|
<%= render "_timeline.html", conn: @conn, statuses_with_authors: @statuses_with_authors %>
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
<%= unless is_nil(@current_user) do %>
|
<%= unless is_nil(@current_user) do %>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<%= render "_post_form.html", conn: @conn, in_reply_to: @status.data["object"]["id"], placeholder: "Reply", content: mentions_for_replying_to(@conn, @status) %>
|
<%= form_tag Routes.frontend_path(@conn, :post_status), method: :post, class: "compose-status" do %>
|
||||||
<hr>
|
<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 %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -121,14 +121,9 @@ defmodule ClacksWeb.FrontendView do
|
||||||
actor = Actor.get_cached_by_ap_id(ap_id)
|
actor = Actor.get_cached_by_ap_id(ap_id)
|
||||||
"@#{actor.nickname}"
|
"@#{actor.nickname}"
|
||||||
end)
|
end)
|
||||||
|
|> Enum.join(" ")
|
||||||
|
|
||||||
case mentions do
|
"#{mentions} "
|
||||||
[] ->
|
|
||||||
""
|
|
||||||
|
|
||||||
_ ->
|
|
||||||
Enum.join(mentions, " ") <> ""
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
defp mentions_for_replying_to(_), do: ""
|
defp mentions_for_replying_to(_), do: ""
|
||||||
|
|
Loading…
Reference in New Issue