trestle-auth 0.2.3 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of trestle-auth might be problematic. Click here for more details.

Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.browserslistrc +1 -0
  3. data/.gitignore +5 -0
  4. data/.rspec +1 -0
  5. data/.travis.yml +20 -3
  6. data/Gemfile +14 -0
  7. data/README.md +35 -8
  8. data/app/assets/bundle/trestle/auth/bundle.css +1 -0
  9. data/app/assets/bundle/trestle/auth/userbox.css +1 -0
  10. data/app/assets/stylesheets/trestle/_custom-auth.css +6 -0
  11. data/app/assets/stylesheets/trestle/auth.css +2 -0
  12. data/app/controllers/trestle/auth/sessions_controller.rb +4 -5
  13. data/app/helpers/trestle/auth/title_helper.rb +20 -0
  14. data/app/helpers/trestle/auth/user_helper.rb +2 -6
  15. data/app/views/layouts/trestle/auth.html.erb +11 -16
  16. data/app/views/trestle/auth/_userbox.html.erb +17 -6
  17. data/app/views/trestle/auth/sessions/_form.html.erb +32 -0
  18. data/app/views/trestle/auth/sessions/new.html.erb +8 -31
  19. data/bin/rails +20 -0
  20. data/config/{locale → locales}/en.yml +7 -0
  21. data/config/locales/es.yml +15 -0
  22. data/config/{locale → locales}/pl.yml +7 -0
  23. data/config/{locale → locales}/pt-BR.yml +7 -0
  24. data/config/locales/zh-CN.yml +8 -0
  25. data/config/routes.rb +8 -3
  26. data/frontend/_form.scss +79 -0
  27. data/frontend/_layout.scss +35 -0
  28. data/{app/assets/stylesheets/trestle/auth/_defaults.scss → frontend/_variables.scss} +2 -6
  29. data/frontend/index.scss +5 -0
  30. data/{app/assets/stylesheets/trestle/auth → frontend}/userbox.scss +14 -12
  31. data/gemfiles/rails-4.2.gemfile +18 -0
  32. data/gemfiles/rails-5.0.gemfile +18 -0
  33. data/gemfiles/rails-5.1.gemfile +18 -0
  34. data/gemfiles/rails-5.2.gemfile +18 -0
  35. data/gemfiles/rails-6.0.gemfile +18 -0
  36. data/lib/generators/trestle/auth/account/account_generator.rb +32 -0
  37. data/lib/generators/trestle/auth/account/templates/admin.rb.erb +47 -0
  38. data/lib/generators/trestle/auth/admin/admin_generator.rb +15 -1
  39. data/lib/generators/trestle/auth/admin/templates/admin.rb.erb +28 -5
  40. data/lib/generators/trestle/auth/install/install_generator.rb +39 -83
  41. data/lib/generators/trestle/auth/install/templates/basic.rb.erb +121 -0
  42. data/lib/generators/trestle/auth/install/templates/devise.rb.erb +87 -0
  43. data/lib/trestle/auth.rb +14 -8
  44. data/lib/trestle/auth/backends.rb +34 -0
  45. data/lib/trestle/auth/backends/base.rb +28 -0
  46. data/lib/trestle/auth/backends/basic.rb +72 -0
  47. data/lib/trestle/auth/backends/devise.rb +14 -0
  48. data/lib/trestle/auth/backends/warden.rb +53 -0
  49. data/lib/trestle/auth/configuration.rb +41 -6
  50. data/lib/trestle/auth/configuration/warden.rb +11 -0
  51. data/lib/trestle/auth/controller/authentication.rb +55 -0
  52. data/lib/trestle/auth/controller/locale.rb +18 -0
  53. data/lib/trestle/auth/controller/time_zone.rb +18 -0
  54. data/lib/trestle/auth/controller_methods.rb +3 -74
  55. data/lib/trestle/auth/engine.rb +1 -1
  56. data/lib/trestle/auth/model_methods.rb +2 -3
  57. data/lib/trestle/auth/version.rb +1 -1
  58. data/package.json +29 -0
  59. data/trestle-auth.gemspec +14 -10
  60. data/webpack.config.js +49 -0
  61. data/yarn.lock +4765 -0
  62. metadata +67 -31
  63. data/app/assets/javascripts/trestle/auth.js +0 -0
  64. data/app/assets/stylesheets/trestle/_custom-auth.scss +0 -4
  65. data/app/assets/stylesheets/trestle/auth.scss +0 -13
  66. data/app/assets/stylesheets/trestle/auth/_form.scss +0 -120
  67. data/app/assets/stylesheets/trestle/auth/_layout.scss +0 -20
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71e10f075c0aee1777d1823511187dfac4d50788006476a5f1a67f9f3555b352
4
- data.tar.gz: e00d07780f77c7914eeaffea5574143064dfe5adc514d5c0580d7d794834cff6
3
+ metadata.gz: bc7d72e5d295f88b10eeb2a14c1a854ba9f7cfb59617a4ec9dd4cea95d00295a
4
+ data.tar.gz: b4e1dfdcba7438acf673c6f36dc2cf4c81eba3c28dcd92d99403bee8f844c803
5
5
  SHA512:
