Style forms, migrate more styles to Tailwind
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
form {
|
||||
.field_with_errors {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
.layout-signup {
|
||||
label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
input[type=text], input[type=email], input[type=password] {
|
||||
font-size: 1.25rem;
|
||||
padding: 0.5rem 1rem;
|
||||
}
|
||||
|
||||
span.at-sign, span.domain {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.error-msg {
|
||||
color: #bc0101;
|
||||
}
|
||||
|
||||
.accept-terms {
|
||||
margin-top: 2rem;
|
||||
font-size: 0.85rem;
|
||||
line-height: 1.5em;
|
||||
color: #888;
|
||||
}
|
||||
}
|
||||
@@ -142,10 +142,6 @@ main {
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.actions {
|
||||
margin-top: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.grid {
|
||||
|
||||
@@ -4,3 +4,5 @@
|
||||
|
||||
@import "base";
|
||||
@import "buttons";
|
||||
@import "forms";
|
||||
@import "links";
|
||||
|
||||
@@ -1,21 +1,16 @@
|
||||
@layer components {
|
||||
.ks-text-link {
|
||||
@apply text-blue-600;
|
||||
&:hover { @apply underline; }
|
||||
&:visited { @apply text-indigo-600; }
|
||||
&:active { @apply text-red-600; }
|
||||
}
|
||||
|
||||
.btn {
|
||||
@apply font-semibold rounded-md leading-none cursor-pointer
|
||||
transition-colors duration-75 focus:outline-none focus:ring-4;
|
||||
}
|
||||
|
||||
.btn-md {
|
||||
@apply btn;
|
||||
@apply py-2.5 px-5 shadow-md;
|
||||
}
|
||||
|
||||
.btn-sm {
|
||||
@apply btn;
|
||||
@apply py-1 px-2 text-sm shadow-sm;
|
||||
}
|
||||
|
||||
|
||||
17
app/javascript/stylesheets/forms.scss
Normal file
17
app/javascript/stylesheets/forms.scss
Normal file
@@ -0,0 +1,17 @@
|
||||
@layer components {
|
||||
form {
|
||||
input[type=text], input[type=email], input[type=password],
|
||||
input[type=number], select {
|
||||
@apply mt-1 rounded-md bg-gray-100 focus:bg-white
|
||||
border-transparent focus:border-gray-500 focus:ring-0;
|
||||
}
|
||||
|
||||
.field_with_errors {
|
||||
@apply inline-block;
|
||||
}
|
||||
|
||||
.error-msg {
|
||||
@apply text-red-700;
|
||||
}
|
||||
}
|
||||
}
|
||||
14
app/javascript/stylesheets/links.scss
Normal file
14
app/javascript/stylesheets/links.scss
Normal file
@@ -0,0 +1,14 @@
|
||||
@layer components {
|
||||
.ks-text-link {
|
||||
@apply text-blue-600;
|
||||
&:hover { @apply underline; }
|
||||
&:visited { @apply text-indigo-600; }
|
||||
&:active { @apply text-red-600; }
|
||||
}
|
||||
|
||||
.devise-links {
|
||||
a {
|
||||
@apply ks-text-link;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,5 +17,7 @@ module.exports = {
|
||||
variants: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [],
|
||||
plugins: [
|
||||
require('@tailwindcss/forms')
|
||||
],
|
||||
}
|
||||
|
||||
@@ -52,9 +52,7 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<p>
|
||||
<%= form.submit class: 'btn btn-md btn-blue' %>
|
||||
</p>
|
||||
</div>
|
||||
<p class="mt-8">
|
||||
<%= form.submit class: 'btn-md btn-blue' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<%= render 'form', donation: @donation, url: admin_donation_path(@donation) %>
|
||||
|
||||
<p class="actions">
|
||||
<p class="mt-8">
|
||||
<%= link_to 'Show', admin_donation_path(@donation), class: 'ks-text-link' %> |
|
||||
<%= link_to 'Back', admin_donations_path, class: 'ks-text-link' %>
|
||||
<p>
|
||||
|
||||
@@ -36,6 +36,6 @@
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<p class="actions">
|
||||
<%= link_to 'Record an out-of-system donation', new_admin_donation_path, class: 'btn btn-md btn-gray' %>
|
||||
<p class="mt-12">
|
||||
<%= link_to 'Record an out-of-system donation', new_admin_donation_path, class: 'btn-md btn-gray' %>
|
||||
</p>
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
<%= render 'form', donation: @donation, url: admin_donations_path %>
|
||||
|
||||
<p class="actions">
|
||||
<%= link_to 'Back', admin_donations_path %>
|
||||
<p class="mt-8">
|
||||
<%= link_to 'Back', admin_donations_path, class: 'ks-text-link' %>
|
||||
</p>
|
||||
|
||||
@@ -30,5 +30,7 @@
|
||||
<%= @donation.paid_at %>
|
||||
</p>
|
||||
|
||||
<%= link_to 'Edit', edit_admin_donation_path(@donation), class: 'ks-text-link' %> |
|
||||
<%= link_to 'Back', admin_donations_path, class: 'ks-text-link' %>
|
||||
<p class="mt-8">
|
||||
<%= link_to 'Edit', edit_admin_donation_path(@donation), class: 'ks-text-link' %> |
|
||||
<%= link_to 'Back', admin_donations_path, class: 'ks-text-link' %>
|
||||
</p>
|
||||
|
||||
@@ -2,19 +2,13 @@
|
||||
|
||||
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
|
||||
<%= render "devise/shared/error_messages", resource: resource %>
|
||||
|
||||
<div class="field">
|
||||
<p>
|
||||
<%= f.label :email, 'Email address' %><br />
|
||||
<%= f.email_field :email, required: true, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<p>
|
||||
<%= f.submit "Resend confirmation instructions" %>
|
||||
</p>
|
||||
</div>
|
||||
<p>
|
||||
<%= f.label :email, 'Email address', class: 'block mb-1' %>
|
||||
<%= f.email_field :email, required: true, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
|
||||
</p>
|
||||
<p class="mt-8">
|
||||
<%= f.submit "Resend confirmation instructions", class: 'btn-md btn-blue' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= render "devise/shared/links" %>
|
||||
|
||||
@@ -4,22 +4,24 @@
|
||||
<%= render "devise/shared/error_messages", resource: resource %>
|
||||
<%= f.hidden_field :reset_password_token %>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :password, "New password" %><br />
|
||||
<% if @minimum_password_length %>
|
||||
<em>(<%= @minimum_password_length %> characters minimum)</em><br />
|
||||
<% end %>
|
||||
<p class="mb-1">
|
||||
<%= f.label :password, "New password" %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.password_field :password, autofocus: true, autocomplete: "new-password" %>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :password_confirmation, "Confirm new password" %><br />
|
||||
<% if @minimum_password_length %>
|
||||
<br><em class="text-sm text-gray-500">(<%= @minimum_password_length %> characters minimum)</em>
|
||||
<% end %>
|
||||
</p>
|
||||
<p class="mb-1">
|
||||
<%= f.label :password_confirmation, "Confirm new password" %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit "Change my password" %>
|
||||
</div>
|
||||
</p>
|
||||
<p class="mt-8">
|
||||
<%= f.submit "Change my password", class: 'btn-md btn-blue' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= render "devise/shared/links" %>
|
||||
|
||||
@@ -2,26 +2,17 @@
|
||||
|
||||
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
|
||||
<%= render "devise/shared/error_messages", resource: resource %>
|
||||
|
||||
<div class="field">
|
||||
<p>
|
||||
<%= f.label :cn, 'User' %><br />
|
||||
<%= f.text_field :cn, autofocus: true, autocomplete: "username", required: true %> @ kosmos.org
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<p>
|
||||
<%= f.label :email, 'Email address' %><br />
|
||||
<%= f.email_field :email, autocomplete: "email", required: true %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<p>
|
||||
<%= f.submit "Send me reset password instructions" %>
|
||||
</p>
|
||||
</div>
|
||||
<p>
|
||||
<%= f.label :cn, 'User', class: 'block' %>
|
||||
<%= f.text_field :cn, autofocus: true, autocomplete: "username", required: true %> @ kosmos.org
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :email, 'Email address', class: 'block' %>
|
||||
<%= f.email_field :email, autocomplete: "email", required: true %>
|
||||
</p>
|
||||
<p class="mt-8">
|
||||
<%= f.submit "Send me reset password instructions", class: 'btn-md btn-blue' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= render "devise/shared/links" %>
|
||||
|
||||
@@ -31,9 +31,9 @@
|
||||
<%= f.password_field :current_password, autocomplete: "current-password" %>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit "Update" %>
|
||||
</div>
|
||||
<p class="mt-8">
|
||||
<%= f.submit "Update", class: 'btn-md btn-blue' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<h3>Cancel my account</h3>
|
||||
|
||||
@@ -2,24 +2,17 @@
|
||||
|
||||
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
|
||||
<%= render "devise/shared/error_messages", resource: resource %>
|
||||
|
||||
<div class="field">
|
||||
<p>
|
||||
<%= f.label :cn, 'User' %><br />
|
||||
<%= f.text_field :cn, autofocus: true, autocomplete: "username" %> @ kosmos.org
|
||||
</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<p>
|
||||
<%= f.label :password %><br />
|
||||
<%= f.password_field :password, autocomplete: "current-password" %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<p>
|
||||
<%= f.submit "Log in" %>
|
||||
</p>
|
||||
</div>
|
||||
<p>
|
||||
<%= f.label :cn, 'User', class: 'block' %>
|
||||
<%= f.text_field :cn, autofocus: true, autocomplete: "username" %> @ kosmos.org
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :password, class: 'block' %>
|
||||
<%= f.password_field :password, autocomplete: "current-password" %>
|
||||
</p>
|
||||
<p class="mt-8">
|
||||
<%= f.submit "Log in", class: 'btn-md btn-blue' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= render "devise/shared/links" %>
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
<div class="devise-links">
|
||||
<div class="devise-links mt-8 text-sm">
|
||||
<%- if controller_name != 'sessions' %>
|
||||
<p>
|
||||
<p class="mb-1.5">
|
||||
<%= link_to "Log in", new_session_path(resource_name) %><br />
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
|
||||
<p>
|
||||
<p class="mb-1.5">
|
||||
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
||||
<p>
|
||||
<p class="mb-1.5">
|
||||
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
||||
<p>
|
||||
<p class="mb-1.5">
|
||||
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
@@ -2,15 +2,13 @@
|
||||
|
||||
<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
|
||||
<%= render "devise/shared/error_messages", resource: resource %>
|
||||
|
||||
<div class="field">
|
||||
<p>
|
||||
<%= f.label :email %><br />
|
||||
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit "Resend unlock instructions" %>
|
||||
</div>
|
||||
</p>
|
||||
<p class="mt-8">
|
||||
<%= f.submit "Resend unlock instructions", class: 'btn-md btn-blue' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= render "devise/shared/links" %>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<h3>Password change</h3>
|
||||
<p>
|
||||
<%= form_with(url: settings_reset_password_path, method: :post) do %>
|
||||
<%= submit_tag("Send me a password reset link", class: 'btn btn-md btn-gray') %>
|
||||
<%= submit_tag("Send me a password reset link", class: 'btn-md btn-gray') %>
|
||||
<% end %>
|
||||
</p>
|
||||
</section>
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
This invitation can only be used once, and sign-up is currently only possible
|
||||
by invitation. Seems like you have good friends!
|
||||
</p>
|
||||
<p>
|
||||
<%= link_to "Get started", signup_steps_path(1), class: "next-step" %>
|
||||
<p class="mt-12">
|
||||
<%= link_to "Get started", signup_steps_path(1), class: "btn btn-md btn-blue" %>
|
||||
</p>
|
||||
|
||||
@@ -2,60 +2,53 @@
|
||||
<% when 1 %>
|
||||
<h2>Choose a username</h2>
|
||||
<%= form_for @user, :url => signup_validate_url do |f| %>
|
||||
<div class="field">
|
||||
<p>
|
||||
<%= f.label :cn, 'Username' %><br />
|
||||
<%= f.text_field :cn, autofocus: true, autocomplete: "username" %>
|
||||
<span class="at-sign">@</span>
|
||||
<span class="domain">kosmos.org</span>
|
||||
</p>
|
||||
<% if @validation_error.present? %>
|
||||
<p class="error-msg">Username <%= @validation_error %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<p><%= f.submit "Continue" %></p>
|
||||
</div>
|
||||
<p>
|
||||
<%= f.label :cn, 'Username', class: 'hidden' %>
|
||||
<%= f.text_field :cn, autofocus: true, autocomplete: "username",
|
||||
class: 'text-xl' %>
|
||||
<span class="text-xl ml-1">@</span>
|
||||
<span class="text-xl">kosmos.org</span>
|
||||
</p>
|
||||
<% if @validation_error.present? %>
|
||||
<p class="error-msg">Username <%= @validation_error %></p>
|
||||
<% end %>
|
||||
<p class="mt-12">
|
||||
<%= f.submit "Continue", class: 'btn btn-md btn-blue' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<% when 2 %>
|
||||
<h2>What's your email?</h2>
|
||||
<%= form_for @user, :url => signup_validate_url do |f| %>
|
||||
<div class="field">
|
||||
<p>
|
||||
<%= f.label :email, 'Email address' %><br />
|
||||
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
||||
</p>
|
||||
<% if @validation_error.present? %>
|
||||
<p class="error-msg">Email <%= @validation_error %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<p><%= f.submit "Continue" %></p>
|
||||
</div>
|
||||
<p>
|
||||
<%= f.label :email, 'Email address', class: 'hidden' %>
|
||||
<%= f.email_field :email, autofocus: true, autocomplete: 'email', class: 'text-xl' %>
|
||||
</p>
|
||||
<% if @validation_error.present? %>
|
||||
<p class="error-msg">Email <%= @validation_error %></p>
|
||||
<% end %>
|
||||
<p class="mt-12">
|
||||
<%= f.submit "Continue", class: 'btn btn-md btn-blue' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<% when 3 %>
|
||||
<h2>Choose a password</h2>
|
||||
|
||||
<%= form_for @user, :url => signup_validate_url do |f| %>
|
||||
<div class="field">
|
||||
<p>
|
||||
<%= f.label :password, 'Password' %><br />
|
||||
<%= f.password_field :password, autofocus: true %>
|
||||
</p>
|
||||
<% if @validation_error.present? %>
|
||||
<p class="error-msg">Password <%= @validation_error %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<p class="accept-terms">
|
||||
<small>
|
||||
By clicking the button below, you accept our future Terms of Service
|
||||
and Privacy Policy. Don't worry, they will be excellent!
|
||||
</small>
|
||||
<p>
|
||||
<%= f.label :password, 'Password', class: 'hidden' %>
|
||||
<%= f.password_field :password, autofocus: true, class: 'text-xl' %>
|
||||
</p>
|
||||
<% if @validation_error.present? %>
|
||||
<p class="error-msg">Password <%= @validation_error %></p>
|
||||
<% end %>
|
||||
<p class="mt-8 text-sm text-gray-500">
|
||||
By clicking the button below, you accept our future Terms of Service
|
||||
and Privacy Policy. Don't worry, they will be excellent!
|
||||
</p>
|
||||
<p class="mt-8">
|
||||
<%= f.submit "Create account", class: 'btn-md btn-blue' %>
|
||||
</p>
|
||||
<div class="actions">
|
||||
<p><%= f.submit "Create account" %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user