Skip to content

Commit

Permalink
Merge pull request #115 from MITLibraries/gdt-129-ask-gis
Browse files Browse the repository at this point in the history
Add 'Ask GIS' panel and reorganize SCSS
  • Loading branch information
jazairi authored Feb 13, 2024
2 parents 0c18643 + 07a35ba commit fe1fa4b
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 27 deletions.
27 changes: 27 additions & 0 deletions app/assets/stylesheets/partials/_panels.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,30 @@
}
}
}

#advanced-search-panel legend {
color: #000
}

.ask-us {
margin-top: 3rem;
a {
margin-top: 0.5rem;
&:after {
padding-left: 1rem;
font-family: FontAwesome;
content: '\f075';
}
}
&.view-md {
@media (min-width: $bp-screen-md) {
display: none;
}
}
&.view-lg {
display: none;
@media (min-width: $bp-screen-md) {
display: block;
}
}
}
12 changes: 12 additions & 0 deletions app/assets/stylesheets/partials/_results.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
.top-space {
margin-top: 2.4rem;
}

.wrap-results {
margin-bottom: 3rem;
background-color: $white-t;
padding: 15px;

.no-results {
margin-left: -15px;
}

.no-results + .ask-us {
margin-top: 0rem;
}
}

.result {
Expand Down
17 changes: 0 additions & 17 deletions app/assets/stylesheets/timdexui.scss
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
body {
font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

// Things I don't know how to classify yet. Ideally this will be empty.
.top-line {
border-top: 1px solid #000;
}

.top-attached {
margin-top: 0;
}

.top-space {
margin-top: 2.4rem;
}

#advanced-search-panel legend {
color: #000
}
8 changes: 1 addition & 7 deletions app/views/record/_sidebar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,5 @@
</div>
<% end %>

<div class="bit askus">
<h3 class="title">Ask Us</h3>
<p>Not finding what you're looking for? We're here to help with anything from quick questions to in-depth research.</p>
<p>
<a class="btn button-secondary" href="https://libraries.mit.edu/ask/">Ask Us</a>
</p>
</div>
<%= render 'shared/ask' %>
</div>
9 changes: 6 additions & 3 deletions app/views/search/results.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,21 @@

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

<div class="<%= 'layout-1q3q' if @filters.present? %> layout-band top-space">
<div class="<%= @filters.present? ? 'layout-1q3q' : 'layout-3q1q' %> layout-band top-space">
<% if @filters.present? %>
<aside class="col1q filter-container">
<div id="filters">
<h2 class="hd-3">Filter your results</h2>
<h3 class="hd-4"><em><%= results_summary(@pagination[:hits]) %></em></h3>
<% @filters&.each_with_index do |(category, values), index| %>
<% if index == 0 %>
<%= render(partial: 'search/filter', locals: {category: category, values: values, first: true}) %>
<%= render(partial: 'search/filter', locals: {category: category, values: values, first: true }) %>
<% else %>
<%= render(partial: 'search/filter', locals: {category: category, values: values, first: false }) %>
<% end %>
<% end %>
</div>
<%= render partial: 'shared/ask', locals: { display: 'view-lg' } %>
</aside>
<% end %>

Expand All @@ -71,15 +72,17 @@
<%= render(partial: 'search/result', collection: @results) %>
</ul>
<% else %>
<div id="results">
<div id="results" class="no-results">
<p class="hd-2">No results found for your search</p>
</div>
<% end %>
</div>
<%= render partial: 'shared/ask', locals: { display: 'aside' } if @results.blank? %>

<% if @results.present? %>
<div id="pagination">
<%= render partial: "pagination" %>
</div>
<%= render partial: 'shared/ask', locals: { display: 'view-md' } %>
<% end %>
</div>
14 changes: 14 additions & 0 deletions app/views/shared/_ask.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<% if display == 'view-aside' %>
<div class="col1qr-sidebar">
<% end %>
<div class="bit ask-us <%= display %>">
<h3 class="title">Need help?</h3>
<% if Flipflop.enabled?(:gdt) %>
<a class="btn button-secondary" href="https://libraries.mit.edu/ask-gis">Ask GIS</a>
<% else %>
<a class="btn button-secondary" href="https://libraries.mit.edu/ask/">Ask Us</a>
<% end %>
</div>
<% if display == 'view-aside' %>
</div>
<% end %>

0 comments on commit fe1fa4b

Please sign in to comment.