proxes 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +1 -1
  4. data/.travis.yml +0 -3
  5. data/Gemfile.ci +5 -2
  6. data/README.md +12 -9
  7. data/Rakefile +10 -5
  8. data/Vagrantfile +1 -4
  9. data/config.ru +32 -24
  10. data/lib/{proxes → ditty/components}/proxes.rb +26 -33
  11. data/lib/proxes/controllers/permissions.rb +4 -3
  12. data/lib/proxes/models/permission.rb +7 -5
  13. data/lib/proxes/policies/permission_policy.rb +4 -4
  14. data/lib/proxes/policies/request/index_policy.rb +1 -1
  15. data/lib/proxes/policies/request_policy.rb +3 -4
  16. data/lib/proxes/policies/token_policy.rb +1 -1
  17. data/lib/proxes/request/cat.rb +2 -2
  18. data/lib/proxes/request/index.rb +2 -2
  19. data/lib/proxes/request.rb +1 -1
  20. data/lib/proxes/security.rb +10 -12
  21. data/lib/proxes/version.rb +1 -1
  22. data/lib/proxes.rb +1 -3
  23. data/migrate/20170207_base_tables.rb +2 -1
  24. data/migrate/20170208_audit_log.rb +1 -0
  25. data/proxes.gemspec +15 -14
  26. data/public/js/bundle.js +44683 -23940
  27. data/public/js/vendors.js +1 -0
  28. data/views/permissions/form.haml +2 -2
  29. data/views/permissions/index.haml +14 -9
  30. metadata +69 -108
  31. data/lib/proxes/container.rb +0 -135
  32. data/lib/proxes/controllers/app.rb +0 -80
  33. data/lib/proxes/controllers/application.rb +0 -80
  34. data/lib/proxes/controllers/audit_logs.rb +0 -44
  35. data/lib/proxes/controllers/component.rb +0 -167
  36. data/lib/proxes/controllers/roles.rb +0 -16
  37. data/lib/proxes/controllers/users.rb +0 -183
  38. data/lib/proxes/db.rb +0 -18
  39. data/lib/proxes/helpers/authentication.rb +0 -58
  40. data/lib/proxes/helpers/component.rb +0 -49
  41. data/lib/proxes/helpers/pundit.rb +0 -40
  42. data/lib/proxes/helpers/views.rb +0 -42
  43. data/lib/proxes/helpers/wisper.rb +0 -15
  44. data/lib/proxes/listener.rb +0 -23
  45. data/lib/proxes/models/audit_log.rb +0 -14
  46. data/lib/proxes/models/base.rb +0 -9
  47. data/lib/proxes/models/identity.rb +0 -70
  48. data/lib/proxes/models/role.rb +0 -17
  49. data/lib/proxes/models/user.rb +0 -64
  50. data/lib/proxes/omniauth.rb +0 -4
  51. data/lib/proxes/policies/application_policy.rb +0 -21
  52. data/lib/proxes/policies/audit_log_policy.rb +0 -41
  53. data/lib/proxes/policies/identity_policy.rb +0 -25
  54. data/lib/proxes/policies/role_policy.rb +0 -37
  55. data/lib/proxes/policies/user_policy.rb +0 -43
  56. data/lib/proxes/rake_tasks.rb +0 -219
  57. data/lib/proxes/seed.rb +0 -5
  58. data/lib/proxes/services/logger.rb +0 -51
  59. data/views/404.haml +0 -1
  60. data/views/audit_logs/index.haml +0 -26
  61. data/views/error.haml +0 -4
  62. data/views/getting_started.haml +0 -16
  63. data/views/identity/login.haml +0 -19
  64. data/views/identity/register.haml +0 -14
  65. data/views/index.haml +0 -3
  66. data/views/layout.haml +0 -58
  67. data/views/partials/delete_form.haml +0 -4
  68. data/views/partials/form_control.haml +0 -20
  69. data/views/partials/navbar.haml +0 -25
  70. data/views/partials/notifications.haml +0 -24
  71. data/views/partials/pager.haml +0 -12
  72. data/views/partials/sidebar.haml +0 -54
  73. data/views/roles/display.haml +0 -38
  74. data/views/roles/edit.haml +0 -11
  75. data/views/roles/form.haml +0 -1
  76. data/views/roles/index.haml +0 -20
  77. data/views/roles/new.haml +0 -10
  78. data/views/users/display.haml +0 -69
  79. data/views/users/edit.haml +0 -11
  80. data/views/users/identity.haml +0 -3
  81. data/views/users/index.haml +0 -23
  82. data/views/users/new.haml +0 -11
  83. data/views/users/profile.haml +0 -39
  84. data/views/users/user.haml +0 -3