6
- metadata.gz: 46d21d2099835f6d7f80a41f98b6983c1de41c2f4fbec486f7c069038f881a7097d6c78377c41e6a1c9b1a8d2d1e2e453c177de2cbfcfbf44f3e3f9410556b14
7
- data.tar.gz: dd803d5a8055402aa4f1b9c6351429c8c4160052e3b2f902db7c830894b78ed9d416f434f0ea99c8e823b043943152465a49df4cd3023494539c149780539629
6
+ metadata.gz: b2b1b76740eac08413c4e074cc2e8a530b8d428905d6fc9a48b2de814457a3cf1d1716698a14306466e93fa29afedf358258a320177cb2ac1e71e7c5b6ee24b7
7
+ data.tar.gz: 246cef636500c0e8337a1a0bf447923d251ee34c48a5de108becfd07b2320f8732e6b08610a0e7c1bf1e852f21d3d5818ac2eda71b4d7b71a9cb0071374be785
@@ -0,0 +1 @@
1
+ > 0.25%
data/.gitignore CHANGED
@@ -7,3 +7,8 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ /node_modules/
11
+ /spec/dummy/db/*.sqlite3
12
+ /spec/dummy/*.sqlite3-journal
13
+ /spec/dummy/log/*.log
14
+ /spec/dummy/tmp/*
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
+ --require spec_helper
1
2
  --format documentation
2
3
  --color
@@ -1,5 +1,22 @@
1
- sudo: false
2
1
  language: ruby
2
+
3
+ cache: bundler
4
+
5
+ before_install:
6
+ - gem update --system
7
+ - gem install bundler
8
+
3
9
  rvm:
4
- - 2.3.1
5
- before_install: gem install bundler -v 1.12.5
10
+ - 2.6.5
11
+
12
+ gemfile:
13
+ - gemfiles/rails-5.0.gemfile
14
+ - gemfiles/rails-5.1.gemfile
15
+ - gemfiles/rails-5.2.gemfile
16
+ - gemfiles/rails-6.0.gemfile
17
+
18
+ jobs:
19
+ include:
20
+ gemfile: gemfiles/rails-4.2.gemfile
21
+ before_install:
22
+ - gem install bundler -v '< 2'
data/Gemfile CHANGED
@@ -2,3 +2,17 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in trestle-auth.gemspec
4
4
  gemspec
5
+
6
+ group :test do
7
+ gem "coveralls", require: false
8
+
9
+ gem "capybara"
10
+ gem "sqlite3", "~> 1.4"
11
+ gem "devise"
12
+ end
13
+
14
+ gem "sassc-rails"
15
+
16
+ gem "rake", "~> 12.0"
17
+
18
+ gem "trestle", github: "TrestleAdmin/trestle"
data/README.md CHANGED
@@ -1,31 +1,58 @@
1
1
  # Trestle Authentication (trestle-auth)
2
2
 
3
+ [![RubyGem](https://img.shields.io/gem/v/trestle-auth.svg?style=flat&colorB=4065a9)](https://rubygems.org/gems/trestle-auth)
4
+ [![Travis](https://img.shields.io/travis/TrestleAdmin/trestle-auth.svg?style=flat)](https://travis-ci.org/TrestleAdmin/trestle-auth)
5
+ [![Coveralls](https://img.shields.io/coveralls/TrestleAdmin/trestle-auth.svg?style=flat)](https://coveralls.io/github/TrestleAdmin/trestle-auth)
6
+
3
7
  > Authentication plugin for the Trestle admin framework
4
8
 
5
- <img src="https://trestle.io/images/Trestle-Auth.png" width="50%" />
9
+ <img src="https://trestle.io/images/Trestle-Auth-1.png" width="50%" /><img src="https://trestle.io/images/Trestle-Auth-2.png" width="50%" />
6
10
 
7
11
 
8
12
  ## Getting Started
9
13
 
10
- These instructions assume you have a working Trestle application. To integrate trestle-auth, first add it to your application's Gemfile:
14
+ These instructions assume you have a working Trestle application. See the [Getting Started](https://github.com/TrestleAdmin/trestle#getting-started) section in the Trestle README.
15
+
16
+ To integrate trestle-auth, first add it to your application's Gemfile, and then run `bundle install`:
11
17
 
12
18
  ```ruby
13
19
  gem 'trestle-auth'
14
20
  ```
15
21
 
16
- Run `bundle install`, and then run the install generator to set up configuration options, user model and user admin resource.
22
+ As of version 0.4.0, trestle-auth now supports multiple authentication backends including Devise/Warden.
23
+
24
+
25
+ ### Option 1: Built-in Integration
17
26
 
18
- $ rails generate trestle:auth:install
19
- $ rake db:migrate
27
+ Run the install generator to add the configuration to `config/initializers/trestle.rb`, and generate a `User` model and admin resource.
20
28
 
21
- Then create an initial admin user from the rails console:
29
+ $ rails generate trestle:auth:install User
22
30
 
23
- $ rails console
24
- > Administrator.create(email: "admin@example.com", password: "password", first_name: "Admin", last_name: "User")
31
+ (if no user model name is specified it will default to `Administrator`)
32
+
33
+ Then run your migrations with `rake db:migrate` and create an initial admin user from within `rails console`:
34
+
35
+ ```ruby
36
+ User.create(email: "admin@example.com", password: "password", first_name: "Admin", last_name: "User")
37
+ ```
25
38
 
26
39
  After restarting your Rails server, any attempt to access a page within your admin will redirect you to the login page.
27
40
 
28
41
 
42
+ ### Option 2: Devise Integration
43
+
44
+ If you already have an existing user model and Devise integration, you can configure trestle-auth to use that instead.
45
+
46
+ $ rails generate trestle:auth:install User --devise
47
+
48
+ Replace `User` with the name of your Devise user model. If not specified, it will default to `Administrator`.
49
+
50
+
51
+ ## Configuration
52
+
53
+ After running the `trestle:auth:install` generator, check your `config/initializers/trestle.rb` for further configuration options.
54
+
55
+
29
56
  ## License
30
57
 
31
58
  The gem is available as open source under the terms of the [LGPLv3 License](https://opensource.org/licenses/LGPL-3.0).
@@ -0,0 +1 @@
1
+ .auth-body{display:flex;color:#fff}.auth-body .container{margin:auto;width:320px}.auth-header{text-align:center;margin-bottom:20px}.auth-header h1{display:flex;align-items:center;justify-content:center;font-size:1.75rem;font-weight:500;text-shadow:rgba(0,0,0,.5) 0 1px 1px;padding:.75rem 1rem}.auth-header img{max-width:80%;max-height:100%}.auth-header span{margin-left:10px}.login-form .form-control,.login-form .input-group-text{background:hsla(0,0%,100%,.1);border:0}.login-form .form-control{color:#fff;font-size:1.1rem;padding:1.75rem .75rem}.login-form .form-control:focus{outline-color:transparent;outline-style:none;box-shadow:none}.login-form .form-control::-webkit-input-placeholder{color:hsla(0,0%,100%,.5)}.login-form .form-control:-ms-input-placeholder{color:hsla(0,0%,100%,.5)}.login-form .form-control::-ms-input-placeholder{color:hsla(0,0%,100%,.5)}.login-form .form-control::placeholder{color:hsla(0,0%,100%,.5)}.login-form .form-control:-webkit-autofill{-webkit-text-fill-color:#fff}.login-form .form-control:-webkit-autofill,.login-form .form-control:-webkit-autofill:active,.login-form .form-control:-webkit-autofill:focus,.login-form .form-control:-webkit-autofill:hover{-webkit-transition:background-color 9999999s ease-in-out 0s;transition:background-color 9999999s ease-in-out 0s}.login-form .input-group-prepend{margin-right:0}.login-form .input-group-text{color:hsla(0,0%,100%,.5);padding:.375rem .25rem .375rem 1rem}.login-form .btn-primary{box-shadow:0 0 2px rgba(0,0,0,.1);padding-top:.75rem;padding-bottom:.75rem}.login-form .alert-danger{background-color:rgba(222,116,113,.75)}.login-form .remember-me{font-size:.95rem;line-height:1.5;padding-left:0}.login-form .remember-me .custom-control-label{display:block;cursor:pointer;background:rgba(0,0,0,.075);color:hsla(0,0%,100%,.75);border-radius:.25rem;padding:.75em 1.5em .75em 3.25em}.login-form .remember-me .custom-control-label:hover{background:rgba(0,0,0,.125)}.login-form .remember-me .custom-control-label:after,.login-form .remember-me .custom-control-label:before{top:.925em;left:1.1em}
@@ -0,0 +1 @@
1
+ .userbox{order:99;padding:2px 0;display:flex;align-items:center}.userbox>a{color:#333;display:block;padding:2px 0;font-weight:400;line-height:40px}.userbox>a:focus,.userbox>a:hover{text-decoration:none}.userbox .avatar{vertical-align:top;margin-left:6px}.userbox .dropdown-toggle:after{vertical-align:middle}@media (max-width:767.98px){.userbox{display:block;position:relative;z-index:5}.userbox .name{display:none}.userbox .avatar{border:1px solid hsla(0,0%,100%,.25);margin-left:0}}
@@ -0,0 +1,6 @@
1
+ /*
2
+ * This file is left as an extension point for user customization.
3
+ *
4
+ * It will be overridden by the similarly named file within
5
+ * the app/assets folder of the Rails application.
6
+ */
@@ -0,0 +1,2 @@
1
+ //= require trestle/auth/bundle
2
+ //= require trestle/_custom-auth
@@ -1,16 +1,15 @@
1
1
  class Trestle::Auth::SessionsController < Trestle::ApplicationController
