gdpr_rails 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/stylesheets/policy_manager/application.css +7 -3
  4. data/app/assets/stylesheets/policy_manager/tabler/dashboard.css +15979 -0
  5. data/app/controllers/policy_manager/application_controller.rb +12 -1
  6. data/app/controllers/policy_manager/categories_controller.rb +2 -0
  7. data/app/controllers/policy_manager/terms_controller.rb +0 -7
  8. data/app/helpers/policy_manager/application_helper.rb +15 -0
  9. data/app/models/policy_manager/portability_request.rb +2 -1
  10. data/app/views/layouts/policy_manager/application.html.erb +21 -66
  11. data/app/views/layouts/policy_manager/blank.html.erb +34 -0
  12. data/app/views/policy_manager/401.erb +14 -1
  13. data/app/views/policy_manager/categories/index.html.erb +36 -19
  14. data/app/views/policy_manager/categories/show.html.erb +46 -26
  15. data/app/views/policy_manager/doc.erb +9 -0
  16. data/app/views/policy_manager/portability_requests/index.html.erb +53 -30
  17. data/app/views/policy_manager/shared/_footer.erb +27 -0
  18. data/app/views/policy_manager/shared/_header.erb +100 -0
  19. data/app/views/policy_manager/terms/_side.erb +42 -0
  20. data/app/views/policy_manager/terms/edit.html.erb +15 -7
  21. data/app/views/policy_manager/terms/new.html.erb +16 -5
  22. data/app/views/policy_manager/terms/show.html.erb +27 -12
  23. data/app/views/policy_manager/user_portability_requests/index.html.erb +58 -34
  24. data/app/views/policy_manager/user_terms/pending.html.erb +32 -4
  25. data/app/views/policy_manager/user_terms/show.html.erb +49 -21
  26. data/config/routes.rb +3 -1
  27. data/lib/policy_manager.rb +1 -0
  28. data/lib/policy_manager/bootstrap_link_renderer.rb +68 -0
  29. data/lib/policy_manager/exporter.rb +6 -0
  30. data/lib/policy_manager/exporter/json_link.rb +1 -5
  31. data/lib/policy_manager/version.rb +1 -1
  32. data/spec/controllers/policy_manager/categories_controller_spec.rb +32 -1
  33. data/spec/controllers/policy_manager/terms_controller_spec.rb +1 -31
  34. data/spec/dummy/log/test.log +15227 -0
  35. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-j/-joLD6bGYWbwr7m8lbVykq-N3VlbwjsslJhFpvIO1M0.cache +0 -0
  36. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5A/5AIrhjjjXhTfhDPF_yhVxN6qDlH7W7my02uwW-21MjE.cache +1 -0
  37. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/6s/6svTyA-_cLrryEIxjCg2dFwGFJQhPSq8bfl7NHX-6S8.cache +1 -0
  38. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/AZ/AZG0LaS8wP07WA8vP7N6xGcOT1q-p2jPeab90NjvW10.cache +0 -0
  39. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/C_/C_P5dY0UXIhjEA7OrFQd1aofpQ-_F7rDisjiNerCFeE.cache +1 -0
  40. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Gk/gkajaBT4J0v708PEXfi7rmWyPyXGbFTU0rbt28hhuCU.cache +1 -0
  41. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ht/HtqVv_OtFVLOaqSfS6SFC1-xHJcXV16Htu4GXJS7Ge8.cache +0 -0
  42. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/JX/JXUoRCJSB2Hqb7r8dj7NjeH3GmkBCMgZiXLlDitT9_8.cache +0 -0
  43. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/KT/KT-nMmPKXvwiFzLexhvO9mK4-Z16Uy2lgSh-C_2tl2A.cache +1 -0
  44. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ly/Lype9QbYtOa9M-u3fcbKpnwunSd0vsgm4kC_Ljy3ei8.cache +1 -0
  45. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/QL/QLwCOHeeYbzWHu9pvmWf9zGaIVz7Jr8aJqETzRVhj2g.cache +0 -0
  46. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/VO/VOMqAX4P5jY9p79SxqoDgMhcwyV3Ji7NH4ZBRN2C4Eg.cache +0 -0
  47. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/X_/X_IvNiCc17UkQfT5hGGeSgXOXQd1jvf9mqLtwgfVBoE.cache +1 -0
  48. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_G/_GWVUnXr5EcwMXjUvdA1DwSGUKeBIFN8_3HqLUuQ2bc.cache +1 -0
  49. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_K/_KRxFH5M3jnffTGbv8MMa9F35zU5K18JLkjYWb8n4K4.cache +1 -0
  50. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dG/Dg4KPTfNIbu-ZWN3w-oz6AOGW2Tnl6wiGMof---xBwM.cache +0 -0
  51. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/hf/hfbBpe8z0eauhajpHgM1LKCGRdXHNCfPKmAJG6PziWw.cache +1 -0
  52. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/iH/iH-iP8fWBpiKteXxHSgWYNCTvH3PoKU3j9HU7N1beK8.cache +1 -0
  53. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/jH/jHf-4aOYfA7SkTW8_sIcQXMi26wGt-lhJPOpLrsXitI.cache +2 -0
  54. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/k9/k9YLRLSeoYGPd6U7HVdzqbKDoJ-kHVlHpqDh3yxctjk.cache +1 -0
  55. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/lD/lDyaaMV05ckGoGvz03Cr_FziEutVI5z8XmGZwSV2ZpY.cache +1 -0
  56. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/rP/rPeQ8umAkR6JSXEzQ6m6oqhlQVPkbF4_C9Rikas9Ziw.cache +1 -0
  57. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/sD/sD_kmbR8U3xvyAe4HyDRvQjP0YD47jZyEbmhEbMFgWE.cache +3 -0
  58. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/se/seYQsoLihjxVNHqBL3F_R5iyDgAdEYJpmMe2BhlMkeo.cache +3 -0
  59. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/sg/sgDzGRWafDZfwXDyiKhxxXXMYcwJd-72HeJTMbEpb3E.cache +0 -0
  60. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/y4/y4-yGJgEeIDCoxA20rsfXeJYRakmtzwIxmHZLMmAutM.cache +0 -0
  61. data/spec/dummy/tmp/portability/14/build.zip +0 -0
  62. data/spec/dummy/tmp/portability/15/build.zip +0 -0
  63. data/spec/dummy/tmp/portability/17/build.zip +0 -0
  64. data/spec/dummy/tmp/portability/2/build.zip +0 -0
  65. metadata +61 -5
  66. data/app/assets/stylesheets/policy_manager/dashboard.css +0 -99
  67. data/app/assets/stylesheets/policy_manager/portability_requests.css +0 -4
  68. data/app/assets/stylesheets/policy_manager/user_portability_requests.css +0 -4
