jera_push 1.2.1 → 1.2.3

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
  SHA256:
3
- metadata.gz: efee65617eb9d612ce38593a5c623d57b336e56ae1017a27d4ced3e8680c862b
4
- data.tar.gz: '00954314ef516fbb4c7711ddcb85dd0ee4063332006ef63d8f8c5500e55e135f'
3
+ metadata.gz: 94afb52f8fb32e6554bdb73f7b03ba48a1ea0cc57cd1789df19f914593739b45
4
+ data.tar.gz: 7586cb6aebe1df7119a2bd9a87ec1cb9de37ac8343c8488477cc5cc99dfc234c
5
5
  SHA512:
6
- metadata.gz: 1371cda26262aefcbb61bf47897a537c6af623eaf703481f10e1770357165b9b23f07eaf5ed38baebb7dc53447663869c6e27f0f086ddb93d4badcf8361ccc39
7
- data.tar.gz: b40dd9d3a328961467dd0d373436a31833165ad3e34e043099451745109002eac483037078bdc80920503dde8d1fa670d776aaaac835ed46d279bf9ff960c77f
6
+ metadata.gz: 9d917503e6bc9904fab6e3c309856491f2c1230baa7b8cd8e946c9560c9aa938a0be3fc40dbb9e9329869cad622cbf49bf9e88701204b383a94f11e871f7858b
7
+ data.tar.gz: b2147d84acdead00ff1351f65e5da1e2ff1061c397b5a754a870f4c112f7bb9c84b57849653fd8bef7adadb0d9207a070755f91a35ad1e1942ea3311114273b0
@@ -1,6 +1,5 @@
1
1
  .devices-list {
2
- overflow-y: scroll;
3
- height: 500px;
2
+ overflow: hidden;
4
3
  width: 100%;
5
4
  margin-bottom: 40px;
6
5
 
@@ -13,4 +12,4 @@
13
12
  font-size: 14px;
14
13
  font-weight: 400;
15
14
  }
16
- }
15
+ }
@@ -13,5 +13,5 @@
13
13
  @import "pages/messages/new";
14
14
 
