Updated to Rails 7.0.5.1

This commit is contained in:
2023-06-28 15:01:01 +01:00
parent b1009ec4de
commit 31e1311fe6
10 changed files with 171 additions and 141 deletions

View File

@@ -1,26 +1,27 @@
<h2>Log in</h2>
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
<div class="black asap m-l3">
<%= form_for(resource, as: resource_name, url: session_path(resource_name), class: "p-10 border shadow br-b-8 md-w-50pc mx-auto") do |f| %>
<div class="flex flex-column">
<%= f.label :email, class: "my-2" %>
<%= f.email_field :email, autofocus: true, autocomplete: "email", class:"input" %>
</div>
<div class="field">
<%= f.label :password %><br />
<%= f.password_field :password, autocomplete: "current-password" %>
<div class="flex flex-column mt-3">
<%= f.label :password, class: "my-2" %>
<%= f.password_field :password, autocomplete: "current-password", class: "input" %>
</div>
<% if devise_mapping.rememberable? %>
<div class="field">
<%= f.check_box :remember_me %>
<%= f.label :remember_me %>
<div class="flex flex-items-center mt-4">
<%= f.check_box :remember_me, class: "checkbox mr-3" %>
<%= f.label :remember_me, class: "form-check-label" %>
</div>
<% end %>
<div class="actions">
<%= f.submit "Log in" %>
<div class="mt-4">
<%= f.submit "Log in", class: "button" %>
</div>
<% end %>
<% end %>
</div>
<%= render "devise/shared/links" %>

View File

@@ -1,4 +1,4 @@
<h1>Domains</h1>
<h1>Domains <%= link_to "Add new domain",new_domain_path %> </h1>
<div id="domains">
<ul>
@@ -8,4 +8,4 @@
</ul>
</div>
<%= link_to "New domain", new_domain_path %>

View File

@@ -1,22 +1,38 @@
<h1><%= @domain.domain %></h1>
<div class="w-100pc br-8 bg-white-lighter border-blue m-3">
<div class="p-5 br-t-8 bg-gray-darkest">
<h2 class="white fs-m1 fw-400"><%= @domain.domain %> <%= link_to "Edit", edit_domain_path(@domain), class: "inline-block br-3 bw-0 px-3 py-2 fs-s2 bg-blue-darker white pointer hover-opacity-80" %> <%= button_to "Delete", @domain, method: :delete, class: "inline-block button bg-red white focus-red" %></h2>
</div>
<div class="p-5">
<h2>Credentials (<%= @domain.credentials.count %>)</h2>
<ul>
<li><%= link_to "Add #{@domain.domain} email address", new_domain_credential_path(@domain) %>
<% @domain.credentials.each do |credential| %>
<li><%= credential.email %> <%= link_to "Edit", edit_domain_credential_path(@domain,credential) %> | <%= button_to "Destroy this credential", [@domain, credential], method: :delete %> </li>
<% end %>
</ul>
<hr/>
<h2>Virtuals (<%= @domain.virtuals.count %>)</h2>
<ul>
<li><%= link_to "Add #{@domain.domain} virtual email", new_domain_virtual_path(@domain) %></li>
<% @domain.virtuals.each do |virtual| %>
<li><%= virtual.email%> >> <%= virtual.destination%> <%= link_to "Edit", edit_domain_virtual_path(@domain,virtual)%> | <%= button_to "Delete", [@domain, virtual], method: :delete %></li>
<% end %>
</ul>
</div>
<div class="flex justify-between p-5 br-b-8 border-t bc-gray-light">
<button class="inline-block br-3 bw-0 px-3 py-2 fs-s2 bg-blue-darker white pointer hover-opacity-80">Read
More</button>
<button class="inline-block br-3 bw-0 px-3 py-2 fs-s2 bg-gray-lighter black pointer hover-opacity-80">Cancel</button>
</div>
</div>
<h1></h1>
<div>
<div>
<%= link_to "Edit this domain", edit_domain_path(@domain) %> | <%= link_to "Back to domains", domains_path %> | <%= button_to "Destroy this domain", @domain, method: :delete %>
</div>
<h2>Credentials (<%= @domain.credentials.count %>)</h2>
<ul>
<li><%= link_to "Add #{@domain.domain} email address", new_domain_credential_path(@domain) %>
<% @domain.credentials.each do |credential| %>
<li><%= credential.email %> <%= link_to "Edit", edit_domain_credential_path(@domain,credential) %> |
<%= button_to "Destroy this credential", [@domain, credential], method: :delete %> </li>
<% end %>
</ul>
<h2>Virtuals (<%= @domain.virtuals.count %>)</h2>
<ul>
<li><%= link_to "Add #{@domain.domain} virtual email", new_domain_virtual_path(@domain) %></li>
<% @domain.virtuals.each do |virtual| %>
<li><%= virtual.email%> >> <%= virtual.destination%></li>
<% end %>
</ul>

View File

@@ -5,14 +5,41 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<link rel="stylesheet" href="https://minimalistcss.github.io/dist/minimalist.min.css">
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
<%= javascript_importmap_tags %>
</head>
</head>
<body>
<p class="notice"><%= notice %></p><p class="alert"><%= alert %></p>
<nav class="flex flex-column md-flex-row bg-gray-lighter px-4">
<div class="flex justify-between">
<a data-toggle="toggle-nav" data-target="#nav-items" href="#"
class="flex items-center ml-auto md-hidden opacity-70">
<div class="m-3 br-4 border-gray-darkest p-1">
<div class="border-t border-gray-darkest my-1 px-3"></div>
<div class="border-t border-gray-darkest my-1"></div>
<div class="border-t border-gray-darkest my-1"></div>
</div>
</a>
</div>
<div id="nav-items" class="hidden flex sm-w-100pc flex-column md-flex md-flex-row md-justify-start items-center">
<%= link_to "Home", root_path, class: "inline-block fs-s1 mx-3 py-3 gray-darkest no-underline hover-underline" %>
<% if user_signed_in? %><%= button_to "Log out", destroy_user_session_path, method: :delete, class: "button bg-red white focus-red" %><% end %>
</div>
</nav>
<main>
<% if notice %><div class="bg-green-lightest green-darkest px-5 py-3 br-3 border-l bw-6 bc-green"><%= notice %></div><% end %>
<% if alert %><div class="bg-red-lightest red-darkest px-5 py-3 br-3 border-l bw-6 bc-red"><%= alert %></div><% end %>
<%= yield %>
</main>
<footer>
<hr/>
RoR Version <%= Rails.version %> (<%=Rails.env%>) | Ruby <%= "#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}" %> | OS <%= RUBY_PLATFORM %>
</footer>
</body>
</html>

View File

@@ -1,4 +1,4 @@
<%= form_with(model: virtual) do |form| %>
<%= form_with(model: [@domain,virtual]) do |form| %>
<% if virtual.errors.any? %>
<div style="color: red">
<h2><%= pluralize(virtual.errors.count, "error") %> prohibited this virtual from being saved:</h2>

View File

@@ -5,6 +5,5 @@
<br>
<div>
<%= link_to "Show this virtual", @virtual %> |
<%= link_to "Back to virtuals", virtuals_path %>
<%= link_to "Back to #{@domain.domain}", domain_path(@domain) %>
</div>

View File

@@ -1,9 +1,9 @@
<h1>New virtual</h1>
<h1>New virtual for <%= @domain.domain %></h1>
<%= render "form", virtual: @virtual %>
<br>
<div>
<%= link_to "Back to virtuals", virtuals_path %>
<%= link_to "Back to #{@domain.domain}", domain_path(@domain) %>
</div>