86 lines
3.5 KiB
Text
86 lines
3.5 KiB
Text
/ If images were just uploaded then show upload success/errors
|
||
/ in a callout.
|
||
= render 'receive_upload'
|
||
|
||
.packagepage
|
||
h1 =@package.name
|
||
|
||
.grid-x.grid-padding-x.packagepage
|
||
#details.small-7.medium-7.cell.packagepage
|
||
p.subtitle = @package.description
|
||
|
||
- if @package.screenshots_pending.length > 0
|
||
div.callout.warning
|
||
p
|
||
' New screenshots have been uploaded for this package.
|
||
' They still need to be approved by a moderator before they are publicly visible.
|
||
' Please check again later.
|
||
|
||
- if screenshots_visible_to_user(@package).count > 0
|
||
- screenshots_visible_to_user(@package).each do |screenshot|
|
||
.listview
|
||
.text-center
|
||
/a.black.fancybox href =url_for(screenshot.image.variant(resize_to_limit: [800,600])) rel='fancybox-thumb' title=screenshot.caption
|
||
/ Fancybox image viewer: http://fancyapps.com/fancybox/3/docs/#usage
|
||
|
||
a href =url_for(screenshot.large_watermarked) rel='fancybox-thumb' title=screenshot.caption data-fancybox='gallery'
|
||
.image-with-zoom-icon-container
|
||
.image-with-zoom-icon
|
||
= image_tag(url_for(screenshot.image), alt: screenshot.caption)
|
||
|
||
.magnifying-glass-icon
|
||
i.fa.fa-search
|
||
|
||
- if screenshot.description
|
||
.imgcaption =screenshot.description
|
||
// Has the unmoderated screenshot been uploaded by the current user?
|
||
- if screenshot_uploaded_by_current_user?(screenshot)
|
||
span.label.warning
|
||
| Uploaded by you
|
||
- unless screenshot.approved
|
||
| (but not public yet)
|
||
|
||
- if screenshot.version.present?
|
||
.imgcaption
|
||
| Screenshot was taken from version #{screenshot.upstream_version} #{time_ago_in_words(screenshot.created_at)} ago
|
||
- if user_signed_in? and current_user.is_admin?
|
||
.imgcaption
|
||
span.label.secondary #{screenshot.adminstatus}
|
||
|
||
|
||
// Show detailed information about the screenshot object when in dev mode
|
||
- if Rails.env == 'development'
|
||
tt
|
||
= screenshot.inspect
|
||
|
||
|
||
// Is the user an admin?
|
||
// TODO: fix dropdowns – do not enforce javascript
|
||
- if user_signed_in? and current_user.is_admin?
|
||
= render(partial: 'admin_dropdown', locals: {screenshot: screenshot})
|
||
// or does the screenshot belong to the user (determined by session cookie)
|
||
- elsif user_signed_in? and screenshot.user == current_user
|
||
= render(partial: 'user_dropdown', locals: {screenshot: screenshot})
|
||
|
||
|
||
// or is the user not related to the screenshot and the screenshot is public?
|
||
// TODO: Move to a seperate page with a form
|
||
//- elsif screenshot.approved
|
||
// = render(partial: 'report_dropdown', locals: {screenshot: screenshot})
|
||
|
||
- else
|
||
.listview
|
||
img src='/images/dummy/no-screenshots-available.svg' width='100%' style='padding: 0 10%'
|
||
|
||
// 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)
|
||
|
||
.small-5.medium-5.cell data-sticky-container=true
|
||
= render(partial: 'details_rightbox', locals: {pkg: @package})
|
||
|
||
/ javascript:
|
||
/ $( function() {
|
||
/ load_reviews()
|
||
/ })
|