@@ -12,9 +12,20 @@ module PolicyManager
12
12
  return redirect_to root_path unless Config.is_admin?(current_user)
13
13
  end
14
14
 
15
+ def doc
16
+ require "redcarpet"
17
+ @markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true, fenced_code_blocks: true)
18
+ lines = File.open( PolicyManager::Engine.root.join("README.md")).readlines
19
+ @html = @markdown.render(lines.join(""))
20
+ render "policy_manager/doc"
21
+ #render inline: html, layout: "policy_manager/application"
22
+ end
23
+
15
24
  def user_authenticated?
16
25
  if !current_user
17
- render :file => "401.erb", :layout => false, :status => :unauthorized
26
+ render :file => "policy_manager/401.erb",
27
+ :layout => "policy_manager/blank",
28
+ :status => :unauthorized
18
29
  end
19
30
  end
20
31
 
@@ -13,6 +13,8 @@ module PolicyManager
13
13
  # GET /categories/1
14
14
  def show
15
15
  @category = PolicyManager::Config.rules.find{|o| o.name == params[:id]}
16
+ @terms = @category.terms.paginate(:page => params[:page],
17
+ :per_page => 12)
16
18
  end
17
19
 
18
20
  private
@@ -5,13 +5,6 @@ module PolicyManager
5
5
  before_action :set_term, only: [:show, :edit, :update, :destroy]
6
6
  before_action :allow_admins
7
7
 
8
- # GET /terms
9
- def index
10
- @terms = Term.where(rule: params[:category_id]).paginate(
11
- :page => params[:page],
12
- :per_page => 10)
13
- end
14
-
15
8
  # GET /terms/1
16
9
  def show
17
10
  end
