Skip to content

Commit b10f970

Browse files
committed
Test alternative home
1 parent 1a3ac85 commit b10f970

5 files changed

Lines changed: 184 additions & 1 deletion

File tree

app/controllers/application_controller.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,28 @@ class ApplicationController < ActionController::Base
3636
}
3737

3838
# GET /
39+
def main2
40+
@services = {
41+
validly_published: Name.where(status: 15).order(validated_at: :desc),
42+
names: Name.all_public.order(created_at: :desc),
43+
publications: Publication.all.order(journal_date: :desc),
44+
register_lists: Registers.where(validated: true).order(updated_at: :desc),
45+
genomes: Genome.all.order(created_at: :desc),
46+
strains: Strain.all.order(created_at: :desc)
47+
}
48+
@display = {
49+
validly_published:
50+
[:abbr_name, [:names_path, sort: :date, status: :SeqCode]]
51+
names: [:abbr_name, [:names_path, sort: :date]]
52+
publications:
53+
[:short_citation, [:publications_path, sort: :date]]
54+
register_lists:
55+
[:acc_url, [:registers_path, status: :validated]]
56+
genomes: [:text, :genomes_path]
57+
strains: [:title, :strains_path]
58+
}
59+
end
60+
3961
def main
4062
@publications = Publication.all.order(journal_date: :desc)
4163
@authors = Author.all.order(created_at: :desc)

app/models/strain.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ def title(prefix = nil)
4141
'%ssc|%07i' % [prefix, id]
4242
end
4343

44+
def text
45+
title('')
46+
end
47+
4448
def seqcode_url(protocol = true)
4549
"#{'https://' if protocol}seqco.de/s:#{id}"
4650
end

app/views/application/_news.html.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<% all ||= false %>
2+
<% ht = all ? 'h1' : 'h2' %>
23

34
<div class="container news">
45
<div class="row mx-1">
56
<div class="col-lg-12 text-center">
6-
<h1>SeqCode News</h1>
7+
<<%= ht %>>SeqCode News</<%= ht %>>
78
<hr/>
89
</div>
910
<dl class="col-lg-12">
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
<%#
2+
<div class="alert alert-info">
3+
<h3>Maintenance 02/Dec/2025</h3>
4+
The SeqCode Registry will undergo a service window on Tuesday, the 2nd
5+
December, 2025 the entire day (CET). We apologize for any issues this may
6+
cause.
7+
</div>
8+
%>
9+
10+
<% if user_signed_in? %>
11+
<div id="notification-permission" class="text-center" style="display: none;">
12+
<%= button_tag(class: 'btn btn-primary', id: 'enable') do %>
13+
<%= fa_icon('bell') %>
14+
Enable notifications
15+
<% end %>
16+
</div>
17+
<% end %>
18+
19+
<div class="main-page-box text-center bg-light rounded-lg border my-5 mx-3 p-5">
20+
<h1>SeqCode Registry</h1>
21+
<p class="lead">
22+
Part of the
23+
<a href="https://isme-microbes.org/seqcode-initiative"
24+
target=_blank>SeqCode initiative</a>, a path forward for naming
25+
the uncultivated
26+
</p>
27+
<hr/>
28+
<div class="container p-0">
29+
<ul class="row nav nav-pills" role="tablist" id="lead-tab">
30+
<%
31+
tabs = {
32+
register: ['pen-fancy', 'Register New Entries', false],
33+
search: [
34+
'search',
35+
'Search and Explore',
36+
true
37+
],
38+
read: ['book-reader', 'Read and Learn More', false]
39+
}
40+
%>
41+
<% tabs.each do |k, v| %>
42+
<li class="col-md-4 px-3 nav-item" role="presentation">
43+
<%= link_to(
44+
"##{k}-content", id: "#{k}-tab",
45+
data: { toggle: 'pill' }, # role: 'tab',
46+
aria: { controls: "#{k}-content", selected: v[2] },
47+
class: 'p-3 w-100 h-100 rounded border w-100 text-primary ' \
48+
'border-primary nav-link main-tab-button ' \
49+
'' + (v[2] ? 'active' : '')
50+
) do %>
51+
<%= fa_icon(v[0], style: 'font-size: 300%;', class: 'mb-3') %><br/>
52+
<b><%= v[1] %></b>
53+
<% end %>
54+
</li>
55+
<% end %>
56+
</ul>
57+
</div>
58+
59+
<!-- Dynamic content -->
60+
<div class="tab-content mt-0" style="font-size: 150%;" id="lead-tabContent">
61+
<div class="tab-pane fade jumbotron p-5"
62+
id="register-content" role="tabpanel" aria-labelledby="register-tab">
63+
<%= fa_icon('caret-down', class: 'text-primary mb-4 d-md-none d-block') %>
64+
<% if !user_signed_in? %>
65+
In order to contribute to SeqCode Registry,
66+
<%= link_to('Create a User', new_user_registration_path) %> or
67+
<%= link_to('Login', new_user_session_path) %>
68+
<% elsif !current_contributor? %>
69+
You are currently not registered as a contributor, please
70+
<%= link_to('Request contributor status',
71+
contributor_request_path) %>
72+
<% else %>
73+
<%= link_to(new_name_url) do %>
74+
<%= fa_icon('plus-circle', class: 'mr-2') %>
75+
Register individual new names in our standard mode
76+
<% end %>
77+
or <br/>
78+
<%= link_to(tutorials_url) do %>
79+
<%= fa_icon('shoe-prints', class: 'mr-2') %>
80+
Follow a guided registration for multiple novel names
81+
<% end %>
82+
<% end %>
83+
</div>
84+
<div class="tab-pane fade show active jumbotron p-5"
85+
id="search-content" role="tabpanel" aria-labelledby="search-tab">
86+
<%= fa_icon('caret-down', class: 'text-primary mb-4 d-md-none d-block') %>
87+
<div class='mx-2'>
88+
<%= render(partial: 'shared/search_bar') %>
89+
</div>
90+
<p class="small mt-4">
91+
We have identified <%=
92+
link_to(pluralize(@entries[:names].count, 'name'), names_path)
93+
%>, including <%=
94+
link_to(
95+
pluralize(@entries[:validly_published].count, 'name'),
96+
names_path(status: 'SeqCode')
97+
)
98+
%> validly published under the SeqCode in <%=
99+
link_to(
100+
pluralize(@entries[:register_lists].count, 'register list'),
101+
registers_path(status: 'validated')
102+
)
103+
%>.
104+
</p>
105+
</div>
106+
<div class="tab-pane fade jumbotron p-5"
107+
id="read-content" role="tabpanel" aria-labelledby="read-tab">
108+
<%= fa_icon('caret-down', class: 'text-primary mb-4 d-md-none d-block') %>
109+
Interested in learning more about the SeqCode?
110+
<br/>
111+
<%= link_to(page_about_url) do %>
112+
<%= fa_icon('question-circle') %>
113+
Visit the <i>About</i> page of the SeqCode Registry<% end %>,
114+
<br/>
115+
<%= link_to(page_seqcode_url) do %>
116+
<%= fa_icon('book') %>
117+
Read the current version of the SeqCode<% end %> or
118+
<br/>
119+
<%= link_to(page_publications_url) do %>
120+
<%= fa_icon('newspaper') %>
121+
Check-out the SeqCode publications<% end %>
122+
</div>
123+
</div>
124+
</div>
125+
126+
<%= render(partial: 'user_actions') %>
127+
<%= render(partial: 'news') %>
128+
129+
<div class="container">
130+
<div class="row">
131+
<div class="col-lg-12 text-center mt-5">
132+
<h2>Recent entries</h1>
133+
<hr/>
134+
</div>
135+
<% @entries.each do |k, v| %>
136+
<div class="col-lg-4 pb-2">
137+
<div class="text-center bg-light rounded-lg border p-5 h-100
138+
recent-entries-list">
139+
<h3><%= k.to_s.capitalize %></h3>
140+
<% v.first(5).each do |i| %>
141+
<%= link_to(i) do %>
142+
<div><%= i.send(@display[k][0]) %></div>
143+
<% end %>
144+
<% end %>
145+
<%= link_to(@display[k][1], class: 'btn btn-primary mt-2') do %>
146+
See all
147+
<% end %>
148+
</div>
149+
</div>
150+
<% end %>
151+
</div>
152+
</div>
153+
154+
<br/>
155+
<%= render(partial: 'shared/cc') %>

config/routes.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
resources :tags
55
# General configuration
66
root(to: 'application#main')
7+
get 'main2' => 'application#main2'
78
concern(:autocompletable) do
89
get :autocomplete, on: :collection
910
end

0 commit comments

Comments
 (0)