Dammit… I can't remember what I changed and why
This commit is contained in:
parent
09b0df40f7
commit
dd7527691e
20 changed files with 579 additions and 319 deletions
|
|
@ -1,35 +1,33 @@
|
|||
// Button that reveals a dropdown/modal for moderation/reporting
|
||||
.button-bar
|
||||
ul.button-group
|
||||
- if not screenshot.approved
|
||||
li
|
||||
a.button.small.success[
|
||||
href=approve_screenshot_path(screenshot.id)
|
||||
method='post'
|
||||
] Approve screenshot
|
||||
- elsif screenshot.markedfordelete
|
||||
li
|
||||
a.button.small.success[
|
||||
href=approve_screenshot_path(screenshot.id)
|
||||
method='post'
|
||||
] Keep screenshot
|
||||
button-group
|
||||
- if user_signed_in?
|
||||
a.button.small.alert[
|
||||
href=delete_screenshot_path(screenshot.id)
|
||||
onclick="return confirm('Really delete the screenshot?');"
|
||||
] Delete screenshot
|
||||
|
||||
- if user_signed_in?
|
||||
li
|
||||
a.button.small.alert[
|
||||
href=delete_screenshot_path(screenshot.id)
|
||||
onclick="return confirm('Really delete the screenshot?');"
|
||||
] Delete screenshot
|
||||
|
||||
/ Display additional information to admins
|
||||
p Status: #{screenshot.adminstatus}
|
||||
p Uploader IP=#{screenshot.uploaderip}
|
||||
p Uploader Token=#{session[:token]}
|
||||
p Uploaded #{screenshot.age_days} (#{screenshot.created_at})
|
||||
- if not screenshot.approved
|
||||
a.button.small.success[
|
||||
href=approve_screenshot_path(screenshot.id)
|
||||
method='post'
|
||||
] Approve screenshot
|
||||
- elsif screenshot.markedfordelete
|
||||
a.button.small.success[
|
||||
href=approve_screenshot_path(screenshot.id)
|
||||
method='post'
|
||||
] Keep screenshot
|
||||
|
||||
/ TODO: Move reporting screenshots to an extra page with a form and captcha
|
||||
/ - else
|
||||
/ / Allow anonymous users to report inappropriate screenshots
|
||||
/ = form_tag(report_screenshot_path(screenshot.id))
|
||||
/ = text_area_tag 'delete_reason', nil, class: 'input-group-field', maxlength: 100, rows: 3, cols: 50
|
||||
/ = submit_tag 'Request removal', class: 'button alert'
|
||||
|
||||
/ Display additional information to admins
|
||||
p Status: #{screenshot.adminstatus}
|
||||
p Uploader IP=#{screenshot.uploaderip}
|
||||
p Uploader Token=#{session[:token]}
|
||||
p Uploaded #{screenshot.age_days} (#{screenshot.created_at})
|
||||
|
||||
/ TODO: Move reporting screenshots to an extra page with a form and captcha
|
||||
/ - else
|
||||
/ / Allow anonymous users to report inappropriate screenshots
|
||||
/ = form_tag(report_screenshot_path(screenshot.id))
|
||||
/ = text_area_tag 'delete_reason', nil, class: 'input-group-field', maxlength: 100, rows: 3, cols: 50
|
||||
/ = submit_tag 'Request removal', class: 'button alert'
|
||||
|
|
|
|||
22
app/views/packages/_receive_upload.slim
Normal file
22
app/views/packages/_receive_upload.slim
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/ Render this callout on top of the package's details page
|
||||
/ if images have just been uploaded.
|
||||
- if (@valid_images and @valid_images.any?) or (@invalid_images and @invalid_images.any?)
|
||||
.row
|
||||
.callout.warning
|
||||
|
||||
- if @invalid_images.any?
|
||||
= fa_icon 'exclamation-circle 2x pull-left'
|
||||
p These images were not accepted:
|
||||
|
||||
ul
|
||||
- @invalid_images.each do |image|
|
||||
li
|
||||
' #{image.image_file_name} (#{image.errors[:image].join(' and the image ')})
|
||||
|
||||
|
||||
|
||||
- if @valid_images.any?
|
||||
= fa_icon 'check-circle 2x pull-left'
|
||||
p
|
||||
' #{pluralize(@valid_images.length, 'screenshot')} received successfully.
|
||||
' Please review the images and add a description for each image. Thanks.
|
||||
|
|
@ -1,13 +1,17 @@
|
|||
// TODO: Can be deleted?
|
||||
//
|
||||
// Button that reveals a dropdown/modal for users (for their own screenshots)
|
||||
.text-right
|
||||
button.small.dropdown.warning.button type="button" data-toggle="admin-info-#{screenshot.id}"
|
||||
'Manage your screenshot
|
||||
.dropdown-pane data-dropdown=true id="admin-info-#{screenshot.id}"
|
||||
a.button.small.alert[
|
||||
href=delete_screenshot_path(screenshot.id)
|
||||
onclick="return confirm('Really delete the screenshot?');"
|
||||
] Delete screenshot
|
||||
p
|
||||
i =screenshot.status
|
||||
/ Ask the user to add a description if not yet done
|
||||
- if screenshot.description.blank?
|
||||
/ TODO: Allow the user to edit the screenshot's description again?
|
||||
div
|
||||
= form_for screenshot, url: update_screenshot_description_path(screenshot) do |f|
|
||||
label for='description' Please add a short description of this screenshot:
|
||||
.input-group
|
||||
span.input-group-label = fa_icon 'edit wobble'
|
||||
= f.text_field 'description', class: 'input-group-field', maxlength: 80
|
||||
.input-group-button
|
||||
= f.submit '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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
/ = link_to 'Back', :back, class: 'button small'
|
||||
/ If images were just uploaded then show upload success/errors
|
||||
/ in a callout.
|
||||
= render 'receive_upload'
|
||||
|
||||
.row.packagepage
|
||||
.small-12.columns
|
||||
|
|
@ -10,7 +12,7 @@
|
|||
- if screenshots_visible_to_user(@package).count > 0
|
||||
- screenshots_visible_to_user(@package).each do |screenshot|
|
||||
.row.listview
|
||||
.text-center
|
||||
/ .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
|
||||
|
|
@ -26,22 +28,9 @@
|
|||
- 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 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
|
||||
- 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
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
= image_tag(screenshot.image.url(:large, timestamp: false), alt: screenshot.caption)
|
||||
- if pkg.screenshots.length > 1
|
||||
a.black href=package_path(name: pkg.name)
|
||||
.text-center and #{pluralize(pkg.screenshots.length-1, 'screenshot')} more…
|
||||
'and #{pluralize(pkg.screenshots.length-1, 'screenshot')} more…
|
||||
- else
|
||||
a href=package_path(name: pkg.name)
|
||||
img.screenshot src="/images/dummy/no-screenshots-upload-one.svg"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
= render 'receive_upload'
|
||||
|
||||
.row
|
||||
h1 = "Upload screenshots for #{@package.name}"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,59 +1,23 @@
|
|||
/ This page only gets displayed if there was invalid uploads.
|
||||
/ Otherwise the user gets redirected to the upload_review page directly.
|
||||
.row
|
||||
h1 Some images feel wrong…
|
||||
h1 Nothing to see here!
|
||||
|
||||
.row
|
||||
p
|
||||
' Thanks for your upload. Just wanted to let you know that
|
||||
' these images were not accepted:
|
||||
|
||||
ul
|
||||
- @invalid_images.each do |image|
|
||||
li
|
||||
' #{image.image_file_name} (#{image.errors[:image].join(' and the image ')})
|
||||
|
||||
|
||||
|
||||
- if @valid_images.any?
|
||||
p
|
||||
' But do not worry. #{pluralize(@valid_images.length, 'screenshot')} seems good.
|
||||
' Let us take a look at them.
|
||||
|
||||
p
|
||||
a.button href=package_path Okay
|
||||
|
||||
/
|
||||
/ = form_for :screenshot, url: upload_review2_path do |f|
|
||||
/
|
||||
/ p 'Please check the images and add
|
||||
/ ' short one-line descriptions that describe each of the images.
|
||||
/
|
||||
/ - @valid_images.each do |screenshot|
|
||||
/
|
||||
/ / Show upload success/errors and load details view.
|
||||
/ .row
|
||||
/ .callout
|
||||
/
|
||||
/ - if @invalid_images.any?
|
||||
/ p These images were not accepted:
|
||||
/
|
||||
/ ul
|
||||
/ - @invalid_images.each do |image|
|
||||
/ li
|
||||
/ ' #{image.image_file_name} (#{image.errors[:image].join(' and the image ')})
|
||||
/
|
||||
/
|
||||
/
|
||||
/ - if @valid_images.any?
|
||||
/ .row
|
||||
/
|
||||
/ .small-4.columns
|
||||
/ a.black.fancybox href=screenshot.image.url(:large, timestamp: false) title='Uploaded image'
|
||||
/ = image_tag(screenshot.image.url(:large, timestamp: false), alt: 'Uploaded image')
|
||||
/ .small-8.columns
|
||||
/ em Your file name:
|
||||
/ p
|
||||
/ = screenshot.image_file_name
|
||||
/
|
||||
/ em Description:
|
||||
/ p
|
||||
/ = text_field_tag "description-#{screenshot.id}"
|
||||
/
|
||||
/ em Delete this image?
|
||||
/ p
|
||||
/ = check_box "delete-#{screenshot.id}", "Delete this image"
|
||||
/
|
||||
/ .row
|
||||
/ button.button type="submit" id="file-submit"
|
||||
/ = fa_stacked_icon "check", base: "circle-thin"
|
||||
/ ' Done
|
||||
/
|
||||
/ - else
|
||||
/ .row
|
||||
/ a.button href=upload_path Back to upload form
|
||||
/ p
|
||||
/ ' #{pluralize(@valid_images.length, 'screenshot')} received successfully.
|
||||
/ ' Please review the images and add a description for each image. Thanks.
|
||||
/
|
||||
/ = render 'packages/details.slim'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue