From a254f64288ed3ef52e2624559d7ffa401a92fa1f Mon Sep 17 00:00:00 2001 From: Luis M Rodriguez-R Date: Wed, 1 Jul 2026 18:47:38 +0200 Subject: [PATCH 1/8] Create scaffold for community members --- app/helpers/application_helper.rb | 4 ++ app/views/users/_affiliation.html.erb | 22 +++++++++ app/views/users/_community_member.html.erb | 45 +++++++++++++++++++ app/views/users/_dashboard_links.html.erb | 2 + app/views/users/_user.html.erb | 14 +----- app/views/users/dashboard.html.erb | 2 +- ...701161300_add_community_member_to_users.rb | 5 +++ ...20260701163952_add_departments_to_users.rb | 6 +++ ...01164537_add_community_answers_to_users.rb | 9 ++++ db/schema.rb | 10 ++++- 10 files changed, 104 insertions(+), 15 deletions(-) create mode 100644 app/views/users/_affiliation.html.erb create mode 100644 app/views/users/_community_member.html.erb create mode 100644 db/migrate/20260701161300_add_community_member_to_users.rb create mode 100644 db/migrate/20260701163952_add_departments_to_users.rb create mode 100644 db/migrate/20260701164537_add_community_answers_to_users.rb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index cec8f2ff..9ae83fb2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -113,6 +113,10 @@ def longer_list(title = '', hide_over = 3, elements = nil, &blk) end end + def current_community_member? + current_user.try :community_member? + end + def current_contributor? current_user.try :contributor? end diff --git a/app/views/users/_affiliation.html.erb b/app/views/users/_affiliation.html.erb new file mode 100644 index 00000000..5f4b181c --- /dev/null +++ b/app/views/users/_affiliation.html.erb @@ -0,0 +1,22 @@ +<% department ||= false %> + +<% if user.affiliation_ror? %> + <%= link_to(user.affiliation, user.ror_url, target: '_blank') %> +<% else %> + <%= user.affiliation %> +<% end %> +<% if department && user.department? %> + (<%= user.department %>) +<% end %> + +<% if user.affiliation_2? %> + | + <% if user.affiliation_2_ror? %> + <%= link_to(user.affiliation_2, user.ror_2_url, target: '_blank') %> + <% else %> + <%= user.affiliation_2 %> + <% end %> + <% if department && user.department_2? %> + (<%= user.department_2 %>) + <% end %> +<% end %> diff --git a/app/views/users/_community_member.html.erb b/app/views/users/_community_member.html.erb new file mode 100644 index 00000000..1b783ffa --- /dev/null +++ b/app/views/users/_community_member.html.erb @@ -0,0 +1,45 @@ +<% if community_member? %> +

Community member profile

+

+ You are registered as a SeqCode Community member. This allows you to + actively participate in the governance of the SeqCode Community, including + through proposing and voting for SeqCode Committee members, participating in + open discussions, and casting ballots on SeqCode ammendments. +

+ +

Current profile information

