Disabled Ubuntu reviews
The reviews are pretty useless. People refer to bugs or old versions or just don't know how to use a piece of software. This is not helpful.
This commit is contained in:
parent
4a2f21631a
commit
fe6430322b
4 changed files with 32 additions and 30 deletions
|
|
@ -238,12 +238,12 @@ class PackagesController < ApplicationController
|
|||
end
|
||||
|
||||
# Show an HTML partial with reviews of this package from the Ubuntu API
|
||||
def reviews
|
||||
expires_in 1.day, public: true
|
||||
# @reviews = Package.find_by_name!(params[:name]).ubuntu_reviews
|
||||
@reviews = get_ubuntu_reviews params[:name]
|
||||
render '_reviews', layout: false
|
||||
end
|
||||
# def reviews
|
||||
# expires_in 1.day, public: true
|
||||
# # @reviews = Package.find_by_name!(params[:name]).ubuntu_reviews
|
||||
# @reviews = get_ubuntu_reviews params[:name]
|
||||
# render '_reviews', layout: false
|
||||
# end
|
||||
|
||||
private
|
||||
|
||||
|
|
|
|||
|
|
@ -1,22 +1,24 @@
|
|||
- if @reviews.count > 0
|
||||
/ Currently unused
|
||||
|
||||
.subtitle Reviews from Ubuntu users
|
||||
/ - if @reviews.count > 0
|
||||
|
||||
- @reviews.each do |review|
|
||||
p
|
||||
div
|
||||
b = review['summary']
|
||||
' …
|
||||
= review['review_text']
|
||||
.text-right
|
||||
em
|
||||
= review['reviewer_displayname']
|
||||
' –
|
||||
= time_ago_in_words(DateTime.parse(review['date_created']))
|
||||
' ago –
|
||||
= star_rating(review['rating'])
|
||||
/ .subtitle Reviews from Ubuntu users
|
||||
|
||||
/ - else
|
||||
/ - @reviews.each do |review|
|
||||
/ p
|
||||
/ div
|
||||
/ b = review['summary']
|
||||
/ ' …
|
||||
/ = review['review_text']
|
||||
/ .text-right
|
||||
/ em
|
||||
/ = review['reviewer_displayname']
|
||||
/ ' –
|
||||
/ = time_ago_in_words(DateTime.parse(review['date_created']))
|
||||
/ ' ago –
|
||||
/ = star_rating(review['rating'])
|
||||
|
||||
/ p
|
||||
/ em No reviews available.
|
||||
/ / - else
|
||||
|
||||
/ / p
|
||||
/ / em No reviews available.
|
||||
|
|
|
|||
|
|
@ -44,12 +44,12 @@
|
|||
// Load reviews from the Ubuntu API through our own (cached) URL.
|
||||
// Use asynchronous load to keep loading times low if the review
|
||||
// was not yet cached.
|
||||
#reviews data-package-reviews-url=package_reviews_path(@package.name)
|
||||
/ #reviews data-package-reviews-url=package_reviews_path(@package.name)
|
||||
|
||||
.small-5.medium-5.columns data-sticky-container=true
|
||||
= render(partial: 'details_rightbox', locals: {pkg: @package})
|
||||
|
||||
javascript:
|
||||
$( function() {
|
||||
load_reviews()
|
||||
})
|
||||
/ javascript:
|
||||
/ $( function() {
|
||||
/ load_reviews()
|
||||
/ })
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ Rails.application.configure do
|
|||
|
||||
# Example file for development to avoid queries to online service
|
||||
# config.ubuntu_reviews_api_url = 'test/files/ubuntu-review-api/cream'
|
||||
config.ubuntu_reviews_api_url = 'https://reviews.ubuntu.com/reviews/api/1.0/reviews/filter/any/any/any/any/%s'
|
||||
# config.ubuntu_reviews_api_url = 'https://reviews.ubuntu.com/reviews/api/1.0/reviews/filter/any/any/any/any/%s'
|
||||
|
||||
config.images_path = Rails.root.join('public', 'screenshots')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue