dq_admin 0.4.0 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f95b7b98accfaff21e3cb9027ccdd1a609a489dd
4
- data.tar.gz: 6e9e72582fcdd274c39718a6200f67aa369ef57c
3
+ metadata.gz: 568b209285749f60aaa20fb2b11f540fefd3c6a7
4
+ data.tar.gz: 5348e12e488305008e96eef16ed78a1d9ea3ebfc
5
5
  SHA512:
6
- metadata.gz: 1ebd0fd676081f308c7a457597a83cf036c10541553badcc2369ae608cc39ffa51cc320e4ee5348330a44431e7e46f04b602be7301bd426a35115307b3e80720
7
- data.tar.gz: a4e51c2863759a9daae107f6666b83d5eb2a746b8b3cfdd3e4ad72aaba966aa2c6df39113a2691751ded7366a417218b859e176b6f3688a4c52508147f2aa0c3
6
+ metadata.gz: 7ba15206f3cf4cf1a268c4021d84e0891587e24217e215e8c8f1371d0be425770a6b1c23fae26432e2a5215bb3794d28f659bc7209381826b3192f024743bafb
7
+ data.tar.gz: bef63cc5e08cfd180b70594df784fcee10df75fa143987441038058026db789fda9fd17d31675e51266639ed333fa72346d271c2973e85a57e1779b996ec309c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dq_admin (0.4.0)
4
+ dq_admin (0.4.2)
5
5
  autoprefixer-rails
6
6
  carrierwave
7
7
  devise
data/README.md CHANGED
@@ -11,21 +11,11 @@ Add this line to your application's Gemfile:
11
11
  ```ruby
12
12
  gem 'dq_admin'
13
13
  rails dq_admin:install:migrations
14
+ rails db:migrate
14
15
  ```
15
16
 
16
- And then execute:
17
- ```bash
18
- $ bundle
17
+ if view path is not correct, add below to your config/application.rb file
19
18
  ```
20
-
21
- Or install it yourself as:
22
- ```bash
23
- $ gem install dq_admin
19
+ config.railties_order = [DqAdmin::Engine, :main_app, :all]
24
20
  ```
25
21
 
26
- ## Contributing
27
- Contribution directions go here.
28
-
29
- ## License
30
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
31
-
@@ -7,11 +7,16 @@ module DqAdmin
7
7
  private
8
8
 
9
9
  def require_admin
10
- return if params['controller'] =~ /^devise\//
10
+ return if is_devise_page?
11
11
  return if user_signed_in?
12
12
  not_found
13
13
  end
14
14
 
15
+ helper_method :is_devise_page?
16
+ def is_devise_page?
17
+ params['controller'] =~ /[sessions|passwords]/
18
+ end
19
+
15
20
  def not_found
16
21
  raise ActionController::RoutingError.new('Not Found')
17
22
  end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DqAdmin
4
+ class SessionsController < ::Devise::SessionsController
5
+ # before_action :configure_sign_in_params, only: [:create]
6
+
7
+ # GET /resource/sign_in
8
+ # def new
9
+ # super
10
+ # end
11
+
12
+ # POST /resource/sign_in
13
+ # def create
14
+ # super
15
+ # end
16
+
17
+ # DELETE /resource/sign_out
18
+ # def destroy
19
+ # super
20
+ # end
21
+
22
+ # protected
23
+
24
+ # If you have extra params to permit, append them to the sanitizer.
25
+ # def configure_sign_in_params
26
+ # devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
27
+ # end
28
+ end
29
+ end
@@ -1,12 +1,4 @@
1
1
  module DqAdmin
2
2
  module ApplicationHelper
3
- def is_devise_page?
4
- params['controller'] =~ /^devise\//
5
- end
6
-
7
- def field_render *args
8
- FieldService.render *args
9
- end
10
-
11
3
  end
12
4
  end
