From 5945b7119491c7da0087fc1726e2a58cf8990f12 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Wed, 19 Apr 2017 21:45:17 +0200 Subject: [PATCH] Right details box is now properly stuck to the top --- app/views/packages/details.slim | 72 ++++++++++++++++----------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/app/views/packages/details.slim b/app/views/packages/details.slim index 2d5545d..6166aec 100644 --- a/app/views/packages/details.slim +++ b/app/views/packages/details.slim @@ -5,47 +5,47 @@ h1 =@package.name .row.packagepage - .small-7.medium-7.columns.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.version} - - if user_signed_in? - .imgcaption - em Admin status: #{screenshot.adminstatus} - - // Is the user an admin? + .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.version} - if user_signed_in? - = render(partial: 'admin_dropdown', locals: {screenshot: screenshot}) - // or does the screenshot belong to the user (determined by session cookie) - - elsif screenshot.uploaderhash == session[:token] - / = render(partial: 'user_dropdown', locals: {screenshot: screenshot}) - / Ask the user to add a description if not yet done - - if screenshot.description.blank? - .imgcaption - p Please add a brief description of this screenshot: - = form_tag(update_screenshot_description_path(screenshot.package.name, screenshot.id)) - .input-group - = text_field_tag 'description', nil, class: 'input-group-field', maxlength: 80 - .input-group-button - =submit_tag 'Save', class: 'button success' - / Offer to delete the screenshot - a.button.small.alert[ - href=delete_screenshot_path(screenshot.id) - onclick="return confirm('Really delete your screenshot again?');" - ] Delete your screenshot + .imgcaption + em Admin status: #{screenshot.adminstatus} - // or is the user not related to the screenshot and the screenshot is public? - - elsif screenshot.approved - = render(partial: 'report_dropdown', locals: {screenshot: screenshot}) + // Is the user an admin? + - if user_signed_in? + = render(partial: 'admin_dropdown', locals: {screenshot: screenshot}) + // or does the screenshot belong to the user (determined by session cookie) + - elsif screenshot.uploaderhash == session[:token] + / = render(partial: 'user_dropdown', locals: {screenshot: screenshot}) + / Ask the user to add a description if not yet done + - if screenshot.description.blank? + .imgcaption + p Please add a brief description of this screenshot: + = form_tag(update_screenshot_description_path(screenshot.package.name, screenshot.id)) + .input-group + = text_field_tag 'description', nil, class: 'input-group-field', maxlength: 80 + .input-group-button + =submit_tag 'Save', class: 'button success' + / Offer to delete the screenshot + a.button.small.alert[ + href=delete_screenshot_path(screenshot.id) + onclick="return confirm('Really delete your screenshot again?');" + ] Delete your screenshot + + // or is the user not related to the screenshot and the screenshot is public? + - elsif screenshot.approved + = render(partial: 'report_dropdown', locals: {screenshot: screenshot}) - else .row.listview @@ -56,7 +56,7 @@ // was not yet cached. #reviews data-package-reviews-url=package_reviews_path(@package.name) - #details.small-5.medium-5.columns data-sticky-container=true + .small-5.medium-5.columns data-sticky-container=true = render(partial: 'details_rightbox', locals: {pkg: @package}) javascript: