ditty 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.pryrc +2 -0
  4. data/.rubocop.yml +1 -1
  5. data/.travis.yml +5 -4
  6. data/CNAME +1 -0
  7. data/Dockerfile +18 -0
  8. data/Gemfile.ci +0 -2
  9. data/Rakefile +2 -2
  10. data/_config.yml +1 -0
  11. data/config.ru +4 -4
  12. data/ditty.gemspec +9 -3
  13. data/docs/CNAME +1 -0
  14. data/docs/_config.yml +1 -0
  15. data/docs/index.md +34 -0
  16. data/exe/ditty +2 -0
  17. data/lib/ditty.rb +4 -2
  18. data/lib/ditty/cli.rb +28 -4
  19. data/lib/ditty/components/{app.rb → ditty.rb} +19 -14
  20. data/lib/ditty/controllers/{application.rb → application_controller.rb} +58 -29
  21. data/lib/ditty/controllers/{audit_logs.rb → audit_logs_controller.rb} +2 -2
  22. data/lib/ditty/controllers/{auth.rb → auth_controller.rb} +17 -16
  23. data/lib/ditty/controllers/{component.rb → component_controller.rb} +19 -18
  24. data/lib/ditty/controllers/{main.rb → main_controller.rb} +6 -2
  25. data/lib/ditty/controllers/roles_controller.rb +23 -0
  26. data/lib/ditty/controllers/{user_login_traits.rb → user_login_traits_controller.rb} +4 -3
  27. data/lib/ditty/controllers/{users.rb → users_controller.rb} +11 -10
  28. data/lib/ditty/db.rb +4 -3
  29. data/lib/ditty/emails/base.rb +5 -2
  30. data/lib/ditty/generators/crud_generator.rb +104 -0
  31. data/lib/ditty/generators/migration_generator.rb +26 -0
  32. data/lib/ditty/generators/project_generator.rb +51 -0
  33. data/lib/ditty/helpers/component.rb +2 -1
  34. data/lib/ditty/helpers/pundit.rb +20 -4
  35. data/lib/ditty/helpers/response.rb +20 -13
  36. data/lib/ditty/helpers/views.rb +7 -3
  37. data/lib/ditty/listener.rb +5 -3
  38. data/lib/ditty/memcached.rb +8 -0
  39. data/lib/ditty/middleware/accept_extension.rb +2 -2
  40. data/lib/ditty/middleware/error_catchall.rb +2 -2
  41. data/lib/ditty/models/base.rb +4 -0
  42. data/lib/ditty/models/role.rb +1 -0
  43. data/lib/ditty/models/user.rb +14 -1
  44. data/lib/ditty/policies/role_policy.rb +1 -1
  45. data/lib/ditty/policies/user_login_trait_policy.rb +1 -1
  46. data/lib/ditty/services/authentication.rb +11 -10
  47. data/lib/ditty/services/email.rb +8 -4
  48. data/lib/ditty/services/logger.rb +1 -1
  49. data/lib/ditty/tasks/ditty.rake +17 -0
  50. data/lib/ditty/tasks/omniauth-ldap.rake +2 -2
  51. data/lib/ditty/templates/.gitignore +5 -0
  52. data/lib/ditty/templates/.rspec +2 -0
  53. data/lib/ditty/templates/.rubocop.yml +7 -0
  54. data/lib/ditty/templates/Rakefile +12 -0
  55. data/lib/ditty/templates/application.rb +12 -0
  56. data/lib/ditty/templates/config.ru +37 -0
  57. data/lib/ditty/templates/controller.rb.erb +58 -0
  58. data/lib/ditty/templates/env.example +4 -0
  59. data/lib/ditty/templates/lib/project.rb.erb +5 -0
  60. data/lib/ditty/templates/migration.rb.erb +7 -0
  61. data/lib/ditty/templates/model.rb.erb +26 -0
  62. data/lib/ditty/templates/pids/.empty_directory +0 -0
  63. data/lib/ditty/templates/policy.rb.erb +48 -0
  64. data/lib/ditty/templates/public/css/sb-admin-2.min.css +10 -0
  65. data/lib/ditty/templates/public/js/sb-admin-2.min.js +7 -0
  66. data/lib/ditty/templates/settings.yml.erb +18 -0
  67. data/lib/ditty/templates/sidekiq.rb +18 -0
  68. data/lib/ditty/templates/sidekiq.yml +9 -0
  69. data/lib/ditty/templates/spec_helper.rb +43 -0
  70. data/lib/ditty/templates/type.rb.erb +21 -0
  71. data/lib/ditty/templates/views/display.haml.tt +20 -0
  72. data/lib/ditty/templates/views/edit.haml.tt +10 -0
  73. data/lib/ditty/templates/views/form.haml.tt +11 -0
  74. data/lib/ditty/templates/views/index.haml.tt +29 -0
  75. data/lib/ditty/templates/views/new.haml.tt +10 -0
  76. data/lib/ditty/version.rb +1 -1
  77. data/lib/rubocop/cop/ditty/call_services_directly.rb +2 -2
  78. data/migrate/20181209_add_user_login_traits.rb +4 -4
  79. data/migrate/20190220_add_parent_id_to_roles.rb +9 -0
  80. data/public/css/styles.css +13 -0
  81. data/public/js/scripts.js +1 -0
  82. data/views/404.haml +2 -4
  83. data/views/audit_logs/index.haml +32 -34
  84. data/views/auth/forgot_password.haml +27 -16
  85. data/views/auth/identity.haml +14 -13
  86. data/views/auth/ldap.haml +2 -2
  87. data/views/auth/login.haml +22 -17
  88. data/views/auth/register.haml +19 -18
  89. data/views/auth/register_identity.haml +27 -12
  90. data/views/auth/reset_password.haml +2 -2
  91. data/views/blank.haml +42 -0
  92. data/views/index.haml +1 -1
  93. data/views/layout.haml +37 -30
  94. data/views/partials/content_tag.haml +0 -0
  95. data/views/partials/delete_form.haml +1 -1
  96. data/views/partials/filter_control.haml +1 -1
  97. data/views/partials/footer.haml +5 -5
  98. data/views/partials/form_control.haml +19 -12
  99. data/views/partials/navitems.haml +44 -0
  100. data/views/partials/notifications.haml +12 -8
  101. data/views/partials/pager.haml +17 -17
  102. data/views/partials/search.haml +6 -7
  103. data/views/partials/sidebar.haml +15 -37
  104. data/views/partials/topbar.haml +68 -0
  105. data/views/roles/display.haml +27 -6
  106. data/views/roles/edit.haml +3 -3
  107. data/views/roles/form.haml +1 -0
  108. data/views/roles/index.haml +23 -16
  109. data/views/roles/new.haml +2 -2
  110. data/views/user_login_traits/display.haml +4 -4
  111. data/views/user_login_traits/edit.haml +3 -3
  112. data/views/user_login_traits/index.haml +4 -4
  113. data/views/user_login_traits/new.haml +2 -2
  114. data/views/users/display.haml +11 -12
  115. data/views/users/edit.haml +3 -3
  116. data/views/users/form.haml +0 -0
  117. data/views/users/index.haml +31 -24
  118. data/views/users/login_traits.haml +6 -8
  119. data/views/users/new.haml +2 -2
  120. data/views/users/profile.haml +13 -13
  121. metadata +143 -15
  122. data/lib/ditty/controllers/roles.rb +0 -13
  123. data/views/partials/navbar.haml +0 -22
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'ditty/controllers/component'
4
- require 'ditty/models/role'
5
- require 'ditty/policies/role_policy'
6
-
7
- module Ditty
8
- class Roles < Ditty::Component
9
- SEARCHABLE = %i[name].freeze
10
-
11
- set model_class: Role
12
- end
13
- end
@@ -1,22 +0,0 @@
1
- .navbar.navbar-default.navbar-static-top{ role: 'navigation', style: 'margin-bottom: 0' }
2
- .navbar-header
3
- %button.navbar-toggle.collapsed{ 'type' => 'button', 'data-toggle' => 'collapse', 'data-target' => '.navbar-collapse' }
4
- %span.sr-only Toggle navigation
5
- %span.icon-bar
6
- %span.icon-bar
7
- %span.icon-bar
8
- %span.navbar-brand
9
- = config('ditty.title', 'Ditty')
10
-
11
- %nav.nav.navbar-top-links.navbar-right.navbar-form{ style: 'border: 0;' }
12
- - if authenticated?
13
- = delete_form_tag("#{settings.map_path}/auth") do
14
- %a.btn.btn-default{ href: "#{settings.map_path}/users/profile" } My Account
15
- %button.btn.btn-default{ type: 'submit' }
16
- Logout
17
- - else
18
- %a.btn.btn-default{ href: "#{settings.map_path}/auth/login" }
19
- Log In
20
-
21
- .navbar-default.sidebar{ role: 'navigation' }
22
- = haml :'partials/sidebar'