super_settings 2.3.1 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8062539b6606b9cd5d043cfe7ec52abfe7a49a13edb59fbd8a9660831282c89
4
- data.tar.gz: 5bd8d1a568fc9828f0a3c1d57d2efda2109ffebf7ecbe5ba55d8ba1c01e1f57c
3
+ metadata.gz: a409f83b0e25f1a6822167604061a205a9f2ba9144776ae12c917a28934af8aa
4
+ data.tar.gz: 7b58a037a30031cbdadaf2afbfcaf37faa0c6d48dee38a6d0a61b7559d99806a
5
5
  SHA512:
6
- metadata.gz: e0a64b3993479ec0f0e94ba362e9dba51dd2ca44d2da8ec09c29f2e0a67bbcae4393352846de727cd21c31eab244304edf8847d2d922acd583cc6f4dc9ebc482
7
- data.tar.gz: 65952c3cecf4ef4c97ff4d84e0a6d49ee4515260551c6941dbe8eeaf894bf3a0d21c922ed8d6afb8431680556c39771de93656de31f1f7c8fa2ef4dd5b84f3ef
6
+ metadata.gz: 797087d1072b5f2dd88fee2f361ad2e4dc53d44145ee57f2a17f0e31fc0fb88c99ddcc73cac8d5f3e39ad5a00d56123748c544fb724e1ac8ef2945d8a004ad19
7
+ data.tar.gz: d586e20dac006fde52f5da754acf7c154a891bf82e4682c7b90b5a432c7261f0a60caaa951783c4586dc960a1d31f3865680b8732142cd0ccb8e26acac80a5ee
data/ARCHITECTURE.md ADDED
File without changes
data/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## 2.4.0
8
+
9
+ ### Added
10
+
11
+ - Incoming links to the web UI now support specifying the value type for the setting being edited by passing `type=value_type` in the URL hash. For example, `#edit=port&type=integer` will open the setting with the key `port` for editing as an integer.
12
+
13
+ ### Changed
14
+
15
+ - Web UI significantly updated to be cleaner and more modern using responsive design instead of tables.
16
+
7
17
  ## 2.3.1
8
18
 
9
19
  ### Fixed
data/README.md CHANGED
@@ -179,11 +179,13 @@ bin/start_rails
179
179
 
180
180
  Then go to http://localhost:3000/settings in your browser.
181
181
 
182
- You can change the layout used by the Web UI. However, if you do this, you will be responsible for providing the CSS styles for the buttons, table rows, and form controls. The CSS class names used by the default layout are compatible with the class names defined in the [Bootstrap library](https://getbootstrap.com/).
183
-
184
182
  It is not required to use the bundled Web UI. You can implement your own UI using the `SuperSettings::Setting` model.
185
183
 
186
- You can link directly to editing a setting by passing `#edit=key` in the URL hash. This will open the Web UI with the setting with the key `key` selected for editing.
184
+ You can link directly to editing a setting by passing `#edit=key` in the URL hash. This will open the Web UI with the setting with the key `key` selected for editing. You can also `type` in the URL hash to specify the value type for the setting. For example, `#edit=port&type=integer` will open the setting with the key `port` for editing as an integer.
185
+
186
+ ```html
187
+ <a href="/settings#edit=port&type=integer">Edit Port Setting</a>
188
+ ```
187
189
 
188
190
  #### REST API
189
191
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.1
1
+ 2.4.0
@@ -21,32 +21,26 @@
21
21
  <strong class="js-flash" style="display:none; margin-left:3rem;"></strong>
22
22
  </div>
23
23
 
24
- <table class="super-settings-table super-settings-table-striped" id="settings-table">
25
- <thead>
26
- <tr>
27
- <th scope="col" class="super-settings-key">
28
- Key
29
- <button class="super-settings-sort-control super-settings-btn-no-chrome" data-field="key" data-order="asc" data-selected="true" title="Sort by key">
30
- <%= icon_image("arrow-down-short", data: {order: :asc}, style: {display: "inline-block"}) %>
31
- <%= icon_image("arrow-up-short", data: {order: :desc}, style: {display: "none"}) %>
32
- </button>
33
- </th>
34
- <th scope="col" class="super-settings-value">Value</th>
35
- <th scope="col" class="super-settings-value-type">Type</th>
36
- <th scope="col" class="super-settings-description">Description</th>
37
- <th scope="col" data-field="updated_at">
38
- Modified
39
- <button class="super-settings-sort-control super-settings-btn-no-chrome" data-field="updated_at" data-order="asc" title="Sort by modified time">
40
- <%= icon_image("arrow-down-short", data: {order: :asc}, style: {display: "inline-block"}) %>
41
- <%= icon_image("arrow-up-short", data: {order: :desc}, style: {display: "none"}) %>
42
- </button>
43
- </th>
44
- <th scope="col" class="super-settings-controls"><span class="super-settings-sr-only">Controls</span></th>
45
- </tr>
46
- </thead>
47
- <tbody translate="no">
48
- </tbody>
49
- </table>
24
+ <div class="super-settings-sort-controls">
25
+ <span class="super-settings-sort-label">Sort by:</span>
26
+ <button class="super-settings-sort-control super-settings-btn-no-chrome" data-field="key" data-order="asc" data-selected="true" title="Sort by key">
27
+ Key
28
+ <%= icon_image("arrow-down-short", data: {order: :asc}, style: {display: "inline-block"}) %>
29
+ <%= icon_image("arrow-up-short", data: {order: :desc}, style: {display: "none"}) %>
30
+ </button>
31
+ <span></span>
32
+ <span></span>
33
+ <span></span>
34
+ <button class="super-settings-sort-control super-settings-btn-no-chrome" data-field="updated_at" data-order="asc" title="Sort by modified time">
35
+ Modified
36
+ <%= icon_image("arrow-down-short", data: {order: :asc}, style: {display: "inline-block"}) %>
37
+ <%= icon_image("arrow-up-short", data: {order: :desc}, style: {display: "none"}) %>
38
+ </button>
39
+ <span></span>
40
+ </div>
41
+
42
+ <div class="super-settings-cards-container" id="settings-container" translate="no">
43
+ </div>
50
44
  </form>
51
45
 
52
46
  <div id="super-settings-modal" class="super-settings-modal js-close-modal" aria-hidden="true" aria-role="dialog">
@@ -58,81 +52,86 @@
58
52
  </div>
59
53
  </main>
60
54
 
61
- <template id="setting-row-template" style="display:none;">
62
- <tr>
63
- <td class="super-settings-key">
64
- <div class="js-value-placeholder"></div>
65
- <input type="hidden" value="" name="settings[{{id}}][key]" class="js-setting-key">
66
- <input type="hidden" value="" name="settings[{{id}}][delete]" class="js-setting-deleted">
67
- </td>
68
-
69
- <td class="super-settings-value">
70
- <div class="js-value-placeholder super-settings-max-height-text"></div>
71
- </td>
72
-
73
- <td class="super-settings-value-type">
74
- <div class="js-value-placeholder"></div>
75
- </td>
76
-
77
- <td class="super-settings-description">
78
- <div class="js-value-placeholder super-settings-max-height-text"></div>
79
- </td>
80
-
81
- <td class="super-settings-last-modified super-settings-text-nowrap">
82
- <div class="js-value-placeholder"></div>
83
- </td>
84
-
85
- <td class="super-settings-controls">
86
- <%= icon_button("info-circle", title: "Setting Info", color: "#0d7ff0", js_class: "js-show-history") %>
87
- <%= icon_button("pencil-square", title: "Edit Setting", color: "#0c8024", js_class: "js-edit-setting") %>
88
- <%= icon_button("trash3", title: "Remove Setting", color: "#dc3545", js_class: "js-remove-setting") %>
89
- <%= icon_button("x-circle", title: "Cancel Changes", color: "#dc3545", js_class: "js-restore-setting", link_style: "display:none;") %>
90
- </td>
91
- </tr>
92
- </template>
55
+ <template id="setting-card-template" style="display:none;">
56
+ <div class="super-settings-card">
57
+ <div class="super-settings-card-content">
58
+ <div class="super-settings-key super-settings-card-key">
59
+ <label class="super-settings-card-label">Key:</label>
60
+ <span class="js-value-placeholder"></span>
61
+ <input type="hidden" value="" name="settings[{{id}}][key]" class="js-setting-key">
62
+ <input type="hidden" value="" name="settings[{{id}}][delete]" class="js-setting-deleted">
63
+ </div>
93
64
 
94
- <template id="setting-row-edit-template" style="display:none;">
95
- <tr data-edited="true" class="super-settings-edit-row">
96
- <td class="super-settings-key">
97
- <div>
98
- <label for="settings_{{id}}_key" class="super-settings-sr-only">Key</label>
99
- <input type="text" id="settings_{{id}}_key" name="settings[{{id}}][key]" value="" maxlength="190" class="super-settings-form-control js-setting-key" required>
65
+ <div class="super-settings-card-value">
66
+ <label class="super-settings-card-label">Value:</label>
67
+ <div class="js-value-placeholder super-settings-max-height-text"></div>
100
68
  </div>
101
- </td>
102
69
 
103
- <td class="super-settings-value">
104
- <div>
105
- <label for="settings_{{id}}_value" class="super-settings-sr-only">Value</label>
70
+ <div class="super-settings-card-type">
71
+ <label class="super-settings-card-label">Type:</label>
106
72
  <span class="js-value-placeholder"></span>
107
73
  </div>
108
- <div class="super-settings-container super-settings-text-danger js-setting-errors" style="display:none;">
74
+
75
+ <div class="super-settings-card-description">
76
+ <label class="super-settings-card-label">Description:</label>
77
+ <div class="js-value-placeholder super-settings-max-height-text"></div>
78
+ </div>
79
+
80
+ <div class="super-settings-card-modified">
81
+ <label class="super-settings-card-label">Modified:</label>
82
+ <span class="js-value-placeholder"></span>
109
83
  </div>
110
- </td>
111
84
 
112
- <td class="super-settings-value-type">
113
- <div>
114
- <label for="settings_{{id}}_value_type" class="super-settings-sr-only">Value Type</label>
85
+ <div class="super-settings-card-controls">
86
+ <%= icon_button("info-circle", title: "Setting Info", color: "var(--icon-info-color)", js_class: "js-show-history") %>
87
+ <%= icon_button("pencil-square", title: "Edit Setting", color: "var(--icon-edit-color)", js_class: "js-edit-setting") %>
88
+ <%= icon_button("trash3", title: "Remove Setting", color: "var(--icon-delete-color)", js_class: "js-remove-setting") %>
89
+ <%= icon_button("x-circle", title: "Cancel Changes", color: "var(--icon-cancel-color)", js_class: "js-restore-setting", link_style: "display:none;") %>
90
+ </div>
91
+ </div>
92
+ </div>
93
+ </template>
94
+
95
+ <template id="setting-card-edit-template" style="display:none;">
96
+ <div class="super-settings-card super-settings-card-edit" data-edited="true">
97
+ <div class="super-settings-card-content">
98
+ <div class="super-settings-card-key">
99
+ <label for="settings_{{id}}_key" class="super-settings-card-label">Key:</label>
100
+ <input type="text" id="settings_{{id}}_key" name="settings[{{id}}][key]" value="" maxlength="190" class="super-settings-form-control js-setting-key" required placeholder="Setting key">
101
+ </div>
102
+
103
+ <div class="super-settings-card-value">
104
+ <label for="settings_{{id}}_value" class="super-settings-card-label">Value:</label>
105
+ <span class="js-value-placeholder"></span>
106
+ <div class="super-settings-container super-settings-text-danger js-setting-errors" style="display:none;">
107
+ </div>
108
+ </div>
109
+
110
+ <div class="super-settings-card-type">
111
+ <label for="settings_{{id}}_value_type" class="super-settings-card-label">Type:</label>
115
112
  <select name="settings[{{id}}][value_type]" class="super-settings-form-control js-setting-value-type" id="settings_{{id}}_value_type">
116
113
  <% SuperSettings::Setting::VALUE_TYPES.each do |value_type| %>
117
114
  <option value="<%= html_escape(value_type) %>"><%= html_escape(value_type) %></option>
118
115
  <% end %>
119
116
  </select>
120
117
  </div>
121
- </td>
122
118
 
123
- <td class="super-settings-description" colspan="2">
124
- <div>
125
- <label for="settings_{{id}}_description" class="super-settings-sr-only">Description</label>
126
- <textarea id="settings_{{id}}_description" name="settings[{{id}}][description]" value="" class="super-settings-form-control" rows="4"></textarea>
119
+ <div class="super-settings-card-description">
120
+ <label for="settings_{{id}}_description" class="super-settings-card-label">Description:</label>
121
+ <textarea id="settings_{{id}}_description" name="settings[{{id}}][description]" value="" class="super-settings-form-control" rows="3" placeholder="Description of this setting"></textarea>
122
+ </div>
123
+
124
+ <div class="super-settings-card-modified">
125
+ <!-- Empty for edit mode -->
127
126
  </div>
128
- </td>
129
-
130
- <td class="super-settings-controls">
131
- <%= icon_button("info-circle", title: "Setting Info", color: "#0d7ff0", js_class: "js-show-history") %>
132
- <%= icon_button("pencil-square", title: "Edit Setting", color: "#c0c0c0", js_class: "js-no-op", disabled: true) %>
133
- <%= icon_button("x-circle", title: "Cancel Changes", color: "#dc3545", js_class: "js-restore-setting") %>
134
- </td>
135
- </tr>
127
+
128
+ <div class="super-settings-card-controls">
129
+ <%= icon_button("info-circle", title: "Setting Info", color: "var(--icon-info-color)", js_class: "js-show-history") %>
130
+ <%= icon_button("pencil-square", title: "Edit Setting", color: "var(--icon-disabled-color)", js_class: "js-no-op", disabled: true) %>
131
+ <%= icon_button("x-circle", title: "Cancel Changes", color: "var(--icon-cancel-color)", js_class: "js-restore-setting") %>
132
+ </div>
133
+ </div>
134
+ </div>
136
135
  </template>
137
136
 
138
137
  <template id="setting-value-field-template" style="display:none;">
@@ -170,17 +169,15 @@
170
169
 
171
170
  <template id="setting-history-table" style="display:none">
172
171
  <h3>Setting History: <span class="super-settings-history-key"></span></h3>
173
- <table class="super-settings-table super-settings-table-striped" id="super-settings-history">
174
- <thead>
175
- <tr>
176
- <th scope="col" class="super-settings-text-nowrap">Time</th>
177
- <th scope="col">Changed By</th>
178
- <th scope="col">Value</th>
179
- </tr>
180
- </thead>
181
- <tbody>
182
- </tbody>
183
- </table>
172
+ <div class="super-settings-history-container">
173
+ <div class="super-settings-history-header">
174
+ <div class="super-settings-history-time">Time</div>
175
+ <div class="super-settings-history-user">Changed By</div>
176
+ <div class="super-settings-history-value">Value</div>
177
+ </div>
178
+ <div class="super-settings-history-items" id="super-settings-history">
179
+ </div>
180
+ </div>
184
181
  </template>
185
182
 
186
183
  <%= javascript_tag %>