Add auth and ruby update
This commit is contained in:
parent
5d50194f39
commit
fbf6923835
43 changed files with 614 additions and 64 deletions
24
app/views/backoffice/show.html.erb
Normal file
24
app/views/backoffice/show.html.erb
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<h1>Einstellungen</h1>
|
||||
|
||||
<p>Hier wird es irgendwann mal was einzustellen geben.</p>
|
||||
<p>
|
||||
<i class="bi bi-list-check"></i>
|
||||
<%= Checklist.count %>
|
||||
<%= link_to Checklist.model_name.human(count: Checklist.count), :checklists %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<i class="bi bi-check2"></i>
|
||||
<%= Check.count %>
|
||||
<%= link_to Check.model_name.human(count: Check.count), :checks %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<i class="bi bi-link"></i>
|
||||
<%= Link.count %>
|
||||
<%= link_to Link.model_name.human(count: Link.count), :links %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= link_to "Backup herunterladen", admin_backup_url, class: "btn btn-secondary", data: { turbo_prefetch: false, frame: "_top", turbo: false } %>
|
||||
</p>
|
||||
2
app/views/home/root.html.erb
Normal file
2
app/views/home/root.html.erb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<h1>Public#root</h1>
|
||||
<p>Find me in app/views/public/root.html.erb</p>
|
||||
|
|
@ -7,25 +7,4 @@
|
|||
<%= Report.count %>
|
||||
<%= link_to Report.model_name.human(count: Report.count), :reports %>
|
||||
</p>
|
||||
<p>
|
||||
<i class="bi bi-list-check"></i>
|
||||
<%= Checklist.count %>
|
||||
<%= link_to Checklist.model_name.human(count: Checklist.count), :checklists %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<i class="bi bi-check2"></i>
|
||||
<%= Check.count %>
|
||||
<%= link_to Check.model_name.human(count: Check.count), :checks %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<i class="bi bi-link"></i>
|
||||
<%= Link.count %>
|
||||
<%= link_to Link.model_name.human(count: Link.count), :links %>
|
||||
</p>
|
||||
|
||||
|
||||
<p>
|
||||
<%= link_to "Backup herunterladen", admin_backup_url, class: "btn btn-secondary", data: { turbo_prefetch: false, frame: "_top", turbo: false } %>
|
||||
</p>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<% if flash[:alert] || flash[:notice] %>
|
||||
<div class="container mt-3 mb-3">
|
||||
<div class="container-fluid mt-3 mb-3">
|
||||
<% if flash[:alert] %>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<%= flash[:alert] %><% flash.delete(:alert) %>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<nav class="navbar navbar-expand-lg bg-body-tertiary">
|
||||
<div class="container">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="<%= root_path %>">
|
||||
<%= tag.i(class: "bi bi-universal-access") %>
|
||||
a11ydive
|
||||
|
|
@ -12,12 +12,21 @@
|
|||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<% @navbar_items.each do |navbar_item| %>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <%= @nav_path.to_s == navbar_item[:path].to_s && "active" %>" <%= @nav_path.to_s == navbar_item[:path].to_s && "aria-current=\"page\"" %> href="<%= url_for(navbar_item[:path]) %>">
|
||||
<% if navbar_item[:icon] %>
|
||||
<span aria-hidden="true" class="bi-<%= navbar_item[:icon] %>"></span>
|
||||
<% if navbar_item[:method].present? && navbar_item[:method] != :get %>
|
||||
<%= button_to(navbar_item[:path], method: navbar_item[:method], class: "nav-link") do %>
|
||||
<% if navbar_item[:icon] %>
|
||||
<span aria-hidden="true" class="bi-<%= navbar_item[:icon] %>"></span>
|
||||
<% end %>
|
||||
<%= navbar_item[:label] %>
|
||||
<% end %>
|
||||
<%= navbar_item[:label] %>
|
||||
</a>
|
||||
<% else %>
|
||||
<a class="nav-link <%= (navbar_item[:active] || @nav_path.to_s == navbar_item[:path].to_s) && "active" %>" <%= @nav_path.to_s == navbar_item[:path].to_s && "aria-current=\"page\"" %> href="<%= url_for(navbar_item[:path]) %>">
|
||||
<% if navbar_item[:icon] %>
|
||||
<span aria-hidden="true" class="bi-<%= navbar_item[:icon] %>"></span>
|
||||
<% end %>
|
||||
<%= navbar_item[:label] %>
|
||||
</a>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
<%# <li class="nav-item">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
<div class="col-auto px-0">
|
||||
<div id="sidebar" class="collapse collapse-horizontal show border-0">
|
||||
<div id="sidebar-nav" class="list-group border-0 rounded-0 text-sm-start min-vh-100">
|
||||
<% if @sidebar_items %>
|
||||
<% @sidebar_items.each do |sidebar_item| %>
|
||||
<% if sidebar_item[:method].present? && sidebar_item[:method] != :get %>
|
||||
<%= button_to(sidebar_item[:path], method: sidebar_item[:method], class: "list-group-item border-end-0 d-inline-block text-truncate") do %>
|
||||
<% if sidebar_item[:icon] %>
|
||||
<span aria-hidden="true" class="bi-<%= sidebar_item[:icon] %>"></span>
|
||||
<% end %>
|
||||
<%= sidebar_item[:label] %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<a class="list-group-item border-0 d-inline-block text-truncate <%= (sidebar_item[:active] || @nav_path.to_s == sidebar_item[:path].to_s) && "active" %>" <%= @nav_path.to_s == sidebar_item[:path].to_s && "aria-current=\"page\"" %> href="<%= url_for(sidebar_item[:path]) %>">
|
||||
<% if sidebar_item[:icon] %>
|
||||
<span aria-hidden="true" class="bi-<%= sidebar_item[:icon] %>"></span>
|
||||
<% end %>
|
||||
<%= sidebar_item[:label] %>
|
||||
</a>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="me-auto"></div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -12,12 +12,19 @@
|
|||
</head>
|
||||
|
||||
<body class="d-flex flex-column min-vh-100">
|
||||
<%= render partial: "layouts/sidebar" %>
|
||||
<%= render partial: "layouts/navigation" %>
|
||||
<%= render partial: "layouts/flash" %>
|
||||
<main class="mt-3 container">
|
||||
<%= yield %>
|
||||
</main>
|
||||
<footer class="container mt-auto"><%= Rails.configuration.build_version && "Version: #{Rails.configuration.build_version}" %>
|
||||
<div class="container-fluid">
|
||||
<div class="row flex-nowrap">
|
||||
<%= render partial: "layouts/sidebar" %>
|
||||
<main class="col ps-md-2 pt-2 <%= "border-start" if sidebar? %>">
|
||||
<%= render partial: "layouts/flash" %>
|
||||
<% if false && sidebar? %>
|
||||
<a href="#" data-bs-target="#sidebar" data-bs-toggle="collapse" class="p-1 text-decoration-none"><i class="bi bi-list bi-lg py-2 p-1"></i> Menu</a>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="container-fluid mt-auto"><%= Rails.configuration.build_version && "Version: #{Rails.configuration.build_version}" %>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
26
app/views/rodauth/_login_form.html.erb
Normal file
26
app/views/rodauth/_login_form.html.erb
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<%= form_with url: rodauth.login_path, method: :post, data: { turbo: false } do |form| %>
|
||||
<% if rodauth.skip_login_field_on_login? %>
|
||||
<div class="form-group mb-3">
|
||||
<%= form.label "login", rodauth.login_label, class: "form-label" %>
|
||||
<%= form.email_field rodauth.login_param, value: params[rodauth.login_param], id: "login", readonly: true, class: "form-control-plaintext" %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="form-group mb-3">
|
||||
<%= form.label "login", rodauth.login_label, class: "form-label" %>
|
||||
<%= form.email_field rodauth.login_param, value: params[rodauth.login_param], id: "login", autocomplete: rodauth.login_field_autocomplete_value, required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.login_param)}", aria: ({ invalid: true, describedby: "login_error_message" } if rodauth.field_error(rodauth.login_param)) %>
|
||||
<%= content_tag(:span, rodauth.field_error(rodauth.login_param), class: "invalid-feedback", id: "login_error_message") if rodauth.field_error(rodauth.login_param) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% unless rodauth.skip_password_field_on_login? %>
|
||||
<div class="form-group mb-3">
|
||||
<%= form.label "password", rodauth.password_label, class: "form-label" %>
|
||||
<%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.password_param)}", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
|
||||
<%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "invalid-feedback", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<%= form.submit rodauth.login_button, class: "btn btn-primary" %>
|
||||
</div>
|
||||
<% end %>
|
||||
9
app/views/rodauth/_login_form_footer.html.erb
Normal file
9
app/views/rodauth/_login_form_footer.html.erb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<% unless rodauth.login_form_footer_links.empty? %>
|
||||
<%== rodauth.login_form_footer_links_heading %>
|
||||
|
||||
<ul>
|
||||
<% rodauth.login_form_footer_links.sort.each do |_, link, text| %>
|
||||
<li><%= link_to text, link %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
28
app/views/rodauth/change_password.html.erb
Normal file
28
app/views/rodauth/change_password.html.erb
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<h1>Passwort ändern</h1>
|
||||
<%= form_with url: rodauth.change_password_path, method: :post, data: { turbo: false } do |form| %>
|
||||
<% if rodauth.change_password_requires_password? %>
|
||||
<div class="form-group mb-3">
|
||||
<%= form.label "password", rodauth.password_label, class: "form-label" %>
|
||||
<%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.password_param)}", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
|
||||
<%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "invalid-feedback", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<%= form.label "new-password", rodauth.new_password_label, class: "form-label" %>
|
||||
<%= form.password_field rodauth.new_password_param, value: "", id: "new-password", autocomplete: "new-password", required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.new_password_param)}", aria: ({ invalid: true, describedby: "new-password_error_message" } if rodauth.field_error(rodauth.new_password_param)) %>
|
||||
<%= content_tag(:span, rodauth.field_error(rodauth.new_password_param), class: "invalid-feedback", id: "new-password_error_message") if rodauth.field_error(rodauth.new_password_param) %>
|
||||
</div>
|
||||
|
||||
<% if rodauth.require_password_confirmation? %>
|
||||
<div class="form-group mb-3">
|
||||
<%= form.label "password-confirm", rodauth.password_confirm_label, class: "form-label" %>
|
||||
<%= form.password_field rodauth.password_confirm_param, value: "", id: "password-confirm", autocomplete: "new-password", required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.password_confirm_param)}", aria: ({ invalid: true, describedby: "password-confirm_error_message" } if rodauth.field_error(rodauth.password_confirm_param)) %>
|
||||
<%= content_tag(:span, rodauth.field_error(rodauth.password_confirm_param), class: "invalid-feedback", id: "password-confirm_error_message") if rodauth.field_error(rodauth.password_confirm_param) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<%= form.submit rodauth.change_password_button, class: "btn btn-primary" %>
|
||||
</div>
|
||||
<% end %>
|
||||
3
app/views/rodauth/login.html.erb
Normal file
3
app/views/rodauth/login.html.erb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<%== rodauth.login_form_header %>
|
||||
<%= render "login_form" %>
|
||||
<%== rodauth.login_form_footer %>
|
||||
14
app/views/rodauth/logout.html.erb
Normal file
14
app/views/rodauth/logout.html.erb
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<%= form_with url: rodauth.logout_path, method: :post, data: { turbo: false } do |form| %>
|
||||
<% if rodauth.features.include?(:active_sessions) %>
|
||||
<div class="form-group mb-3">
|
||||
<div class="form-check">
|
||||
<%= form.check_box rodauth.global_logout_param, id: "global-logout", class: "form-check-input", include_hidden: false %>
|
||||
<%= form.label "global-logout", rodauth.global_logout_label, class: "form-check-label" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<%= form.submit rodauth.logout_button, class: "btn btn-warning" %>
|
||||
</div>
|
||||
<% end %>
|
||||
3
app/views/rodauth/multi_phase_login.html.erb
Normal file
3
app/views/rodauth/multi_phase_login.html.erb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<%== rodauth.login_form_header %>
|
||||
<%== rodauth.render_multi_phase_login_forms %>
|
||||
<%== rodauth.login_form_footer %>
|
||||
3
app/views/rodauth/profile.html.erb
Normal file
3
app/views/rodauth/profile.html.erb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<h1><%= current_account.email %></h1>
|
||||
|
||||
<pre><%= JSON.pretty_generate current_account.attributes %></pre>
|
||||
22
app/views/rodauth/remember.html.erb
Normal file
22
app/views/rodauth/remember.html.erb
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<%= form_with url: rodauth.remember_path, method: :post, data: { turbo: false } do |form| %>
|
||||
<fieldset class="form-group mb-3">
|
||||
<div class="form-check">
|
||||
<%= form.radio_button rodauth.remember_param, rodauth.remember_remember_param_value, id: "remember-remember", class: "form-check-input" %>
|
||||
<%= form.label "remember-remember", rodauth.remember_remember_label, class: "form-check-label" %>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<%= form.radio_button rodauth.remember_param, rodauth.remember_forget_param_value, id: "remember-forget", class: "form-check-input" %>
|
||||
<%= form.label "remember-forget", rodauth.remember_forget_label, class: "form-check-label" %>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<%= form.radio_button rodauth.remember_param, rodauth.remember_disable_param_value, id: "remember-disable", class: "form-check-input" %>
|
||||
<%= form.label "remember-disable", rodauth.remember_disable_label, class: "form-check-label" %>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<%= form.submit rodauth.remember_button, class: "btn btn-primary" %>
|
||||
</div>
|
||||
<% end %>
|
||||
Loading…
Add table
Add a link
Reference in a new issue