Styling fixes on harvest page
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
@import './live/registration.css';
|
||||
@import './pages/privacy.css';
|
||||
@import './live/table.css';
|
||||
@import './live/yield.css';
|
||||
|
||||
/* Alerts and form errors used by phx.new */
|
||||
.alert {
|
||||
|
||||
9
assets/css/live/yield.css
Normal file
9
assets/css/live/yield.css
Normal file
@@ -0,0 +1,9 @@
|
||||
.date-picker {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 0.7em;
|
||||
}
|
||||
|
||||
.date-picker select {
|
||||
max-width: 8rem;
|
||||
}
|
||||
@@ -9,9 +9,14 @@
|
||||
phx-change="validate"
|
||||
phx-submit="save">
|
||||
|
||||
|
||||
<%= label f, :date %>
|
||||
<%= date_input f, :date %>
|
||||
<%= error_tag f, :date %>
|
||||
<div class="date-picker" >
|
||||
<%= date_select f, :date, default: DateTime.now!("Etc/UTC"), builder: fn b -> %>
|
||||
<%= b.(:day, []) %> / <%= b.(:month, options: [{"01", "1"}, "02", "03", "04", "05", {"06", "6"}, "07", "08", "09", "10", "11", "12"]) %> / <%= b.(:year, options: ["2023"]) %>
|
||||
<% end %>
|
||||
<%= error_tag f, :date %>
|
||||
</div>
|
||||
|
||||
<%= label f, :plant %>
|
||||
<%= select f, :plant, Ecto.Enum.values(Osuuspuutarha.Harvest.Yield, :plant), prompt: "Choose a value" %>
|
||||
|
||||
@@ -16,19 +16,19 @@ defmodule OsuuspuutarhaWeb.YieldLive.Index do
|
||||
|
||||
defp apply_action(socket, :edit, %{"id" => id}) do
|
||||
socket
|
||||
|> assign(:page_title, "Edit Yield")
|
||||
|> assign(:page_title, "Edit yield")
|
||||
|> assign(:yield, Harvest.get_yield!(id))
|
||||
end
|
||||
|
||||
defp apply_action(socket, :new, _params) do
|
||||
socket
|
||||
|> assign(:page_title, "New Yield")
|
||||
|> assign(:yield, %Yield{})
|
||||
|> assign(:page_title, "New yield")
|
||||
|> assign(:yield, %Yield{unit: :kg, date: DateTime.utc_now()})
|
||||
end
|
||||
|
||||
defp apply_action(socket, :index, _params) do
|
||||
socket
|
||||
|> assign(:page_title, "Listing Yields")
|
||||
|> assign(:page_title, "Good day, Albert!")
|
||||
|> assign(:yield, nil)
|
||||
end
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<h1>Listing Yields</h1>
|
||||
<h1>Hello Albert!</h1>
|
||||
|
||||
<%= if @live_action in [:new, :edit] do %>
|
||||
<.modal return_to={Routes.yield_index_path(@socket, :index)}>
|
||||
@@ -27,7 +27,7 @@
|
||||
<tbody id="yields">
|
||||
<%= for yield <- @yields do %>
|
||||
<tr id={"yield-#{yield.id}"}>
|
||||
<td><%= yield.date %></td>
|
||||
<td><%= yield.date.day %>.<%= yield.date.month %>.<%= yield.date.year %></td>
|
||||
<td><%= yield.plant %></td>
|
||||
<td><%= yield.amount %></td>
|
||||
<td><%= yield.unit %></td>
|
||||
|
||||
Reference in New Issue
Block a user