Skip to content

Commit fe1fa4b

Browse files
authored
Merge pull request #115 from MITLibraries/gdt-129-ask-gis
Add 'Ask GIS' panel and reorganize SCSS
2 parents 0c18643 + 07a35ba commit fe1fa4b

File tree

6 files changed

+60
-27
lines changed

6 files changed

+60
-27
lines changed

app/assets/stylesheets/partials/_panels.scss

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,30 @@
7272
}
7373
}
7474
}
75+
76+
#advanced-search-panel legend {
77+
color: #000
78+
}
79+
80+
.ask-us {
81+
margin-top: 3rem;
82+
a {
83+
margin-top: 0.5rem;
84+
&:after {
85+
padding-left: 1rem;
86+
font-family: FontAwesome;
87+
content: '\f075';
88+
}
89+
}
90+
&.view-md {
91+
@media (min-width: $bp-screen-md) {
92+
display: none;
93+
}
94+
}
95+
&.view-lg {
96+
display: none;
97+
@media (min-width: $bp-screen-md) {
98+
display: block;
99+
}
100+
}
101+
}

app/assets/stylesheets/partials/_results.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1+
.top-space {
2+
margin-top: 2.4rem;
3+
}
4+
15
.wrap-results {
26
margin-bottom: 3rem;
37
background-color: $white-t;
48
padding: 15px;
9+
10+
.no-results {
11+
margin-left: -15px;
12+
}
13+
14+
.no-results + .ask-us {
15+
margin-top: 0rem;
16+
}
517
}
618

719
.result {
Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
11
body {
22
font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
33
}
4-
5-
// Things I don't know how to classify yet. Ideally this will be empty.
6-
.top-line {
7-
border-top: 1px solid #000;
8-
}
9-
10-
.top-attached {
11-
margin-top: 0;
12-
}
13-
14-
.top-space {
15-
margin-top: 2.4rem;
16-
}
17-
18-
#advanced-search-panel legend {
19-
color: #000
20-
}

app/views/record/_sidebar.html.erb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,5 @@
88
</div>
99
<% end %>
1010

11-
<div class="bit askus">
12-
<h3 class="title">Ask Us</h3>
13-
<p>Not finding what you're looking for? We're here to help with anything from quick questions to in-depth research.</p>
14-
<p>
15-
<a class="btn button-secondary" href="https://libraries.mit.edu/ask/">Ask Us</a>
16-
</p>
17-
</div>
11+
<%= render 'shared/ask' %>
1812
</div>

app/views/search/results.html.erb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,21 @@
4848

4949
<%= render(partial: 'shared/error', collection: @errors) %>
5050

51-
<div class="<%= 'layout-1q3q' if @filters.present? %> layout-band top-space">
51+
<div class="<%= @filters.present? ? 'layout-1q3q' : 'layout-3q1q' %> layout-band top-space">
5252
<% if @filters.present? %>
5353
<aside class="col1q filter-container">
5454
<div id="filters">
5555
<h2 class="hd-3">Filter your results</h2>
5656
<h3 class="hd-4"><em><%= results_summary(@pagination[:hits]) %></em></h3>
5757
<% @filters&.each_with_index do |(category, values), index| %>
5858
<% if index == 0 %>
59-
<%= render(partial: 'search/filter', locals: {category: category, values: values, first: true}) %>
59+
<%= render(partial: 'search/filter', locals: {category: category, values: values, first: true }) %>
6060
<% else %>
6161
<%= render(partial: 'search/filter', locals: {category: category, values: values, first: false }) %>
6262
<% end %>
6363
<% end %>
6464
</div>
65+
<%= render partial: 'shared/ask', locals: { display: 'view-lg' } %>
6566
</aside>
6667
<% end %>
6768

@@ -71,15 +72,17 @@
7172
<%= render(partial: 'search/result', collection: @results) %>
7273
</ul>
7374
<% else %>
74-
<div id="results">
75+
<div id="results" class="no-results">
7576
<p class="hd-2">No results found for your search</p>
7677
</div>
7778
<% end %>
7879
</div>
80+
<%= render partial: 'shared/ask', locals: { display: 'aside' } if @results.blank? %>
7981

8082
<% if @results.present? %>
8183
<div id="pagination">
8284
<%= render partial: "pagination" %>
8385
</div>
86+
<%= render partial: 'shared/ask', locals: { display: 'view-md' } %>
8487
<% end %>
8588
</div>

app/views/shared/_ask.html.erb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<% if display == 'view-aside' %>
2+
<div class="col1qr-sidebar">
3+
<% end %>
4+
<div class="bit ask-us <%= display %>">
5+
<h3 class="title">Need help?</h3>
6+
<% if Flipflop.enabled?(:gdt) %>
7+
<a class="btn button-secondary" href="https://libraries.mit.edu/ask-gis">Ask GIS</a>
8+
<% else %>
9+
<a class="btn button-secondary" href="https://libraries.mit.edu/ask/">Ask Us</a>
10+
<% end %>
11+
</div>
12+
<% if display == 'view-aside' %>
13+
</div>
14+
<% end %>

0 commit comments

Comments
 (0)