From 7236ac409cbaa1c27f0c31f913e734ee728b02cb Mon Sep 17 00:00:00 2001 From: Inhji Date: Thu, 9 Mar 2023 21:43:30 +0100 Subject: [PATCH] mix format --- lib/chiya_web/controllers/note_controller.ex | 2 +- .../controllers/page_html/channel.html.heex | 2 +- .../controllers/setting_html/show.html.heex | 30 +++++++++---------- .../controllers/setting_controller_test.exs | 27 +++++++++++++++-- 4 files changed, 40 insertions(+), 21 deletions(-) diff --git a/lib/chiya_web/controllers/note_controller.ex b/lib/chiya_web/controllers/note_controller.ex index 83bd2ce..159823d 100644 --- a/lib/chiya_web/controllers/note_controller.ex +++ b/lib/chiya_web/controllers/note_controller.ex @@ -31,7 +31,7 @@ defmodule ChiyaWeb.NoteController do def show(conn, %{"id" => id}) do # note = Notes.get_note!(id) # render(conn, :show, note: note) - live_render(conn, NoteShowLive, session: %{ "note_id" => id }) + live_render(conn, NoteShowLive, session: %{"note_id" => id}) end def edit(conn, %{"id" => id}) do diff --git a/lib/chiya_web/controllers/page_html/channel.html.heex b/lib/chiya_web/controllers/page_html/channel.html.heex index 672c72d..2f3c171 100644 --- a/lib/chiya_web/controllers/page_html/channel.html.heex +++ b/lib/chiya_web/controllers/page_html/channel.html.heex @@ -7,4 +7,4 @@ <%= @channel.content %>

- \ No newline at end of file + diff --git a/lib/chiya_web/controllers/setting_html/show.html.heex b/lib/chiya_web/controllers/setting_html/show.html.heex index 04ef18e..2e76dda 100644 --- a/lib/chiya_web/controllers/setting_html/show.html.heex +++ b/lib/chiya_web/controllers/setting_html/show.html.heex @@ -3,26 +3,24 @@ <:subtitle>These are your site's settings. <:actions> <%= if @setting == nil do %> - <.link href={~p"/admin/settings/new"}> - <.button>Create settings - + <.link href={~p"/admin/settings/new"}> + <.button>Create settings + <% else %> - <.link href={~p"/admin/settings/edit"}> - <.button>Edit settings - + <.link href={~p"/admin/settings/edit"}> + <.button>Edit settings + <% end %> <%= if @setting !== nil do %> - -<.list> - <:item title="Title"><%= @setting.title %> - <:item title="Subtitle"><%= @setting.subtitle %> - <:item title="Theme"><%= @setting.theme %> - <:item title="User agent"><%= @setting.user_agent %> - <:item title="Custom css"><%= @setting.custom_css %> - <:item title="Custom html"><%= @setting.custom_html %> - - + <.list> + <:item title="Title"><%= @setting.title %> + <:item title="Subtitle"><%= @setting.subtitle %> + <:item title="Theme"><%= @setting.theme %> + <:item title="User agent"><%= @setting.user_agent %> + <:item title="Custom css"><%= @setting.custom_css %> + <:item title="Custom html"><%= @setting.custom_html %> + <% end %> diff --git a/test/chiya_web/controllers/setting_controller_test.exs b/test/chiya_web/controllers/setting_controller_test.exs index 6e2b3e2..3438673 100644 --- a/test/chiya_web/controllers/setting_controller_test.exs +++ b/test/chiya_web/controllers/setting_controller_test.exs @@ -3,9 +3,30 @@ defmodule ChiyaWeb.SettingControllerTest do import Chiya.SiteFixtures - @create_attrs %{custom_css: "some custom_css", custom_html: "some custom_html", subtitle: "some subtitle", theme: :default, title: "some title", user_agent: "some user_agent"} - @update_attrs %{custom_css: "some updated custom_css", custom_html: "some updated custom_html", subtitle: "some updated subtitle", theme: :default, title: "some updated title", user_agent: "some updated user_agent"} - @invalid_attrs %{custom_css: nil, custom_html: nil, subtitle: nil, theme: nil, title: nil, user_agent: nil} + @create_attrs %{ + custom_css: "some custom_css", + custom_html: "some custom_html", + subtitle: "some subtitle", + theme: :default, + title: "some title", + user_agent: "some user_agent" + } + @update_attrs %{ + custom_css: "some updated custom_css", + custom_html: "some updated custom_html", + subtitle: "some updated subtitle", + theme: :default, + title: "some updated title", + user_agent: "some updated user_agent" + } + @invalid_attrs %{ + custom_css: nil, + custom_html: nil, + subtitle: nil, + theme: nil, + title: nil, + user_agent: nil + } setup [:register_and_log_in_user]