@@ -19,6 +19,21 @@ module PolicyManager
19
19
  nil
20
20
  end
21
21
 
22
+ def state_color(state)
23
+ case state
24
+ when "pending", "draft"
25
+ return "tag-yellow"
26
+ when "progress"
27
+ return "tag-azure"
28
+ when "completed", "published"
29
+ return "tag-green"
30
+ end
31
+ end
32
+
33
+ def gravatar_url(user, size)
34
+ gravatar_id = Digest::MD5.hexdigest(user.email.downcase)
35
+ "http://gravatar.com/avatar/#{gravatar_id}.png?s=#{size}"
36
+ end
22
37
 
23
38
  def chart(data)
24
39
  begin
@@ -41,7 +41,8 @@ module PolicyManager
41
41
  end
42
42
 
43
43
  def download_link
44
- self.attachment.expiring_url(PolicyManager::Config.exporter.expiration_link)
44
+ url = self.attachment.expiring_url(PolicyManager::Config.exporter.expiration_link)
45
+ PolicyManager::Config.exporter.customize_link(url)
45
46
  end
46
47
 
47
48
  def handle_progress
@@ -6,12 +6,17 @@
6
6
  <%= csrf_meta_tags %>
7
7
 
8
8
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
9
+
9
10
  <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
10
11
 
11
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
12
+
13
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
14
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,300i,400,400i,500,500i,600,600i,700,700i&amp;subset=latin-ext">
12
15
 
13
16
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
14
17
 
18
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
19
+
15
20
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
16
21
  <script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>
17
22
 
@@ -22,76 +27,26 @@
22
27
  <%= javascript_include_tag "policy_manager/application", debug: false %>
23
28
 
24
29
  </head>
25
- <body>
26
-
27
- <nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0">
28
- <a class="navbar-brand col-sm-3 col-md-2 mr-0" href="/">
29
- <%= I18n.t("terms_app.sub_title") %></a>
30
- <ul class="navbar-nav px-3">
31
- <li class="nav-item text-nowrap">
32
- <% if PolicyManager::Config.logout_url.present? %>
33
- <a class="nav-link" href="<%= PolicyManager::Config.logout_url %>"><%= I18n.t("terms_app.sign_out") %></a>
34
- <% end %>
35
- </li>
36
- </ul>
37
- </nav>
38
-
39
- <div class="container-fluid">
40
- <div class="row">
41
- <nav class="col-md-2 d-none d-md-block bg-light sidebar">
42
- <div class="sidebar-sticky">
43
- <ul class="nav flex-column">
44
- <% if PolicyManager::Config.is_admin?(controller.current_user) %>
45
-
46
- <li class="nav-item">
47
- <a class="nav-link" href="<%= categories_path %>">
48
- <i class="fas fa-balance-scale"></i>
49
- <%= I18n.t("terms_app.menu.policies") %>
50
- </a>
51
- </li>
52
30
 
53
- <li class="nav-item">
54
- <a class="nav-link" href="<%= portability_requests_path %>">
55
- <i class="fas fa-suitcase"></i>
56
- <%= I18n.t("terms_app.menu.portability_requests") %>
57
- </a>
58
- </li
59
-
60
- <% end %>
61
-
62
- <% if controller.current_user.is_a? PolicyManager::Config.user_resource %>
63
-
64
- <li class="separator"></li>
65
-
66
- <li class="nav-item">
67
- <a class="nav-link" href="<%= pending_user_terms_path %>">
68
- <i class="fas fa-user-secret"></i>
69
- <%= I18n.t("terms_app.menu.user_pending_policies") %>
70
- </a>
71
- </li>
72
-
73
- <li class="nav-item">
74
- <a class="nav-link" href="<%= user_portability_requests_path %>">
75
- <i class="fas fa-suitcase"></i>
76
- <%= I18n.t("terms_app.menu.user_portability_requests") %>
77
- </a>
78
- </li>
79
-
80
- <% end %>
81
-
82
- </ul>
31
+ <body>
83
32
 
33
+ <div class="page">
34
+ <div class="page-main">
35
+ <%= render partial: "policy_manager/shared/header" %>
36
+
37
+ <div class="my-3 my-md-5">
38
+ <div class="container">
39
+ <p id="notice">
40
+ <%= flash_messages %>
41
+ </p>
42
+ <%= yield %>
43
+ </div>
84
44
  </div>
