Skip to content
Open
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
2 changes: 1 addition & 1 deletion app/assets/stylesheets/notes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ textarea#note_text,
blockquote.note > p {
width: 100%;
font-family: serif;
font-size: 125%;
font-size: 150%;
}

textarea#note_text {
Expand Down
18 changes: 11 additions & 7 deletions app/assets/stylesheets/search.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
.search-result {
padding-top: 0.50em;
padding-bottom: 0.50em;
.search-results {
list-style: none;
padding: 0;
}

.search-result:first-of-type {
padding-top: 0em;
.search-result {
padding: 0.5em;

> p {
margin: 0;
}
}

.search-result + .search-result {
margin-top: 0.50em;
.search-result:nth-child(2n) {
background: #eee;
}
4 changes: 2 additions & 2 deletions app/views/search/_result.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<section class="search-result">
<li class="search-result">
<p><%= link_to note.summarize(200), note %></p>
<p>
<time datetime="<%=note.created_at.getutc.iso8601%>" title="<%=note.created_at.getutc.iso8601%>"><%=time_ago_in_words note.created_at%> ago</time>
&nbsp;
<span>#{heart} +<%=number_to_human note.likes.size%></span>
</p>
</section>
</li>
20 changes: 11 additions & 9 deletions app/views/search/search.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<%- title @query %>
<%- title "Results for \"#{@query}\"" %>
<main class="row">
<section>
<h1>Results for &ldquo;<%=@query%>&rdquo;</h1>
<% if @results.any? %>
<%= render partial: 'search/result', collection: @results, as: :note %>
<% else %>
<p>No results</p>
<% end %>
</section>
<section>
<h1>Results for &ldquo;<%=@query%>&rdquo;</h1>
<% if @results.any? %>
<ul class="search-results">
<%= render partial: 'search/result', collection: @results, as: :note %>
</ul>
<% else %>
<p>No results</p>
<% end %>
</section>
</main>