Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'Ask GIS' panel and reorganize SCSS #115

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't we losing this default contact logic the way this is implemented?

I wonder if we could continue down the path you started here and have a single shared/ask partial and within that partial split out the gdt/non-gdt logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think that makes sense. The original 'Ask Us' bit felt kind of placeholder-y, but that's not my assumption to make.

<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 %>
Loading