85
- </nav>
45
+ </div>
86
46
 
87
- <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
88
- <p id="notice">
89
- <%= flash_messages %>
90
- </p>
91
- <%= yield %>
92
- </main>
47
+ <%= render partial: "policy_manager/shared/footer" %>
93
48
  </div>
94
- </div>
49
+
95
50
 
96
51
  </body>
97
52
  </html>
@@ -0,0 +1,34 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= I18n.t("terms_app.title") %></title>
5
+
6
+ <%= csrf_meta_tags %>
7
+
8
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
9
+
10
+ <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
11
+
12
+
13
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
14
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,300i,400,400i,500,500i,600,600i,700,700i&amp;subset=latin-ext">
15
+
16
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
17
+
18
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
19
+
20
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
21
+ <script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>
22
+
23
+ <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.10/css/all.css" integrity="sha384-+d0P83n9kaQMCwj8F4RJB66tzIwOKmrdb46+porD/OvrJ+37WqIM7UoBtwHO6Nlg" crossorigin="anonymous">
24
+
25
+ <%= javascript_include_tag "https://www.gstatic.com/charts/loader.js" %>
26
+ <%= stylesheet_link_tag "policy_manager/application", media: "all" %>
27
+ <%= javascript_include_tag "policy_manager/application", debug: false %>
28
+
29
+ </head>
30
+
31
+ <body>
32
+ <%= yield %>
33
+ </body>
34
+ </html>
@@ -1 +1,14 @@
1
- <h1>access denied</h1>
1
+ <div class="page">
2
+ <div class="page-content">
3
+ <div class="container text-center">
4
+ <div class="display-1 text-muted mb-5">
5
+ <i class="si si-exclamation"></i> 401
6
+ </div>
7
+ <h1 class="h2 mb-3">Oops.. You just found an error page..</h1>
8
+ <p class="h4 text-muted font-weight-normal mb-7">We are sorry but you are not authorized to access this page&hellip;</p>
9
+ <a class="btn btn-primary" href="javascript:history.back()">
10
+ <i class="fa fa-arrow-left mr-2"></i>Go back
11
+ </a>
12
+ </div>
13
+ </div>
14
+ </div>
@@ -1,26 +1,43 @@
1
1
  <h2><%= I18n.t("terms_app.categories.index.title") %></h2>
2
2
 
3
+ <div class="row">
4
+ <div class="col-12">
5
+ <div class="card">
6
+ <%= chart ->{PolicyManager::UserTerm.group_by_day(:created_at, format: "%a").count} %>
7
+ </div>
8
+ </div>
9
+ </div>
3
10
 
4
- <%= chart ->{PolicyManager::UserTerm.group_by_day(:created_at, format: "%a").count} %>
5
11
 
6
- <div class="table-responsive">
7
- <table class="table table-striped table-sm">
8
- <thead>
9
- <tr>
10
- <th><%= I18n.t("terms_app.categories.index.table.name") %></th>
11
- <th><%= I18n.t("terms_app.categories.index.table.terms") %></th>
12
- <th colspan="3"></th>
13
- </tr>
14
- </thead>
12
+ <div class="card">
15
13
 
16
- <tbody>
17
- <% @categories.each do |category| %>
14
+ <div class="card-header">
15
+ <h3 class="card-title">
16
+ <%= I18n.t("terms_app.categories.index.title") %>
17
+ </h3>
18
+ </div>
19
+
20
+ <div class="table-responsive">
21
+ <table class="table card-table table-vcenter text-nowrap">
22
+ <thead>
18
23
  <tr>
19
- <td><%= category.name %></td>
20
- <td><%= category.terms.size %></td>
21
- <td><%= link_to I18n.t("terms_app.categories.index.table.show"), category_path(category.name) %></td>
24
+ <th><%= I18n.t("terms_app.categories.index.table.name") %></th>
25
+ <th><%= I18n.t("terms_app.categories.index.table.terms") %></th>
26
+ <th colspan="1"></th>
22
27
  </tr>
