Skip to content

Commit 204d2e4

Browse files
authored
Merge pull request #1244 from projectblacklight/repository-card
Improve responsiveness of repository index page cards
2 parents 29d268a + 370c8b8 commit 204d2e4

File tree

2 files changed

+23
-66
lines changed

2 files changed

+23
-66
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,10 @@
11
.al-repository {
2-
background-color: $gray-200;
32
border: $default-border-styling;
4-
margin-bottom: $spacer;
5-
6-
.al-repository-information {
7-
font-size: $font-size-sm;
8-
padding: $spacer;
9-
10-
@media (min-width: 992px) {
11-
padding-left: 0;
12-
}
13-
14-
address {
15-
margin-bottom: 0;
16-
}
17-
18-
.repo-name {
19-
margin-bottom: $spacer;
20-
}
21-
22-
.al-repository-contact,
23-
.al-repository-extra-collection-count {
24-
font-weight: 300;
25-
}
26-
27-
.al-repository-street-address {
28-
margin-bottom: 0.5rem;
29-
}
30-
31-
.al-repository-description {
32-
margin-right: $spacer;
33-
padding-left: $spacer * 2;
34-
35-
@media (min-width: 992px) {
36-
border-left: $default-border-styling;
37-
}
38-
}
39-
40-
.al-repository-extra {
41-
text-align: center;
42-
43-
.al-repository-extra-collection-count {
44-
font-style: italic;
45-
margin-bottom: $spacer;
46-
}
3+
background-color: $gray-200;
4+
}
475

48-
.al-repository-collection-count {
49-
font-weight: $font-weight-bold;
50-
}
51-
}
6+
@include media-breakpoint-up(sm) {
7+
.al-repository-description {
8+
border-left: $default-border-styling;
529
}
5310
}

app/views/arclight/repositories/_repository.html.erb

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
<div class="al-repository">
1+
<div class="mb-3 mx-auto al-repository">
22
<div class="container">
33
<div class='row'>
4-
<div class='col-2 align-self-center al-repository-thumbnail hidden-md-down'>
5-
<%= image_tag repository.thumbnail_url, alt: repository.name, class: 'img-fluid' %>
4+
<div class='col-2 align-self-center d-none d-lg-block al-repository-thumbnail'>
5+
<%= image_tag repository.thumbnail_url, alt: repository.name, class: 'img-fluid d-block mx-auto' %>
66
</div>
77

8-
<div class="col-sm-12 col-lg-10 al-repository-information">
9-
<%= content_tag(params[:id] == repository.slug ? :h1 : :h2, class: 'h5 repo-name') do %>
10-
<%= link_to_unless(params[:id] == repository.slug, repository.name, arclight_engine.repository_path(repository.slug)) %>
8+
<div class="col-sm-12 col-lg-10 py-3 al-repository-information">
9+
<%= content_tag(params[:id] == repository.slug ? :h1 : :h2, class: 'h5 mb-3 repo-name') do %>
10+
<%= link_to_unless(params[:id] == repository.slug, repository.name, arclight_engine.repository_path(repository.slug)) %>
1111
<% end %>
12-
<div class='row no-gutters justify-content-md-center'>
13-
<div class='col-4 col-md-3 al-repository-contact'>
14-
<address>
15-
<div class="al-repository-street-address">
12+
<div class='row no-gutters justify-content-center'>
13+
<div class='col-12 col-sm-4 col-md-3 fw-light al-repository-contact'>
14+
<address class="text-break">
15+
<div class="mb-3 al-repository-street-address">
1616
<%= repository.location %>
1717
</div>
1818

@@ -22,19 +22,19 @@
2222
</address>
2323
</div>
2424

25-
<div class='col al-repository-description'>
25+
<div class='col-12 col-sm mt-3 mt-sm-0 al-repository-description'>
2626
<%= repository.description %>
2727
</div>
2828

2929
<% if on_repositories_index? %>
30-
<div class='col col-lg-2 al-repository-extra align-self-center hidden-md-down'>
31-
<div class='al-repository-extra-collection-count'>
32-
<span class="al-repository-collection-count">
33-
<%= t(:'arclight.views.repositories.number_of_collections', count: repository.collection_count) %>
34-
</span>
35-
</div>
36-
<%= link_to(t(:'arclight.views.repositories.view_more'), arclight_engine.repository_path(repository.slug), class: 'btn btn-secondary btn-sm') %>
30+
<div class='col-12 col-lg-2 mt-3 mt-lg-0 text-center al-repository-extra'>
31+
<div class='mb-1 fst-italic fw-bold'>
32+
<%= t(:'arclight.views.repositories.number_of_collections', count: repository.collection_count) %>
3733
</div>
34+
<% if repository.collection_count&.positive? %>
35+
<%= link_to(t(:'arclight.views.repositories.view_more'), arclight_engine.repository_path(repository.slug), class: 'btn btn-secondary btn-sm') %>
36+
<% end %>
37+
</div>
3838
<% end %>
3939
</div>
4040
</div>

0 commit comments

Comments
 (0)