2
2
  layout 'trestle/auth'
3
3
 
4
+ skip_before_action :authenticate_user, only: [:new, :create]
4
5
  skip_before_action :require_authenticated_user
5
6
 
6
7
  def new
7
8
  end
8
9
 
9
10
  def create
10
- if user = Trestle.config.auth.authenticate(params)
11
- login!(user)
12
- remember_me! if params[:remember_me] == "1"
13
- redirect_to previous_location || Trestle.config.path
11
+ if authentication_backend.authenticate!
12
+ redirect_to authentication_backend.previous_location || instance_exec(&Trestle.config.auth.redirect_on_login)
14
13
  else
15
14
  flash[:error] = t("admin.auth.error", default: "Incorrect login details.")
16
15
  redirect_to action: :new
@@ -19,6 +18,6 @@ class Trestle::Auth::SessionsController < Trestle::ApplicationController
19
18
 
20
19
  def destroy
21
20
  logout!
22
- redirect_to login_url
21
+ redirect_to instance_exec(&Trestle.config.auth.redirect_on_logout)
23
22
  end
24
23
  end
@@ -0,0 +1,20 @@
1
+ module Trestle
2
+ module Auth
3
+ module TitleHelper
4
+ def trestle_auth_title
5
+ if Trestle.config.auth.logo
6
+ image_tag(Trestle.config.auth.logo)
7
+ elsif Trestle.config.site_logo
8
+ image_tag(Trestle.config.site_logo)
9
+ elsif Trestle.config.site_logo_small
10
+ safe_join([
11
+ image_tag(Trestle.config.site_logo_small, alt: "", class: ""),
12
+ content_tag(:span, Trestle.config.site_title)
13
+ ], "\n")
14
+ else
15
+ Trestle.config.site_title
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,13 +1,9 @@
1
1
  module Trestle::Auth::UserHelper