+
+
Given name
+
<%= current_user.given %>
+ +
Family name
+
<%= current_user.family %>
+ +
Email address
+
<%= current_user.email %>
+ +
Affiliation (institute / department)
+
<%= render(partial: 'affiliation', + locals: { user: user, department: true }) %> + +
Position
+
<%= current_user.position %>
+ +
Highest academic degree
+
<%= current_user.highest_degree %>
+ +
+ Brief description of achievements or relevant publications in the field of + microbiology and microbial systematics +
+
<%= current_user.achievements %>
+ +
Membership in a national or international microbiological society
+
<%= current_user.membership_societies %>
+
+ Would you be interested in serving in a SeqCode Committee administrative + post? +
+
<%= current_user.committee_interest? ? 'Yes' : 'No' %>
+
+<% end %> diff --git a/app/views/users/_dashboard_links.html.erb b/app/views/users/_dashboard_links.html.erb index c579dc21..e7cd3316 100644 --- a/app/views/users/_dashboard_links.html.erb +++ b/app/views/users/_dashboard_links.html.erb @@ -6,6 +6,8 @@ links[:editor] = ['user-edit', 'Editor'] if current_editor? links[:curator] = ['user-check', 'Curator'] if current_curator? links[:contributor] = ['user-plus', 'Contributor'] if current_contributor? + links[:community_member] = + ['users', 'Community member'] if current_community_member? %>
<% links.each do |role, icon| %> diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb index 51b132b2..b3eeb9e0 100644 --- a/app/views/users/_user.html.erb +++ b/app/views/users/_user.html.erb @@ -14,19 +14,7 @@ <% end %> <%= adaptable_value(entry, 'Affiliation') do %> - <% if user.affiliation_ror? %> - <%= link_to(user.affiliation, user.ror_url, target: '_blank') %> - <% else %> - <%= user.affiliation %> - <% end %> - <% if user.affiliation_2? %> - | - <% if user.affiliation_2_ror? %> - <%= link_to(user.affiliation_2, user.ror_2_url, target: '_blank') %> - <% else %> - <%= user.affiliation_2 %> - <% end %> - <% end %> + <%= render(partial: 'affiliation', locals: { user: user }) %> <% end %> <%= adaptable_value(entry, 'Roles') do %> diff --git a/app/views/users/dashboard.html.erb b/app/views/users/dashboard.html.erb index 49c00231..d55e187c 100644 --- a/app/views/users/dashboard.html.erb +++ b/app/views/users/dashboard.html.erb @@ -11,7 +11,7 @@ <%= render(partial: 'about') %>
<%= render(partial: 'actions') %> - <% when 'admin', 'editor', 'curator', 'contributor' %> + <% when 'admin', 'editor', 'curator', 'contributor', 'community_member' %> <%= render(partial: which) %> <% end %>
diff --git a/db/migrate/20260701161300_add_community_member_to_users.rb b/db/migrate/20260701161300_add_community_member_to_users.rb new file mode 100644 index 00000000..d785b657 --- /dev/null +++ b/db/migrate/20260701161300_add_community_member_to_users.rb @@ -0,0 +1,5 @@ +class AddCommunityMemberToUsers < ActiveRecord::Migration[6.1] + def change + add_column :users, :community_member, :bool, default: false + end +end diff --git a/db/migrate/20260701163952_add_departments_to_users.rb b/db/migrate/20260701163952_add_departments_to_users.rb new file mode 100644 index 00000000..7d07db67 --- /dev/null +++ b/db/migrate/20260701163952_add_departments_to_users.rb @@ -0,0 +1,6 @@ +class AddDepartmentsToUsers < ActiveRecord::Migration[6.1] + def change + add_column :users, :department, :string, default: nil + add_column :users, :department_2, :string, default: nil + end +end diff --git a/db/migrate/20260701164537_add_community_answers_to_users.rb b/db/migrate/20260701164537_add_community_answers_to_users.rb new file mode 100644 index 00000000..90e49957 --- /dev/null +++ b/db/migrate/20260701164537_add_community_answers_to_users.rb @@ -0,0 +1,9 @@ +class AddCommunityAnswersToUsers < ActiveRecord::Migration[6.1] + def change + add_column :users, :position, :string, default: nil + add_column :users, :highest_degree, :string, default: nil + add_column :users, :achievements, :text, default: nil + add_column :users, :membership_societies, :string, default: nil + add_column :users, :committee_interest, :boolean, default: nil + end +end diff --git a/db/schema.rb b/db/schema.rb index 66b65806..a0eafbd0 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2026_05_14_135351) do +ActiveRecord::Schema.define(version: 2026_07_01_164537) do # These are extensions that must be enabled in order to support this database enable_extension "fuzzystrmatch" @@ -536,6 +536,14 @@ t.boolean "opt_message_email", default: true t.string "affiliation_2" t.string "affiliation_2_ror" + t.boolean "community_member", default: false + t.string "department" + t.string "department_2" + t.string "position" + t.string "highest_degree" + t.text "achievements" + t.string "membership_societies" + t.boolean "committee_interest" t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true t.index ["email"], name: "index_users_on_email", unique: true t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true From ac737a924af599f669d8bf6f9b9aa5dd343e69a8 Mon Sep 17 00:00:00 2001 From: Luis M Rodriguez-R Date: Wed, 1 Jul 2026 18:54:00 +0200 Subject: [PATCH 2/8] Update _community_member.html.erb --- app/views/users/_community_member.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_community_member.html.erb b/app/views/users/_community_member.html.erb index 1b783ffa..80f501e0 100644 --- a/app/views/users/_community_member.html.erb +++ b/app/views/users/_community_member.html.erb @@ -1,4 +1,4 @@ -<% if community_member? %> +<% if current_community_member? %>

Community member profile

You are registered as a SeqCode Community member. This allows you to From c026d5df9227402040167a316a5b1ff99cd3e55c Mon Sep 17 00:00:00 2001 From: Luis M Rodriguez-R Date: Wed, 1 Jul 2026 18:55:43 +0200 Subject: [PATCH 3/8] Update _community_member.html.erb --- app/views/users/_community_member.html.erb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/users/_community_member.html.erb b/app/views/users/_community_member.html.erb index 80f501e0..13b31fb6 100644 --- a/app/views/users/_community_member.html.erb +++ b/app/views/users/_community_member.html.erb @@ -19,8 +19,10 @@

