sail 3.2.1 → 3.2.2

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: 94b1de6bcfc5b63dd7f8c70f41f8ea6ba1854c1c2450ec4af96ada1dbbb7d7ad
4
- data.tar.gz: 763a33aeeb99d60e3e39738c18cd69ce412f25d361172429b0290a1889987435
3
+ metadata.gz: 1f50a3ffd08ce3319b7c12965a4ada7954e9be63c98904480cb82fc9ca94876e
4
+ data.tar.gz: caf14276d020f847b8b7fd3d5959e028d300289cd7e996622cd4c00505dc820e
5
5
  SHA512:
6
- metadata.gz: bae9a9c7e57178919310c0346753334be151de60f40f30880285c39757d290a518b6a6a3d9c7d52d8daa4086246fb3633398a798db20bf2a38dd5e474e88ca6f
7
- data.tar.gz: d5bdabbe9a741573cfa830c772a7a0bb1725c62b493dff6414f93a49806e78e511691dbcd38f9d9b00a06a91371cbf75e995142aa978b45642934e79cc21b69a
6
+ metadata.gz: 34a45a3c9879a9317d60f43df33ad48f1391b7a44861eabefbe187cb221d9029c5bf98d4ce6bd8770059a8c535a9023fe0627b9dc458d5b2d82df67d4730667d
7
+ data.tar.gz: 034f78ae3a617031c3861b0777dc165dbf48ca3b5325e23758ac1d97cb53e684f06f8dfee05756a6eeb0dea0c04b6239fd75f0a29762839ad64c530578fee960
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ![dashboard](https://raw.githubusercontent.com/vinistock/sail/master/app/assets/images/sail/sail.png)
2
2
 
3
- [![Maintainability](https://api.codeclimate.com/v1/badges/00ed468acd8b93f66478/maintainability)](https://codeclimate.com/github/vinistock/sail/maintainability) [![Build Status](https://travis-ci.org/vinistock/sail.svg?branch=master)](https://travis-ci.org/vinistock/sail) [![Test Coverage](https://codeclimate.com/github/vinistock/sail/badges/coverage.svg)](https://codeclimate.com/github/vinistock/sail/coverage) [![Gem Version](https://badge.fury.io/rb/sail.svg)](https://badge.fury.io/rb/sail) ![](http://ruby-gem-downloads-badge.herokuapp.com/sail?color=brightgreen&type=total)
3
+ [![Maintainability](https://api.codeclimate.com/v1/badges/00ed468acd8b93f66478/maintainability)](https://codeclimate.com/github/vinistock/sail/maintainability) [![Build Status](https://travis-ci.org/vinistock/sail.svg?branch=master)](https://travis-ci.org/vinistock/sail) [![Test Coverage](https://codeclimate.com/github/vinistock/sail/badges/coverage.svg)](https://codeclimate.com/github/vinistock/sail/coverage) [![Gem Version](https://badge.fury.io/rb/sail.svg)](https://badge.fury.io/rb/sail) ![](http://ruby-gem-downloads-badge.herokuapp.com/sail?color=brightgreen&type=total) [![Mentioned in Awesome Ruby](https://awesome.re/mentioned-badge.svg)](https://github.com/markets/awesome-ruby)
4
4
 
5
5
  # Sail
6
6
 
@@ -213,6 +213,8 @@ Response
213
213
 
214
214
  Sail's few strings are all localized for English in [en.yml], making it easy to create translations for the desired languages.
215
215
 
216
+ Make sure to pass in the desired locale as a parameter.
217
+
216
218
  ## Contributing
217
219
 
218
220
  Contributions are very welcome! Don't hesitate to ask if you wish to contribute, but don't yet know how.
@@ -15,6 +15,8 @@ let profilesButton = document.getElementById("btn-profiles");
15
15
  let dashboardBody = document.getElementById("settings-dashboard");
16
16
  let guideButton = document.getElementById("btn-guide");
17
17
  let guide = document.getElementById("guide-modal");
18
+ let guideSections = guide.getElementsByTagName("summary");
19
+ var i;
18
20
 
19
21
  function submitSearch() {
20
22
  document.getElementById("search-form").submit();
@@ -118,4 +120,18 @@ function refreshClick() {
118
120
  }
119
121
  }
120
122
 
121
- for(var i = 0; i < refreshButtons.length; i++) refreshButtons[i].addEventListener("click", refreshClick);
123
+ for(i = 0; i < refreshButtons.length; i++) refreshButtons[i].addEventListener("click", refreshClick);
124
+
125
+ // Guide related functions
126
+
127
+ function sectionClick() {
128
+ for(i = 0; i < guideSections.length; i++) {
129
+ if (this.parentElement.open) {
130
+ guideSections[i].parentElement.style.display = "block";
131
+ } else if (this !== guideSections[i]) {
132
+ guideSections[i].parentElement.style.display = "none";
133
+ }
134
+ }
135
+ }
136
+
137
+ for(i = 0; i < guideSections.length; i++) guideSections[i].addEventListener("click", sectionClick);
@@ -6,4 +6,4 @@ $aluminium: #D9D9D9;
6
6
  $light_yellow: #F9CF00;
7
7
  $tangerine: #F19F4D;
8
8
  $lead: #003049;
9
- $bright_red: #D00000;
9
+ $bright_red: #E63946;
@@ -17,20 +17,35 @@
17
17
  @import "colors";
18
18
  @import "shared";
19
19
 
20
+ * {
21
+ font-family: 'Open Sans', sans-serif;
22
+ }
23
+
24
+ .title {
25
+ font-family: 'Montserrat', sans-serif;
26
+ }
27
+
20
28
  html, body {
21
29
  height: 100vh;
22
30
  margin: 0;
23
31
  padding: 0;
24
32
  background-color: $cerulean;
25
- font-family: 'Raleway', sans-serif;
26
33
  }
27
34
 
28
35
  .clearfix {
29
36
  clear: both;
30
37
  }
31
38
 
39
+ .clear-xs {
40
+ @media (max-width: 413px) {
41
+ clear: both;
42
+ margin-top: 8px;
43
+ }
44
+ }
45
+
32
46
  #nav-bar {
33
47
  background-color: $lead;
48
+ box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15), 0 5px 12px rgba(0, 0, 0, 0.1);
34
49
 
35
50
  .home-link {
36
51
  @extend .color-transition;
@@ -48,7 +63,6 @@ html, body {
48
63
  position: relative;
49
64
  bottom: 50px;
50
65
  font-size: 20px;
51
- font-family: "Raleway", sans-serif;
52
66
  outline: none;
53
67
  background: transparent;
54
68
  border: none;
@@ -63,7 +77,8 @@ html, body {
63
77
 
64
78
  #btn-guide {
65
79
  right: 70px;
66
-
80
+ padding: 0;
81
+ margin: 0;
67
82
  @media (min-width: 1200px) { right: 110px; }
68
83
  }
69
84
 
@@ -116,10 +131,10 @@ html, body {
116
131
 
117
132
  .modal {
118
133
  position: fixed;
119
- height: 50%;
120
- width: 50%;
121
- top: 25%;
122
- left: 25%;
134
+ height: 70%;
135
+ width: 70%;
136
+ top: 15%;
137
+ left: 15%;
123
138
  background-color: white;
124
139
  z-index: 1;
125
140
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
@@ -220,7 +235,6 @@ html, body {
220
235
  border: none;
221
236
  font-size: 20px;
222
237
  width: 90%;
223
- font-family: 'Raleway', sans-serif;
224
238
  position: relative;
225
239
  top: 10px;
226
240
  text-overflow: ellipsis;
@@ -260,6 +274,10 @@ html, body {
260
274
  float: right;
261
275
  }
262
276
 
277
+ img {
278
+ display: none;
279
+ }
280
+
263
281
  &::-webkit-details-marker {
264
282
  display: none;
265
283
  }
@@ -299,6 +317,15 @@ html, body {
299
317
  label {
300
318
  display: none;
301
319
  }
320
+
321
+ img {
322
+ display: block;
323
+ height: 20px;
324
+ width: 20px;
325
+ float: left;
326
+ position: relative;
327
+ top: 10px;
328
+ }
302
329
  }
303
330
 
304
331
  p, p ~ * {
@@ -15,7 +15,7 @@
15
15
  background-color: white;
16
16
  margin: 1rem .75rem;
17
17
  display: inline-block;
18
- box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
18
+ box-shadow: 0 19px 38px rgba(0, 0, 0, 0.15), 0 15px 12px rgba(0, 0, 0, 0.1);
19
19
  padding: 10px;
20
20
  z-index: 2;
21
21
  width: 90%;
@@ -32,7 +32,7 @@
32
32
 
33
33
  .relevancy-score {
34
34
  float: right;
35
- color: darken($aluminium, 5%);
35
+ color: darken($aluminium, 30%);
36
36
  }
37
37
  }
38
38
 
@@ -91,6 +91,10 @@
91
91
  text-align: center;
92
92
  border: none;
93
93
  border-bottom: 2px solid $aluminium;
94
+ -webkit-border-radius: 0;
95
+ -moz-border-radius: 0;
96
+ border-radius: 0;
97
+ padding: 0;
94
98
  @extend .border-transition;
95
99
  }
96
100
 
@@ -99,9 +103,13 @@
99
103
  bottom: 10px;
100
104
  border: none;
101
105
  border-bottom: 2px solid $aluminium;
106
+ -webkit-border-radius: 0;
107
+ -moz-border-radius: 0;
108
+ border-radius: 0;
102
109
  width: 100%;
103
110
  text-align: center;
104
111
  font-size: 22px;
112
+ padding: 0;
105
113
  @extend .border-transition;
106
114
  }
107
115
 
@@ -317,7 +325,6 @@
317
325
  border: none;
318
326
  width: 100%;
319
327
  font-size: 20px;
320
- font-family: 'Raleway', sans-serif;
321
328
  background: transparent;
322
329
  padding: 5px;
323
330
  @extend .rounded;
@@ -9,5 +9,13 @@ module Sail
9
9
  def current_user
10
10
  main_app.scope.request.env["warden"]&.user
11
11
  end
12
+
13
+ def default_url_options
14
+ { locale: I18n.locale }
15
+ end
16
+
17
+ def set_locale
18
+ I18n.locale = params[:locale].presence || I18n.default_locale
19
+ end
12
20
  end
13
21
  end
@@ -8,6 +8,7 @@ module Sail
8
8
  # Implements all actions for the dashboard
9
9
  # and for the JSON API
10
10
  class SettingsController < ApplicationController
11
+ before_action :set_locale, only: :index
11
12
  after_action :log_update, only: %i[update reset], if: -> { Sail.configuration.enable_logging && @successful_update }
12
13
 
13
14
  # rubocop:disable AbcSize
@@ -6,7 +6,7 @@
6
6
  <meta name="theme-color" content="#4484CE">
7
7
  <meta name="description" content="Sail is a lightweight Rails engine that brings an admin panel for managing configuration settings on a live Rails app">
8
8
  <title><%= I18n.t('sail.page_title') %></title>
9
- <link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet">
9
+ <link href="https://fonts.googleapis.com/css?family=Montserrat|Open+Sans&display=swap" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'">
10
10
  <%= stylesheet_link_tag "sail/application", media: "all" %>
11
11
  <%= javascript_include_tag "sail/application", async: true %>
12
12
  <%= csrf_meta_tags %>
@@ -4,6 +4,8 @@
4
4
 
5
5
  <details>
6
6
  <summary>
7
+ <%= image_tag("sail/angle-left.svg") %>
8
+
7
9
  <div>
8
10
  <%= I18n.t("sail.searching") %>
9
11
  <label><%= I18n.t("sail.how_to_find_settings") %></label>
@@ -26,6 +28,8 @@
26
28
 
27
29
  <details>
28
30
  <summary>
31
+ <%= image_tag("sail/angle-left.svg") %>
32
+
29
33
  <div>
30
34
  <%= I18n.t("sail.profiles") %>
31
35
  <label><%= I18n.t("sail.how_to_profiles") %></label>
@@ -39,6 +43,8 @@
39
43
 
40
44
  <details>
41
45
  <summary>
46
+ <%= image_tag("sail/angle-left.svg") %>
47
+
42
48
  <div>
43
49
  <%= I18n.t("sail.relevancy_score") %>
44
50
  <label><%= I18n.t("sail.how_to_relevancy_score") %></label>
@@ -51,6 +57,8 @@
51
57
 
52
58
  <details>
53
59
  <summary>
60
+ <%= image_tag("sail/angle-left.svg") %>
61
+
54
62
  <div>
55
63
  <%= I18n.t("sail.available_groups_and_types") %>
56
64
  <label><%= I18n.t("sail.how_to_groups_and_types") %></label>
@@ -1,6 +1,6 @@
1
1
  <% cache setting, expires_in: Sail.configuration.cache_life_span do %>
2
2
  <div class="card">
3
- <h3>
3
+ <h3 class="title">
4
4
  <%= setting.display_name %>
5
5
 
6
6
  <span class="relevancy-score" title="<%= I18n.t("sail.relevancy_tooltip") %>"><%= setting.relevancy %></span>
@@ -24,13 +24,17 @@
24
24
  </div>
25
25
  <% end %>
26
26
 
27
+ <div class="clear-xs"></div>
28
+
27
29
  <% if setting.stale? %>
28
30
  <div class="label-container">
29
31
  <%= link_to(I18n.t("sail.stale"), settings_path(query: Sail::ConstantCollection::STALE), method: :get, class: "tag stale-label", title: I18n.t("sail.stale_tooltip", days: Sail.configuration.days_until_stale)) %>
30
32
  </div>
31
33
  <% end %>
32
34
 
33
- <p class="setting-description" title="<%= setting.description %>"><%= setting.description %></p>
35
+ <p class="setting-description" title="<%= setting.description %>">
36
+ <label for="<%= "input_for_#{setting.name}" %>"><%= setting.description %></label>
37
+ </p>
34
38
 
35
39
  <%= form_tag(setting_path(name: setting.name), method: :put, remote: true) do %>
36
40
  <div class="card-body-container">
@@ -32,7 +32,7 @@ en:
32
32
  by_group_html: "<b>By group:</b> will find all settings in the same group (must be exact match)"
33
33
  by_cast_type_html: "<b>By cast type:</b> will find all settings with the same type (must be exact match)"
34
34
  by_stale_html: "<b>By stale:</b> will find settings that are stale (haven't been updated recently)"
35
- by_recent_html: "<b>By recent:</b> will find settings updated in the last X hours (.e.g: recent 50)"
35
+ by_recent_html: "<b>By recent:</b> will find settings updated in the last X hours (e.g.: recent 50)"
36
36
  profiles_can_be_used: Profiles can be used to configure many states of settings. They save the values of all settings in a given moment.
37
37
  profile_configuring: Configure settings as desired and create a new profile. Activate profiles to change the value of all settings at once.
38
38
  relevancy_score: Relevancy Score
@@ -40,13 +40,11 @@ module Sail
40
40
  errors = [ActiveRecord::NoDatabaseError]
41
41
  errors << PG::ConnectionBad if defined?(PG)
42
42
 
43
- # rubocop:disable Naming/RescuedExceptionsVariableName
44
43
  begin
45
44
  Sail::Setting.load_defaults unless Rails.env.test?
46
45
  rescue *errors
47
46
  warn "Skipping setting creation because database doesn't exist"
48
47
  end
49
- # rubocop:enable Naming/RescuedExceptionsVariableName
50
48
  end
51
49
 
52
50
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sail
4
- VERSION = "3.2.1"
4
+ VERSION = "3.2.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sail
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vinicius Stock
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-08 00:00:00.000000000 Z
11
+ date: 2019-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fugit
@@ -248,6 +248,20 @@ dependencies:
248
248
  - - ">="
249
249
  - !ruby/object:Gem::Version
250
250
  version: '0'
251
+ - !ruby/object:Gem::Dependency
252
+ name: rubocop-rails
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ type: :development
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ">="
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
251
265
  - !ruby/object:Gem::Dependency
252
266
  name: simplecov
253
267
  requirement: !ruby/object:Gem::Requirement
@@ -359,7 +373,7 @@ licenses:
359
373
  metadata: {}
360
374
  post_install_message: |
361
375
  **************************************************************************
362
- Sail 3.2.1!
376
+ Sail 3.2.2!
363
377
 
364
378
  For major version upgrades, check the CHANGELOG and run the updater to
365
379
  create necessary migrations.
@@ -381,7 +395,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
381
395
  - !ruby/object:Gem::Version
382
396
  version: '0'
383
397
  requirements: []
384
- rubygems_version: 3.0.3
398
+ rubygems_version: 3.0.4
385
399
  signing_key:
386
400
  specification_version: 4
387
401
  summary: Sail is a lightweight Rails engine that brings an admin panel for managing