five-two-nw-olivander 0.1.2.23 → 0.1.2.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/olivander/application_helper.rb +29 -0
- data/app/inputs/custom_form_builder.rb +43 -0
- data/app/views/application/_form.html.haml +1 -1
- data/app/views/application/index.json.jbuilder +4 -3
- data/app/views/devise/confirmations/new.html.erb +20 -0
- data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/devise/mailer/email_changed.html.erb +7 -0
- data/app/views/devise/mailer/password_change.html.erb +3 -0
- data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/devise/passwords/edit.html.erb +27 -0
- data/app/views/devise/passwords/new.html.erb +18 -0
- data/app/views/devise/registrations/edit.html.erb +35 -0
- data/app/views/devise/registrations/new.html.erb +25 -0
- data/app/views/devise/sessions/new.html.erb +20 -0
- data/app/views/devise/shared/_error_messages.html.erb +15 -0
- data/app/views/devise/shared/_links.html.haml +19 -0
- data/app/views/devise/unlocks/new.html.erb +19 -0
- data/app/views/layouts/olivander/adminlte/_head.html.haml +1 -0
- data/app/views/layouts/olivander/adminlte/_sidebar.html.haml +2 -2
- data/app/views/layouts/olivander/adminlte/login.html.haml +7 -16
- data/config/initializers/simple_form.rb +57 -10
- data/lib/olivander/application_context.rb +1 -1
- data/lib/olivander/version.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c84745db767e205f4aec15220fedbd5dd8d4dc3dc973e4a24624e51c59301443
|
4
|
+
data.tar.gz: 635805ef6e29cc864c36afc572811a452205aa947dbcce7bbac914cbb3740ecb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4f3cd18eccd926ef5fbc6e555ffa3450713f1c91647accfe6625d51df3ec2ccf0c11588c6d68f2a441d89087af319604916d5f9cc1368d45c7362f219541522
|
7
|
+
data.tar.gz: 9d9c6ccc4a03f07d14c98f9f20ba3fcc9c5f56cc782f9c7ffd2632bedcf38773cd9a1c981614e184dbefb4d1baea4155f5159827b4789e5bdad54ed3692e9ddf
|
@@ -84,5 +84,34 @@ module Olivander
|
|
84
84
|
|
85
85
|
sym.to_s.titleize
|
86
86
|
end
|
87
|
+
|
88
|
+
def is_dev_environment?
|
89
|
+
sidebar_context_suffix != 'production'
|
90
|
+
end
|
91
|
+
|
92
|
+
def sidebar_context_name
|
93
|
+
[@context.name, sidebar_context_suffix&.upcase].reject(&:blank?).join(' ')
|
94
|
+
end
|
95
|
+
|
96
|
+
def sidebar_context_suffix
|
97
|
+
suffix = nil
|
98
|
+
suffix ||= ENV['CLIENT_ENVIRONMENT']
|
99
|
+
parts = request.host.split('.')
|
100
|
+
suffix ||= parts.first.split('-').last.downcase if request.host.include?('-')
|
101
|
+
suffix ||= 'local' if %w[localhost test].include?(parts.last.downcase)
|
102
|
+
suffix ||= 'production'
|
103
|
+
suffix
|
104
|
+
end
|
105
|
+
|
106
|
+
def sidebar_background_class
|
107
|
+
@context.sidebar_background_class ||
|
108
|
+
ENV['SIDEBAR_BACKGROUND_CLASS'] ||
|
109
|
+
(is_dev_environment? ? 'bg-danger' : 'bg-info')
|
110
|
+
end
|
111
|
+
|
112
|
+
def favicon_link
|
113
|
+
favicon_path = is_dev_environment? ? '/images/favicon-dev.png' : '/images/favicon.ico'
|
114
|
+
favicon_link_tag(image_path(favicon_path))
|
115
|
+
end
|
87
116
|
end
|
88
117
|
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
class CustomFormBuilder < SimpleForm::FormBuilder
|
2
|
+
def initialize(*)
|
3
|
+
Rails.logger.warn "instantiating this class"
|
4
|
+
super
|
5
|
+
end
|
6
|
+
|
7
|
+
def association(association, options = {}, &block)
|
8
|
+
Rails.logger.warn "making an association"
|
9
|
+
resolve_custom_input_association(association, options)
|
10
|
+
super(association, options, &block)
|
11
|
+
end
|
12
|
+
|
13
|
+
def resolve_custom_input_association(association, options)
|
14
|
+
return if options[:as].present?
|
15
|
+
|
16
|
+
[
|
17
|
+
"#{object.class.name.demodulize}#{association.to_s.titleize}", "#{association.to_s.titleize}"
|
18
|
+
].each do |key|
|
19
|
+
Rails.logger.debug "trying for #{key}"
|
20
|
+
next unless attempt_mapping_with_custom_namespace("#{key}Input").present?
|
21
|
+
|
22
|
+
options[:as] = key.to_sym
|
23
|
+
break
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def fetch_association_collection(reflection, options)
|
30
|
+
Rails.logger.warn "we got into here"
|
31
|
+
|
32
|
+
options_method = "options_for_#{reflection.name}".to_sym
|
33
|
+
if object.respond_to?(options_method) then
|
34
|
+
Rails.logger.info "using specific method"
|
35
|
+
options.fetch(:collection) do
|
36
|
+
object.send(options_method)
|
37
|
+
end
|
38
|
+
else
|
39
|
+
Rails.logger.info "doing it old school"
|
40
|
+
super(reflection, options)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
resource = (@_effective_resource || Effective::Resource.new(controller_path))
|
2
|
+
@resources = instance_variable_get('@' + resource.plural_name)
|
3
|
+
|
4
|
+
json.array! @resources
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<h2>Resend confirmation instructions</h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
<%= f.full_error :confirmation_token %>
|
6
|
+
|
7
|
+
<div class="form-inputs">
|
8
|
+
<%= f.input :email,
|
9
|
+
required: true,
|
10
|
+
autofocus: true,
|
11
|
+
value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email),
|
12
|
+
input_html: { autocomplete: "email" } %>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div class="form-actions">
|
16
|
+
<%= f.button :submit, "Resend confirmation instructions" %>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
<%= render "devise/shared/links" %>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<p>Hello <%= @email %>!</p>
|
2
|
+
|
3
|
+
<% if @resource.try(:unconfirmed_email?) %>
|
4
|
+
<p>We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.</p>
|
5
|
+
<% else %>
|
6
|
+
<p>We're contacting you to notify you that your email has been changed to <%= @resource.email %>.</p>
|
7
|
+
<% end %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<p>Hello <%= @resource.email %>!</p>
|
2
|
+
|
3
|
+
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
|
4
|
+
|
5
|
+
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
|
6
|
+
|
7
|
+
<p>If you didn't request this, please ignore this email.</p>
|
8
|
+
<p>Your password won't change until you access the link above and create a new one.</p>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<p>Hello <%= @resource.email %>!</p>
|
2
|
+
|
3
|
+
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
|
4
|
+
|
5
|
+
<p>Click the link below to unlock your account:</p>
|
6
|
+
|
7
|
+
<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<h2>Change your password</h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
|
6
|
+
<%= f.input :reset_password_token, as: :hidden %>
|
7
|
+
<%= f.full_error :reset_password_token %>
|
8
|
+
|
9
|
+
<div class="form-inputs">
|
10
|
+
<%= f.input :password,
|
11
|
+
label: "New password",
|
12
|
+
required: true,
|
13
|
+
autofocus: true,
|
14
|
+
hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length),
|
15
|
+
input_html: { autocomplete: "new-password" } %>
|
16
|
+
<%= f.input :password_confirmation,
|
17
|
+
label: "Confirm your new password",
|
18
|
+
required: true,
|
19
|
+
input_html: { autocomplete: "new-password" } %>
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<div class="form-actions">
|
23
|
+
<%= f.button :submit, "Change my password" %>
|
24
|
+
</div>
|
25
|
+
<% end %>
|
26
|
+
|
27
|
+
<%= render "devise/shared/links" %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<h2>Forgot your password?</h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
|
6
|
+
<div class="form-inputs">
|
7
|
+
<%= f.input :email,
|
8
|
+
required: true,
|
9
|
+
autofocus: true,
|
10
|
+
input_html: { autocomplete: "email" } %>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<div class="form-actions">
|
14
|
+
<%= f.button :submit, "Send me reset password instructions" %>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<%= render "devise/shared/links" %>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<h2>Edit <%= resource_name.to_s.humanize %></h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
|
6
|
+
<div class="form-inputs">
|
7
|
+
<%= f.input :email, required: true, autofocus: true %>
|
8
|
+
|
9
|
+
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
10
|
+
<p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<%= f.input :password,
|
14
|
+
hint: "leave it blank if you don't want to change it",
|
15
|
+
required: false,
|
16
|
+
input_html: { autocomplete: "new-password" } %>
|
17
|
+
<%= f.input :password_confirmation,
|
18
|
+
required: false,
|
19
|
+
input_html: { autocomplete: "new-password" } %>
|
20
|
+
<%= f.input :current_password,
|
21
|
+
hint: "we need your current password to confirm your changes",
|
22
|
+
required: true,
|
23
|
+
input_html: { autocomplete: "current-password" } %>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<div class="form-actions">
|
27
|
+
<%= f.button :submit, "Update" %>
|
28
|
+
</div>
|
29
|
+
<% end %>
|
30
|
+
|
31
|
+
<h3>Cancel my account</h3>
|
32
|
+
|
33
|
+
<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p>
|
34
|
+
|
35
|
+
<%= link_to "Back", :back %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<h2>Sign up</h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
|
6
|
+
<div class="form-inputs">
|
7
|
+
<%= f.input :email,
|
8
|
+
required: true,
|
9
|
+
autofocus: true,
|
10
|
+
input_html: { autocomplete: "email" }%>
|
11
|
+
<%= f.input :password,
|
12
|
+
required: true,
|
13
|
+
hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length),
|
14
|
+
input_html: { autocomplete: "new-password" } %>
|
15
|
+
<%= f.input :password_confirmation,
|
16
|
+
required: true,
|
17
|
+
input_html: { autocomplete: "new-password" } %>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div class="form-actions">
|
21
|
+
<%= f.button :submit, "Sign up" %>
|
22
|
+
</div>
|
23
|
+
<% end %>
|
24
|
+
|
25
|
+
<%= render "devise/shared/links" %>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<h2>Log in</h2>
|
2
|
+
;lkjasd;lkjasdf
|
3
|
+
<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
|
4
|
+
<div class="form-inputs">
|
5
|
+
<%= f.input :email,
|
6
|
+
required: false,
|
7
|
+
autofocus: true,
|
8
|
+
input_html: { autocomplete: "email" } %>
|
9
|
+
<%= f.input :password,
|
10
|
+
required: false,
|
11
|
+
input_html: { autocomplete: "current-password" } %>
|
12
|
+
<%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div class="form-actions">
|
16
|
+
<%= f.button :submit, "Log in" %>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
<%= render "devise/shared/links" %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<% if resource.errors.any? %>
|
2
|
+
<div id="error_explanation">
|
3
|
+
<h2>
|
4
|
+
<%= I18n.t("errors.messages.not_saved",
|
5
|
+
count: resource.errors.count,
|
6
|
+
resource: resource.class.model_name.human.downcase)
|
7
|
+
%>
|
8
|
+
</h2>
|
9
|
+
<ul>
|
10
|
+
<% resource.errors.full_messages.each do |message| %>
|
11
|
+
<li><%= message %></li>
|
12
|
+
<% end %>
|
13
|
+
</ul>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
- if controller_name != 'sessions'
|
2
|
+
= link_to "Log in", new_session_path(resource_name)
|
3
|
+
%br/
|
4
|
+
- if devise_mapping.registerable? && controller_name != 'registrations'
|
5
|
+
%p.mb-0
|
6
|
+
= link_to "Sign up", new_registration_path(resource_name)
|
7
|
+
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
|
8
|
+
%p.mb-1
|
9
|
+
= link_to "I forgot my password", new_password_path(resource_name)
|
10
|
+
- if devise_mapping.confirmable? && controller_name != 'confirmations'
|
11
|
+
= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name)
|
12
|
+
%br/
|
13
|
+
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
|
14
|
+
= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name)
|
15
|
+
%br/
|
16
|
+
- if devise_mapping.omniauthable?
|
17
|
+
- resource_class.omniauth_providers.each do |provider|
|
18
|
+
= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), method: :post
|
19
|
+
%br/
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<h2>Resend unlock instructions</h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
<%= f.full_error :unlock_token %>
|
6
|
+
|
7
|
+
<div class="form-inputs">
|
8
|
+
<%= f.input :email,
|
9
|
+
required: true,
|
10
|
+
autofocus: true,
|
11
|
+
input_html: { autocomplete: "email" } %>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<div class="form-actions">
|
15
|
+
<%= f.button :submit, "Resend unlock instructions" %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<%= render "devise/shared/links" %>
|
@@ -2,6 +2,7 @@
|
|
2
2
|
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
|
3
3
|
%title= page_title
|
4
4
|
%meta{:content => "width=device-width,initial-scale=1", :name => "viewport"}/
|
5
|
+
= favicon_link
|
5
6
|
= csrf_meta_tags
|
6
7
|
= csp_meta_tag
|
7
8
|
%link{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback' }
|
@@ -1,9 +1,9 @@
|
|
1
1
|
/ Main Sidebar Container
|
2
2
|
%aside.main-sidebar.sidebar-dark-primary.elevation-4{ data: { controller: 'left-nav' }}
|
3
3
|
/ Brand Logo
|
4
|
-
%a.brand-link
|
4
|
+
%a.brand-link{ href: "/", class: sidebar_background_class }
|
5
5
|
%img.brand-image.img-circle.elevation-3{:alt => @context.logo.alt, :src => @context.logo.url, :style => "opacity: .8"}/
|
6
|
-
%span.brand-text.font-weight-light=
|
6
|
+
%span.brand-text.font-weight-light= sidebar_context_name
|
7
7
|
/ Sidebar
|
8
8
|
.sidebar
|
9
9
|
/ Sidebar user panel (optional)
|
@@ -3,25 +3,16 @@
|
|
3
3
|
= render partial: 'layouts/olivander/adminlte/head'
|
4
4
|
%body.hold-transition.login-page
|
5
5
|
.login-box
|
6
|
-
|
7
|
-
.
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
-# .login-logo
|
7
|
+
-# %img.brand-image.img-circle.elevation-3{:alt => @context.logo.alt, :src => @context.logo.url, :style => "opacity: .8"}
|
8
|
+
.card
|
9
|
+
.card-header.text-center{ class: sidebar_background_class }
|
10
|
+
%a.h1{ href: '/' }
|
11
|
+
%b= sidebar_context_name
|
11
12
|
.card-body
|
12
13
|
%p.login-box-msg Sign in to start your session
|
13
14
|
= render partial: 'layouts/olivander/adminlte/login_flashes'
|
14
15
|
= yield
|
15
16
|
.card-footer
|
16
17
|
%p.small
|
17
|
-
|
18
|
-
some form of notice here
|
19
|
-
some form of notice here
|
20
|
-
some form of notice here
|
21
|
-
some form of notice here
|
22
|
-
some form of notice here
|
23
|
-
some form of notice here
|
24
|
-
some form of notice here
|
25
|
-
some form of notice here
|
26
|
-
some form of notice here
|
27
|
-
some form of notice here
|
18
|
+
|
@@ -70,16 +70,49 @@ SimpleForm.setup do |config|
|
|
70
70
|
config.wrappers :checkbox, class: "form-check",
|
71
71
|
hint_class: :field_with_hint, error_class: :field_with_errors, valid_class: :field_without_errors do |b|
|
72
72
|
b.use :html5
|
73
|
-
b.use :placeholder
|
74
|
-
b.optional :maxlength
|
75
|
-
b.optional :minlength
|
76
|
-
b.optional :pattern
|
77
|
-
b.optional :min_max
|
78
73
|
b.optional :readonly
|
79
|
-
b.
|
80
|
-
|
81
|
-
|
82
|
-
b.use :
|
74
|
+
b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba|
|
75
|
+
ba.use :label_text
|
76
|
+
end
|
77
|
+
b.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid'
|
78
|
+
b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
|
79
|
+
b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
|
80
|
+
end
|
81
|
+
|
82
|
+
# vertical input for boolean
|
83
|
+
config.wrappers :vertical_boolean, tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
|
84
|
+
b.use :html5
|
85
|
+
b.optional :readonly
|
86
|
+
b.wrapper :form_check_wrapper, tag: 'div', class: 'form-check' do |bb|
|
87
|
+
bb.use :input, class: 'form-check-input' #, error_class: 'is-invalid', valid_class: 'is-valid'
|
88
|
+
bb.use :label, class: 'form-check-label'
|
89
|
+
bb.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' }
|
90
|
+
bb.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
# vertical input for radio buttons and check boxes
|
95
|
+
config.wrappers :vertical_collection, item_wrapper_class: 'form-check', item_label_class: 'form-check-label', tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
|
96
|
+
b.use :html5
|
97
|
+
b.optional :readonly
|
98
|
+
b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba|
|
99
|
+
ba.use :label_text
|
100
|
+
end
|
101
|
+
b.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid'
|
102
|
+
b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
|
103
|
+
b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
|
104
|
+
end
|
105
|
+
|
106
|
+
# vertical input for inline radio buttons and check boxes
|
107
|
+
config.wrappers :vertical_collection_inline, item_wrapper_class: 'form-check form-check-inline', item_label_class: 'form-check-label', tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
|
108
|
+
b.use :html5
|
109
|
+
b.optional :readonly
|
110
|
+
b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba|
|
111
|
+
ba.use :label_text
|
112
|
+
end
|
113
|
+
b.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid'
|
114
|
+
b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
|
115
|
+
b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
|
83
116
|
end
|
84
117
|
|
85
118
|
config.wrappers :switch, class: "custom-control custom-switch",
|
@@ -170,10 +203,24 @@ SimpleForm.setup do |config|
|
|
170
203
|
# Custom wrappers for input types. This should be a hash containing an input
|
171
204
|
# type as key and the wrapper that will be used for all inputs with specified type.
|
172
205
|
# config.wrapper_mappings = { string: :prepend }
|
206
|
+
config.wrapper_mappings = {
|
207
|
+
boolean: :vertical_boolean,
|
208
|
+
check_boxes: :check_box,
|
209
|
+
# date: :horizontal_multi_select,
|
210
|
+
# datetime: :horizontal_multi_select,
|
211
|
+
# file: :horizontal_file,
|
212
|
+
# radio_buttons: :horizontal_collection,
|
213
|
+
# range: :horizontal_range,
|
214
|
+
# time: :horizontal_multi_select
|
215
|
+
}
|
173
216
|
|
174
217
|
# Namespaces where SimpleForm should look for custom input classes that
|
175
218
|
# override default inputs.
|
176
|
-
|
219
|
+
Dir.glob('app/inputs/**/')
|
220
|
+
.map{ |x| x.gsub('app/inputs/', '').split('/').reject(&:blank?).join('/').camelize }
|
221
|
+
.reject(&:blank?).each do |d|
|
222
|
+
config.custom_inputs_namespaces << d
|
223
|
+
end
|
177
224
|
|
178
225
|
# Default priority for time_zone inputs.
|
179
226
|
# config.time_zone_priority = nil
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Olivander
|
2
2
|
class ApplicationContext
|
3
|
-
attr_accessor :name, :logo, :company, :menu_items, :route_builder, :sign_out_path
|
3
|
+
attr_accessor :name, :logo, :company, :menu_items, :route_builder, :sign_out_path, :sidebar_background_class
|
4
4
|
|
5
5
|
def self.default
|
6
6
|
ctx = ApplicationContext.new
|
data/lib/olivander/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: five-two-nw-olivander
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.2.
|
4
|
+
version: 0.1.2.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Dennis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chartkick
|
@@ -194,6 +194,7 @@ files:
|
|
194
194
|
- app/controllers/olivander/application_controller.rb
|
195
195
|
- app/datatables/olivander/datatable.rb
|
196
196
|
- app/helpers/olivander/application_helper.rb
|
197
|
+
- app/inputs/custom_form_builder.rb
|
197
198
|
- app/inputs/date_time_input.rb
|
198
199
|
- app/jobs/olivander/application_job.rb
|
199
200
|
- app/mailers/olivander/application_mailer.rb
|
@@ -205,6 +206,20 @@ files:
|
|
205
206
|
- app/views/application/index.json.jbuilder
|
206
207
|
- app/views/application/new.html.haml
|
207
208
|
- app/views/application/show.html.haml
|
209
|
+
- app/views/devise/confirmations/new.html.erb
|
210
|
+
- app/views/devise/mailer/confirmation_instructions.html.erb
|
211
|
+
- app/views/devise/mailer/email_changed.html.erb
|
212
|
+
- app/views/devise/mailer/password_change.html.erb
|
213
|
+
- app/views/devise/mailer/reset_password_instructions.html.erb
|
214
|
+
- app/views/devise/mailer/unlock_instructions.html.erb
|
215
|
+
- app/views/devise/passwords/edit.html.erb
|
216
|
+
- app/views/devise/passwords/new.html.erb
|
217
|
+
- app/views/devise/registrations/edit.html.erb
|
218
|
+
- app/views/devise/registrations/new.html.erb
|
219
|
+
- app/views/devise/sessions/new.html.erb
|
220
|
+
- app/views/devise/shared/_error_messages.html.erb
|
221
|
+
- app/views/devise/shared/_links.html.haml
|
222
|
+
- app/views/devise/unlocks/new.html.erb
|
208
223
|
- app/views/effective/resource/_actions_dropleft.html.haml
|
209
224
|
- app/views/layouts/olivander/adminlte/_content.html.haml
|
210
225
|
- app/views/layouts/olivander/adminlte/_content_kanban.html.haml
|