Skip to content

Commit

Permalink
Add search and resolve controller tests. Cleanup HTML based on those …
Browse files Browse the repository at this point in the history
…tests.
  • Loading branch information
scotdalton committed Mar 20, 2013
1 parent 6615136 commit 4be4b0b
Show file tree
Hide file tree
Showing 7 changed files with 455 additions and 255 deletions.
17 changes: 17 additions & 0 deletions app/helpers/search_helper.rb
Expand Up @@ -42,4 +42,21 @@ def referent_labels(context_obj = @current_context_object)
def group_list def group_list
group_list ||= ('A'..'Z').to_a.push('0-9').push('Other') group_list ||= ('A'..'Z').to_a.push('0-9').push('Other')
end end

# Date dropdowns in search page
def date
years + months + days
end

def years
select_year(nil, {:prompt => true, :start_year => Date.today.year, :end_year => 1950}, {:name => "__year", :class=>"year input-small"})
end

def months
select_month(nil, {:prompt => true, :use_short_month => true}, {:name => "__month", :class=>"month input-small"})
end

def days
select_day(nil, {:prompt => true}, {:name => "__day", :class=>"day input-small"})
end
end end
174 changes: 87 additions & 87 deletions app/views/resolve/_citation.html.erb
@@ -1,87 +1,87 @@






<table id="citation" width="100%" cellpadding="3" cellspacing="0"> <table id="citation" width="100%" cellpadding="3" cellspacing="0">
<% <%
cite = @user_request.referent.to_citation cite = @user_request.referent.to_citation
#rft_metadata = @user_request.referent.metadata #rft_metadata = @user_request.referent.metadata
%> %>


<tr> <tr>
<td class="largeTextb" width="90" valign="TOP"><div align="right"><%= cite[:title_label] %>:</div></td> <td class="largeTextb" width="90" valign="TOP"><div align="right"><%= cite[:title_label] %>:</div></td>


<td class="largeText"><%= cite[:title] %></td> <td class="largeText"><%= cite[:title] %></td>
</tr> </tr>
<% # Try to warn if this could be a typo. If we have an rft.object_id, then <% # Try to warn if this could be a typo. If we have an rft.object_id, then
# SFX recognized it as an actually existing journal. If not, then it # SFX recognized it as an actually existing journal. If not, then it
# might be a typo. If it came from a manually entered citation, warn them. # might be a typo. If it came from a manually entered citation, warn them.


if display_not_found_warning?(@user_request) if display_not_found_warning?(@user_request)
%> %>
<tr><td class="largeTextb notice"><div align="right">(!) Warning:</div></td><td class="largeText notice"><%= umlaut_config.app_name %> does not know about a <%= (@user_request.referent.format).downcase %> with this name. Please check your entry.</td></tr> <tr><td class="largeTextb notice"><div align="right">(!) Warning:</div></td><td class="largeText notice"><%= umlaut_config.app_name %> does not know about a <%= (@user_request.referent.format).downcase %> with this name. Please check your entry.</td></tr>


<% end %> <% end %>
<% <%
@page_title = cite[:title] @page_title = cite[:title]
if cite[:author] if cite[:author]
%> %>
<tr> <tr>
<td width="90" class="largeTextb"><div align="right">Author:</div></td> <td width="90" class="largeTextb"><div align="right">Author:</div></td>
<td class="largeText"><%= cite[:author] %></td> <td class="largeText"><%= cite[:author] %></td>
</tr> </tr>
<% <%
end end
if cite[:subtitle] %> if cite[:subtitle] %>
<tr> <tr>
<td width="90"><div align="right" class="smallTextb"><strong><%= cite[:subtitle_label] %>:</strong></div></td> <td width="90"><div align="right" class="smallTextb"><strong><%= cite[:subtitle_label] %>:</strong></div></td>
<td><span class="smallText"><%= cite[:subtitle] %></span></td> <td><span class="smallText"><%= cite[:subtitle] %></span></td>
</tr> </tr>
<% <%
end end


if (cite[:issn] && ! cite[:issn].empty?) %> if (cite[:issn] && ! cite[:issn].empty?) %>
<tr> <tr>
<td><div align="right" class="smallTextb"><strong>ISSN:</strong></div></td> <td><div align="right" class="smallTextb"><strong>ISSN:</strong></div></td>
<td><span class="smallText"><%= cite[:issn] %></span></td> <td><span class="smallText"><%= cite[:issn] %></span></td>
</tr> </tr>
<% <%
end end


if (cite[:isbn] && ! cite[:isbn].empty? ) %> if (cite[:isbn] && ! cite[:isbn].empty? ) %>
<tr> <tr>
<td><div align="right" class="smallTextb">ISBN:</strong></div></td> <td><div align="right" class="smallTextb"><strong>ISBN:</strong></div></td>
<td><span class="smallText"><%= cite[:isbn] %></span></td> <td><span class="smallText"><%= cite[:isbn] %></span></td>
</tr> </tr>
<% <%
end %> end %>
<% unless cite[:pub].blank? %> <% unless cite[:pub].blank? %>
<tr> <tr>
<td><div align="right" class="smallTextb">Publisher:</div></td> <td><div align="right" class="smallTextb">Publisher:</div></td>
<td><span class="smallText"><%= cite[:pub] %> <td></tr> <td><span class="smallText"><%= cite[:pub] %></span></td></tr>
<% end %> <% end %>
<% unless cite[:date].blank? && cite[:volume].blank? && cite[:issue].blank? && cite[:page].blank? %> <% unless cite[:date].blank? && cite[:volume].blank? && cite[:issue].blank? && cite[:page].blank? %>
<tr> <tr>
<td><div align="right" class="smallTextb">Published:</div></td> <td><div align="right" class="smallTextb">Published:</div></td>
<td><span class="smallText"> <td><span class="smallText">
<%= date_format(cite[:date]) %>&nbsp;&nbsp; <%= date_format(cite[:date]) %>&nbsp;&nbsp;


<% unless cite[:volume].blank? %> <% unless cite[:volume].blank? %>
Volume:&nbsp;&nbsp;<%= cite[:volume] %>&nbsp;&nbsp; Volume:&nbsp;&nbsp;<%= cite[:volume] %>&nbsp;&nbsp;
<% end %> <% end %>
<% unless cite[:issue].blank? %> <% unless cite[:issue].blank? %>
Issue:&nbsp;&nbsp;<%= cite[:issue] %>&nbsp;&nbsp; Issue:&nbsp;&nbsp;<%= cite[:issue] %>&nbsp;&nbsp;
<% end %> <% end %>
<% unless cite[:page].blank? %> <% unless cite[:page].blank? %>
Page:&nbsp;&nbsp;<%= cite[:page] %>&nbsp;&nbsp; Page:&nbsp;&nbsp;<%= cite[:page] %>&nbsp;&nbsp;
<% end %> <% end %>
</span></td> </span></td>
</tr> </tr>
<% end %> <% end %>
</table> </table>





2 changes: 1 addition & 1 deletion app/views/resolve/_holding.html.erb
Expand Up @@ -42,7 +42,7 @@
<% else %> <% else %>
<em class="note label">May be alternate edition.</em> <em class="note label">May be alternate edition.</em>
<% end %> <% end %>
<div> </div>
</td> </td>
</tr> </tr>
<% end %> <% end %>
Expand Down

0 comments on commit 4be4b0b

Please sign in to comment.