@@ -1,26 +0,0 @@
1
- .row
2
- .col-md-12
3
- .panel.panel-default
4
- %table.table.table-striped
5
- %thead
6
- %tr
7
- %th User email
8
- %th Action
9
- %th Details
10
- %th Created at
11
- %tbody
12
- -list.each do |entity|
13
- %tr
14
- %td
15
- -if entity.user
16
- %a{ href: "/_proxes/users/#{entity.user.id}" }= entity.user.email
17
- -else
18
- None
19
- %td
20
- = entity.action
21
- %td
22
- = entity.details
23
- %td
24
- = entity.created_at.strftime('%Y-%m-%d %H:%M:%S')
25
-
26
- =pagination(list, base_path)
data/views/error.haml DELETED
@@ -1,4 +0,0 @@
1
- %h2 Whoops
2
-
3
- %p.lead
4
- = error.class
@@ -1,16 +0,0 @@
1
- .row
2
- .col-md-12
3
- .panel.panel-success
4
- .panel-heading
5
- You can now start using this Elasticsearch cluster:
6
- .panel-body
7
- %h4 Send Data
8
- %pre
9
- :plain
10
- curl -X POST '#{ request.base_url }/#{ current_user.email }/test' \
11
- -u #{ current_user.email }:yourpassword -d '{"message":"Get cracking!"}'
12
-
13
- %h4 Search
14
- %pre
15
- curl -X GET '#{ request.base_url }/_search' -u #{ current_user.email }:yourpassword
16
-
@@ -1,19 +0,0 @@
1
- .row
2
- .col-sm-3
3
- .col-sm-6
4
- .panel.panel-default
5
- .panel-heading
6
- %h4 ProxES Login
7
- .panel-body
8
- %form{ method: 'post', action: '/_proxes/auth/identity/callback' }
9
- .form-group
10
- %label.control-label Username
11
- %input.form-control.border-input{ name: 'username' }
12
- .form-group
13
- %label.control-label Password
14
- %input.form-control.border-input{ name: 'password', type: 'password' }
15
- %button.btn.btn-primary{ type: 'submit' } Log In
16
- .pull-right
17
- No account yet?
18
- %a.btn.btn-default{ href: '/_proxes/auth/identity/register' } Register
19
- .col-sm-3
@@ -1,14 +0,0 @@
1
- .row
2
- .col-md-2
3
- .col-md-8
4
- .panel.panel-default
5
- .panel-heading
6
- %h4 ProxES Registration
7
- .panel-body
8
- %form.form-horizontal{ method: 'post', action: '/_proxes/auth/identity/new' }
9
- = form_control(:username, identity, label: 'Email', placeholder: 'Your email address')
10
- = form_control(:password, identity, label: 'Password', type: :password)
11
- = form_control(:password_confirmation, identity, label: 'Confirm Password', type: :password)
12
-
13
- %button.btn.btn-primary{ type: 'submit' } Register
14
- .col-md-2
data/views/index.haml DELETED
@@ -1,3 +0,0 @@
1
- = haml :getting_started
2
-
3
- #react-dashboard{ 'data-elasticsearch-url' => '.'}
data/views/layout.haml DELETED
@@ -1,58 +0,0 @@
1
- !!! 5
2
- %html{ lang: 'en' }
3
- %head
4
- %meta{ charset: 'utf-8' }
5
- %meta{ 'http-equiv' => 'X-UA-Compatible', 'content' => 'IE=edge,chrome=1' }
6
- %meta{ name: 'viewport', content: 'width=device-width, initial-scale=1' }
7
- %meta{ name: 'theme-color', content: '#ffffff' }
8
- %link{ rel: 'manifest', href: '/_proxes/manifest.json' }
9
- %link{ rel: 'icon', type: 'image/png', sizes: '32x32', href: '/_proxes/images/favicon-32x32.png' }
10
- %link{ rel: 'icon', type: 'image/png', sizes: '16x16', href: '/_proxes/images/favicon-16x16.png' }
11
- %link{ rel: 'apple-touch-icon', sizes: '76x76', href: '/_proxes/images/apple-icon.png' }
12
- %link{ rel: 'mask-icon', href: '/safari-pinned-tab.svg', color: '#5bbad5' }
13
-
14
- %title
15
- ProxES
16
- - if defined? title
17
- = "- #{title}"
18
-
19
- %meta{ name: 'description', content: '' }
20
- %meta{ name: 'author', content: '' }
21
-
22
- / Le styles
23
- %link{ rel: 'stylesheet', href: 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css', media: 'screen' }
24
- %link{ rel: 'stylesheet', href: 'https://cdnjs.cloudflare.com/ajax/libs/startbootstrap-sb-admin-2/3.3.7+1/css/sb-admin-2.min.css', media: 'screen' }
25
- %link{ rel: 'stylesheet', href: 'https://cdnjs.cloudflare.com/ajax/libs/metisMenu/2.5.2/metisMenu.min.css', media: 'screen' }
26
- %link{ rel: 'stylesheet', href: 'https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', media: 'screen' }
27
- /[if lt IE 9] <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
28
- /[if lt IE 9] <script src="https://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
29
-
30
- %script{ type: 'text/javascript', src: 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js' }
31
- %script{ type: 'text/javascript', src: 'https://cdnjs.cloudflare.com/ajax/libs/list.js/1.5.0/list.min.js' }
32
- %body
33
- #wrapper
34
- = haml :'partials/navbar', locals: { title: (defined?(title) ? title : 'ProxES') }
35
- #page-wrapper
36
- .row
37
- .col-md-12
38
- - if cluster_health.nil?
39
- .alert.alert-danger.text-center Cannot Connect to Cluster
40
- -if defined? title
41
- %h1.page-header= title
42
- = haml :'partials/notifications'
43
-
44
- = yield
45
- %footer.footer.text-muted.text-center
46
- %hr
47
- .copyright
48
- :plain
49
- &copy; <script>document.write(new Date().getFullYear())</script>, JadeIT
50
-
51
-
52
- / Placed at the end of the document so the pages load faster
53
- %script{ type: 'text/javascript', src: 'https://cdnjs.cloudflare.com/ajax/libs/startbootstrap-sb-admin-2/3.3.7+1/js/sb-admin-2.min.js' }
54
- %script{ type: 'text/javascript', src: 'https://cdnjs.cloudflare.com/ajax/libs/metisMenu/2.5.2/metisMenu.min.js' }
55
- %script{ type: 'text/javascript', src: 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js' }
56
- %script{ type: 'text/javascript', src: 'https://cdnjs.cloudflare.com/ajax/libs/react/15.4.1/react.min.js' }
57
- %script{ type: 'text/javascript', src: 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.bundle.min.js' }
58
- %script{ type: 'text/javascript', src: '/_proxes/js/bundle.js' }
@@ -1,4 +0,0 @@
1
- <form method="post" action="<%= base_path %>/<%= entity.id %>">
2
- <input type="hidden" name="_method" value="DELETE">
3
- <button type="submit" class="btn btn-danger"><%= delete_label %></button>
4
- </form>
@@ -1,20 +0,0 @@
1
- %div{ class: "form-group#{model.errors[field] ? ' has-error' : ''}" }
2
- %label.col-sm-3.control-label{ for: attributes[:id] }= label
3
- .col-sm-9
4
- - type = attributes.delete(:type)
5
- - if type == 'select'
6
- - options = attributes.delete(:options)
7
- %select{attributes}
8
- - if attributes[:multiple]
9
- - options.each do |k,v| k ||= v; v ||= k;
10
- %option{ value: k, selected: (model.send(field).map(&:id).include? k)}= v
11
- - else
12
- %option{ value: ""} -- Select One --
13
- - options.each do |k,v| k ||= v; v ||= k;
14
- %option{ value: k, selected: (k.to_s == model[field].to_s)}= v
15
- - elsif type == 'textarea'
16
- %textarea{attributes}= preserve(model[field])
17
- - else
18
- %input{attributes, type: type, value: model[field]}
19
- - if model.errors[field]
20
- %p.help-block.text-danger= model.errors[field].join(', ')
@@ -1,25 +0,0 @@
1
- .navbar.navbar-inverse.navbar-static-top{ role: 'navigation', style: 'margin-bottom: 0' }
2
- .navbar-header
3
- %span.navbar-brand
4
- %a{ href: '/_proxes' }
5
- ProxES
6
- %button.navbar-toggle.collapsed{ 'type' => 'button', 'data-toggle' => 'collapse', 'data-target' => '#navbar', 'aria-expanded' => 'false', 'aria-controls' => 'navbar' }
7
- %span.sr-only Toggle navigation
8
- %span.icon-bar.bar1
9
- %span.icon-bar.bar2
10
- %span.icon-bar.bar3
11
-
12
- -if authenticated?
13
- %form.nav.navbar-top-links.navbar-form.navbar-right{ action: '/_proxes/auth/identity', method: 'post' }
14
- %a.btn.btn-default{ href: "/_proxes/users/profile" } My Account
15
- %input{ name: '_method', value: 'DELETE', type: 'hidden' }
16
- %button.btn.btn-default{ type: 'submit' }
17
- / %i.ti-panel
18
- Logout
19
- - else
20
- %ul.nav.navbar-top-links.navbar-right
21
- %li
22
- %a.btn.btn-link{ href: '/_proxes/auth/identity' }
23
- Log In
24
- .navbar-default.sidebar{ role: 'navigation' }
25
- = haml :'partials/sidebar'
@@ -1,24 +0,0 @@
1
- - if flash[:danger]
2
- .alert.alert-danger.alert-dismissible{ role: "alert" }
3
- %button.close{ 'type' => 'button', 'aria-hidden' => 'true', 'area-label' => 'true', 'data-dismiss' => 'alert' } &times;
4
- - (flash[:danger].is_a?(Array) ? flash[:danger] : [flash[:danger]]).each do |msg|
5
- %span= msg
6
-
7
- - if flash[:warning]
8
- .alert.alert-warning.alert-dismissible{ role: "alert" }
9
- %button.close{ 'type' => 'button', 'aria-hidden' => 'true', 'area-label' => 'true', 'data-dismiss' => 'alert' } &times;
10
- - (flash[:warning].is_a?(Array) ? flash[:warning] : [flash[:warning]]).each do |msg|
11
- %span= msg
12
-
13
- - if flash[:success]
14
- .alert.alert-success.alert-dismissible{ role: "alert" }
15
- %button.close{ 'type' => 'button', 'aria-hidden' => 'true', 'area-label' => 'true', 'data-dismiss' => 'alert' } &times;
16
- - (flash[:success].is_a?(Array) ? flash[:success] : [flash[:success]]).each do |msg|
17
- %span= msg
18
-
19
-
20
- - if flash[:info]
21
- .alert.alert-info.alert-dismissible{ role: "alert" }
22
- %button.close{ 'type' => 'button', 'aria-hidden' => 'true', 'area-label' => 'true', 'data-dismiss' => 'alert' } &times;
23
- - (flash[:info].is_a?(Array) ? flash[:info] : [flash[:info]]).each do |msg|
24
- %span= msg
@@ -1,12 +0,0 @@
1
- %nav{"aria-label" => "Page navigation"}
2
- %p.text-center
3
- Showing #{list.current_page_record_range} of #{list.pagination_record_count} records
4
- %ul.pager
5
- %li
6
- %a{href: "#{base_path}?page=1&count=#{list.page_size}"} First
7
- %li{class: ("disabled" if list.first_page?)}
8
- %a{href: prev_link} Previous
9
- %li{class: ("disabled" if list.last_page?)}
10
- %a{href: next_link} Next
11
- %li
12
- %a{href: "#{base_path}?page=#{list.page_count}&count=#{list.page_size}"} Last
@@ -1,54 +0,0 @@
1
- %ul.nav.nav-pills.nav-stacked
2
- - if authenticated?
3
- %li
4
- %a{ href: '/_proxes' }
5
- %i.fa.fa-home.fa-fw
6
- Home
7
- - ProxES::Container.navigation.each do |item|
8
- - if item[:target].nil? || policy(item[:target]).list?
9
- - if item[:group]
10
- %li
11
- %a{ href: '#' }
12
- %i.fa.fa-fw{ class: "fa-#{item[:icon]}" }
13
- =item[:group]
14
- %span.fa.arrow
15
- %ul.nav.nav-second-level
16
- - item[:items].each do |sub_item|
17
- %li
18
- %a{ href: "/_proxes#{sub_item[:link]}" }
19
- %i.fa.fa-fw{ class: "fa-#{sub_item[:icon]}" }
20
- = sub_item[:text]
21
- - else
22
- %li
23
- %a{ href: "/_proxes#{item[:link]}" }
24
- %i.fa.fa-fw{ class: "fa-#{item[:icon]}" }
25
- = item[:text]
26
- - else
27
- %li.active
28
- %a{ href: '/_proxes/auth/identity' }
29
- %i.fa.fa-user.fa-fw
30
- Log In
31
- %li
32
- %a{ href: '/_proxes/auth/identity/register' }
33
- %i.fa.fa-pencil-square-o.fa-fw
34
- Register
35
-
36
- - if authenticated?
37
- - if cluster_health
38
- %table.table
39
- %tbody
40
- %tr
41
- %th
42
- Cluster:
43
- %td
44
- = cluster_health['cluster_name']
45
- %tr
46
- %th
47
- Status:
48
- %td
49
- = cluster_health['status']
50
- %tr
51
- %th
52
- Nodes:
53
- %td
54
- = cluster_health['number_of_nodes']
@@ -1,38 +0,0 @@
1
- .row
2
- .col-md-2
3
- .col-md-8
4
- .panel.panel-default
5
- .panel-body
6
- %p.description
7
- %label Name:
8
- = entity.name
9
-
10
- .row
11
- .col-md-6
12
- %a.btn.btn-default{ href: "#{base_path}/#{entity.id}/edit" } Edit
13
- .col-md-6.text-right
14
- - if policy(entity).delete?
15
- %form{ method: 'post', action: "#{base_path}/#{entity.id}" }
16
- %input{ name: '_method', value: 'DELETE', type: 'hidden' }
17
- %button.btn.btn-warning{ type: 'submit' } Delete
18
- .col-md-2
19
-
20
- .row
21
- .col-md-2
22
- .col-md-8
23
- .panel.panel-default
24
- .panel-heading
25
- %h4 Permissions
26
- %table.table
27
- - if entity.permissions.count > 0
28
- - entity.permissions.each do |permission|
29
- %tr
30
- %td
31
- %a.btn-block{ href: "/_proxes/permissions/#{entity.id}" }
32
- = permission.verb
33
- = permission.pattern
34
- - else
35
- %tr
36
- %td{ colspan: 2 } No Permissions
37
-
38
- .col-md-2
@@ -1,11 +0,0 @@
1
- .row
2
- .col-md-2
3
- .col-md-8
4
- .panel.panel-default
5
- .panel-body
6
- %form.form-horizontal{ method: 'post', action: "#{base_path}/#{entity.id}" }
7
- %input{ name: '_method', value: 'PUT', type: 'hidden' }
8
- = haml :'roles/form', locals: { entity: entity }
9
- %button.btn.btn-primary{ type: 'submit' }
10
- Update Role
11
- .col-md-2
@@ -1 +0,0 @@
1
- = form_control(:name, entity)
@@ -1,20 +0,0 @@
1
- .row
2
- .col-md-12
3
- .panel.panel-default
4
- %table.table.table-striped
5
- %thead
6
- %tr
7
- %th Name
8
- %th Permissions
9
- %tbody
10
- -list.each do |entity|
11
- %tr
12
- %td
13
- %a{ href: "#{base_path}/#{entity.id}" }= entity.name
14
- %td
15
- = entity.permissions_dataset.count
16
- - if policy(::ProxES::Role).create?
17
- .panel-body.text-right
18
- %a.btn.btn-primary{ href: "#{base_path}/new" } New Role
19
-
20
- =pagination(list, base_path)
data/views/roles/new.haml DELETED
@@ -1,10 +0,0 @@
1
- .row
2
- .col-md-2
3
- .col-md-8
4
- .panel.panel-default
5
- .panel-body
6
- %form.form-horizontal{ method: 'post', action: base_path }
7
- = haml :'roles/form', locals: { entity: entity }
8
- %button.btn.btn-primary.btn{ type: 'submit' }
9
- Create Role
10
- .col-md-2
@@ -1,69 +0,0 @@
1
- .row
2
- .col-md-2
3
- .col-md-8
4
- .panel.panel-default
5
- .panel-body
6
- .author
7
- %img.pull-right.thumbnail{ src: entity.gravatar }
8
- %h4= entity.email
9
-
10
- %hr
11
- %p.description
12
- %label Name:
13
- = entity.name
14
- %p.description
15
- %label Surname:
16
- = entity.surname
17
- %p.description
18
- %label Roles:
19
- = entity.roles_dataset.map(:name).map(&:titlecase).join(', ')
20
- %p.description
21
- %label Signed up:
22
- = entity.created_at.strftime('%Y-%m-%d %H:%M:%S')
23
-
24
- .row
25
- .col-md-6
26
- %a.btn.btn-default{ href: "#{base_path}/#{entity.id}/edit" } Edit
27
- .col-md-6.text-right
28
- - if policy(entity).delete?
29
- %form{ method: 'post', action: "#{base_path}/#{entity.id}" }
30
- %input{ name: '_method', value: 'DELETE', type: 'hidden' }
31
- %button.btn.btn-warning{ type: 'submit' } Delete
32
- .col-md-2
33
-
34
- .row
35
- .col-md-2
36
- .col-md-8
37
- .panel.panel-default
38
- .panel-heading
39
- %h4 Permissions
40
- %table.table
41
- - if entity.permissions.count > 0
42
- - entity.permissions.each do |permission|
43
- %tr
44
- %td
45
- %a.btn-block{ href: "/_proxes/permissions/#{entity.id}" }
46
- = permission.verb
47
- = permission.pattern
48
- - else
49
- %tr
50
- %td{ colspan: 2 } No Permissions
51
- .col-md-2
52
-
53
- - if entity.identity.first
54
- .row
55
- .col-md-2
56
- .col-md-8
57
- .panel.panel-default
58
- .panel-heading
59
- %h4 Change Password
60
- .panel-body
61
- %form.form-horizontal{ method: 'post', action: "#{base_path}/#{entity.id}/identity" }
62
- %input{ name: '_method', value: 'PUT', type: 'hidden' }
63
- = form_control(:password, entity.identity.first, type: 'password', placeholder: 'Your password', group: 'identity')
64
- = form_control(:password_confirmation, entity.identity.first, type: 'password', label: 'Confirm Password', placeholder: 'Confirm your password', group: 'identity')
65
- %button.btn.btn-primary{ type: 'submit' }
66
- Change Password
67
- .col-md-2
68
-
69
-
@@ -1,11 +0,0 @@
1
- .row
2
- .col-md-2
3
- .col-md-8
4
- .panel.panel-default
5
- .panel-body
6
- %form.form-horizontal{ method: 'post', action: "#{base_path}/#{entity.id}" }
7
- %input{ name: '_method', value: 'PUT', type: 'hidden' }
8
- = haml :'users/user', locals: { user: entity }
9
- %button.btn.btn-primary{ type: 'submit' }
10
- Update User
11
- .col-md-2
@@ -1,3 +0,0 @@
1
- = form_control(:username, identity, label: 'Email', placeholder: 'Your email address')
2
- = form_control(:password, identity, type: 'password', placeholder: 'Your password')
3
- = form_control(:password_confirmation, identity, type: 'password', label: 'Confirm Password', placeholder: 'Confirm your password')
@@ -1,23 +0,0 @@
1
- .row
2
- .col-md-12
3
- .panel.panel-default
4
- %table.table.table-striped
5
- %thead
6
- %tr
7
- %th Email
8
- %th Name
9
- %th Surname
10
- %th Roles
11
- %tbody
12
- -list.each do |entity|
13
- %tr
14
- %td
15
- %a{ href: "#{base_path}/#{entity.id}" }= entity.email
16
- %td= entity.name
17
- %td= entity.surname
18
- %td= entity.roles_dataset.map(:name).map(&:titlecase).join(', ')
19
- - if policy(::ProxES::User).create?
20
- .panel-body.text-right
21
- %a.btn.btn-primary{ href: "#{base_path}/new" } New User
22
-
23
- =pagination(list, base_path)
data/views/users/new.haml DELETED
@@ -1,11 +0,0 @@
1
- .row
2
- .col-md-2
3
- .col-md-8
4
- .panel.panel-default
5
- .panel-body
6
- %form.form-horizontal{ method: 'post', action: base_path }
7
- = haml :'users/identity', locals: { identity: identity }
8
- = haml :'users/user', locals: { user: entity }
9
- %button.btn.btn-primary.btn{ type: 'submit' }
10
- Create User
11
- .col-md-2
@@ -1,39 +0,0 @@
1
- .row
2
- .col-md-2
3
- .col-md-8
4
- .panel.panel-default
5
- .panel-body
6
- .author
7
- %img.pull-right.thumbnail{ src: entity.gravatar }
8
- %h4= entity.email
9
-
10
- %hr
11
- %p.description
12
- %label Name:
13
- = entity.name
14
- %p.description
15
- %label Surname:
16
- = entity.surname
17
- %p.description
18
- %label Roles:
19
- = entity.roles_dataset.map(:name).map(&:titlecase).join(', ')
20
- %p.description
21
- %label Signed up:
22
- = entity.created_at.strftime('%Y-%m-%d %H:%M:%S')
23
- .col-md-2
24
-
25
- .row
26
- .col-md-2
27
- .col-md-8
28
- .panel.panel-default
29
- .panel-heading
30
- %h4 Change Password
31
- .panel-body
32
- %form.form-horizontal{ method: 'post', action: "#{base_path}/#{entity.id}/identity" }
33
- %input{ name: '_method', value: 'PUT', type: 'hidden' }
34
- = form_control(:old_password, identity, type: 'password', placeholder: 'Your current password')
35
- = form_control(:password, identity, type: 'password', placeholder: 'Your new password')
36
- = form_control(:password_confirmation, identity, type: 'password', label: 'Confirm Password', placeholder: 'Confirm your password')
37
- %button.btn.btn-primary{ type: 'submit' }
38
- Change Password
39
- .col-md-2
@@ -1,3 +0,0 @@
1
- = form_control(:name, user)
2
- = form_control(:surname, user)
3
- = form_control(:role_id, user, type: 'select', options: ProxES::Role.to_hash(:id, :name), name: 'user[role_id][]', field: :roles, multiple: true)