mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 12:08:00 +01:00
default to centered (can still be set to left if desired)
This commit is contained in:
parent
fefd73f3bd
commit
dbfdd22ea9
3 changed files with 14 additions and 4 deletions
|
@ -9,8 +9,8 @@ defmodule PhilomenaWeb.LayoutView do
|
|||
conn.assigns[:layout_class] || "layout--narrow"
|
||||
end
|
||||
|
||||
def container_class(%{use_centered_layout: true}), do: "layout--center-aligned"
|
||||
def container_class(_user), do: nil
|
||||
def container_class(%{use_centered_layout: false}), do: nil
|
||||
def container_class(_user), do: "layout--center-aligned"
|
||||
|
||||
def render_time(conn) do
|
||||
(Time.diff(Time.utc_now(), conn.assigns[:start_time], :microsecond) / 1000.0)
|
||||
|
|
9
priv/repo/migrations/20200905214139_default_centered.exs
Normal file
9
priv/repo/migrations/20200905214139_default_centered.exs
Normal file
|
@ -0,0 +1,9 @@
|
|||
defmodule Philomena.Repo.Migrations.DefaultCentered do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
alter table(:users) do
|
||||
modify :use_centered_layout, :boolean, from: :boolean, default: true
|
||||
end
|
||||
end
|
||||
end
|
|
@ -3,7 +3,7 @@
|
|||
--
|
||||
|
||||
-- Dumped from database version 12.3 (Debian 12.3-1.pgdg100+1)
|
||||
-- Dumped by pg_dump version 12.3 (Debian 12.3-1.pgdg90+1)
|
||||
-- Dumped by pg_dump version 12.4 (Debian 12.4-1.pgdg90+1)
|
||||
|
||||
SET statement_timeout = 0;
|
||||
SET lock_timeout = 0;
|
||||
|
@ -1959,7 +1959,7 @@ CREATE TABLE public.users (
|
|||
images_favourited_count integer DEFAULT 0 NOT NULL,
|
||||
last_donation_at timestamp without time zone,
|
||||
scratchpad text,
|
||||
use_centered_layout boolean DEFAULT false NOT NULL,
|
||||
use_centered_layout boolean DEFAULT true NOT NULL,
|
||||
secondary_role character varying,
|
||||
hide_default_role boolean DEFAULT false NOT NULL,
|
||||
personal_title character varying,
|
||||
|
@ -4796,3 +4796,4 @@ INSERT INTO public."schema_migrations" (version) VALUES (20200617113333);
|
|||
INSERT INTO public."schema_migrations" (version) VALUES (20200706171350);
|
||||
INSERT INTO public."schema_migrations" (version) VALUES (20200725234412);
|
||||
INSERT INTO public."schema_migrations" (version) VALUES (20200817213256);
|
||||
INSERT INTO public."schema_migrations" (version) VALUES (20200905214139);
|
||||
|
|
Loading…
Reference in a new issue