This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make search cover Entity, Photo and Post, and display results visually …
- Loading branch information
Showing
13 changed files
with
86 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
module ApplicationHelper | ||
def partial_name(thing) | ||
case thing.class.to_s | ||
when 'Post' | ||
return '/shared/show_post' | ||
when 'Entity' | ||
return thing.person? ? '/shared/show_person' : '/shared/show_organization' | ||
when 'Photo' | ||
return '/shared/show_photo' | ||
end | ||
nil # Shouldn't happen | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
<!--start: Wrapper--> | ||
<div id="wrapper" class="full"> | ||
<!-- start: Page Title --> | ||
<div id="page-title"> | ||
|
||
<!--start: Row --> | ||
<div class="row-fluid"> | ||
<h2>Resultados para '<%= @query %>'</h2> | ||
|
||
<div class="span8 separate"> | ||
<h3>Resultados para '<%= @query %>'</h3> | ||
</div> | ||
<!-- end: Page Title --> | ||
|
||
<ul> | ||
<!--start: Wrapper--> | ||
<div id="wrapper"> | ||
|
||
<!-- start: Portfolio --> | ||
<div id="wall" class="row-fluid"> | ||
|
||
<% @results.each do |result| %> | ||
<li><%= result.searchable.name %></li> | ||
<%= render partial_name(result.searchable), :item => result.searchable %> | ||
<% end %> | ||
</ul> | ||
|
||
<%= paginate @results %> | ||
</div> | ||
|
||
</div> | ||
<!-- end: Portfolio --> | ||
|
||
<%= paginate @results %> | ||
|
||
</div> | ||
<!-- end: Wrapper --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<div class="span3 item"> | ||
<div class="picture"> | ||
<%= link_to image_tag(item.avatar.url ? item.avatar.url : 'avatar.png'), | ||
organization_path(item), class: 'image' %> | ||
<div class="description"> | ||
<p> | ||
<%= link_to item.name, organization_path(item) %> | ||
<% if !item.short_name.nil? && !item.short_name.blank? %> | ||
(<%= link_to item.short_name, organization_path(item) %>) | ||
<% end %> | ||
</p> | ||
<p> | ||
<%= item.description %> | ||
</p> | ||
|
||
<%= render 'shared/show_admin_links', :item => item %> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div class="span3 item"> | ||
<div class="picture"> | ||
<%= link_to image_tag(item.avatar.url ? item.avatar.url : 'avatar.png'), | ||
person_path(item), class: 'image' %> | ||
<div class="description"> | ||
<p> | ||
<%= link_to item.short_or_long_name, person_path(item) %> | ||
</p> | ||
<p> | ||
<%= item.description %> | ||
</p> | ||
|
||
<%= render 'shared/show_admin_links', :item => item %> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
<div class="<%= photo.extra_wide? ? 'span6': 'span3' %> item"> | ||
<div class="<%= item.extra_wide? ? 'span6': 'span3' %> item"> | ||
<div class="picture"> | ||
<%= link_to image_tag(photo.file.url(photo.extra_wide ? :full : :small)), photo, class: 'image' %> | ||
<%= link_to image_tag(item.file.url(item.extra_wide ? :full : :small)), item, class: 'image' %> | ||
<div class="description"> | ||
<p> | ||
<%= link_to photo.footer, photo %> | ||
<%= link_to item.footer, item %> | ||
</p> | ||
<p> | ||
© <%= link_to photo.copyright, photo.source %> | ||
© <%= link_to item.copyright, item.source %> | ||
</p> | ||
|
||
<%= render 'shared/show_admin_links', :item => photo %> | ||
<%= render 'shared/show_admin_links', :item => item %> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div class="span3 item"> | ||
<div class="picture"> | ||
<div class="description"> | ||
<p> | ||
<%= link_to item.title, post_path(item) %> | ||
</p> | ||
<%= render 'shared/show_admin_links', :item => item %> | ||
</div> | ||
</div> | ||
</div> |