Add post content type to frontend
This commit is contained in:
parent
39b48eb52d
commit
64b1515b46
|
@ -189,6 +189,16 @@ ul.notifications-list {
|
|||
// we want 100% width to include the border
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.compose-status-options {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.spacer {
|
||||
flex-grow: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.search-form {
|
||||
|
|
|
@ -274,13 +274,13 @@ defmodule ClacksWeb.FrontendController do
|
|||
})
|
||||
end
|
||||
|
||||
def post_status(conn, %{"content" => content} = params) do
|
||||
def post_status(conn, %{"content" => content, "content_type" => content_type} = params) do
|
||||
current_user = conn.assigns[:user] |> Repo.preload(:actor)
|
||||
|
||||
UserActionsHelper.post_status(
|
||||
current_user,
|
||||
content,
|
||||
"text/plain",
|
||||
content_type,
|
||||
Map.get(params, "in_reply_to")
|
||||
)
|
||||
|> case do
|
||||
|
|
|
@ -2,8 +2,18 @@
|
|||
<%= 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" %>
|
||||
|
||||
<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 %>
|
||||
|
|
Loading…
Reference in New Issue