<%= current_user.email %>
Affiliation (institute / department)
-
<%= render(partial: 'affiliation', - locals: { user: user, department: true }) %> +
<%= render( + partial: 'affiliation', + locals: { user: current_user, department: true } + ) %>
Position
<%= current_user.position %>
From b4a3cd166010ed650ad326d02b1094e88d929fa2 Mon Sep 17 00:00:00 2001 From: Luis M Rodriguez-R Date: Wed, 1 Jul 2026 19:12:48 +0200 Subject: [PATCH 4/8] Update member dashboard --- app/controllers/users_controller.rb | 1 + app/views/users/_community_member.html.erb | 58 ++++++++-------------- 2 files changed, 23 insertions(+), 36 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index b043282e..6169ee7c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -44,6 +44,7 @@ def update def dashboard redirect_to(root_url) unless user_signed_in? @pending = { main: current_user.unseen_notifications.count } + @crumbs = ['User dashboard'] if current_user.admin? @contributor_applications = User.contributor_applications diff --git a/app/views/users/_community_member.html.erb b/app/views/users/_community_member.html.erb index 13b31fb6..8de77612 100644 --- a/app/views/users/_community_member.html.erb +++ b/app/views/users/_community_member.html.erb @@ -7,41 +7,27 @@ open discussions, and casting ballots on SeqCode ammendments.

-

Current profile information

-
-
Given name
-
<%= current_user.given %>
- -
Family name
-
<%= current_user.family %>
- -
Email address
-
<%= current_user.email %>
- -
Affiliation (institute / department)
-
<%= render( - partial: 'affiliation', - locals: { user: current_user, department: true } - ) %>
- -
Position
-
<%= current_user.position %>
- -
Highest academic degree
-
<%= current_user.highest_degree %>
- -
- Brief description of achievements or relevant publications in the field of - microbiology and microbial systematics -
-
<%= current_user.achievements %>
- -
Membership in a national or international microbiological society
-
<%= current_user.membership_societies %>
-
- Would you be interested in serving in a SeqCode Committee administrative - post? -
-
<%= current_user.committee_interest? ? 'Yes' : 'No' %>
+
+

<%= fa_icon('user-tie') %> Current profile information

+ <% + { + 'Given name' => :given, + 'Family name' => :family, + 'Email address' => :email, + 'Affiliation' => render( + partial: 'affiliation', + locals: { user: current_user, department: true } + ), + 'Position' => :position, + 'Highest academic degree' => :highest_degree, + 'Brief description of achievements' => :achievements, + 'Membership in a microbiological society' => :membership_societies, + 'Interest in serving in the SeqCode Committee' => + current_user.committee_interest? ? 'Yes' : 'No' + }.each do |k, v| + %> +
<%= k %>
+
<%= v.is_a?(Symbol) ? current_user.send(v) : v %>
+ <% end %>
<% end %> From 6ed773534d1c7823ed281428b598b101bdbbdf51 Mon Sep 17 00:00:00 2001 From: Luis M Rodriguez-R Date: Wed, 1 Jul 2026 19:14:38 +0200 Subject: [PATCH 5/8] Update _community_member.html.erb --- app/views/users/_community_member.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_community_member.html.erb b/app/views/users/_community_member.html.erb index 8de77612..05899651 100644 --- a/app/views/users/_community_member.html.erb +++ b/app/views/users/_community_member.html.erb @@ -7,7 +7,7 @@ open discussions, and casting ballots on SeqCode ammendments.

-
+

<%= fa_icon('user-tie') %> Current profile information

<% { From bd1f0b6fcb4723bfb03b322eeecdc47bc9d185e3 Mon Sep 17 00:00:00 2001 From: Luis M Rodriguez-R Date: Wed, 1 Jul 2026 19:26:18 +0200 Subject: [PATCH 6/8] Update _community_member.html.erb --- app/views/users/_community_member.html.erb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/views/users/_community_member.html.erb b/app/views/users/_community_member.html.erb index 05899651..ae73f1f9 100644 --- a/app/views/users/_community_member.html.erb +++ b/app/views/users/_community_member.html.erb @@ -6,9 +6,14 @@ through proposing and voting for SeqCode Committee members, participating in open discussions, and casting ballots on SeqCode ammendments.

+
-

<%= fa_icon('user-tie') %> Current profile information

+

+ <%= fa_icon('user-tie', class: 'float-right') %> + Member profile +

+ <% { 'Given name' => :given, From c212919e494732eb1fab57cfe9118e50313e34fa Mon Sep 17 00:00:00 2001 From: Luis M Rodriguez-R Date: Wed, 1 Jul 2026 19:35:22 +0200 Subject: [PATCH 7/8] Update _actions.html.erb --- app/views/users/_actions.html.erb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/views/users/_actions.html.erb b/app/views/users/_actions.html.erb index 4de676da..9d8f2394 100644 --- a/app/views/users/_actions.html.erb +++ b/app/views/users/_actions.html.erb @@ -27,6 +27,17 @@ <% end %> <% end %> + <% if current_community_member? # If instead of unless just to test TODO %> + + <% end %> + <% if false # Do not include this option for now %> <% end %> - <% if current_community_member? # If instead of unless just to test TODO %> + <% unless current_community_member? %>