aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/packages')
-rw-r--r--app/views/packages/_metadata.html.erb2
-rw-r--r--app/views/packages/_package_header.html.erb2
-rw-r--r--app/views/packages/added.html.erb2
-rw-r--r--app/views/packages/keyworded.html.erb2
-rw-r--r--app/views/packages/search.html.erb6
-rw-r--r--app/views/packages/stable.html.erb2
-rw-r--r--app/views/packages/updated.html.erb2
7 files changed, 9 insertions, 9 deletions
diff --git a/app/views/packages/_metadata.html.erb b/app/views/packages/_metadata.html.erb
index 426afd9..5568c08 100644
--- a/app/views/packages/_metadata.html.erb
+++ b/app/views/packages/_metadata.html.erb
@@ -3,7 +3,7 @@
<h3 class="panel-title"><%= t :box_metadata %></h3>
</div>
<ul class="list-group kk-metadata-list">
- <% if package.homepage.size > 1 %>
+ <% if !package.homepage.nil? && package.homepage.size > 1 %>
<li class="kk-metadata-item list-group-item">
<div class="row">
<div class="col-xs-12 col-md-3 kk-metadata-key">
diff --git a/app/views/packages/_package_header.html.erb b/app/views/packages/_package_header.html.erb
index 1b7876b..8c611da 100644
--- a/app/views/packages/_package_header.html.erb
+++ b/app/views/packages/_package_header.html.erb
@@ -25,7 +25,7 @@
<%= package.description %>
</p>
- <% unless package.homepage.empty? || package.homepage.first.nil? || package.homepage.first.empty? %>
+ <% unless package.homepage.nil? || package.homepage.first.nil? || package.homepage.first.empty? %>
<p class="kk-package-homepage">
<%= content_tag :a, package.homepage.first, href: package.homepage.first, rel: 'nofollow' %>
</p>
diff --git a/app/views/packages/added.html.erb b/app/views/packages/added.html.erb
index 97d5cb6..589226a 100644
--- a/app/views/packages/added.html.erb
+++ b/app/views/packages/added.html.erb
@@ -12,7 +12,7 @@
<% cache("added-full-#{@changes.hash}") do %>
<ul class="list-group">
<% @changes.each do |change|
- _package = Package.find_by(:atom, cp_to_atom(change.category, change.package)) %>
+ _package = PackageRepository.find_by(:atom, cp_to_atom(change.category, change.package)) %>
<%= render partial: 'changed_package', object: change, as: 'change', locals: { package: _package, version: _package.latest_version } %>
<% end %>
</ul>
diff --git a/app/views/packages/keyworded.html.erb b/app/views/packages/keyworded.html.erb
index ff5b60c..a83a558 100644
--- a/app/views/packages/keyworded.html.erb
+++ b/app/views/packages/keyworded.html.erb
@@ -12,7 +12,7 @@
<% cache("keyworded-full-#{@changes.hash}") do %>
<ul class="list-group">
<% @changes.each do |change|
- _package = Package.find_by(:atom, cp_to_atom(change.category, change.package)) %>
+ _package = PackageRepository.find_by(:atom, cp_to_atom(change.category, change.package)) %>
<%= render partial: 'changed_package', object: change, as: 'change', locals: { package: _package, version: _package.version(change.version) } %>
<% end %>
</ul>
diff --git a/app/views/packages/search.html.erb b/app/views/packages/search.html.erb
index fe77dd3..c4b5a75 100644
--- a/app/views/packages/search.html.erb
+++ b/app/views/packages/search.html.erb
@@ -3,15 +3,15 @@
<% if @packages.size > 0 %>
<div class="panel panel-default">
<div class="panel-heading">
- Results <%= @offset + 1 %>—<%= [@offset + Package.default_search_size, @packages.total].min %> of <%= @packages.total %>
+ Results <%= @offset + 1 %>—<%= [@offset + PackageRepository.default_search_size, @packages.total].min %> of <%= @packages.total %>
</div>
<div class="list-group">
<%= render partial: 'package_result_row', collection: @packages, as: 'package' %>
</div>
<div class="panel-footer">
<div class="btn-group" role="group" aria-label="Result navigation">
- <%= link_to '< Prev', search_packages_path(q: params[:q], o: [@offset - Package.default_search_size, 0].max), class: 'btn btn-default' + (@offset > 0 ? '' : ' disabled') %>
- <%= link_to 'Next >', search_packages_path(q: params[:q], o: @offset + Package.default_search_size), class: 'btn btn-default ' + ((@offset + Package.default_search_size) > @packages.total ? 'disabled' : '') %>
+ <%= link_to '< Prev', search_packages_path(q: params[:q], o: [@offset - PackageRepository.default_search_size, 0].max), class: 'btn btn-default' + (@offset > 0 ? '' : ' disabled') %>
+ <%= link_to 'Next >', search_packages_path(q: params[:q], o: @offset + PackageRepository.default_search_size), class: 'btn btn-default ' + ((@offset + PackageRepository.default_search_size) > @packages.total ? 'disabled' : '') %>
</div>
</div>
</div>
diff --git a/app/views/packages/stable.html.erb b/app/views/packages/stable.html.erb
index 7b230fe..d9654de 100644
--- a/app/views/packages/stable.html.erb
+++ b/app/views/packages/stable.html.erb
@@ -12,7 +12,7 @@
<% cache("stable-full-#{@changes.hash}") do %>
<ul class="list-group">
<% @changes.each do |change|
- _package = Package.find_by(:atom, cp_to_atom(change.category, change.package)) %>
+ _package = PackageRepository.find_by(:atom, cp_to_atom(change.category, change.package)) %>
<%= render partial: 'changed_package', object: change, as: 'change', locals: { package: _package, version: _package.version(change.version) } %>
<% end %>
</ul>
diff --git a/app/views/packages/updated.html.erb b/app/views/packages/updated.html.erb
index b774c58..af54ce1 100644
--- a/app/views/packages/updated.html.erb
+++ b/app/views/packages/updated.html.erb
@@ -12,7 +12,7 @@
<% cache("updated-full-#{@changes.hash}") do %>
<ul class="list-group">
<% @changes.each do |change|
- _package = Package.find_by(:atom, cp_to_atom(change.category, change.package)) %>
+ _package = PackageRepository.find_by(:atom, cp_to_atom(change.category, change.package)) %>
<%= render partial: 'changed_package', object: change, as: 'change', locals: { package: _package, version: _package.version(change.version) } %>
<% end %>
</ul>