@@ -0,0 +1,35 @@
1
+ <div class="login-box">
2
+ <div class="login-logo">
3
+ <a href="/">Admin</a>
4
+ </div>
5
+ <div class="login-box-body">
6
+ <p class="login-box-msg">Sign in to start your session</p>
7
+
8
+ <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
9
+
10
+ <div class="form-group has-feedback">
11
+ <%= f.email_field :email, autofocus: true, autocomplete: "email", class: "form-control" %>
12
+ <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
13
+ </div>
14
+
15
+ <div class="form-group has-feedback">
16
+ <%= f.password_field :password, autocomplete: "off", class: "form-control" %>
17
+ <span class="glyphicon glyphicon-lock form-control-feedback"></span>
18
+ </div>
19
+
20
+ <% if devise_mapping.rememberable? -%>
21
+ <div class="form-group has-feedback">
22
+ <%= f.check_box :remember_me %>
23
+ <%= f.label :remember_me, style: "font-weight: normal;" %>
24
+ </div>
25
+ <% end -%>
26
+
27
+ <div class="row">
28
+ <div class="col-xs-4">
29
+ <%= f.submit "Sign in", class: "btn btn-primary btn-block btn-flat" %>
30
+ </div>
31
+ </div>
32
+ <% end %>
33
+ </div>
34
+ </div>
35
+
@@ -0,0 +1,25 @@
1
+ <%- if controller_name != 'sessions' %>
2
+ <%= link_to "Log in", new_session_path(resource_name) %><br />
3
+ <% end -%>
4
+
5
+ <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6
+ <%= link_to "Sign up", new_registration_path(resource_name) %><br />
7
+ <% end -%>
8
+
9
+ <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
10
+ <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
11
+ <% end -%>
12
+
13
+ <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14
+ <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
15
+ <% end -%>
16
+
17
+ <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
18
+ <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
19
+ <% end -%>
20
+
21
+ <%- if devise_mapping.omniauthable? %>
22
+ <%- resource_class.omniauth_providers.each do |provider| %>
23
+ <%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider) %><br />
24
+ <% end -%>
25
+ <% end -%>
data/config/routes.rb CHANGED
@@ -2,7 +2,7 @@ DqAdmin::Engine.routes.draw do
2
2
 
3
3
  root 'dashboard#index'
4
4
 
5
- devise_for :users, class_name: "DqAdmin::User", path: '', module: :devise
5
+ devise_for :users, class_name: "DqAdmin::User", path: '', module: :dq_admin
6
6
 
7
7
  resources :fields
8
8
  resources :settings
@@ -1,3 +1,3 @@
1
1
  module DqAdmin
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.2'
3
3
  end
data/lib/dq_admin.rb CHANGED
@@ -1,6 +1,3 @@
1
- require "devise"
2
- require "kaminari"
3
- require 'jquery-rails'
4
1
  require "dq_admin/engine"
5
2
 
6
3
  module DqAdmin
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dq_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - vincent178
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-19 00:00:00.000000000 Z
11
+ date: 2018-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -165,6 +165,7 @@ files:
165
165
  - app/controllers/dq_admin/dashboard_controller.rb
166
166
  - app/controllers/dq_admin/fields_controller.rb
167
167
  - app/controllers/dq_admin/products_controller.rb
168
+ - app/controllers/dq_admin/sessions_controller.rb
168
169
  - app/controllers/dq_admin/users_controller.rb
169
170
  - app/helpers/dq_admin/application_helper.rb
170
171
  - app/helpers/dq_admin/dashboard_helper.rb
@@ -211,6 +212,8 @@ files:
211
212
  - app/views/kaminari/_paginator.html.erb
212
213
  - app/views/kaminari/_prev_page.html.erb
213
214
  - app/views/layouts/dq_admin/application.html.erb
215
+ - app/views/sessions/new.html.erb
216
+ - app/views/shared/_links.html.erb
214
217
  - bin/rails
215
218
  - config/initializers/devise.rb
216
219
  - config/initializers/user.rb