2
2
  def format_user_name(user)
3
- if user.respond_to?(:first_name) && user.respond_to?(:last_name)
4
- safe_join([user.first_name, content_tag(:strong, user.last_name)], " ")
5
- else
6
- display(user)
7
- end
3
+ instance_exec(user, &Trestle.config.auth.format_user_name)
8
4
  end
9
5
 
10
6
  def avatar_for(user)
11
- avatar { instance_exec(user, &Trestle.config.auth.avatar) } if Trestle.config.auth.avatar
7
+ instance_exec(user, &Trestle.config.auth.avatar) if Trestle.config.auth.avatar
12
8
  end
13
9
  end
@@ -5,32 +5,27 @@
5
5
  <meta content='width=device-width, initial-scale=1' name='viewport'>
6
6
  <meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'>
7
7
 
8
- <meta content='no-cache' name='turbolinks-cache-control'>
8
+ <% if Trestle.config.turbolinks %>
9
+ <meta content='no-cache' name='turbolinks-cache-control'>
10
+ <% end %>
9
11
 
10
12
  <%= csrf_meta_tags %>
11
13
 
12
14
  <title><%= Trestle.config.site_title %></title>
13
15
 
16
+ <%= stylesheet_link_tag "trestle/admin", 'data-turbolinks-track': 'reload' %>
17
+ <%= stylesheet_link_tag "trestle/theme", 'data-turbolinks-track': 'reload' if Trestle.config.theme %>
18
+ <%= stylesheet_link_tag "trestle/custom", 'data-turbolinks-track': 'reload' %>
19
+
14
20
  <%= stylesheet_link_tag "trestle/auth", 'data-turbolinks-track': 'reload' %>
