From baf7dd1f9ff8833ae2a03277b7fe3d08661e2650 Mon Sep 17 00:00:00 2001 From: MoshiKoi <54333972+MoshiKoi@users.noreply.github.com> Date: Fri, 21 Aug 2026 05:29:31 +0000 Subject: [PATCH 1/9] Add a user preference for the preferred community order --- app/assets/javascripts/community_order.js | 19 ++++++ app/assets/stylesheets/users.scss | 24 +++++++ app/views/layouts/_head.html.erb | 1 + app/views/users/_prefs.html.erb | 79 ++++++++++++++++------- app/views/users/_prefs_block.erb | 9 +++ app/views/users/_prefs_inline.erb | 9 +++ config/config/preferences.yml | 9 ++- package-lock.json | 20 ++++++ package.json | 1 + tsconfig.json | 2 +- 10 files changed, 147 insertions(+), 26 deletions(-) create mode 100644 app/assets/javascripts/community_order.js create mode 100644 app/views/users/_prefs_block.erb create mode 100644 app/views/users/_prefs_inline.erb diff --git a/app/assets/javascripts/community_order.js b/app/assets/javascripts/community_order.js new file mode 100644 index 000000000..b2641695e --- /dev/null +++ b/app/assets/javascripts/community_order.js @@ -0,0 +1,19 @@ +document.addEventListener('DOMContentLoaded', () => { + const pref = $(".community-sortable"); + const sortable = pref.find(".sortable"); + + const input = pref.find(".js-user-pref"); + + sortable.sortable({ + appendTo: pref, + update: () => { + const val = sortable.children() + .map((_, el) => el.dataset['community']) + .toArray() + .join(','); + + input.val(val); + input.trigger("change"); + } + }); +}); \ No newline at end of file diff --git a/app/assets/stylesheets/users.scss b/app/assets/stylesheets/users.scss index 3835a2878..2fe215ab9 100644 --- a/app/assets/stylesheets/users.scss +++ b/app/assets/stylesheets/users.scss @@ -187,6 +187,30 @@ img { } } +.user-pref.user-block-pref { + flex-direction: column; + align-items: flex-start; +} + +.community-sortable { + .community-sortable-list-item { + display: flex; + justify-content: flex-start; + align-items: center; + cursor: grab; + img { + max-height: 1.5rem; + } + .img { + width: 100px; + padding: 10px; + } + .label { + flex-grow: 1; + } + } +} + $sizes: (16, 32, 40, 48, 64, 128, 256); @each $size in $sizes { diff --git a/app/views/layouts/_head.html.erb b/app/views/layouts/_head.html.erb index 700655931..3d38a4143 100644 --- a/app/views/layouts/_head.html.erb +++ b/app/views/layouts/_head.html.erb @@ -34,6 +34,7 @@ <%= stylesheet_link_tag 'application', media: 'all' %> <%= javascript_include_tag "https://cdn.jsdelivr.net/npm/jquery@2.2.2/dist/jquery.min.js" %> +<%= javascript_include_tag "https://cdn.jsdelivr.net/npm/jquery-ui@1.14.2/dist/jquery-ui.min.js" %> <%= javascript_include_tag "https://cdn.jsdelivr.net/npm/moment@2.13.0/min/moment.min.js" %> <%= javascript_include_tag "https://cdn.jsdelivr.net/npm/select2@4.0.12/dist/js/select2.min.js" %> <% if SiteSetting['DonationsEnabled'] && (SiteSetting['LoadStripeEverywhere'] || controller_name == 'donations') %> diff --git a/app/views/users/_prefs.html.erb b/app/views/users/_prefs.html.erb index 7239b2f9a..46201d3cf 100644 --- a/app/views/users/_prefs.html.erb +++ b/app/views/users/_prefs.html.erb @@ -1,27 +1,58 @@ <% prefs.each do |name, value| %> <% pref_config = AppConfig.preferences[name] %> - + <% case pref_config['type'] %> + <% when 'boolean' %> + <%= render 'prefs_inline', name: name, pref_config: pref_config do %> + + data-community="<%= community %>" /> + <% end %> + <% when 'choice' %> + <%= render 'prefs_inline', name: name, pref_config: pref_config do %> + <%= select_tag nil, + options_for_select(preference_choice(pref_config), selected: value), + class: 'js-user-pref form-element', + data: { pref: name, community: community } %> + <% end %> + <% when 'integer' %> + <%= render 'prefs_inline', name: name, pref_config: pref_config do %> + + <% end %> + <% when 'string' %> + <%= render 'prefs_inline', name: name, pref_config: pref_config do %> + + <% end %> + <% when 'community_order' %> + <%= render 'prefs_block', name: name, pref_config: pref_config do %> +
+
+ Reorder + <% logo_paths = SiteSetting.all_communities('SiteLogoPath') %> +
    + <% Community.where(hidden: false).each do |c| %> +
  1. + + <% logo_setting = logo_paths[c.id] %> + <% if logo_setting.present? %> +
    + <%= c.name %> +
    + <% end %> +
    + <%= c.name %> +
    +
  2. + <% end %> +
+ +
+
+ <% end %> + <% end %> <% end %> diff --git a/app/views/users/_prefs_block.erb b/app/views/users/_prefs_block.erb new file mode 100644 index 000000000..cc3c395d6 --- /dev/null +++ b/app/views/users/_prefs_block.erb @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/app/views/users/_prefs_inline.erb b/app/views/users/_prefs_inline.erb new file mode 100644 index 000000000..838f296ca --- /dev/null +++ b/app/views/users/_prefs_inline.erb @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/config/config/preferences.yml b/config/config/preferences.yml index 240b901ba..8aa7b4e41 100644 --- a/config/config/preferences.yml +++ b/config/config/preferences.yml @@ -2,7 +2,7 @@ # Schema: # # preference_name: -# type: boolean | string | integer | choice +# type: boolean | string | integer | choice | community_order # description: Free-form description # choice: # - only @@ -100,3 +100,10 @@ collapse_related_posts: Collapse the Related Posts widget in the sidebar by default. default: 'false' global: true + +community_order: + type: community_order + description: > + Order of communities in the dashboard and dropdown + default: '' + global: true \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 33a5deaed..25f607d60 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "name": "qpixel", "devDependencies": { "@types/jquery": "^3.5.32", + "@types/jqueryui": "1.12.24", "@types/prettier": "2.7.3", "@types/select2": "^4.0.63", "dompurify": "3.4.13", @@ -25,6 +26,16 @@ "@types/sizzle": "*" } }, + "node_modules/@types/jqueryui": { + "version": "1.12.24", + "resolved": "https://registry.npmjs.org/@types/jqueryui/-/jqueryui-1.12.24.tgz", + "integrity": "sha512-E2sGULwzMhg4kAeOV+gYcXjg988RuPkviWCt09jLe6GGK9sHM7dTqS8H7JMuUWoZQBucIBzBAgM5o/ezKUFkeg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/jquery": "*" + } + }, "node_modules/@types/prettier": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", @@ -151,6 +162,15 @@ "@types/sizzle": "*" } }, + "@types/jqueryui": { + "version": "1.12.24", + "resolved": "https://registry.npmjs.org/@types/jqueryui/-/jqueryui-1.12.24.tgz", + "integrity": "sha512-E2sGULwzMhg4kAeOV+gYcXjg988RuPkviWCt09jLe6GGK9sHM7dTqS8H7JMuUWoZQBucIBzBAgM5o/ezKUFkeg==", + "dev": true, + "requires": { + "@types/jquery": "*" + } + }, "@types/prettier": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", diff --git a/package.json b/package.json index d61965491..2b0198c14 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ }, "devDependencies": { "@types/jquery": "^3.5.32", + "@types/jqueryui": "1.12.24", "@types/prettier": "2.7.3", "@types/select2": "^4.0.63", "dompurify": "3.4.13", diff --git a/tsconfig.json b/tsconfig.json index 04dd419db..1d355ad6f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,7 @@ "moduleResolution": "node", "noEmit": true, "target": "ES2021", - "types": ["./global.d.ts", "@types/jquery", "moment", "@types/select2"] + "types": ["./global.d.ts", "@types/jquery", "@types/jqueryui", "moment", "@types/select2"] }, "include": ["./app/assets/javascripts", "./public/assets/community"], "exclude": [ From 3a556aa0d88d6b1ceda70ff76dff66b99ab2a224 Mon Sep 17 00:00:00 2001 From: MoshiKoi <54333972+MoshiKoi@users.noreply.github.com> Date: Fri, 21 Aug 2026 06:41:18 +0000 Subject: [PATCH 2/9] Make the dropdown and dashboard follow the user's preferred order --- app/controllers/application_controller.rb | 2 +- app/models/community.rb | 12 ++++++++++++ app/views/layouts/_header.html.erb | 2 +- app/views/users/_prefs.html.erb | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 62372c684..cb94a1de0 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -32,7 +32,7 @@ def upload end def dashboard - @communities = Community.all + @communities = Community.all.user_preferred_order(current_user) @edits = Post.unscoped do SuggestedEdit.unscoped.joins(:post).where(active: true).group(Arel.sql('posts.category_id')).count end diff --git a/app/models/community.rb b/app/models/community.rb index d6eca7ac3..6c0db2fde 100644 --- a/app/models/community.rb +++ b/app/models/community.rb @@ -5,4 +5,16 @@ class Community < ApplicationRecord default_scope { where(is_fake: false) } validates :host, uniqueness: { case_sensitive: false } + + scope :user_preferred_order, lambda { |user| + if user.nil? + all + else + user_order = user.preference('community_order', community: false) + .split(',') + .map(&:to_i) + + in_order_of(:id, user_order, filter: false) + end + } end diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index d228bede2..ed42dc466 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -135,7 +135,7 @@

Communities

<% logo_paths = SiteSetting.all_communities('SiteLogoPath') %> - <% Community.where(hidden: false).each do |c| %> + <% Community.where(hidden: false).user_preferred_order(current_user).each do |c| %>
<% logo_setting = logo_paths[c.id] %> <%= link_to "//#{c.host}" do %> diff --git a/app/views/users/_prefs.html.erb b/app/views/users/_prefs.html.erb index 46201d3cf..a37ef115c 100644 --- a/app/views/users/_prefs.html.erb +++ b/app/views/users/_prefs.html.erb @@ -30,7 +30,7 @@ Reorder <% logo_paths = SiteSetting.all_communities('SiteLogoPath') %>
    - <% Community.where(hidden: false).each do |c| %> + <% Community.where(hidden: false).user_preferred_order(current_user).each do |c| %>
  1. <% logo_setting = logo_paths[c.id] %> From 1f69eaa77abc8fcc9dc77a24090b1673ee7103f9 Mon Sep 17 00:00:00 2001 From: MoshiKoi <54333972+MoshiKoi@users.noreply.github.com> Date: Fri, 21 Aug 2026 08:13:23 +0000 Subject: [PATCH 3/9] Work around empty user preference --- app/models/community.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/models/community.rb b/app/models/community.rb index 6c0db2fde..901bf3eb1 100644 --- a/app/models/community.rb +++ b/app/models/community.rb @@ -14,7 +14,14 @@ class Community < ApplicationRecord .split(',') .map(&:to_i) - in_order_of(:id, user_order, filter: false) + # For some reason, even though we pass in filter: false, + # if user_order is empty, in_order_of still returns an empty array. + # Therefore we have to special case this + if user_order.empty? + all + else + in_order_of(:id, user_order, filter: false) + end end } end From a7c287a1f626390bd1e441479335095ca7dab640 Mon Sep 17 00:00:00 2001 From: MoshiKoi <54333972+MoshiKoi@users.noreply.github.com> Date: Fri, 21 Aug 2026 10:30:10 +0000 Subject: [PATCH 4/9] Use SortableJS instead of jQuery-UI --- app/assets/javascripts/community_order.js | 21 ++++++-------- app/views/layouts/_head.html.erb | 2 +- global.d.ts | 2 ++ package-lock.json | 34 ++++++++++------------- package.json | 2 +- tsconfig.json | 2 +- 6 files changed, 28 insertions(+), 35 deletions(-) diff --git a/app/assets/javascripts/community_order.js b/app/assets/javascripts/community_order.js index b2641695e..0c8acebe2 100644 --- a/app/assets/javascripts/community_order.js +++ b/app/assets/javascripts/community_order.js @@ -1,19 +1,16 @@ document.addEventListener('DOMContentLoaded', () => { - const pref = $(".community-sortable"); - const sortable = pref.find(".sortable"); + const pref = /** @type {HTMLElement} */(document.querySelector(".community-sortable")); + const sortable = /** @type {HTMLElement} */(pref.querySelector(".sortable")); + const input = /** @type {HTMLInputElement} */(pref.querySelector(".js-user-pref")); - const input = pref.find(".js-user-pref"); - - sortable.sortable({ - appendTo: pref, - update: () => { - const val = sortable.children() - .map((_, el) => el.dataset['community']) - .toArray() + Sortable.create(sortable, { + onSort: () => { + const val = [...sortable.children] + .map(el => /** @type {HTMLElement} */(el).dataset['community']) .join(','); - input.val(val); - input.trigger("change"); + input.value = val; + input.dispatchEvent(new Event("change")); } }); }); \ No newline at end of file diff --git a/app/views/layouts/_head.html.erb b/app/views/layouts/_head.html.erb index 3d38a4143..9d834dd3e 100644 --- a/app/views/layouts/_head.html.erb +++ b/app/views/layouts/_head.html.erb @@ -34,7 +34,7 @@ <%= stylesheet_link_tag 'application', media: 'all' %> <%= javascript_include_tag "https://cdn.jsdelivr.net/npm/jquery@2.2.2/dist/jquery.min.js" %> -<%= javascript_include_tag "https://cdn.jsdelivr.net/npm/jquery-ui@1.14.2/dist/jquery-ui.min.js" %> +<%= javascript_include_tag "https://cdn.jsdelivr.net/npm/sortablejs@latest/Sortable.min.js" %> <%= javascript_include_tag "https://cdn.jsdelivr.net/npm/moment@2.13.0/min/moment.min.js" %> <%= javascript_include_tag "https://cdn.jsdelivr.net/npm/select2@4.0.12/dist/js/select2.min.js" %> <% if SiteSetting['DonationsEnabled'] && (SiteSetting['LoadStripeEverywhere'] || controller_name == 'donations') %> diff --git a/global.d.ts b/global.d.ts index 5ecaaa1d6..ce5f3f5f3 100644 --- a/global.d.ts +++ b/global.d.ts @@ -1,3 +1,5 @@ +declare var Sortable: typeof import("sortablejs"); + interface ElementOffset { top: number; left: number; diff --git a/package-lock.json b/package-lock.json index 25f607d60..6a7507084 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,9 +7,9 @@ "name": "qpixel", "devDependencies": { "@types/jquery": "^3.5.32", - "@types/jqueryui": "1.12.24", "@types/prettier": "2.7.3", "@types/select2": "^4.0.63", + "@types/sortablejs": "1.15.9", "dompurify": "3.4.13", "moment": "2.13.0", "prettier-plugin-brace-style": "0.8.1", @@ -26,16 +26,6 @@ "@types/sizzle": "*" } }, - "node_modules/@types/jqueryui": { - "version": "1.12.24", - "resolved": "https://registry.npmjs.org/@types/jqueryui/-/jqueryui-1.12.24.tgz", - "integrity": "sha512-E2sGULwzMhg4kAeOV+gYcXjg988RuPkviWCt09jLe6GGK9sHM7dTqS8H7JMuUWoZQBucIBzBAgM5o/ezKUFkeg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/jquery": "*" - } - }, "node_modules/@types/prettier": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", @@ -59,6 +49,13 @@ "integrity": "sha512-xzLEyKB50yqCUPUJkIsrVvoWNfFUbIZI+RspLWt8u+tIW/BetMBZtgV2LY/2o+tYH8dRvQ+eoPf3NdhQCcLE2w==", "dev": true }, + "node_modules/@types/sortablejs": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/@types/sortablejs/-/sortablejs-1.15.9.tgz", + "integrity": "sha512-7HP+rZGE2p886PKV9c9OJzLBI6BBJu1O7lJGYnPyG3fS4/duUCcngkNCjsLwIMV+WMqANe3tt4irrXHSIe68OQ==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/trusted-types": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", @@ -162,15 +159,6 @@ "@types/sizzle": "*" } }, - "@types/jqueryui": { - "version": "1.12.24", - "resolved": "https://registry.npmjs.org/@types/jqueryui/-/jqueryui-1.12.24.tgz", - "integrity": "sha512-E2sGULwzMhg4kAeOV+gYcXjg988RuPkviWCt09jLe6GGK9sHM7dTqS8H7JMuUWoZQBucIBzBAgM5o/ezKUFkeg==", - "dev": true, - "requires": { - "@types/jquery": "*" - } - }, "@types/prettier": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", @@ -192,6 +180,12 @@ "integrity": "sha512-xzLEyKB50yqCUPUJkIsrVvoWNfFUbIZI+RspLWt8u+tIW/BetMBZtgV2LY/2o+tYH8dRvQ+eoPf3NdhQCcLE2w==", "dev": true }, + "@types/sortablejs": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/@types/sortablejs/-/sortablejs-1.15.9.tgz", + "integrity": "sha512-7HP+rZGE2p886PKV9c9OJzLBI6BBJu1O7lJGYnPyG3fS4/duUCcngkNCjsLwIMV+WMqANe3tt4irrXHSIe68OQ==", + "dev": true + }, "@types/trusted-types": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", diff --git a/package.json b/package.json index 2b0198c14..394f7c27d 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,9 @@ }, "devDependencies": { "@types/jquery": "^3.5.32", - "@types/jqueryui": "1.12.24", "@types/prettier": "2.7.3", "@types/select2": "^4.0.63", + "@types/sortablejs": "1.15.9", "dompurify": "3.4.13", "moment": "2.13.0", "prettier-plugin-brace-style": "0.8.1", diff --git a/tsconfig.json b/tsconfig.json index 1d355ad6f..04dd419db 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,7 @@ "moduleResolution": "node", "noEmit": true, "target": "ES2021", - "types": ["./global.d.ts", "@types/jquery", "@types/jqueryui", "moment", "@types/select2"] + "types": ["./global.d.ts", "@types/jquery", "moment", "@types/select2"] }, "include": ["./app/assets/javascripts", "./public/assets/community"], "exclude": [ From f3975259f6c0d1d11e6b9ac5b3eff997f113ae5a Mon Sep 17 00:00:00 2001 From: MoshiKoi <54333972+MoshiKoi@users.noreply.github.com> Date: Fri, 21 Aug 2026 11:16:22 +0000 Subject: [PATCH 5/9] Add buttons to reorder communities without dragging --- app/assets/javascripts/community_order.js | 28 +++++++++++++++-------- app/views/users/_prefs.html.erb | 6 ++++- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/community_order.js b/app/assets/javascripts/community_order.js index 0c8acebe2..d0078183e 100644 --- a/app/assets/javascripts/community_order.js +++ b/app/assets/javascripts/community_order.js @@ -1,16 +1,26 @@ document.addEventListener('DOMContentLoaded', () => { const pref = /** @type {HTMLElement} */(document.querySelector(".community-sortable")); - const sortable = /** @type {HTMLElement} */(pref.querySelector(".sortable")); + const el = /** @type {HTMLElement} */(pref.querySelector(".sortable")); const input = /** @type {HTMLInputElement} */(pref.querySelector(".js-user-pref")); - Sortable.create(sortable, { - onSort: () => { - const val = [...sortable.children] - .map(el => /** @type {HTMLElement} */(el).dataset['community']) - .join(','); - - input.value = val; - input.dispatchEvent(new Event("change")); + const sortable = Sortable.create(el, { + store: { + get: () => input.value.split(','), + set: self => { + input.value = self.toArray().join(','); + input.dispatchEvent(new Event("change")); + } } }); + + document.querySelectorAll('.community-sortable-list-item').forEach(el => { + el.querySelector('.sort-up-btn')?.addEventListener('click', _ => { + el.previousElementSibling?.insertAdjacentElement('beforebegin', el); + sortable.save(); + }); + el.querySelector('.sort-down-btn')?.addEventListener('click', _ => { + el.nextElementSibling?.insertAdjacentElement('afterend', el); + sortable.save(); + }); + }) }); \ No newline at end of file diff --git a/app/views/users/_prefs.html.erb b/app/views/users/_prefs.html.erb index a37ef115c..f336223a1 100644 --- a/app/views/users/_prefs.html.erb +++ b/app/views/users/_prefs.html.erb @@ -31,8 +31,12 @@ <% logo_paths = SiteSetting.all_communities('SiteLogoPath') %>
      <% Community.where(hidden: false).user_preferred_order(current_user).each do |c| %> -
    1. +
    2. +
      + + +
      <% logo_setting = logo_paths[c.id] %> <% if logo_setting.present? %>
      From 41554be9901e0bef7c0ca44487eaa34b7752c02e Mon Sep 17 00:00:00 2001 From: MoshiKoi <54333972+MoshiKoi@users.noreply.github.com> Date: Sun, 23 Aug 2026 08:47:47 +0000 Subject: [PATCH 6/9] Add discoverablity links to the preference from the dropdown and dashboard --- app/views/application/dashboard.html.erb | 4 ++++ app/views/layouts/_header.html.erb | 3 +++ 2 files changed, 7 insertions(+) diff --git a/app/views/application/dashboard.html.erb b/app/views/application/dashboard.html.erb index 2843a3336..cdea593ce 100644 --- a/app/views/application/dashboard.html.erb +++ b/app/views/application/dashboard.html.erb @@ -8,6 +8,10 @@

      All communities, with their categories. You can also see the communities from the dropdown arrow at the top right of each page. + <% if user_signed_in? %> + You may change the order in which these communities appear in + <%= link_to 'your preferences', user_preferences_path %>. + <% end %>

      <% @communities.each do |c| %> diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index ed42dc466..82c84bfe6 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -133,6 +133,9 @@

      Communities

      + <% if user_signed_in? %> + <%= link_to 'Edit order', user_preferences_path, class: 'button is-muted is-small' %> + <% end %>
      <% logo_paths = SiteSetting.all_communities('SiteLogoPath') %> <% Community.where(hidden: false).user_preferred_order(current_user).each do |c| %> From ecd88c1b21aca2706d60184fce03ec4a176b17ec Mon Sep 17 00:00:00 2001 From: MoshiKoi <54333972+MoshiKoi@users.noreply.github.com> Date: Sun, 23 Aug 2026 09:25:21 +0000 Subject: [PATCH 7/9] Remove label being associated with first button of the community selector --- app/views/users/_prefs_block.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/_prefs_block.erb b/app/views/users/_prefs_block.erb index cc3c395d6..7cec49cb0 100644 --- a/app/views/users/_prefs_block.erb +++ b/app/views/users/_prefs_block.erb @@ -1,4 +1,4 @@ -
    3. + +
      <% logo_setting = logo_paths[c.id] %> <% if logo_setting.present? %> From 60c9c99a93dad496b9410b7358d896cfb990deec Mon Sep 17 00:00:00 2001 From: MoshiKoi <54333972+MoshiKoi@users.noreply.github.com> Date: Sun, 23 Aug 2026 10:01:27 +0000 Subject: [PATCH 9/9] Some stylistic adjustments --- app/assets/stylesheets/users.scss | 8 ++++++++ app/views/users/_prefs.html.erb | 24 ++++++++++++++---------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/app/assets/stylesheets/users.scss b/app/assets/stylesheets/users.scss index 2fe215ab9..05118f9fe 100644 --- a/app/assets/stylesheets/users.scss +++ b/app/assets/stylesheets/users.scss @@ -208,6 +208,14 @@ img { .label { flex-grow: 1; } + .sortable-buttons { + display: flex; + flex-direction: column; + } + .community-label { + display: flex; + align-items: center; + } } } diff --git a/app/views/users/_prefs.html.erb b/app/views/users/_prefs.html.erb index e2bfa2fdd..ae5520e97 100644 --- a/app/views/users/_prefs.html.erb +++ b/app/views/users/_prefs.html.erb @@ -31,22 +31,26 @@ <% logo_paths = SiteSetting.all_communities('SiteLogoPath') %>
        <% Community.where(hidden: false).user_preferred_order(current_user).each do |c| %> -
      1. +
      2. -
        +
        + +
        +
        -
        - <% logo_setting = logo_paths[c.id] %> - <% if logo_setting.present? %> -
        - <%= c.name %> +
        + <% logo_setting = logo_paths[c.id] %> + <% if logo_setting.present? %> +
        + <%= c.name %> +
        + <% end %> +
        + <%= c.name %>
        - <% end %> -
        - <%= c.name %>
      3. <% end %>