Added projects
This commit is contained in:
parent
0964187f22
commit
8b4ffb83ec
37 changed files with 470 additions and 1935 deletions
|
|
@ -1,30 +1,37 @@
|
|||
h1 a11ydive
|
||||
h2 Dashboard
|
||||
h1 Dashboard
|
||||
|
||||
- if Report.any?
|
||||
h3 Zuletzt bearbeitete Prüfberichte
|
||||
ul
|
||||
- Report.all.order(updated_at: :desc).limit(3).each do |r|
|
||||
li = link_to(r.name, r)
|
||||
.row
|
||||
.col-md-6
|
||||
- if Project.current.any?
|
||||
h2
|
||||
i.bi.bi-folder>
|
||||
'Aktuelle Projekte
|
||||
ul
|
||||
- Project.current.order(updated_at: :desc).each do |p|
|
||||
li = link_to(p.name, p)
|
||||
|
||||
p
|
||||
i.bi.bi-journal-text
|
||||
=< Report.count
|
||||
=< link_to Report.model_name.human(count: Report.count), :reports
|
||||
- if Report.any?
|
||||
h2
|
||||
i.bi.bi-journal-text>
|
||||
'Zuletzt bearbeitete Prüfberichte
|
||||
ul
|
||||
- Report.all.order(updated_at: :desc).limit(3).each do |r|
|
||||
li = link_to(r.name, r)
|
||||
|
||||
h3 Hotkeys
|
||||
p Auf der Bericht-Ausfüllen Seite können folgende Shortcuts verwendet werden:
|
||||
dl
|
||||
dt t
|
||||
dd Springe zum Anfang des Contents (Skip-Link, kann auf allen Seiten verwendet werden)
|
||||
dt a
|
||||
dd Alle auf
|
||||
dt s
|
||||
dd Alle zu
|
||||
dt b
|
||||
dd Baum
|
||||
dt n
|
||||
dd Notizen
|
||||
dt e
|
||||
dd Springe zu erstem Check
|
||||
|
||||
.col-md-6
|
||||
h2 Hotkeys
|
||||
p Auf der Bericht-Ausfüllen Seite können folgende Shortcuts verwendet werden:
|
||||
dl
|
||||
dt t
|
||||
dd Springe zum Anfang des Contents (Skip-Link, kann auf allen Seiten verwendet werden)
|
||||
dt a
|
||||
dd Alle auf
|
||||
dt s
|
||||
dd Alle zu
|
||||
dt b
|
||||
dd Baum
|
||||
dt n
|
||||
dd Notizen
|
||||
dt e
|
||||
dd Springe zu erstem Check
|
||||
|
||||
|
|
|
|||
5
app/views/projects/_form.html.erb
Normal file
5
app/views/projects/_form.html.erb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<%= bootstrap_form_with(model: project) do |form| %>
|
||||
<%= form.text_field :name %>
|
||||
<%= form.rich_text_area :details %>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
20
app/views/projects/_project.html.slim
Normal file
20
app/views/projects/_project.html.slim
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
.project id=dom_id(project)
|
||||
p
|
||||
strong Name:
|
||||
= project.name
|
||||
p
|
||||
strong Details:
|
||||
= project.details
|
||||
p
|
||||
strong Berichte:
|
||||
ul.ps-0
|
||||
- project.reports.each do
|
||||
li.d-flex.ps-0
|
||||
=< "ID #{_1.id}: #{l(_1.created_at,format: :short)} #{_1.name}"
|
||||
= link_to(_1, class: "btn btn-sm btn-link-secondary") do
|
||||
i.bi.bi-folder-symlink
|
||||
= button_to(project_reports_path(project), class: "btn btn-sm btn-link-secondary", params: { copy_from_id: _1.id }) do
|
||||
i.bi.bi-copy
|
||||
p
|
||||
= link_to(new_project_report_path(project), class: "btn btn-secondary") do
|
||||
i.bi.bi-plus-lg
|
||||
2
app/views/projects/_project.json.jbuilder
Normal file
2
app/views/projects/_project.json.jbuilder
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
json.extract! project, :id, :name, :created_at, :updated_at
|
||||
json.url project_url(project, format: :json)
|
||||
8
app/views/projects/edit.html.erb
Normal file
8
app/views/projects/edit.html.erb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<h1><%= t("scaffold.pagetitle_edit", model: Project.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", project: @project %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_show", model: Project.model_name.human), @project %>
|
||||
<%= link_to t("scaffold.link_index", model: Project.model_name.human(count: 2)), projects_path %>
|
||||
</div>
|
||||
25
app/views/projects/index.html.erb
Normal file
25
app/views/projects/index.html.erb
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<h1><%= t("scaffold.pagetitle_index", model: Project.model_name.human(count: 2)) %></h1>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= Project.human_attribute_name(:id) %></th>
|
||||
|
||||
<th><%= Project.human_attribute_name(:name) %></th>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @projects.each do |project| %>
|
||||
<tr>
|
||||
<td><%= link_to(project.id, url_for(project)) %></td>
|
||||
|
||||
<td><%= link_to(project.name, url_for(project)) %></td>
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_new", model: Project.model_name.human), new_project_path %>
|
||||
</div>
|
||||
1
app/views/projects/index.json.jbuilder
Normal file
1
app/views/projects/index.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.array! @projects, partial: "projects/project", as: :project
|
||||
7
app/views/projects/new.html.erb
Normal file
7
app/views/projects/new.html.erb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<h1><%= t("scaffold.pagetitle_new", model: Project.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", project: @project %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_index", model: Project.model_name.human(count: 2)), projects_path %>
|
||||
</div>
|
||||
9
app/views/projects/show.html.erb
Normal file
9
app/views/projects/show.html.erb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<h1><%= t("scaffold.pagetitle_show", model: @project.class.model_name.human) %></h1>
|
||||
|
||||
<%= render @project %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_edit", model: @project.model_name.human), edit_project_path(@project) %>
|
||||
<%= link_to t("scaffold.link_index", model: @project.model_name.human(count: 2)), projects_path %>
|
||||
<%= button_to t("scaffold.link_destroy", model: @project.model_name.human), @project, method: :delete, class: "btn btn-outline-danger" if @project.reports.none? %>
|
||||
</div>
|
||||
1
app/views/projects/show.json.jbuilder
Normal file
1
app/views/projects/show.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.partial! "projects/project", project: @project
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
<%= bootstrap_form_with(model: report) do |form| %>
|
||||
<%= bootstrap_form_with(model: report.persisted? ? report : [@project, report]) do |form| %>
|
||||
<%= form.collection_select :project_id, Project.all, :id, :name, include_blank: true %>
|
||||
<%= form.text_field :name %>
|
||||
<%= form.text_field :url %>
|
||||
<%= form.rich_text_area :comment %>
|
||||
|
|
|
|||
|
|
@ -4,5 +4,5 @@
|
|||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_show", model: Report.model_name.human), @report %>
|
||||
<%= link_to t("scaffold.link_index", model: Report.model_name.human(count: 2)), reports_path %>
|
||||
<%= link_to t("scaffold.link_index", model: Report.model_name.human(count: 2)), project_reports_path(@report.project) %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -27,5 +27,5 @@
|
|||
</table>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_new", model: Report.model_name.human), new_report_path %>
|
||||
<%= link_to t("scaffold.link_new", model: Report.model_name.human), new_project_report_path(@project) %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@
|
|||
<%= render "form", report: @report %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_index", model: Report.model_name.human(count: 2)), reports_path %>
|
||||
<%= link_to t("scaffold.link_index", model: Report.model_name.human(count: 2)), project_reports_path(@project) %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,11 +3,12 @@
|
|||
i.bi.bi-journal-text.me-2
|
||||
= @report.name
|
||||
div
|
||||
small
|
||||
'Erstellt am
|
||||
= l(@report.created_at, format: :short)
|
||||
', zuletzt bearbeitet am
|
||||
= l(@report.updated_at, format: :short)
|
||||
small = "Erstellt am #{l(@report.created_at, format: :short)}, zuletzt bearbeitet am #{l(@report.updated_at, format: :short)}"
|
||||
|
||||
p
|
||||
i.bi.bi-folder
|
||||
strong< = link_to(@report.project.name, @report.project)
|
||||
|
||||
.smb-4.lead.mb-5
|
||||
= @report.comment || tag.i("leer")
|
||||
- if @current_page
|
||||
|
|
@ -26,7 +27,6 @@ div
|
|||
.btn-group.me-3.visually-hidden
|
||||
= link_to("Alle zu [s]", "#", data: { action: "click->details-list#closeAll", controller: :hotkey, hotkey: "s" }, class: "btn btn-outline-secondary")
|
||||
= link_to("Alle auf [a]", "#", data: { action: "click->details-list#openAll", controller: :hotkey, hotkey: "a" }, class: "btn btn-outline-secondary")
|
||||
/= button_to(tag.i(class: "bi bi-trash"), page_path(@current_page), method: :delete, class: "btn btn-outline-danger", form: {data: { turbo_confirm: "Bist du sicher?" }})
|
||||
.row
|
||||
.col-lg-3.col-md-4.col-sm-12
|
||||
.page_nav.sticky-top
|
||||
|
|
@ -63,5 +63,5 @@ div
|
|||
| ODT
|
||||
.action-row
|
||||
= link_to t("scaffold.link_edit", model: @report.model_name.human), edit_report_path(@report)
|
||||
= link_to t("scaffold.link_index", model: @report.model_name.human(count: 2)), reports_path
|
||||
= link_to t("scaffold.link_index", model: @report.model_name.human(count: 2)), project_reports_path(@report.project)
|
||||
= button_to t("scaffold.link_destroy", model: @report.model_name.human), @report, method: :delete, class: "btn btn-outline-danger", data: { turbo_confirm: "Bist du sicher?"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue