philomena/lib/philomena_web/templates/image/_options.html.slime

129 lines
6.1 KiB
Text
Raw Normal View History

2019-12-08 05:53:18 +01:00
- display_mod_tools? = can?(@conn, :hide, @image)
2019-12-04 05:14:56 +01:00
#image_options_area
.block__header.block__header--js-tabbed
a href="#" data-click-tab="reporting" data-load-tab=Routes.image_reporting_path(@conn, :show, @image)
i.fa.fa-exclamation-triangle>
| Report
a href="#" data-click-tab="sharing"
i.fa.fa-share>
| Share
2019-12-20 18:26:38 +01:00
a href="#" data-click-tab="favoriters" data-load-tab=Routes.image_favorite_path(@conn, :index, @image)
2019-12-04 05:14:56 +01:00
i.fa.fa-star>
| List favoriters
2019-12-20 23:35:46 +01:00
= if display_mod_tools? and not hide_staff_tools?(@conn) do
2019-12-08 05:53:18 +01:00
a href="#" data-click-tab="replace"
i.fa.fa-upload>
| Replace
a href="#" data-click-tab="administration"
i.fa.fa-toolbox>
| Manage
2019-12-08 05:53:18 +01:00
= if present?(@image.scratchpad) do
i.fa.fa-sticky-note.fa--important<
i.fa.fa-exclamation.fa--important
2019-12-04 05:14:56 +01:00
.block__tab.hidden data-tab="favoriters"
p Loading...
.block__tab.hidden data-tab="reporting"
p Loading...
.block__tab.hidden data-tab="sharing"
#embed_options
- source_link = if @image.source_url in [nil, ""], do: " (Original source unknown at time of posting)", else: " - [url=#{@image.source_url}]Original source[/url]"
h5 Derpibooru
p
strong> Small thumbnail
input.input#embed_small_thumbnail_tag type="text" value=">>#{@image.id}s" cols="10" readonly="readonly"
a< href="#" data-click-copy="#embed_small_thumbnail_tag"
i.fa.fa-clipboard>
| Copy
p
strong> Thumbnail
input.input#embed_thumbnail_tag type="text" value=">>#{@image.id}t" cols="10" readonly="readonly"
a< href="#" data-click-copy="#embed_thumbnail_tag"
i.fa.fa-clipboard>
| Copy
p
strong> Preview
input.input#embed_preview_tag type="text" value=">>#{@image.id}p" cols="10" readonly="readonly"
a< href="#" data-click-copy="#embed_preview_tag"
i.fa.fa-clipboard>
| Copy
h5 BBCode
p
strong> Full size BBcode
a href="#" data-click-copy="#bbcode_embed_full_tag"
i.fa.fa-clipboard>
| Copy
br
textarea.input.input--wide.input--separate-top#bbcode_embed_full_tag rows="2" cols="100" readonly="readonly"
= "[img]#{thumb_url(@image, false, :full)}[/img]\n[url=#{Routes.image_url(@conn, :show, @image)}]View on Derpibooru[/url]#{source_link}"
p
strong> Thumbnailed BBcode
a href="#" data-click-copy="#bbcode_embed_thumbnail_tag"
i.fa.fa-clipboard>
| Copy
br
textarea.input.input--wide.input--separate-top#bbcode_embed_thumbnail_tag rows="2" cols="100" readonly="readonly"
2019-12-08 05:53:18 +01:00
= "[img]#{thumb_url(@image, false, :medium)}[/img]\n[url=#{Routes.image_url(@conn, :show, @image)}]View on Derpibooru[/url]#{source_link}"
2019-12-16 06:25:06 +01:00
2019-12-08 05:53:18 +01:00
= if display_mod_tools? do
.block__tab.hidden data-tab="replace"
2019-12-16 06:25:06 +01:00
= form_for @changeset, Routes.image_file_path(@conn, :update, @image), [method: "put", multipart: true], fn f ->
#js-image-upload-previews
p Upload a file from your computer
.field = file_input f, :image, class: "input js-scraper"
= submit "Save changes", class: "button", data: [disable_with: raw("Replacing&hellip;")]
2019-12-08 05:53:18 +01:00
.block__tab.hidden data-tab="administration"
.block.block--danger
2019-12-16 06:25:06 +01:00
a.button.button--link> href=Routes.image_scratchpad_path(@conn, :edit, @image)
2019-12-08 05:53:18 +01:00
i.far.fa-edit
= if present?(@image.scratchpad) do
strong> Mod notes:
= escape_nl2br @image.scratchpad
- else
em No mod notes present
= if not @image.hidden_from_users do
= form_for @changeset, Routes.image_delete_path(@conn, :create, @image), [method: "post"], fn f ->
= label f, :deletion_reason, "Deletion reason (cannot be empty)"
.field.field--inline
= text_input f, :deletion_reason, class: "input input--wide", placeholder: "Rule violation", required: true
= submit "Delete", class: "button button--state-danger button--separate-left"
2019-12-16 06:25:06 +01:00
.flex.flex--spaced-out.flex--wrap
= if not @image.hidden_from_users do
= form_for @changeset, Routes.image_feature_path(@conn, :create, @image), [method: "post"], fn _f ->
.field
p Automatically tags 'featured image'
= submit "Feature", data: [confirm: "Are you really, really sure?"], class: "button button--state-success"
2020-01-31 21:10:15 +01:00
- else
= button_to "Restore", Routes.image_delete_path(@conn, :delete, @image), method: "delete", class: "button button--state-success"
2019-12-16 06:25:06 +01:00
2020-01-31 21:10:15 +01:00
= form_for @changeset, Routes.image_repair_path(@conn, :create, @image), [method: "post"], fn _f ->
.field
= submit "Repair", class: "button button--state-success"
2019-12-16 06:25:06 +01:00
= form_for @changeset, Routes.image_hash_path(@conn, :delete, @image), [method: "delete"], fn _f ->
.field
p Allows reuploading the image
.flex.flex--end-bunched
= submit "Clear hash", data: [confirm: "Are you really, really sure?"], class: "button button--state-danger"
br
.flex.flex--spaced-out
= if @image.commenting_allowed do
= button_to "Lock commenting", Routes.image_comment_lock_path(@conn, :create, @image), method: "post", class: "button"
- else
= button_to "Unlock commenting", Routes.image_comment_lock_path(@conn, :delete, @image), method: "delete", class: "button"
= if @image.description_editing_allowed do
= button_to "Lock description editing", Routes.image_description_lock_path(@conn, :create, @image), method: "post", class: "button"
- else
= button_to "Unlock description editing", Routes.image_description_lock_path(@conn, :delete, @image), method: "delete", class: "button"
= if @image.tag_editing_allowed do
= button_to "Lock tag editing", Routes.image_tag_lock_path(@conn, :create, @image), method: "post", class: "button"
- else
= button_to "Unlock tag editing", Routes.image_tag_lock_path(@conn, :delete, @image), method: "delete", class: "button"