wip: wcag structure
This commit is contained in:
parent
4c31dbbed0
commit
4dd445be57
48 changed files with 461 additions and 137 deletions
7
app/views/guidelines/_form.html.erb
Normal file
7
app/views/guidelines/_form.html.erb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<%= bootstrap_form_with(model: guideline) do |form| %>
|
||||
<%= form.collection_select :principle_id, Principle.all.sort_by(&:id), :id, :t_name %>
|
||||
<%= form.number_field :number %>
|
||||
<%= form.text_field :name_de %>
|
||||
<%= form.rich_text_area :description_de %>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
15
app/views/guidelines/_guideline.html.erb
Normal file
15
app/views/guidelines/_guideline.html.erb
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<div id="<%= dom_id guideline %>">
|
||||
<p>
|
||||
<strong>Principle:</strong>
|
||||
<%= guideline.principle.t_name %>
|
||||
</p>
|
||||
|
||||
<%= guideline.description_de %>
|
||||
<h2 class="mt-4">Richtlinien</h2>
|
||||
<% guideline.checks.each do |check| %>
|
||||
<section class="pt-3">
|
||||
<h3 class="fs-5"><%= link_to check %></h3>
|
||||
<%= check.t_criterion %>
|
||||
</section>
|
||||
<% end %>
|
||||
</div>
|
||||
2
app/views/guidelines/_guideline.json.jbuilder
Normal file
2
app/views/guidelines/_guideline.json.jbuilder
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
json.extract! guideline, :id, :principle_id, :number, :name_de, :created_at, :updated_at
|
||||
json.url guideline_url(guideline, format: :json)
|
||||
8
app/views/guidelines/edit.html.erb
Normal file
8
app/views/guidelines/edit.html.erb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<h1><%= t("scaffold.pagetitle_edit", model: Guideline.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", guideline: @guideline %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_show", model: Guideline.model_name.human), @guideline %>
|
||||
<%= link_to t("scaffold.link_index", model: Guideline.model_name.human(count: 2)), guidelines_path %>
|
||||
</div>
|
||||
28
app/views/guidelines/index.html.erb
Normal file
28
app/views/guidelines/index.html.erb
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<h1><%= t("scaffold.pagetitle_index", model: Guideline.model_name.human(count: 2)) %></h1>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th><%= Guideline.human_attribute_name(:name_de) %></th>
|
||||
|
||||
<th><%= Guideline.human_attribute_name(:description_de) %></th>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @guidelines.each do |guideline| %>
|
||||
<tr>
|
||||
|
||||
|
||||
|
||||
<td><%= link_to(guideline, url_for(guideline)) %></td>
|
||||
<td><%= link_to(guideline.description_de, url_for(guideline)) %></td>
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_new", model: Guideline.model_name.human), new_guideline_path %>
|
||||
</div>
|
||||
1
app/views/guidelines/index.json.jbuilder
Normal file
1
app/views/guidelines/index.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.array! @guidelines, partial: "guidelines/guideline", as: :guideline
|
||||
7
app/views/guidelines/new.html.erb
Normal file
7
app/views/guidelines/new.html.erb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<h1><%= t("scaffold.pagetitle_new", model: Guideline.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", guideline: @guideline %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_index", model: Guideline.model_name.human(count: 2)), guidelines_path %>
|
||||
</div>
|
||||
9
app/views/guidelines/show.html.erb
Normal file
9
app/views/guidelines/show.html.erb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<h1><%= @guideline %></h1>
|
||||
|
||||
<%= render @guideline %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_edit", model: @guideline.model_name.human), edit_guideline_path(@guideline) %>
|
||||
<%= link_to t("scaffold.link_index", model: @guideline.model_name.human(count: 2)), guidelines_path %>
|
||||
<%= button_to t("scaffold.link_destroy", model: @guideline.model_name.human), @guideline, method: :delete, class: "btn btn-outline-danger" %>
|
||||
</div>
|
||||
1
app/views/guidelines/show.json.jbuilder
Normal file
1
app/views/guidelines/show.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.partial! "guidelines/guideline", guideline: @guideline
|
||||
Loading…
Add table
Add a link
Reference in a new issue