23
- <% end %>
24
- </tbody>
25
- </table>
26
- </div>
28
+ </thead>
29
+
30
+ <tbody>
31
+ <% @categories.each do |category| %>
32
+ <tr>
33
+ <td><%= category.name %></td>
34
+ <td><%= category.terms.size %></td>
35
+ <td><%= link_to I18n.t("terms_app.categories.index.table.show"), category_path(category.name), class: "btn btn-secondary btn-sm" %></td>
36
+ </tr>
37
+ <% end %>
38
+ </tbody>
39
+ </table>
40
+ </div>
41
+
42
+
43
+ </div>
@@ -1,32 +1,52 @@
1
- <h2><%= I18n.t("terms_app.categories.show.title", name: @category.name) %></h2>
2
-
3
1
  <div class="float-right">
4
2
  <%= link_to I18n.t("terms_app.misc.back"), categories_path, class: " btn btn-primary" %>
5
3
  <%= link_to I18n.t("terms_app.categories.show.new"), new_category_term_path(@category.name), class: " btn btn-success"%>
6
4
  </div>
7
5
 
8
- <div class="table-responsive">
9
- <table class="table table-striped table-sm">
10
- <thead>
11
- <tr>
12
- <th><%= I18n.t("terms_app.categories.show.table.id") %></th>
13
- <th><%= I18n.t("terms_app.categories.show.table.content") %></th>
14
- <th><%= I18n.t("terms_app.categories.show.table.state") %></th>
15
- <th><%= I18n.t("terms_app.categories.show.table.updated_at") %></th>
16
- <th></th>
17
- </tr>
18
- </thead>
19
-
20
- <tbody>
21
- <% @category.terms.each do |term| %>
22
- <tr>
23
- <td><%= term.id %></td>
24
- <td><%= truncate(term.description, length: 17, separator: " ", omission: '...') %></td>
25
- <td><%= I18n.t("terms_app.states.#{term.state}") %></td>
26
- <td><%= term.updated_at %></td>
27
- <td><%= link_to I18n.t("terms_app.categories.show.table.show"), category_term_path(@category.name, term) %></td>
28
- </tr>
29
- <% end %>
30
- </tbody>
31
- </table>
6
+ <h2>
7
+ <%= I18n.t("terms_app.categories.show.title", name: @category.name) %>
8
+ </h2>
9
+
10
+
11
+ <div class="card">
12
+
13
+ <div class="card-body">
14
+
15
+ <div class="table-responsive">
16
+ <table class="table card-table table-vcenter text-nowrap">
17
+ <thead>
18
+ <tr>
19
+ <th><%= I18n.t("terms_app.categories.show.table.id") %></th>
20
+ <th><%= I18n.t("terms_app.categories.show.table.content") %></th>
21
+ <th><%= I18n.t("terms_app.categories.show.table.state") %></th>
22
+ <th><%= I18n.t("terms_app.categories.show.table.updated_at") %></th>
23
+ <th></th>
24
+ </tr>
25
+ </thead>
26
+
27
+ <tbody>
28
+ <% @terms.each do |term| %>
29
+ <tr>
30
+ <td><%= term.id %></td>
31
+ <td><%= truncate(term.description, length: 17, separator: " ", omission: '...') %></td>
32
+ <td>
33
+ <span class="tag <%=state_color(term.state)%>">
34
+ <%= I18n.t("terms_app.states.#{term.state}") %>
35
+ </span>
36
+
37
+ </td>
38
+ <td><%= term.updated_at %></td>
39
+ <td><%= link_to I18n.t("terms_app.categories.show.table.show"), category_term_path(@category.name, term), class: "btn btn-sm btn-secondary" %></td>
40
+ </tr>
41
+ <% end %>
42
+ </tbody>
43
+ </table>
44
+
45
+
46
+ </div>
47
+ </div>
32
48
  </div>
49
+
50
+ <%= will_paginate @terms, renderer: PolicyManager::BootstrapLinkRenderer %>
51
+
52
+
@@ -0,0 +1,9 @@
1
+ <div class="card">
2
+ <div class="card-body">
3
+ <%= @html.html_safe %>
4
+ </div>
5
+
6
+ <div class="card-footer">
7
+
8
+ </div>
9
+ </div>
@@ -1,42 +1,65 @@
1
+
1
2
  <h2><%= I18n.t("terms_app.portability_requests.index.title") %></h2>
2
3
 
3
4
  <% if @portability_requests.size == 0 %>
