From 4a5a50dd9a5199558fbdac80cc4d9f5288e2d51f Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Sat, 25 Apr 2015 20:05:38 +0200 Subject: [PATCH] Slightly improved the image status. Cruft removed. --- app/assets/stylesheets/my.scss | 9 +++++++++ app/models/screenshot.rb | 4 ++-- app/views/packages/details.slim | 22 +--------------------- 3 files changed, 12 insertions(+), 23 deletions(-) diff --git a/app/assets/stylesheets/my.scss b/app/assets/stylesheets/my.scss index 58f8395..1c00472 100644 --- a/app/assets/stylesheets/my.scss +++ b/app/assets/stylesheets/my.scss @@ -224,11 +224,20 @@ a.black color: #808080; } + /* Description of a screenshot (e.g. the situation when the screenshot was taken) */ .imgcaption { text-align: center; } + /* Status of a screenshot (e.g. if it has to be moderated) */ + .imgstatus + { + text-align: center; + font-style: italic; + color: #808080; + } + .bigpanel { background-color: white; diff --git a/app/models/screenshot.rb b/app/models/screenshot.rb index b32d4d9..defd498 100644 --- a/app/models/screenshot.rb +++ b/app/models/screenshot.rb @@ -39,8 +39,8 @@ class Screenshot < ActiveRecord::Base def status - text = '' - # Completes the sentence: 'This image...' + text = 'This image ' + if self.approved text << 'is public' else diff --git a/app/views/packages/details.slim b/app/views/packages/details.slim index 4904317..3fb3b15 100644 --- a/app/views/packages/details.slim +++ b/app/views/packages/details.slim @@ -1,10 +1,3 @@ -// Package list - //.small-4.columns - //.rating - // TODO: use actual rating - //.progress.radius - //span.meter style="width: #{rand(100)}%" Rating - .row.packagepage .small-12.columns h1 =@package.name @@ -18,6 +11,7 @@ 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) .imgcaption =screenshot.caption + .imgstatus =screenshot.status // TODO: Enable button only if admin or uploader a.button.tiny.alert[ href=delete_screenshot_path(@package.name, screenshot.id) @@ -43,7 +37,6 @@ ' application using the XUL user interface language. - / a.button.round.expand href=upload_package_by_name_path(name: @package.name) Upload more screenshots for #{@package.name} a.button.round.expand data-reveal-id="upload-modal" Upload more screenshots for #{@package.name} #upload-modal.reveal-modal data-reveal=true role='dialog' @@ -89,19 +82,6 @@ ' If you don't use english by default please start your application ' from a shell using after setting "export LANG=C". - -//javascript: -// $(function () { -// $('#fileupload').fileupload({ -// dataType: 'json', -// done: function (e, data) { -// $.each(data.result.files, function (index, file) { -// $('

').text(file.name).appendTo(document.body); -// }); -// } -// }); -// }); - // TODO: Enable comment form //javascript: // $('#comment-summary').on( 'input', function() {