15
21
 
16
- <%= javascript_include_tag "turbolinks" if defined?(Turbolinks) %>
17
- <%= javascript_include_tag "trestle/auth", 'data-turbolinks-track': 'reload' %>
22
+ <%= javascript_include_tag "turbolinks" if Trestle.config.turbolinks %>
23
+
24
+ <%= hook "auth.head" %>
18
25
  </head>
19
26
 
20
- <body>
27
+ <body class="auth-body theme-bg-dark">
21
28
  <main class="container">
22
- <header class="auth-header">
23
- <h1>
24
- <% if Trestle.config.site_logo -%>
25
- <%= image_tag(Trestle.config.site_logo, alt: Trestle.config.site_title) %>
26
- <% elsif Trestle.config.site_logo_small -%>
27
- <%= image_tag(Trestle.config.site_logo_small, alt: Trestle.config.site_title) %>
28
- <% else -%>
29
- <%= Trestle.config.site_title %>
30
- <% end -%>
31
- </h1>
32
- </header>
33
-
34
29
  <%= yield %>
35
30
  </main>
36
31
  </body>
@@ -1,17 +1,28 @@
1
- <div class="userbox pull-right dropdown">
2
- <%= link_to "#", class: 'dropdown-toggle', data: { toggle: 'dropdown' } do %>
3
- <span class="name">
1
+ <% show_dropdown = (Trestle.config.auth.user_admin && Trestle.lookup(Trestle.config.auth.user_admin)) || Trestle.config.auth.enable_logout %>
2
+
3
+ <div class="userbox<% if show_dropdown %> dropdown<% end %>">
4
+ <% content = capture do %>
5
+ <span class="name<% if show_dropdown %> dropdown-toggle<% end %>">
4
6
  <%= format_user_name(current_user) %>