4
5
  <p><%= I18n.t("terms_app.portability_requests.index.empty") %></p>
5
6
  <% else %>
6
7
 
7
- <%= chart ->{PolicyManager::PortabilityRequest.group_by_day(:created_at).count} %>
8
-
9
- <div class="table-responsive">
10
- <table class="table table-striped table-sm">
11
- <thead>
12
- <tr>
13
- <th><%= I18n.t("terms_app.portability_requests.index.table.user") %></th>
14
- <th><%= I18n.t("terms_app.portability_requests.index.table.state") %></th>
15
- <th><%= I18n.t("terms_app.portability_requests.index.table.created_at") %></th>
16
- <!--<th>Expire at</th>-->
17
- <th colspan="2"></th>
18
- </tr>
19
- </thead>
20
-
21
- <tbody>
22
- <% @portability_requests.each do |portability_request| %>
8
+ <div class="row">
9
+ <div class="col-12">
10
+ <div class="card">
11
+ <%= chart ->{PolicyManager::PortabilityRequest.group_by_day(:created_at).count} %>
12
+ </div>
13
+ </div>
14
+ </div>
15
+
16
+ <div class="card">
17
+
18
+ <div class="card-header">
19
+ <h3 class="card-title">
20
+ <%= I18n.t("terms_app.portability_requests.index.title") %>
21
+ </h3>
22
+ </div>
23
+
24
+ <div class="table-responsive">
25
+ <table class="table card-table table-vcenter text-nowrap">
26
+ <thead>
23
27
  <tr>
24
- <td><%= portability_request.user.email %></td>
25
- <td><%= I18n.t("terms_app.portability_requests.index.states.#{portability_request.state}") %></td>
26
- <td><%= portability_request.created_at %></td>
27
- <!--<td><%= portability_request.expire_at %></td>-->
28
- <td>
29
- <%= link_to I18n.t("terms_app.portability_requests.index.table.confirm"), confirm_portability_request_path(portability_request), data: { confirm: I18n.t("terms_app.misc.are_you_sure") } if portability_request.pending?
30
- %>
31
-
32
- </td>
33
- <td><%= link_to I18n.t("terms_app.portability_requests.index.table.destroy"), portability_request, method: :delete, data: { confirm: I18n.t("terms_app.misc.are_you_sure") } %></td>
28
+ <th><%= I18n.t("terms_app.portability_requests.index.table.user") %></th>
29
+ <th><%= I18n.t("terms_app.portability_requests.index.table.state") %></th>
30
+ <th><%= I18n.t("terms_app.portability_requests.index.table.created_at") %></th>
31
+ <!--<th>Expire at</th>-->
32
+ <th colspan="2"></th>
34
33
  </tr>
35
- <% end %>
36
- </tbody>
37
- </table>
34
+ </thead>
38
35
 
39
- <%= will_paginate @portability_requests, :style => 'letter-spacing: 5px' %>
36
+ <tbody>
37
+ <% @portability_requests.each do |portability_request| %>
38
+ <tr>
39
+ <td><%= portability_request.user.email %></td>
40
+ <td>
41
+ <span class="tag <%=state_color(portability_request.state)%>">
42
+ <%= I18n.t("terms_app.portability_requests.index.states.#{portability_request.state}") %>
43
+ </span>
44
+
45
+ </td>
46
+ <td><%= portability_request.created_at %></td>
47
+ <!--<td><%= portability_request.expire_at %></td>-->
48
+ <td>
49
+ <%= link_to I18n.t("terms_app.portability_requests.index.table.confirm"), confirm_portability_request_path(portability_request), data: { confirm: I18n.t("terms_app.misc.are_you_sure") } if portability_request.pending?
50
+ %>
51
+
52
+ </td>
53
+ <td><%= link_to I18n.t("terms_app.portability_requests.index.table.destroy"), portability_request, method: :delete, data: { confirm: I18n.t("terms_app.misc.are_you_sure") }, class: "btn btn-sm btn-danger" %></td>
54
+ </tr>
55
+ <% end %>
56
+ </tbody>
57
+ </table>
58
+
59
+ </div>
40
60
 
41
61
  </div>
62
+
63
+ <%= will_paginate @portability_requests, renderer: PolicyManager::BootstrapLinkRenderer %>
64
+
42
65
  <% end %>