Style changes

This commit is contained in:
Shadowfacts 2020-08-02 17:46:18 -04:00
parent 28cd37966a
commit e7f89b85b9
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
7 changed files with 35 additions and 151 deletions

View File

@ -1,36 +1,29 @@
/* This file is for your main application css. */ body {
@import "./phoenix.css"; font-family: -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
}
/* Alerts and form errors */ .container {
.alert { max-width: 1280px;
padding: 15px; margin: 0 auto;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px;
} }
.alert-info {
color: #31708f; header nav {
background-color: #d9edf7; display: flex;
border-color: #bce8f1; flex-direction: row;
justify-content: space-between;
ul {
padding-left: 0;
li {
list-style: none;
display: inline;
margin-right: 15px;
&:last-child {
margin-right: 0;
} }
.alert-warning {
color: #8a6d3b;
background-color: #fcf8e3;
border-color: #faebcc;
} }
.alert-danger {
color: #a94442;
background-color: #f2dede;
border-color: #ebccd1;
} }
.alert p {
margin-bottom: 0;
}
.alert:empty {
display: none;
}
.invalid-feedback {
color: #a94442;
display: block;
margin: -1rem 0 2rem;
} }

File diff suppressed because one or more lines are too long

View File

@ -18,8 +18,8 @@ defmodule Wiki.Content do
[%Page{}, ...] [%Page{}, ...]
""" """
def list_pages do def list_pages(user) do
Repo.all(Page) Repo.all(from p in Page, where: p.user_id == ^user.id)
end end
@doc """ @doc """

View File

@ -56,7 +56,7 @@ defmodule WikiWeb.PageController do
end end
def index(conn, _params) do def index(conn, _params) do
pages = Content.list_pages() pages = Content.list_pages(conn.assigns.current_user)
render(conn, "index.html", pages: pages) render(conn, "index.html", pages: pages)
end end

View File

@ -16,12 +16,6 @@ defmodule WikiWeb.Router do
plug :accepts, ["json"] plug :accepts, ["json"]
end end
scope "/", WikiWeb do
pipe_through :browser
get "/", PageController, :index
end
# Other scopes may use custom stacks. # Other scopes may use custom stacks.
# scope "/api", WikiWeb do # scope "/api", WikiWeb do
# pipe_through :api # pipe_through :api
@ -66,7 +60,8 @@ defmodule WikiWeb.Router do
put "/users/settings/update_email", UserSettingsController, :update_email put "/users/settings/update_email", UserSettingsController, :update_email
get "/users/settings/confirm_email/:token", UserSettingsController, :confirm_email get "/users/settings/confirm_email/:token", UserSettingsController, :confirm_email
resources "/pages", PageController resources "/pages", PageController, except: [:index]
get "/", PageController, :index
post "/pages/:id/uploads", PageController, :create_upload post "/pages/:id/uploads", PageController, :create_upload
get "/pages/:id/uploads/:upload_id", PageController, :get_upload get "/pages/:id/uploads/:upload_id", PageController, :get_upload
delete "/pages/:id/uploads/:upload_id", PageController, :delete_upload delete "/pages/:id/uploads/:upload_id", PageController, :delete_upload

View File

@ -4,7 +4,7 @@
<meta charset="utf-8"/> <meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/> <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Wiki · Phoenix Framework</title> <title>Wiki</title>
<link rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/> <link rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/>
<script defer type="text/javascript" src="<%= Routes.static_path(@conn, "/js/app.js") %>"></script> <script defer type="text/javascript" src="<%= Routes.static_path(@conn, "/js/app.js") %>"></script>
</head> </head>
@ -13,16 +13,13 @@
<section class="container"> <section class="container">
<nav role="navigation"> <nav role="navigation">
<ul> <ul>
<li><a href="https://hexdocs.pm/phoenix/overview.html">Get Started</a></li> <li><a href="/">Home</a></li>
<%= if function_exported?(Routes, :live_dashboard_path, 2) do %> <%= if function_exported?(Routes, :live_dashboard_path, 2) do %>
<li><%= link "LiveDashboard", to: Routes.live_dashboard_path(@conn, :home) %></li> <li><%= link "LiveDashboard", to: Routes.live_dashboard_path(@conn, :home) %></li>
<% end %> <% end %>
</ul> </ul>
<%= render "_user_menu.html", assigns %> <%= render "_user_menu.html", assigns %>
</nav> </nav>
<a href="https://phoenixframework.org/" class="phx-logo">
<img src="<%= Routes.static_path(@conn, "/images/phoenix.png") %>" alt="Phoenix Framework Logo"/>
</a>
</section> </section>
</header> </header>
<main role="main" class="container"> <main role="main" class="container">

View File

@ -3,8 +3,8 @@ defmodule Wiki.Repo.Migrations.CreatePageLinks do
def change do def change do
create table(:page_links) do create table(:page_links) do
add :from_id, references(:pages, on_delete: :nothing), primary_key: true add :from_id, references(:pages, on_delete: :delete_all), primary_key: true
add :to_id, references(:pages, on_delete: :nothing), primary_key: true add :to_id, references(:pages, on_delete: :delete_all), primary_key: true
end end
create index(:page_links, [:from_id]) create index(:page_links, [:from_id])