15
15
  .brand-logo{
16
- margin: 10px 0 0 22px;
17
- }
16
+ margin: 0px 0 0 22px;
17
+ }
@@ -371,6 +371,10 @@ table {
371
371
  width:100%;
372
372
  display: table;
373
373
 
374
+ tbody > tr {
375
+ word-break: break-all;
376
+ }
377
+
374
378
  &.bordered > thead > tr,
375
379
  &.bordered > tbody > tr {
376
380
  border-bottom: 1px solid $table-border-color;
@@ -406,7 +410,7 @@ thead {
406
410
  }
407
411
 
408
412
  td, th{
409
- padding: 15px 5px;
413
+ padding: 20px 20px 20px 4px;
410
414
  display: table-cell;
411
415
  text-align: left;
412
416
  vertical-align: middle;
@@ -1,7 +1,7 @@
1
1
  nav {
2
2
  color: $navbar-font-color;
3
3
  @extend .z-depth-1;
4
- background-color: $primary-color;
4
+ background-color: $navbar-background-color;
5
5
  width: 100%;
6
6
  height: $navbar-height-mobile;
7
7
  line-height: $navbar-height-mobile;
@@ -20,6 +20,12 @@ nav {
20
20
  .nav-wrapper {
21
21
  position: relative;
22
22
  height: 100%;
23
+
24
+ li {
25
+ a {
26
+ font-weight: 500;
27
+ }
28
+ }
23
29
  }
24
30
 
25
31
  @media #{$large-and-up} {
@@ -50,10 +56,11 @@ nav {
50
56
  font-size: $navbar-brand-font-size;
51
57
  padding: 0;
52
58
  white-space: nowrap;
53
-
59
+
54
60
  img {
55
61
  width: 100px;
56
62
  height: auto;
63
+ vertical-align: middle;
57
64
  }
58
65
 
59
66
  &.center {
@@ -221,6 +221,7 @@ $navbar-height-mobile: 56px !default;
221
221
  $navbar-font-size: 1rem !default;
222
222
  $navbar-font-color: #fff !default;
223
223
  $navbar-brand-font-size: 2.1rem !default;
224
+ $navbar-background-color: rgba(0, 0, 0, 0.87);
224
225
 
225
226
  /* 14. Side Navigation
226
227
  ========================================================================== */
@@ -1,3 +1,12 @@
1
1
  .devices-list-container {
2
2
  padding-bottom: 40px;
3
- }
3
+
4
+ .custom-col {
5
+ width: auto !important;
6
+ margin-left: -9px !important;
7
+ }
8
+
9
+ .fix-left-label {
10
+ left: 22px !important;
11
+ }
12
+ }
@@ -1,7 +1,15 @@
1
1
  .container-messages-new {
2
2
 
3
+ h3 {
4
+ margin-left: -14px;
5
+ }
6
+
3
7
  .options {
4
8
  margin-bottom: 32px;
9
+
10
+ label {
11
+ margin-left: -4px;
12
+ }
5
13
  }
6
14
 
7
15
  .message-attributes {
@@ -12,13 +20,14 @@
12
20
  text-decoration: underline;
13
21
  color: #0000EE;
14
22
  cursor: pointer;
23
+ float: left;
15
24
  }
16
25
 
17
26
  .btn-submit {
18
- margin-right: 24px;
27
+ margin-left: -10px;
19
28
  }
20
29
  }
21
30
 
22
31
  #message_devices {
23
32
  display: none;
24
- }
33
+ }
@@ -3,7 +3,7 @@ module JeraPush
3
3
 
4
4
  def index
5
5
  @filter = JeraPush::DeviceFilter.new params_filter
6
- @devices = @filter.search.order(created_at: :desc).page(params[:page]).per(params[:per])
6
+ @devices = @filter.search.order(created_at: :desc).page(params[:page]).per(10)
7
7
 
8
8
  respond_to do |format|
9
9
  format.js {}
@@ -2,25 +2,35 @@ module JeraPush::Admin::DevicesHelper
2
2
 
3
3
  def resource_extras(device)
4
4
  if JeraPush.resource_attributes && JeraPush.resource_attributes.any?
5
- return resource_attributes(JeraPush.resource_attributes, device.pushable)
5
+ return resource_attributes(JeraPush.resource_attributes, device.try(:pushable))
6
6
  end
7
- return [device.pushable]
7
+ return [device.try(:pushable)]
8
8
  end
9
9
 
10
10
  def resource_attributes(attributes, resource)
11
- if resource
12
- attrs = attributes.collect do |attribute|
13
- "#{attribute}: #{resource.send(attribute)}"
11
+ return [] unless resource.present?
12
+
13
+ attrs = attributes.collect do |attribute|
14
+ if resource&.send(attribute)
15
+ "#{I18n.t("activerecord.attributes.#{resource.class.to_s.downcase}.#{attribute}")}: #{resource.send(attribute)}"
14
16
  end
15
- return attrs.delete_if { |v| v.nil?}
17
+ end
18
+ attrs.delete_if { |v| v.nil?}
19
+ end
20
+
21
+ def translate_resource_names(resources_name=[])
22
+ resources_name.collect do |resource|
23
+ ["#{I18n.t("activerecord.models.#{resource.downcase}.one")}", resource]
16
24
  end
17
25
  end
18
26
 
19
27
  def devices_fields_for_filter_select
20
- fields = [:token]
28
+ fields = []
29
+ fields << [I18n.t("jera_push.admin.attributes.token"), "token"]
30
+
21
31
  if JeraPush.resource_attributes && JeraPush.resource_attributes.any?
22
32
  JeraPush.resource_attributes.each do |attribute|
23
- fields << attribute
33
+ fields << ["#{I18n.t("jera_push.admin.attributes.#{attribute}")}", attribute]
24
34
  end
25
35
  end
26
36
  fields
@@ -1,4 +1,4 @@
1
- <table class="highlight">
1
+ <table class="striped">
2
2
  <thead>
3
3
  <tr>
4
4
  <th data-field="checkbox"></th>
@@ -22,7 +22,7 @@
22
22
  <%= label_tag "device_#{device.id}", ''%>
23
23
  </td>
24
24
  <td><%= device.id %></td>
25
- <td><%= device.token.truncate(40) %></td>
25
+ <td><%= device.token.truncate(50) %></td>
26
26
  <td><%= device.platform %></td>
27
27
  <td colspan="4">
28
28
  <% resource_extras(device).each do |attribute| %>
@@ -32,4 +32,4 @@
32
32
  </tr>
33
33
  <% end %>
34
34
  </tbody>
35
- </table>
35
+ </table>
@@ -2,7 +2,7 @@
2
2
  <%= form_tag filter_path, method: :get, class: 'col s12', remote: true do |f| %>
3
3
  <div class="row">
4
4
  <% JeraPush::Device.platform.values.each do |platform| %>
5
- <div class="input-field col s2">
5
+ <div class="input-field col s2 custom-col">
6
6
  <p>
7
7
  <%= check_box_tag :"platform[]", platform, filter.platform.include?(platform), id: "platform_#{platform}" %>
8
8
  <label for="platform_<%= platform %>"><%= platform %><label>
@@ -12,7 +12,7 @@
12
12
  </div>
13
13
  <div class="row">
14
14
  <div class="input-field col s12">
15
- <%= select_tag :resource_name, options_for_select(JeraPush.resources_name, filter.resource_name) %>
15
+ <%= select_tag :resource_name, options_for_select(translate_resource_names(JeraPush.resources_name), filter.resource_name) %>
16
16
  </div>
17
17
  </div>
18
18
  <div class="row">
@@ -22,7 +22,7 @@
22
22
  <div class="input-field col s9">
23
23
  <div class="col s6">
24
24
  <%= text_field_tag :value, filter.value %>
25
- <label for="value"><%= t('jera_push.admin.filter.value') %></label>
25
+ <label class="fix-left-label" for="value"><%= t('jera_push.admin.filter.value') %></label>
26
26
  </div>
27
27
 
28
28
  <div class="input-field col s3">
@@ -31,4 +31,4 @@
31
31
  </div>
32
32
  </div>
33
33
  <% end %>
34
- </div>
34
+ </div>
@@ -1,24 +1,24 @@
1
- <table class="highlight">
1
+ <table class="highlight bordered">
2
2
  <thead>
3
3
  <tr>
4
4
  <th data-field="id"><%= t('jera_push.admin.devices.attributes.id') %></th>
5
- <th data-field="token"><%= t('jera_push.admin.devices.attributes.token') %></th>
6
5
  <th data-field="platform"><%= t('jera_push.admin.devices.attributes.platform') %></th>
7
6
  <th data-field="resource"><%= t('jera_push.admin.devices.attributes.resource') %></th>
7
+ <th data-field="token"><%= t('jera_push.admin.devices.attributes.token') %></th>
8
8
  </tr>
9
9
  </thead>
10
10
  <tbody>
11
11
  <% devices.each do |device| %>
12
12
  <tr>
13
- <td><%= device.id %></td>
14
- <td><%= device.token.truncate(50) %></td>
15
- <td><%= device.platform %></td>
16
- <td>
13
+ <td class="col s2"><%= device.id %></td>
14
+ <td class="col s2"><%= device.platform %></td>
15
+ <td class="col s2">
17
16
  <% resource_extras(device).each do |attribute| %>
18
17
  <div><%= attribute %></div>
19
18
  <% end %>
20
19
  </td>
20
+ <td class="col s2"><%= device.token %></td>
21
21
  </tr>
22
22
  <% end %>
23
23
  </tbody>
24
- </table>
24
+ </table>
@@ -19,9 +19,9 @@
19
19
  <% @messages.each do |message| %>
20
20
  <tr>
21
21
  <td width="5%"><%= message.id %></td>
22
- <td width="75%"><div class="json-message"><%= message.list_content %></div></td>
23
- <td width="20%"><%= message.display_created_at %></td>
24
- <td width="10%"><%= message.show_link %></td>
22
+ <td width="60%"><div class="json-message"><%= message.list_content %></div></td>
23
+ <td width="15%"><%= message.display_created_at %></td>
24
+ <td width="25%"><%= message.show_link %></td>
25
25
  </tr>
26
26
  <% end %>
27
27
  </tbody>
@@ -1,3 +1,4 @@
1
- <li class="disabled">
2
- <%= content_tag :a, raw(t 'views.pagination.truncate') %>
1
+ <!-- <li class="disabled">
2
+ < %= content_tag :a, raw(t 'views.pagination.truncate') %>
3
3
  </li>
4
+ -->
@@ -1,7 +1,7 @@
1
1
  <nav>
2
2
  <div class="nav-wrapper">
3
3
  <a href="<%= jera_push_admin_path %>" class="brand-logo">
4
- <img src="https://jera.com.br/images/logo-facebook.png" alt="Jera Software Logo">
4
+ <img src="https://jera.com.br/images/logo-jera-light.svg" alt="Jera Software Logo">
5
5
  </a>
6
6
  <ul id="nav-mobile" class="right hide-on-med-and-down">
7
7
  <li class="<%= 'active' if current_page?(jera_push_admin_devices_path) %>">
@@ -21,4 +21,4 @@
21
21
  </li>
22
22
  </ul>
23
23
  </div>
24
- </nav>
24
+ </nav>
@@ -27,6 +27,10 @@ pt-BR:
27
27
  id: ID
28
28
  platform: Plataforma
29
29
  admin:
30
+ attributes:
31
+ id: Identificador
32
+ name: Nome
33
+ email: Email
30
34
  navbar:
31
35
  devices: Aparelhos
32
36
  messages: Mensagens
@@ -39,12 +43,12 @@ pt-BR:
39
43
  send: Enviar
40
44
  send_all: Todos
41
45
  remove_all: Nenhum
42
- devices:
46
+ devices:
43
47
  attributes:
44
48
  id: Identificador
45
49
  token: Token
46
50
  platform: Plataforma
47
- resource: Recurso
51
+ resource: Recurso
48
52
  message_devices:
49
53
  attributes:
50
54
  device: Aparelho
@@ -72,4 +76,3 @@ pt-BR:
72
76
  new_attribute: Novo Atributo
73
77
  specific: Específico
74
78
  broadcast: Broadcast
75
-
@@ -1,3 +1,3 @@
1
1
  module JeraPush
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jera_push
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jera
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-07 00:00:00.000000000 Z
11
+ date: 2020-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5.2'
20
- - - "~>"
21
- - !ruby/object:Gem::Version
22
- version: '6'
19
+ version: 5.0.0
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
- version: '5.2'
30
- - - "~>"
31
- - !ruby/object:Gem::Version
32
- version: '6'
26
+ version: 5.0.0
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: enumerize
35
29
  requirement: !ruby/object:Gem::Requirement