pouyana/gutenbergtranslator

View on GitHub
app/views/books/show.html.erb

Summary

Maintainability
Test Coverage
<% book = @book%>
<h2>
<%= book.title %>
</h2>
<h4>
by <%=book.author%>
</h4>
<div class="row" style="margin-bottom:10px">
 <div class="span3">
  <% wd = Wikidata.new(book,locale)%>
  <% wd.dataMiner %>
  <% if wd.hasArticle%>
    <%=link_to (t :Wikipedia), wd.getWikipediaUrl, :class=>"label label-inverse"%>
  <%end%>
  <%=link_to (t :Gutenberg) , book.gutenberg, :class=>"label label-inverse" %>
 </div>
</div>
<div class="row-fluid">
 <div class="span2 offset10">
  <h5>Statistics</h5>
  <table class="table">
   <tr>
    <th>
    Articles
    </th>
    <th>
    Paragraphs
    </th>
   </tr>
   <tr>
    <td>
    <% if wd.hasArticle%>
    <%= wd.articleCount%>
    <% end%>
    </td>
    <% if book.paragraph_count!=-1%>
    <td>
    <%= book.paragraph_count %>
    </td>
    <%end%>
   </tr>
  </table>
 </div>
</div>