fixing page titles, fleshing out readme
This commit is contained in:
parent
c79a67b345
commit
2fe6f4c174
8 changed files with 86 additions and 6 deletions
81
README.md
81
README.md
|
@ -2,6 +2,83 @@
|
||||||
|
|
||||||
Calendaring app for shift-worker shift tracking, with support for CSV export and sharing work schedule with others.
|
Calendaring app for shift-worker shift tracking, with support for CSV export and sharing work schedule with others.
|
||||||
|
|
||||||
## Tech
|
Written in Elixir & Phoenix LiveView, with Bootstrap v5.
|
||||||
|
|
||||||
Written in Elixir & Phoenix LiveView.
|
## TODO
|
||||||
|
|
||||||
|
- [ ] Ability to edit shifts?
|
||||||
|
- [ ] Proper modal to delete shifts?
|
||||||
|
- [ ] Allow all-day items for notes, or require hours even for sick days?
|
||||||
|
|
||||||
|
## Deploying
|
||||||
|
|
||||||
|
### New versions
|
||||||
|
|
||||||
|
When improvements are made, we can update the deployed version like so:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cd /opt/shift73k
|
||||||
|
git pull 73k master
|
||||||
|
mix deps.get --only prod
|
||||||
|
MIX_ENV=prod mix compile
|
||||||
|
# might not be needed:
|
||||||
|
MIX_ENV=prod mix ecto.migrate
|
||||||
|
# rebuild static assets:
|
||||||
|
rm -rf priv/static/
|
||||||
|
npm run deploy --prefix ./assets
|
||||||
|
MIX_ENV=prod mix phx.digest
|
||||||
|
MIX_ENV=prod mix release --overwrite
|
||||||
|
# test starting it:
|
||||||
|
MIX_ENV=prod _build/prod/rel/shift73k/bin/shift73k start
|
||||||
|
```
|
||||||
|
|
||||||
|
### systemd unit:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[Unit]
|
||||||
|
Description=Shift73k service
|
||||||
|
After=local-fs.target network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=runuser
|
||||||
|
Group=runuser
|
||||||
|
WorkingDirectory=/opt/shift73k/_build/prod/rel/shift73k
|
||||||
|
ExecStart=/opt/shift73k/_build/prod/rel/shift73k/bin/shift73k start
|
||||||
|
ExecStop=/opt/shift73k/_build/prod/rel/shift73k/bin/shift73k stop
|
||||||
|
#EnvironmentFile=/etc/default/myApp.env
|
||||||
|
Environment=LANG=en_US.utf8
|
||||||
|
Environment=MIX_ENV=prod
|
||||||
|
#Environment=PORT=4000
|
||||||
|
LimitNOFILE=65535
|
||||||
|
UMask=0027
|
||||||
|
SyslogIdentifier=shift73k
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
```
|
||||||
|
|
||||||
|
### nginx config:
|
||||||
|
|
||||||
|
```conf
|
||||||
|
upstream phoenix {
|
||||||
|
server 127.0.0.1:4000 max_fails=5 fail_timeout=60s;
|
||||||
|
}
|
||||||
|
server {
|
||||||
|
location / {
|
||||||
|
allow all;
|
||||||
|
# Proxy Headers
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Cluster-Client-Ip $remote_addr;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_redirect off;
|
||||||
|
# WebSockets
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_pass http://phoenix;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
|
@ -5,7 +5,7 @@ defmodule Shift73kWeb.UserShiftsCsvController do
|
||||||
alias Shift73k.Shifts.Shift
|
alias Shift73k.Shifts.Shift
|
||||||
|
|
||||||
def new(conn, _params) do
|
def new(conn, _params) do
|
||||||
render(conn, "new.html")
|
render(conn, "new.html", page_title: "CSV Export")
|
||||||
end
|
end
|
||||||
|
|
||||||
def export(conn, %{"csv_export" => request_params}) do
|
def export(conn, %{"csv_export" => request_params}) do
|
||||||
|
|
|
@ -13,6 +13,7 @@ defmodule Shift73kWeb.ShiftAssignLive.Index do
|
||||||
def mount(_params, session, socket) do
|
def mount(_params, session, socket) do
|
||||||
socket
|
socket
|
||||||
|> assign_defaults(session)
|
|> assign_defaults(session)
|
||||||
|
|> assign(:page_title, "Schedule Shifts")
|
||||||
|> assign(:custom_shift, @custom_shift)
|
|> assign(:custom_shift, @custom_shift)
|
||||||
|> assign(:show_template_btn_active, false)
|
|> assign(:show_template_btn_active, false)
|
||||||
|> assign(:show_template_details, false)
|
|> assign(:show_template_details, false)
|
||||||
|
|
|
@ -13,6 +13,7 @@ defmodule Shift73kWeb.ShiftImportLive.Index do
|
||||||
|
|
||||||
socket
|
socket
|
||||||
|> assign_defaults(session)
|
|> assign_defaults(session)
|
||||||
|
|> assign(:page_title, "iCal Import")
|
||||||
|> assign(:url_valid, false)
|
|> assign(:url_valid, false)
|
||||||
|> assign(:url_validated, false)
|
|> assign(:url_validated, false)
|
||||||
|> assign(:tz_valid, true)
|
|> assign(:tz_valid, true)
|
||||||
|
|
|
@ -35,7 +35,7 @@ defmodule Shift73kWeb.ShiftLive.Index do
|
||||||
|
|
||||||
defp apply_action(socket, :index, _params) do
|
defp apply_action(socket, :index, _params) do
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "Listing Shifts")
|
|> assign(:page_title, "My Shifts")
|
||||||
|> assign(:shift, nil)
|
|> assign(:shift, nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ defmodule Shift73kWeb.ShiftTemplateLive.Index do
|
||||||
|
|
||||||
defp apply_action(socket, :index, _params) do
|
defp apply_action(socket, :index, _params) do
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "Listing Shift templates")
|
|> assign(:page_title, "My Shift Templates")
|
||||||
|> assign(:shift_template, nil)
|
|> assign(:shift_template, nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ defmodule Shift73kWeb.UserLive.Settings do
|
||||||
def mount(_params, session, socket) do
|
def mount(_params, session, socket) do
|
||||||
socket
|
socket
|
||||||
|> assign_defaults(session)
|
|> assign_defaults(session)
|
||||||
|
|> assign(:page_title, "User Settings")
|
||||||
|> alert_email_verified?()
|
|> alert_email_verified?()
|
||||||
|> live_okreply()
|
|> live_okreply()
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<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"/>
|
||||||
<%= csrf_meta_tag() %>
|
<%= csrf_meta_tag() %>
|
||||||
<%= live_title_tag assigns[:page_title] || "Shift73k", suffix: " · Phoenix Framework" %>
|
<%= live_title_tag assigns[:page_title] || "", suffix: assigns[:page_title] && " · Shift73k" || "Shift73k" %>
|
||||||
<link phx-track-static rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/>
|
<link phx-track-static rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/>
|
||||||
<script defer phx-track-static type="text/javascript" src="<%= Routes.static_path(@conn, "/js/app.js") %>"></script>
|
<script defer phx-track-static type="text/javascript" src="<%= Routes.static_path(@conn, "/js/app.js") %>"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
Loading…
Reference in a new issue