-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a53fd9d
commit acf3389
Showing
12 changed files
with
116 additions
and
51 deletions.
There are no files selected for viewing
39 changes: 29 additions & 10 deletions
39
lib/yearbook_web/live/admin/academic_year_live/form_component.html.heex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,36 @@ | ||
<div> | ||
<h2><%= @title %></h2> | ||
|
||
<.form let={f} for={@changeset} id="academic_year-form" phx-target={@myself} phx-change="validate" phx-submit="save"> | ||
<%= label(f, :start) %> | ||
<%= number_input(f, :start) %> | ||
<%= error_tag(f, :start) %> | ||
<div class="px-5 py-5 bg-white sm:p-6"> | ||
<div class="grid grid-cols-6 gap-6"> | ||
<div class="col-span-6 sm:col-span-6"> | ||
<label for="title" class="block text-base font-medium text-gray-700"> | ||
<h2><%= @title %></h2> | ||
</label> | ||
</div> | ||
|
||
<%= label(f, :finish) %> | ||
<%= number_input(f, :finish) %> | ||
<%= error_tag(f, :finish) %> | ||
<div class="col-span-4 sm:col-span-1"> | ||
<%= label(f, "Começo", class: "block text-base font-medium text-gray-700") %> | ||
<label> | ||
<%= select(f, :start, 2022..1970, prompt: "Ano", class: "mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-orange-500 focus:border-orange-500 sm:text-sm") %> | ||
</label> | ||
<div class="px-4 py-3 bg-white-50 text-right sm:px-6"></div> | ||
<%= error_tag(f, :start) %> | ||
</div> | ||
|
||
<div> | ||
<%= submit("Save", phx_disable_with: "Saving...") %> | ||
<div class="col-span-4 sm:col-span-1"> | ||
<%= label(f, "Fim", class: "block text-base font-medium text-gray-700") %> | ||
<label> | ||
<%= select(f, :finish, 2023..1970, prompt: "Ano", class: "mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-orange-500 focus:border-orange-500 sm:text-sm") %> | ||
</label> | ||
<div class="px-4 py-3 bg-white-50 text-right sm:px-6"></div> | ||
<%= error_tag(f, :finish) %> | ||
</div> | ||
</div> | ||
<div class="px-4 py-3 bg-white-50 text-right sm:px-6"> | ||
<%= submit(class: "inline-flex items-center justify-center rounded-md border border-transparent bg-orange-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-orange-700 focus:outline-none focus:ring-2 focus:ring-orange-500 focus:ring-offset-2 sm:w-auto") do %> | ||
Guardar | ||
<% end %> | ||
</div> | ||
</div> | ||
</.form> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 39 additions & 13 deletions
52
lib/yearbook_web/live/admin/class_live/form_component.html.heex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,47 @@ | ||
<div> | ||
<h2><%= @title %></h2> | ||
|
||
<.form let={f} for={@changeset} id="class-form" phx-target={@myself} phx-change="validate" phx-submit="save"> | ||
<%= label(f, :degree_id) %> | ||
<%= select(f, :degree_id, Enum.map(@degrees, &{&1.name, &1.id})) %> | ||
<%= error_tag(f, :degree_id) %> | ||
<div class="px-4 py-5 bg-white sm:p-6"> | ||
<div class="grid grid-cols-6 gap-6"> | ||
<div class="col-span-6 sm:col-span-6"> | ||
<label for="title" class="block text-base font-medium text-gray-700"> | ||
<h2><%= @title %></h2> | ||
</label> | ||
</div> | ||
|
||
<div class="col-span-6 sm:col-span-4"> | ||
<%= label(f, "Curso", class: "block text-base font-medium text-gray-700") %> | ||
<label> | ||
<%= select(f, :degree_id, Enum.map(@degrees, &{&1.name, &1.id}), class: "mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-orange-500 focus:border-orange-500 sm:text-sm") %> | ||
</label> | ||
<div class="px-4 py-3 bg-white-50 text-right sm:px-6"></div> | ||
<%= error_tag(f, :degree_id) %> | ||
</div> | ||
<div class="px-4 py-3 bg-white-50 text-right sm:px-6"></div> | ||
|
||
<%= label(f, :academic_year_id) %> | ||
<%= select(f, :academic_year_id, Enum.map(@academic_years, &{"#{&1.start}/#{&1.finish}", &1.id})) %> | ||
<%= error_tag(f, :academic_year_id) %> | ||
<div class="col-span-6 sm:col-span-2"> | ||
<%= label(f, "Ano Letivo", class: "block text-base font-medium text-gray-700") %> | ||
<label> | ||
<%= select(f, :academic_year_id, Enum.map(@academic_years, &{"#{&1.start}/#{&1.finish}", &1.id}), prompt: "Ano Letivo", class: "mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-orange-500 focus:border-orange-500 sm:text-sm") %> | ||
</label> | ||
<div class="px-4 py-3 bg-white-50 text-right sm:px-6"></div> | ||
<%= error_tag(f, :academic_year_id) %> | ||
</div> | ||
|
||
<%= label(f, :year) %> | ||
<%= number_input(f, :year) %> | ||
<%= error_tag(f, :year) %> | ||
<div class="col-span-6 sm:col-span-2"> | ||
<%= label(f, "Ano", class: "block text-base font-medium text-gray-700") %> | ||
<label> | ||
<%= select(f, :year, 1..5, prompt: "Ano", class: "mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-orange-500 focus:border-orange-500 sm:text-sm") %> | ||
</label> | ||
<div class="px-4 py-3 bg-white-50 text-right sm:px-6"></div> | ||
<%= error_tag(f, :year) %> | ||
</div> | ||
</div> | ||
|
||
<div> | ||
<%= submit("Save", phx_disable_with: "Saving...") %> | ||
<div class="px-4 py-3 bg-white-50 text-right sm:px-6"> | ||
<%= submit(class: "inline-flex items-center justify-center rounded-md border border-transparent bg-orange-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-orange-700 focus:outline-none focus:ring-2 focus:ring-orange-500 focus:ring-offset-2 sm:w-auto") do %> | ||
Guardar | ||
<% end %> | ||
</div> | ||
</div> | ||
</.form> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 27 additions & 10 deletions
37
lib/yearbook_web/live/admin/degree_live/form_component.html.heex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,34 @@ | ||
<div> | ||
<h2><%= @title %></h2> | ||
|
||
<.form let={f} for={@changeset} id="degree-form" phx-target={@myself} phx-change="validate" phx-submit="save"> | ||
<%= label(f, :name) %> | ||
<%= text_input(f, :name) %> | ||
<%= error_tag(f, :name) %> | ||
<div class="px-5 py-5 bg-white sm:p-6"> | ||
<div class="grid grid-cols-6 gap-6"> | ||
<div class="col-span-6 sm:col-span-6"> | ||
<label for="title" class="block text-base font-medium text-gray-700"> | ||
<h2><%= @title %></h2> | ||
</label> | ||
</div> | ||
|
||
<%= label(f, :cycle) %> | ||
<%= number_input(f, :cycle) %> | ||
<%= error_tag(f, :cycle) %> | ||
<div class="col-span-4 sm:col-span-4"> | ||
<%= label(f, "Curso", class: "block text-base font-medium text-gray-700") %> | ||
<%= text_input(f, :name, autocomplete: "off", class: "mt-1 focus:ring-orange-500 focus:border-orange-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md") %> | ||
<div class="px-4 py-3 bg-white-50 text-right sm:px-6"></div> | ||
<%= error_tag(f, :name) %> | ||
</div> | ||
|
||
<div> | ||
<%= submit("Save", phx_disable_with: "Saving...") %> | ||
<div class="col-span-4 sm:col-span-1"> | ||
<%= label(f, "Ciclo", class: "block text-base font-medium text-gray-700") %> | ||
<label> | ||
<%= select(f, :cycle, 1..3, prompt: "Ciclo", class: "mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-orange-500 focus:border-orange-500 sm:text-sm") %> | ||
</label> | ||
<div class="px-4 py-3 bg-white-50 text-right sm:px-6"></div> | ||
<%= error_tag(f, :cycle) %> | ||
</div> | ||
</div> | ||
<div class="px-4 py-3 bg-white-50 text-right sm:px-6"> | ||
<%= submit(class: "inline-flex items-center justify-center rounded-md border border-transparent bg-orange-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-orange-700 focus:outline-none focus:ring-2 focus:ring-orange-500 focus:ring-offset-2 sm:w-auto") do %> | ||
Guardar | ||
<% end %> | ||
</div> | ||
</div> | ||
</.form> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters