Skip to content

Commit d1ed168

Browse files
authored
Merge pull request #815 from ElixirTeSS/fix-row-abuse
Alignment fixes
2 parents 2add4b9 + f076de5 commit d1ed168

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+500
-616
lines changed

app/assets/stylesheets/application.scss

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,12 @@ div.wrapper {
107107
}
108108

109109
#content {
110-
padding: 10px;
111110
flex-grow: 1;
112111
overflow: hidden;
113112
}
114113

115114
#sidebar {
116115
width: $sidebar-width;
117-
padding: 10px;
118116
margin-right: $layout-spacing-base * 2;
119117
margin-top: $layout-spacing-base;
120118
flex-shrink: 0;
@@ -194,7 +192,7 @@ div.wrapper {
194192
}
195193

196194
ul.facet-sort-wrap {
197-
margin-bottom: $layout-spacing-base * 2;
195+
margin-bottom: $layout-spacing-base;
198196
}
199197

200198
.facet-sort {
@@ -239,12 +237,6 @@ ul.facet-sort-wrap {
239237
margin-top: 5px;
240238
}
241239

242-
// Bootstrap's row
243-
.row {
244-
margin: 10px 0 10px 0;
245-
//padding: 0px 0px 10px 0px; // Do not add padding to the row - messes up sidebar etc.
246-
}
247-
248240
// From https://css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container/
249241
.dont-break-out {
250242
/* These are technically the same, but use both */

app/assets/stylesheets/themes/default.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $light-05-color: rgba(244, 247, 251, 0.05); // Unused
2424
// TeSS variables
2525
//////////////////////////////
2626
// Misc
27-
$layout-spacing-base: 24px;
27+
$layout-spacing-base: 30px;
2828
$item-padding-base: 24px;
2929
$sidebar-width: 280px;
3030
$transition-time: 300ms;
@@ -115,6 +115,8 @@ $breadcrumb-bg: transparent;
115115
$breadcrumb-separator: "/";
116116
$breadcrumb-color: $dark-color !default;
117117
$breadcrumb-active-color: $dark-color !default;
118+
$breadcrumb-padding-horizontal: 5px;
119+
$breadcrumb-padding-vertical: $layout-spacing-base / 2;
118120

119121
// Pagination
120122
$pagination-color: $primary-color;

app/views/bans/new.html.erb

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
<div class="row wrapper">
2-
<div class="col-md-12">
3-
<div class="page-header">
4-
<%= page_title('Ban') %>
5-
</div>
6-
<div class="col-md-8">
7-
<%= simple_form_for [@user, @ban], url: user_ban_path(@user) do |f| %>
8-
<%= f.input :reason %>
9-
<%= f.input :shadow, label: 'Shadowban?' %>
10-
<div class="form-group">
11-
<%= f.submit 'Submit', class: 'btn btn-primary' %>
12-
<%= link_to t('.cancel', default: t("helpers.links.cancel")), :back, class: 'btn btn-default' %>
13-
</div>
14-
<% end %>
15-
</div>
1+
<div class="page-header">
2+
<%= page_title('Ban') %>
3+
</div>
4+
<div class="row">
5+
<div class="col-md-8">
6+
<%= simple_form_for [@user, @ban], url: user_ban_path(@user) do |f| %>
7+
<%= f.input :reason %>
8+
<%= f.input :shadow, label: 'Shadowban?' %>
9+
<div class="form-group">
10+
<%= f.submit 'Submit', class: 'btn btn-primary' %>
11+
<%= link_to t('.cancel', default: t("helpers.links.cancel")), :back, class: 'btn btn-default' %>
12+
</div>
13+
<% end %>
1614
</div>
1715
</div>
Lines changed: 44 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,49 @@
11
<%- model_class = Collection -%>
2-
<div class="row wrapper">
3-
<div class="col-md-12">
4-
<div class="page-header row">
5-
<%= page_title(t('.title', :default => [:'helpers.titles.curate', 'Curate %{type} in %{model} %{title}'], type: @item_class.table_name, model: model_class.model_name.human.titleize.downcase, title: @collection.title), class: 'col-md-8') %>
6-
<div class="col-md-4" style="margin-top: 25px;">
7-
<%= label_tag :since, t('.new_items_since', default: ['%{count} new items since'], count: @items.length) %>
8-
<input id="since" type="date" value="<%= @since.strftime('%Y-%m-%d') %>" pattern="\d{4}-\d{2}-\d{2}" onchange="params = new URLSearchParams(window.location.search); params.set(since, this.value); window.location.search=params.toString();" />
9-
<% if @item_class.name == "Event" %>
10-
<%= label_tag :since, t('.show_past', default: ['show past events']) %>
11-
<%= check_box_tag :past, true, @show_past.present?, onchange: "params = new URLSearchParams(window.location.search); this.checked ? params.set('past', true) : params.delete('past'); window.location.search = params.toString();" %>
12-
<% end %>
13-
</div>
2+
<div class="page-header">
3+
<div class="row">
4+
<%= page_title(t('.title', :default => [:'helpers.titles.curate', 'Curate %{type} in %{model} %{title}'], type: @item_class.table_name, model: model_class.model_name.human.titleize.downcase, title: @collection.title), class: 'col-md-8') %>
5+
<div class="col-md-4" style="margin-top: 25px;">
6+
<%= label_tag :since, t('.new_items_since', default: ['%{count} new items since'], count: @items.length) %>
7+
<input id="since" type="date" value="<%= @since.strftime('%Y-%m-%d') %>" pattern="\d{4}-\d{2}-\d{2}" onchange="params = new URLSearchParams(window.location.search); params.set(since, this.value); window.location.search=params.toString();" />
8+
<% if @item_class.name == "Event" %>
9+
<%= label_tag :since, t('.show_past', default: ['show past events']) %>
10+
<%= check_box_tag :past, true, @show_past.present?, onchange: "params = new URLSearchParams(window.location.search); this.checked ? params.set('past', true) : params.delete('past'); window.location.search = params.toString();" %>
11+
<% end %>
1412
</div>
15-
<%= form_with url: request.url, local: true, method: :patch do |f| %>
16-
<table class="table table-striped table-hover collection_curation_table">
17-
<thead>
18-
<tr>
19-
<th></th>
20-
<%- item_fields(@item_class).each do |field| -%>
21-
<th><%= t field, default: field.to_s.titleize %></th>
22-
<%- end %>
23-
<th></th>
24-
</tr>
25-
</thead>
26-
<tbody>
27-
<% @items.each do |item| %>
28-
<%- id = "item_#{item.id}" %>
29-
<tr>
30-
<td>
31-
<%= label_tag id do %>
32-
<%= hidden_field_tag "reviewed_item_ids[]", item.id %>
33-
<input id="item_<%= item.id %>" type="checkbox" name="item_ids[]" value="<%= item.id %>" <%= @collection.send("#{@item_class.table_name.singularize}_ids").include?(item.id) ? 'checked' : '' %> />
34-
<% end %>
35-
</td>
36-
<%- item_fields(@item_class).each do |field| -%>
37-
<td><label for="<%= id %>"><%= [item.send(field)].flatten.join(', ') %></label></td>
38-
<% end %>
39-
<td><%= link_to t('.link', default: [:'helpers.titles.link', 'Link']), item %></td>
40-
</tr>
41-
<% end %>
42-
</tbody>
43-
</table>
13+
</div>
14+
</div>
4415

45-
<div class="form-group actions">
46-
<%= f.submit class: 'btn btn-primary' %>
47-
</div>
16+
<%= form_with url: request.url, local: true, method: :patch do |f| %>
17+
<table class="table table-striped table-hover collection_curation_table">
18+
<thead>
19+
<tr>
20+
<th></th>
21+
<%- item_fields(@item_class).each do |field| -%>
22+
<th><%= t field, default: field.to_s.titleize %></th>
23+
<%- end %>
24+
<th></th>
25+
</tr>
26+
</thead>
27+
<tbody>
28+
<% @items.each do |item| %>
29+
<%- id = "item_#{item.id}" %>
30+
<tr>
31+
<td>
32+
<%= label_tag id do %>
33+
<%= hidden_field_tag "reviewed_item_ids[]", item.id %>
34+
<input id="item_<%= item.id %>" type="checkbox" name="item_ids[]" value="<%= item.id %>" <%= @collection.send("#{@item_class.table_name.singularize}_ids").include?(item.id) ? 'checked' : '' %> />
35+
<% end %>
36+
</td>
37+
<%- item_fields(@item_class).each do |field| -%>
38+
<td><label for="<%= id %>"><%= [item.send(field)].flatten.join(', ') %></label></td>
39+
<% end %>
40+
<td><%= link_to t('.link', default: [:'helpers.titles.link', 'Link']), item %></td>
41+
</tr>
4842
<% end %>
43+
</tbody>
44+
</table>
45+
46+
<div class="form-group actions">
47+
<%= f.submit class: 'btn btn-primary' %>
4948
</div>
50-
</div>
49+
<% end %>
Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
<%- model_class = Collection -%>
2-
<div class="row wrapper">
3-
<div class="col-md-12">
4-
<div class="page-header">
5-
<%= page_title(t('.title', :default => [:'helpers.titles.edit', 'Edit %{model}'], :model => model_class.model_name.human.titleize.downcase)) %>
6-
</div>
7-
<div class="row">
8-
<div class="col-md-4 col-md-push-8">
9-
<%= render :partial => 'collections/partials/general_collection_info' %>
10-
</div>
11-
<div class="col-md-8 col-md-pull-4">
12-
<%= render :partial => 'form' %>
13-
</div>
14-
</div>
2+
<div class="page-header">
3+
<%= page_title(t('.title', :default => [:'helpers.titles.edit', 'Edit %{model}'], :model => model_class.model_name.human.titleize.downcase)) %>
4+
</div>
5+
<div class="row">
6+
<div class="col-md-4 col-md-push-8">
7+
<%= render :partial => 'collections/partials/general_collection_info' %>
8+
</div>
9+
<div class="col-md-8 col-md-pull-4">
10+
<%= render :partial => 'form' %>
1511
</div>
1612
</div>

app/views/collections/new.html.erb

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
<%- model_class = Collection -%>
2-
3-
<div class="row wrapper">
4-
<div class="col-md-12">
5-
<div class="page-header">
6-
<%= page_title(t('.title', :default => [:'helpers.titles.new', 'New %{model}'], :model => model_class.model_name.human.titleize.downcase)) %>
7-
</div>
8-
<div class="row">
9-
<div class="col-md-4 col-md-push-8">
10-
<%= render :partial => 'collections/partials/general_collection_info' %>
11-
</div>
12-
<div class="col-md-8 col-md-pull-4">
13-
<%= render :partial => 'form' %>
14-
</div>
15-
</div>
2+
<div class="page-header">
3+
<%= page_title(t('.title', :default => [:'helpers.titles.new', 'New %{model}'], :model => model_class.model_name.human.titleize.downcase)) %>
4+
</div>
5+
<div class="row">
6+
<div class="col-md-4 col-md-push-8">
7+
<%= render :partial => 'collections/partials/general_collection_info' %>
8+
</div>
9+
<div class="col-md-8 col-md-pull-4">
10+
<%= render :partial => 'form' %>
1611
</div>
1712
</div>

app/views/collections/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<%= delete_button(@collection) if policy(@collection).destroy? %>
2222
</div>
2323
</div>
24-
<div class="row">
24+
<div class="my-3">
2525
<% materials = @collection.materials %>
2626
<% materials_count = @collection.materials.count %>
2727
<% events = @collection.events %>

app/views/common/_associated_events.html.erb

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,23 @@
1212
<% active = activator.check_pane(id) if activator %>
1313

1414
<div id="<%= id %>" class="tab-pane fade<%= ' in active' if active -%>">
15-
<div class="row">
16-
<div class="col-xs-12">
17-
<div class="search-results-count">
18-
Showing <%= pluralize(shown_count, name) -%>
19-
<% all_btn_text = "Filter #{name.pluralize(shown_count)}" %>
20-
<% if limit && total_count > limit %>
21-
out of <%= total_count -%>
22-
<% all_btn_text = "View all #{name.pluralize(shown_count)} & filter" %>
23-
<% end %>
24-
<% if past_count > 0 %>
25-
<span class="muted">(also found <%= pluralize(past_count, 'past event') %>)</span>
26-
<% end %>
27-
</div>
28-
29-
<% if shown_count > 0 && view_all_link %>
30-
<%= link_to all_btn_text, view_all_link, class: 'btn btn-xs btn-default' %>
31-
<% elsif past_count > 0 && inc_expired_link %>
32-
<%= link_to "View all #{name.pluralize(shown_count)} & filter", inc_expired_link, class: 'btn btn-xs btn-default' %>
33-
<% end %>
34-
</div>
15+
<div class="search-results-count my-3">
16+
Showing <%= pluralize(shown_count, name) -%>
17+
<% all_btn_text = "Filter #{name.pluralize(shown_count)}" %>
18+
<% if limit && total_count > limit %>
19+
out of <%= total_count -%>
20+
<% all_btn_text = "View all #{name.pluralize(shown_count)} & filter" %>
21+
<% end %>
22+
<% if past_count > 0 %>
23+
<span class="muted">(also found <%= pluralize(past_count, 'past event') %>)</span>
24+
<% end %>
3525
</div>
3626

27+
<% if shown_count > 0 && view_all_link %>
28+
<%= link_to all_btn_text, view_all_link, class: 'btn btn-xs btn-default' %>
29+
<% elsif past_count > 0 && inc_expired_link %>
30+
<%= link_to "View all #{name.pluralize(shown_count)} & filter", inc_expired_link, class: 'btn btn-xs btn-default' %>
31+
<% end %>
32+
3733
<%= render partial: 'common/masonry_grid', locals: { objects: resources } %>
3834
</div>

app/views/common/_associated_resources.html.erb

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,17 @@
99
<% active = activator.check_pane(id) if activator %>
1010

1111
<div id="<%= id %>" class="tab-pane fade<%= ' in active' if active -%>">
12-
<div class="row">
13-
<div class="col-xs-12">
14-
<div class="search-results-count">
15-
Showing <%= pluralize(shown_count, name) -%>
16-
<% if limit && total_count > limit %>
17-
out of <%= total_count -%>
18-
<% all_btn_text = 'View all & filter' %>
19-
<% else %>
20-
<% all_btn_text = 'Filter' %>
21-
<% end %>
22-
</div>
23-
24-
<%= link_to all_btn_text, view_all_link, class: 'btn btn-xs btn-default' if view_all_link %>
25-
</div>
12+
<div class="search-results-count my-3">
13+
Showing <%= pluralize(shown_count, name) -%>
14+
<% if limit && total_count > limit %>
15+
out of <%= total_count -%>
16+
<% all_btn_text = 'View all & filter' %>
17+
<% else %>
18+
<% all_btn_text = 'Filter' %>
19+
<% end %>
2620
</div>
2721

22+
<%= link_to all_btn_text, view_all_link, class: 'btn btn-xs btn-default' if view_all_link %>
23+
2824
<%= render partial: 'common/masonry_grid', locals: { objects: resources } %>
2925
</div>

app/views/common/_external_resource.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<% api_url = external_resource.api_url_of_tool -%>
2-
<%= content_tag(:div, class: 'col-md-12 col-sm-12 bounding-box', data: { 'biotools-url': api_url }) do %>
2+
<%= content_tag(:div, class: 'bounding-box', data: { 'biotools-url': api_url }) do %>
33
<%= link_to(external_resource.url, target: '_blank', rel: 'nofollow noopener') do %>
44
<h5>
55
<i class="fa fa-external-link"></i>

0 commit comments

Comments
 (0)