admin_generator 0.1.0 → 0.1.1

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: 03e88b869b80a4bd750a6e538e3d63f2e505fce4
4
- data.tar.gz: 0bdb127e846b766d320dbb52f5bd809d1a2a1213
3
+ metadata.gz: 11ddec8c42e0decb5c696ac2d94ae6104144907b
4
+ data.tar.gz: b530fa086e7c1213dba28fe20b87961ef9df4c6f
5
5
  SHA512:
6
- metadata.gz: 2a9c2302d2c6606b22baade89d23964060a130a68357d26229905a1eb77b3ac74a902cedb00b74dc8cdf0584a09f1c610b8c20d5bb8622f38a9d5579a8c01028
7
- data.tar.gz: d852363896128483463429e741cb32546cbb90f19479a13b31943f10dd2a596e3caefd30d66d973b0427b5498f208ed157fa9e692f4ab6a15cd36dd26b3ea37d
6
+ metadata.gz: af01bf0fe2246a9bb808fa122487b76ff1ce7a206d104427a11b0b911883cbb06ce776fbd271ea93de3682697ca04ccac9f89967e67e60d6ca83f06e842a1ad9
7
+ data.tar.gz: 83d11b3368e5747622c55902231fc10de09406ca6c5a412acdbac9e65d167a58243901c5ce3152a44e59ab1b5e7e5b112b91402991de6cbe8f3ddef98a275507
@@ -14,7 +14,14 @@ module AdminGenerator
14
14
  generate "sorcery:install"
15
15
  generate "sorcery:install", "activity_logging brute_force_protection --only-submodules"
16
16
 
17
- route "namespace :admin do\n root 'home#index'\n end"
17
+ route <<-EOH
18
+ namespace :admin do
19
+ root 'home#index'
20
+ resource :sessions, only: %i(create)
21
+ get 'login' => 'sessions#new', as: :login
22
+ get 'logout' => 'sessions#destroy', as: :logout
23
+ end
24
+ EOH
18
25
  end
19
26
  end
20
27
  end
@@ -1,3 +1,3 @@
1
1
  module AdminGenerator
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -1,6 +1,6 @@
1
- class Admin::SettionsController < Admin::BaseController
2
- skip_before_filter :login_required, only: %[new, create]
3
- before_action :login_required, only: %w[destroy]
1
+ class Admin::SessionsController < Admin::BaseController
2
+ skip_before_action :login_required, only: %i(new create)
3
+ before_action :login_required, only: :destroy
4
4
 
5
5
  def new
6
6
  cookies.permanent[:admin] = true # analyticsの解析が入らないようにするやつ
@@ -19,6 +19,6 @@ class Admin::SettionsController < Admin::BaseController
19
19
 
20
20
  def destroy
21
21
  logout
22
- redirect_to root_url, notice: t('sign_out')
22
+ redirect_to admin_root_url, notice: t('sign_out')
23
23
  end
24
24
  end
@@ -1,6 +1,6 @@
1
1
  <div class="span10">
2
2
  <h1>管理者ログイン</h1>
3
- <%= form_tag admin_sessions_path do %>
3
+ <%= form_tag admin_sessions_path, method: :post do %>
4
4
  <div class="field">
5
5
  <%= label_tag :username %>
6
6
  <%= text_field_tag :username, params[:username] %>
@@ -13,6 +13,6 @@
13
13
  <%= check_box_tag :remember_me, 1, params[:remember_me] %>
14
14
  <%= label_tag :remember_me %>
15
15
  </div>
16
- <div class="actions"><%= submit_tag t('sign_in'), class: 'btn btn-large btn-primary' %></div>
16
+ <div class="actions"><%= submit_tag 'sign_in', class: 'btn btn-large btn-primary' %></div>
17
17
  <% end %>
18
18
  </div>
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>PcKeyboardInfo</title>
5
+ <%= csrf_meta_tags %>
6
+
7
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
8
+ <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
9
+ </head>
10
+
11
+ <body>
12
+ <%= yield %>
13
+ </body>
14
+ </html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: admin_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - jiikko
@@ -74,9 +74,10 @@ files:
74
74
  - lib/admin_generator/version.rb
75
75
  - lib/templates/controllers/admin/base_controller.rb
76
76
  - lib/templates/controllers/admin/home_controller.rb
77
- - lib/templates/controllers/admin/sessios_controller.rb
77
+ - lib/templates/controllers/admin/sessions_controller.rb
78
78
  - lib/templates/views/admin/home/index.html.slim
79
79
  - lib/templates/views/admin/sessions/new.html.erb
80
+ - lib/templates/views/layouts/admin/application.html.erb
80
81
  homepage: https://github.com/jiikko/admin_generator
81
82
  licenses:
82
83
  - MIT