From 64b1515b46118a4ebc8b9123e4c88fc42185ae68 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 25 May 2020 19:34:58 -0400 Subject: [PATCH] Add post content type to frontend --- assets/css/clacks.scss | 10 ++++++++++ lib/clacks_web/controllers/frontend_controller.ex | 4 ++-- .../templates/frontend/_post_form.html.eex | 12 +++++++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/assets/css/clacks.scss b/assets/css/clacks.scss index 34095b8..4482950 100644 --- a/assets/css/clacks.scss +++ b/assets/css/clacks.scss @@ -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 { diff --git a/lib/clacks_web/controllers/frontend_controller.ex b/lib/clacks_web/controllers/frontend_controller.ex index 2a0d0fb..7e59561 100644 --- a/lib/clacks_web/controllers/frontend_controller.ex +++ b/lib/clacks_web/controllers/frontend_controller.ex @@ -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 diff --git a/lib/clacks_web/templates/frontend/_post_form.html.eex b/lib/clacks_web/templates/frontend/_post_form.html.eex index c3cfa82..236eebc 100644 --- a/lib/clacks_web/templates/frontend/_post_form.html.eex +++ b/lib/clacks_web/templates/frontend/_post_form.html.eex @@ -2,8 +2,18 @@ <%= if assigns[:in_reply_to] do %> <% end %> + <% placeholder = assigns[:placeholder] || "What's up?" %> <% content = assigns[:content] || "" %> - <%= submit "Post" %> + +
+ +
+ <%= submit "Post" %> +
<% end %>