Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions app/views/users/_actions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@
<% end %>
</li>
<% end %>
<% unless current_community_member? %>
<li class="nav-item">
<%= link_to(
'https://forms.gle/FWMb3JnUpVDt7TXXA',
class: 'nav-link', target: '_blank'
) do %>
<%= fa_icon('users') %> Become a SeqCode Community member
<% end %>
</li>
<% end %>

<% if false # Do not include this option for now %>
<li class='nav-item'>
<%= link_to(
Expand Down
22 changes: 22 additions & 0 deletions app/views/users/_affiliation.html.erb
Original file line number Diff line number Diff line change
@@ -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 %>
38 changes: 38 additions & 0 deletions app/views/users/_community_member.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<% if current_community_member? %>
<h1>Community member</h1>
<p class="lead">
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.
</p>
<br/>

<dl class="main-section name-details">
<h2>
<%= fa_icon('user-tie', class: 'float-right') %>
Member profile
</h2>

<%
{
'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|
%>
<dt><%= k %></dt>
<dd><%= v.is_a?(Symbol) ? current_user.send(v) : v %></dd>
<% end %>
</dl>
<% end %>
2 changes: 2 additions & 0 deletions app/views/users/_dashboard_links.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
%>
<div class="btn-group-vertical w-100 pb-4">
<% links.each do |role, icon| %>
Expand Down
14 changes: 1 addition & 13 deletions app/views/users/_user.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/dashboard.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<%= render(partial: 'about') %>
<hr/>
<%= render(partial: 'actions') %>
<% when 'admin', 'editor', 'curator', 'contributor' %>
<% when 'admin', 'editor', 'curator', 'contributor', 'community_member' %>
<%= render(partial: which) %>
<% end %>
</div>
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20260701161300_add_community_member_to_users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddCommunityMemberToUsers < ActiveRecord::Migration[6.1]
def change
add_column :users, :community_member, :bool, default: false
end
end
6 changes: 6 additions & 0 deletions db/migrate/20260701163952_add_departments_to_users.rb
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions db/migrate/20260701164537_add_community_answers_to_users.rb
Original file line number Diff line number Diff line change
@@ -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
10 changes: 9 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
Loading