5
- <span class="caret"></span>
6
7
  </span>
7
8
 
8
9
  <%= avatar_for(current_user) %>
9
10
  <% end %>
10
11
 
12
+ <% if show_dropdown %>
13
+ <%= link_to content, "#", data: { toggle: 'dropdown' } %>
14
+ <% else %>
15
+ <%= content %>
16
+ <% end %>
17
+
18
+ <% if show_dropdown -%>
11
19
  <ul class="dropdown-menu dropdown-menu-right">
12
20
  <% if Trestle.config.auth.user_admin && user_admin = Trestle.lookup(Trestle.config.auth.user_admin) -%>
13
- <li><%= link_to t("admin.auth.my_account", default: "My Account"), user_admin.path(:show, id: current_user), class: "dropdown-item" %></li>
21
+ <li><%= admin_link_to t("admin.auth.my_account", default: "My Account"), current_user, admin: user_admin, class: "dropdown-item" %></li>
22
+ <% end -%>
23
+ <% if Trestle.config.auth.enable_logout -%>
24
+ <li><%= link_to t("admin.auth.logout", default: "Log out"), trestle.logout_path, class: "dropdown-item" %></li>
14
25
  <% end -%>
15
- <li><%= link_to t("admin.auth.logout", default: "Log out"), trestle.logout_path, class: "dropdown-item" %></li>
16
26
  </ul>
27
+ <% end %>
17
28
  </div>
@@ -0,0 +1,32 @@
1
+ <div class="form-group">
2
+ <div class="input-group">
3
+ <div class="input-group-prepend">
4
+ <span class="input-group-text"><i class="fa fa-user fa-fw"></i></span>
5
+ </div>
6
+ <%= f.text_field Trestle.config.auth.authenticate_with, placeholder: Trestle.config.auth.human_attribute_name(Trestle.config.auth.authenticate_with), class: "form-control" %>
7
+ </div>
8
+ </div>
9
+
10
+ <div class="form-group">
11
+ <div class="input-group">
12
+ <div class="input-group-prepend">
13
+ <span class="input-group-text"><i class="fa fa-lock fa-fw"></i></span>
14
+ </div>
15
+ <%= f.password_field :password, placeholder: Trestle.config.auth.human_attribute_name(:password), class: "form-control" %>
16
+ </div>
17
+ </div>
18
+
19
+ <%= hook("auth.login.form", f) %>
20
+
21
+ <% if Trestle.config.auth.remember.enabled %>
22
+ <div class="form-group">
23
+ <div class="custom-control custom-checkbox remember-me">
24
+ <%= f.check_box :remember_me, class: "custom-control-input", include_hidden: false %>
25
+ <%= f.label :remember_me, t("admin.auth.remember_me", default: "Remember me"), class: "custom-control-label" %>
26
+ </div>
27
+ </div>
28
+ <% end %>
29
+
30
+ <div class="form-group">
31
+ <%= f.submit t("admin.auth.login", default: "Login"), class: "btn btn-primary btn-block btn-lg" %>
32
+ </div>
@@ -1,38 +1,15 @@
1
- <%= form_tag login_path, class: "login-form" do %>
2
- <%= hook("auth.login.heading") %>
1
+ <%= form_for authentication_scope, url: login_path, html: { class: "login-form" } do |f| %>
2
+ <header class="auth-header">
3
+ <%= hook("auth.login.heading") do %>
4
+ <h1><%= trestle_auth_title %></h1>
5
+ <% end %>
6
+ </header>
3
7
 
