debshots/app/views/packages/details.slim

55 lines
2.3 KiB
Text

/ If images were just uploaded then show upload success/errors
/ in a callout.
= render 'receive_upload'
.row.packagepage
.small-12.columns
h1 =@package.name
.row.packagepage
#details.small-7.medium-7.columns.packagepage
p.subtitle = @package.description
- if screenshots_visible_to_user(@package).count > 0
- screenshots_visible_to_user(@package).each do |screenshot|
.row.listview
/ .text-center
a.black.fancybox href=screenshot.image.url(:large, timestamp: false) rel='fancybox-thumb' title=screenshot.caption
= image_tag(screenshot.image.url(:large, timestamp: false), alt: screenshot.caption)
- if screenshot.description
.imgcaption =screenshot.description
- if screenshot.version.present?
.imgcaption
em from version #{screenshot.upstream_version}
- if user_signed_in? and current_user.is_admin?
.imgcaption
span.label.secondary #{screenshot.adminstatus}
// Is the user an admin?
- 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
.row.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.columns data-sticky-container=true
= render(partial: 'details_rightbox', locals: {pkg: @package})
javascript:
$( function() {
load_reviews()
})