keystone_ui-colors 0.5.0 → 0.6.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: 7e19d4ac1360f6f858edb7466444b610d3aa41f27c41c770f9d2b1674e51d04b
4
- data.tar.gz: 53bc07b0653b12cd9b36f9b94908a6aebdb8cc79370618c0ba70f22a27fdf21a
3
+ metadata.gz: 86b3c37333e27dbf268ca2d3295c43b44034c969dd3036fead470cd9d5651ac8
4
+ data.tar.gz: bc34dce6a7a7109a243b4864b4c5cc7810b6a5aa0c4b498e9b3ce3588e5c54c8
5
5
  SHA512:
6
- metadata.gz: e9e76f7316025de47b02b16e490c674dbacc7fd2eb43d0122c9a84b1d60c0350bda35a4514993a550ffa28e4b624ef7961cb72aee95bc7aeb62f576e5a3675cb
7
- data.tar.gz: b2f238d93c3fd4384d99e94891ef4afff962dded85eb3809f6fd8ac111eb17c9513e9cda2d61f102da557deef1f9093a1f4d46598c9e3058cbd81d8d9365db79
6
+ metadata.gz: c358b736c5ec048821cb3e61e1be0caccd82e5c411fb01d8a2ea2e3d7779633dc3d24d602485bae10085539d3c6db6c4338fb8600a36e2d1b7be8d2a4a4dbde7
7
+ data.tar.gz: e33ee1858ae023f5d15758dc3aa43c38d289d50bf38e2fc24a892805d51617c430e6fa777cbb8beed25bf53e3795d5cf5e9654988d43b01d57cc5bf48e9c1303
data/README.md CHANGED
@@ -184,8 +184,11 @@ or for the host's default when the account's look is not registered either. The
184
184
  settings page then shows no look selected and still saves. While an account's colours apply, the
185
185
  page still shows the user's own look.
186
186
 
187
- The colours settings page lists every registered look, with the user's current
188
- look chosen, and saves the one they pick. A name the host does not register is
187
+ The colours settings page lists the app's own look first and then every
188
+ registered look, with the user's current look chosen, and saves the one they
189
+ pick. The app's own look is labelled "Classic" unless the app sets
190
+ `app_look_label`, is chosen when no look is saved, and saving it clears the saved
191
+ look, so the page goes back to the account's look or the app's default. A name the host does not register is
189
192
  refused with a message and nothing is stored. With no looks registered the page
190
193
  shows no look choice.
191
194
 
@@ -12,7 +12,7 @@ module KeystoneUi
12
12
 
13
13
  def call
14
14
  preference.assign_attributes(chosen_colours)
15
- preference.look = @values[:look] if @values.key?(:look) && @look_allowed
15
+ preference.look = @values[:look].presence if @values.key?(:look) && @look_allowed
16
16
 
17
17
  return Refusal.new(preference.errors.full_messages.first) unless preference.save
18
18
 
@@ -1,7 +1,8 @@
1
1
  <%= ui_section(title: "Look", spacing: :sm) do %>
2
2
  <div style="display: flex; flex-wrap: wrap; gap: 0.5rem;">
3
+ <%= ui_radio_card(name: "look", value: "", label: KeystoneUi::Colors.configuration.app_look_label, checked: preference.look.nil?) %>
3
4
  <% KeystoneUi.configuration.looks.each_key do |look| %>
4
- <%= ui_radio_card(name: "look", value: look, label: look.humanize, checked: (preference.look || KeystoneUi.configuration.default_look) == look) %>
5
+ <%= ui_radio_card(name: "look", value: look, label: look.humanize, checked: preference.look == look) %>
5
6
  <% end %>
6
7
  </div>
7
8
  <% end %>
@@ -3,7 +3,7 @@
3
3
  module KeystoneUi
4
4
  module Colors
5
5
  class Configuration
6
- attr_accessor :current_owner_method, :authentication_method, :default_template, :default_accent, :default_surface, :default_mode, :default_background, :default_text, :account_colors, :current_account_method, :layout, :user_looks, :account_looks
6
+ attr_accessor :current_owner_method, :authentication_method, :default_template, :default_accent, :default_surface, :default_mode, :default_background, :default_text, :account_colors, :current_account_method, :layout, :user_looks, :account_looks, :app_look_label
7
7
 
8
8
  def initialize
9
9
  @current_owner_method = :current_user
@@ -19,6 +19,7 @@ module KeystoneUi
19
19
  @layout = "application"
20
20
  @user_looks = true
21
21
  @account_looks = true
22
+ @app_look_label = "Classic"
22
23
  end
23
24
  end
24
25
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module KeystoneUi
4
4
  module Colors
5
- VERSION = "0.5.0"
5
+ VERSION = "0.6.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keystone_ui-colors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Schneider