Slight design improvements

This commit is contained in:
Christoph Haas 2020-10-19 21:19:49 +02:00
parent f5f6e4960b
commit 986b42145e
3 changed files with 69 additions and 30 deletions

View file

@ -30,42 +30,46 @@ h1 =@package.name
.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)
.imgcaption
- if screenshot.description.present?
= screenshot.description
' ∙
- 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}
' from version #{screenshot.version} ∙
' #{time_ago_in_words(screenshot.created_at)} ago
// 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 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
// Show detailed information about the screenshot object when in dev mode
/ - if Rails.env == 'development'
/ p
/ 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})
// 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})
// 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