4
8
  <% if flash[:error] -%>
5
- <div class="alert alert-danger">
9
+ <div class="alert alert-danger error-bg">
6
10
  <p><%= flash[:error] %></p>
7
11
  </div>
8
12
  <% end -%>
9
13
 
10
- <div class="form-group">
11
- <div class="input-group">
12
- <span class="input-group-addon"><i class="fa fa-user fa-fw"></i></span>
13
- <%= text_field_tag Trestle.config.auth.authenticate_with, "", placeholder: Trestle.config.auth.authenticate_with.to_s.humanize, class: "form-control" %>
14
- </div>
15
- </div>
16
-
17
- <div class="form-group">
18
- <div class="input-group">
19
- <span class="input-group-addon"><i class="fa fa-lock fa-fw"></i></span>
20
- <%= password_field_tag :password, "", placeholder: "Password", class: "form-control" %>
21
- </div>
22
- </div>
23
-
24
- <%= hook("auth.login.form") %>
25
-
26
- <% if Trestle.config.auth.remember.enabled %>
27
- <div class="form-group">
28
- <label class="remember-me">
29
- <%= check_box_tag :remember_me %>
30
- <%= t("admin.auth.remember_me", default: "Remember me") %>
31
- </label>
32
- </div>
33
- <% end %>
34
-
35
- <div class="form-group">
36
- <%= submit_tag t("admin.auth.login", default: "Login"), class: "btn btn-primary btn-block" %>
37
- </div>
14
+ <%= render "form", f: f %>
38
15
  <% end %>
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails gems
3
+ # installed from the root of your application.
4
+
5
+ ENGINE_ROOT = File.expand_path('..', __dir__)
6
+ ENGINE_PATH = File.expand_path('../lib/trestle/auth/engine', __dir__)
7
+
8
+ # Set up gems listed in the Gemfile.
9
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
10
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
11
+
12
+ require "rails"
13
+ # Pick the frameworks you want:
14
+ require "active_model/railtie"
15
+ require "active_record/railtie"
16
+ require "action_controller/railtie"
17
+ require "action_view/railtie"
18
+ require "sprockets/railtie"
19
+ # require "rails/test_unit/railtie"
20
+ require 'rails/engine/commands'
@@ -6,3 +6,10 @@ en:
6
6
  logout: "Logout"
7
7
  error: "Incorrect login details."
8
8
  remember_me: "Remember me"
9
+
10
+ auth/account:
11
+ titles:
12
+ edit: "My Account"
13
+
14
+ breadcrumbs:
15
+ index: "My Account"
@@ -0,0 +1,15 @@
1
+ es:
2
+ admin:
3
+ auth:
4
+ my_account: "Mi Cuenta"
5
+ login: "Inicio de sesión"
6
+ logout: "Sair"
7
+ error: "Email o contraseña incorrectos."
8
+ remember_me: "Recuérdame"
9
+
10
+ auth/account:
11
+ titles:
12
+ edit: "Mi Cuenta"
13
+
14
+ breadcrumbs:
15
+ index: "Mi Cuenta"
@@ -6,3 +6,10 @@ pl:
6
6
  logout: "Wyloguj się"
7
7
  error: "Nieprawidłowe dane logowania."
8
8
  remember_me: "Zapamiętaj mnie"
9
+
10
+ auth/account:
11
+ titles:
12
+ edit: "Moje konto"
13
+
14
+ breadcrumbs:
15
+ index: "Moje konto"