Skip to content

Commit 927df8b

Browse files
committed
Improve display in mobile
1 parent 794409e commit 927df8b

20 files changed

Lines changed: 49 additions & 30 deletions

app/assets/stylesheets/application.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ $theme-colors: (
2929
@import "bootstrap";
3030
@import "font_awesome5_webfont";
3131

32-
3332
.card-columns {
3433
@include media-breakpoint-only(sm) { column-count: 1; }
3534
@include media-breakpoint-only(md) { column-count: 2; }
@@ -92,5 +91,12 @@ $theme-colors: (
9291
}
9392
}
9493
}
94+
.nav-pills .nav-link.active {
95+
color: #fff !important;
96+
}
97+
.jumbotron {
98+
padding-top: 1em;
99+
}
95100
}
96101
}
102+

app/assets/stylesheets/custom.scss

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,12 @@ nav.navbar-dark {
173173
font-size: 120%;
174174
dt {
175175
margin-top: 1em;
176+
176177
.date {
177-
display: inline-block;
178-
position: absolute;
178+
@include media-breakpoint-up(md) {
179+
display: inline-block;
180+
position: absolute;
181+
}
179182
right: 1rem;
180183
color: #00000066;
181184
}
@@ -291,3 +294,10 @@ nav.navbar {
291294
}
292295
}
293296

297+
@include media-breakpoint-down(sm) {
298+
.actions-section dd a, .btn-action {
299+
display: block !important;
300+
margin-top: 1em;
301+
}
302+
}
303+

app/helpers/application_helper.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,10 @@ def initialize(opts)
310310
end
311311

312312
def css
313-
{ cards: { class: 'card-columns' }, table: { class: 'table table-hover' } }[type]
313+
{
314+
cards: { class: 'card-columns' },
315+
table: { class: 'table table-hover table-responsive-md' }
316+
}[type]
314317
end
315318

316319
def tag

app/views/application/_user_actions.html.erb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<div class="text-center bg-light rounded-lg border my-5 mx-3 p-5 user-actions">
22
<% if user_signed_in? %>
3-
<div class="row">
4-
<div class="col-md-3 mb-2 text-right">
3+
<div class="row text-left">
4+
<div class="col-md-3 mb-2 text-md-right">
55
<h3>User</h3>
66
</div>
7-
<div class="col-md-9 mb-2 text-left">
7+
<div class="col-md-9 mb-2">
88
<%= link_to(dashboard_path, class: 'btn btn-secondary btn-sm') do %>
99
<%= fa_icon('tachometer-alt') %> User Dashboard
1010
<% end %>
@@ -15,11 +15,11 @@
1515
</div>
1616
</div>
1717

18-
<div class="row">
19-
<div class="col-md-3 mb-2 text-right">
18+
<div class="row text-left">
19+
<div class="col-md-3 mb-2 text-md-right">
2020
<h3>Contributor</h3>
2121
</div>
22-
<div class="col-md-9 mb-2 text-left">
22+
<div class="col-md-9 mb-2">
2323
<% if current_contributor? %>
2424
<%= link_to('Register a new name',
2525
new_name_path, class: 'btn btn-info btn-sm') %>
@@ -47,11 +47,11 @@
4747
</div>
4848

4949
<% if current_curator? %>
50-
<div class="row">
51-
<div class="col-md-3 mb-2 text-right">
50+
<div class="row text-left">
51+
<div class="col-md-3 mb-2 text-md-right">
5252
<h3>Curator</h3>
5353
</div>
54-
<div class="col-md-9 mb-2 text-left">
54+
<div class="col-md-9 mb-2">
5555
<%= link_to('Names awaiting review',
5656
submitted_names_path,
5757
class: 'btn btn-primary btn-sm') %>

app/views/correspondences/_correspondence.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<%= f.input(:message, as: :rich_text_area, label: false) %>
4747
<%= f.input(:notify, as: :boolean, label_html: { class: 'text-dark' },
4848
label: 'Notify corresponding users by email') %>
49-
<%= f.button(:submit, 'Send message') %>
49+
<%= f.button(:submit, 'Send message', class: 'btn-action') %>
5050
&raquo; The messages will be in the permanent record,
5151
visible only to submitter and curators
5252
<hr/>
@@ -57,7 +57,7 @@
5757
size: 'lg', async: template_correspondences_url(content: true)
5858
)
5959
%>
60-
<%= modal_button(id, class: 'btn btn-secondary') do %>
60+
<%= modal_button(id, class: 'btn btn-secondary btn-action') do %>
6161
Load template
6262
<% end %>
6363
&raquo; Browse and use pre-formatted template messages

app/views/genomes/_curator.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<% if current_curator? %>
2-
<dl name="curator" class="main-section name-details">
2+
<dl name="curator" class="main-section name-details actions-section">
33
<h2>Curator Actions</h2>
44
<dd class="pt-2">
55
<%= link_to(

app/views/names/_admin.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<% if current_admin? && @name.validated? %>
2-
<dl name="admin" class="main-section name-details">
2+
<dl name="admin" class="main-section name-details actions-section">
33
<h2>Admin Actions</h2>
44
<dd class="pt-2">
55
<% if @name.validated? %>

app/views/names/_contributor.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<% if @name.can_edit?(current_user) || @name.can_claim?(current_user) %>
2-
<dl name="contributor" class="main-section name-details">
2+
<dl name="contributor" class="main-section name-details actions-section">
33
<h2>Contributor Actions</h2>
44
<dd class="pt-2">
55
<% if @name.can_claim?(current_user) && !@name.claimed?(current_user) %>

app/views/names/_curator.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<% if current_curator? %>
2-
<dl name="curator" class="main-section name-details">
2+
<dl name="curator" class="main-section name-details actions-section">
33
<h2>Curator Actions</h2>
44
<dd class="pt-2">
55
<% if @name.validated? %>

app/views/names/_etymology_table.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<% dict_id = modal('Dictionary lookup', size: 'lg') do %>
22
<% end %>
3-
<table class="table table-hover table-responsive-lg my-4"
3+
<table class="table table-hover table-responsive-md my-4"
44
data-behavior="dictionary" data-id="<%= dict_id %>">
55
<thead>
66
<th>Component</th>

0 commit comments

Comments
 (0)