diff --git a/lib/philomena_web/templates/activity/_channel_strip.html.heex b/lib/philomena_web/templates/activity/_channel_strip.html.heex new file mode 100644 index 00000000..143e49a0 --- /dev/null +++ b/lib/philomena_web/templates/activity/_channel_strip.html.heex @@ -0,0 +1,32 @@ +
+
+ <% # TODO %> + + <% # - if channel.channel_image.present? %> + <% # => image_tag channel.uploaded_channel_image.url, width: 32, height: 32, alt: "#{channel.title}'s logo'", class: 'channel-strip__image' %> + <% # - else %> + <% # => image_tag 'no_avatar_original.svg', width: 32, height: 32, alt: "#{channel.title}'s logo'", class: 'channel-strip__image' %> + <%= @channel.title || @channel.short_name %> + +
+
+ <%= if @channel.is_live do %> + + LIVE NOW + +
+ <%= @channel.viewers %> + <%= + if @channel.viewers == 1 do + "viewer" + else + "viewers" + end + %> + <% else %> + + OFF AIR + + <% end %> +
+
diff --git a/lib/philomena_web/templates/activity/_channel_strip.html.slime b/lib/philomena_web/templates/activity/_channel_strip.html.slime deleted file mode 100644 index 278cc6e9..00000000 --- a/lib/philomena_web/templates/activity/_channel_strip.html.slime +++ /dev/null @@ -1,19 +0,0 @@ -.block__content.flex.alternating-color - .flex__grow - / TODO - a href=~p"/channels/#{@channel}" - /- if channel.channel_image.present? - / => image_tag channel.uploaded_channel_image.url, width: 32, height: 32, alt: "#{channel.title}'s logo'", class: 'channel-strip__image' - /- else - / => image_tag 'no_avatar_original.svg', width: 32, height: 32, alt: "#{channel.title}'s logo'", class: 'channel-strip__image' - = @channel.title || @channel.short_name - .flex__fixed.flex__right - = if @channel.is_live do - span.channel-strip__state.label.label--narrow.label--success - ' LIVE NOW - br - => @channel.viewers - = if @channel.viewers == 1, do: "viewer", else: "viewers" - - else - span.channel-strip__state.label.label--narrow.label--danger - ' OFF AIR diff --git a/lib/philomena_web/templates/activity/_comment_strip.html.heex b/lib/philomena_web/templates/activity/_comment_strip.html.heex new file mode 100644 index 00000000..5660ee55 --- /dev/null +++ b/lib/philomena_web/templates/activity/_comment_strip.html.heex @@ -0,0 +1,17 @@ +
+
+ <%= render(PhilomenaWeb.ImageView, "_image_container.html", image: @comment.image, size: :thumb_tiny, conn: @conn) %> +
+
+ + # + <%= @comment.image.id %> + + by + + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @comment, conn: @conn) %> + +
+ <%= pretty_time(@comment.created_at) %> +
+
diff --git a/lib/philomena_web/templates/activity/_comment_strip.html.slime b/lib/philomena_web/templates/activity/_comment_strip.html.slime deleted file mode 100644 index d072a8c0..00000000 --- a/lib/philomena_web/templates/activity/_comment_strip.html.slime +++ /dev/null @@ -1,12 +0,0 @@ -.block__content.flex.alternating-color - .flex__shrink.spacing-right - = render PhilomenaWeb.ImageView, "_image_container.html", image: @comment.image, size: :thumb_tiny, conn: @conn - .flex__grow - a href="/#{@comment.image.id}#comment_#{@comment.id}" - | # - => @comment.image.id - ' by - span.hyphenate-breaks - = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @comment, conn: @conn - br - = pretty_time(@comment.created_at) diff --git a/lib/philomena_web/templates/activity/_topic_strip.html.heex b/lib/philomena_web/templates/activity/_topic_strip.html.heex new file mode 100644 index 00000000..d9e85222 --- /dev/null +++ b/lib/philomena_web/templates/activity/_topic_strip.html.heex @@ -0,0 +1,14 @@ +
+ <%= if @topic.sticky do %> + + <% end %> + <%= if @topic.last_post do %> + + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @topic.last_post, conn: @conn) %> + + <%= link("replied to", to: ~p"/forums/#{@topic.forum}/topics/#{@topic}?#{[post_id: @topic.last_post]}" <> "#post_#{@topic.last_post.id}") %> + <% end %> + <%= link(@topic.title, to: ~p"/forums/#{@topic.forum}/topics/#{@topic}") %> + in + <%= link(@topic.forum.name, to: ~p"/forums/#{@topic.forum}") %> +
diff --git a/lib/philomena_web/templates/activity/_topic_strip.html.slime b/lib/philomena_web/templates/activity/_topic_strip.html.slime deleted file mode 100644 index 8dc09e01..00000000 --- a/lib/philomena_web/templates/activity/_topic_strip.html.slime +++ /dev/null @@ -1,10 +0,0 @@ -.block__content.alternating-color - = if @topic.sticky do - i.fa.fa-thumbtack> - = if @topic.last_post do - span.hyphenate-breaks - = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @topic.last_post, conn: @conn - = link("replied to", to: ~p"/forums/#{@topic.forum}/topics/#{@topic}?#{[post_id: @topic.last_post]}" <> "#post_#{@topic.last_post.id}") - =<> link(@topic.title, to: ~p"/forums/#{@topic.forum}/topics/#{@topic}") - ' in - => link(@topic.forum.name, to: ~p"/forums/#{@topic.forum}") diff --git a/lib/philomena_web/templates/activity/index.html.heex b/lib/philomena_web/templates/activity/index.html.heex new file mode 100644 index 00000000..e5d97459 --- /dev/null +++ b/lib/philomena_web/templates/activity/index.html.heex @@ -0,0 +1,89 @@ +
+ <%= if @show_sidebar do %> + + <% end %> +
+ <%= render(PhilomenaWeb.ImageView, "index.html", conn: @conn, images: @images, size: :thumb) %> + <%= if @show_sidebar and not is_nil(@watched) and Enum.any?(@watched) do %> +
+
+ + Watched Images + + + + + Browse Watched Images + + +
+
+ <%= for image <- @watched do %> + <%= render(PhilomenaWeb.ImageView, "_image_box.html", image: image, link: ~p"/images/#{image}?#{[q: "my:watched"]}", size: :thumb_small, conn: @conn) %> + <% end %> +
+
+ <% end %> +
+
diff --git a/lib/philomena_web/templates/activity/index.html.slime b/lib/philomena_web/templates/activity/index.html.slime deleted file mode 100644 index f6f0a712..00000000 --- a/lib/philomena_web/templates/activity/index.html.slime +++ /dev/null @@ -1,54 +0,0 @@ -.column-layout - = if @show_sidebar do - aside.column-layout__left#activity-side - = if not is_nil(@featured_image) and not PhilomenaWeb.ImageView.filter_or_spoiler_hits?(@conn, @featured_image) do - .center - h4.remove-top-margin Featured Image - = render PhilomenaWeb.ImageView, "_image_box.html", image: @featured_image, size: :medium, conn: @conn - .block.block--fixed.block--fixed--sub.block--success.center.hide-mobile - ' Enjoy the site? - a href="/pages/donations" - ' Become a patron or donate! - .block.block--fixed.block--fixed--sub.center.hide-mobile - ' Issues? Want to chat? - a href="/pages/contact" Contact us! - .block.hide-mobile - a.block__header--single-item.center href="/search?q=first_seen_at.gt:3 days ago&sf=wilson_score&sd=desc" - ' Trending Images - .block__content.flex.flex--centered.flex--wrap.image-flex-grid - = for image <- @top_scoring do - = render PhilomenaWeb.ImageView, "_image_box.html", image: image, size: :thumb_small, conn: @conn - a.block__header--single-item.center href="/search?q=*&sf=score&sd=desc" - ' All Time Top Scoring - .block.hide-mobile - a.block__header--single-item.center href="/channels" - ' Streams - = for channel <- @streams do - = render PhilomenaWeb.ActivityView, "_channel_strip.html", channel: channel, conn: @conn - .block.hide-mobile - a.block__header--single-item.center href="/forums" - ' Forum Activity - = for topic <- @topics do - = render PhilomenaWeb.ActivityView, "_topic_strip.html", topic: topic, conn: @conn - .block.hide-mobile - a.block__header--single-item.center href="/comments" - ' Recent Comments - = for comment <- @comments do - = render PhilomenaWeb.ActivityView, "_comment_strip.html", comment: comment, conn: @conn - a.block__header--single-item.center href="/search?q=first_seen_at.gt:3 days ago&sf=comment_count&sd=desc" - ' Most Commented-on Images - - .column-layout__main - = render PhilomenaWeb.ImageView, "index.html", conn: @conn, images: @images, size: :thumb - = if @show_sidebar and not is_nil(@watched) and Enum.any?(@watched) do - .block - .block__header - span.block__header__title - ' Watched Images - a href="/search?q=my:watched" title="Browse Watched Images" - i.fa.fa-eye> - span.hide-mobile - ' Browse Watched Images - .block__content.js-resizable-media-container - = for image <- @watched do - = render PhilomenaWeb.ImageView, "_image_box.html", image: image, link: ~p"/images/#{image}?#{[q: "my:watched"]}", size: :thumb_small, conn: @conn diff --git a/lib/philomena_web/templates/admin/advert/_form.html.heex b/lib/philomena_web/templates/admin/advert/_form.html.heex new file mode 100644 index 00000000..9b375b70 --- /dev/null +++ b/lib/philomena_web/templates/admin/advert/_form.html.heex @@ -0,0 +1,59 @@ +<%= form_for @changeset, @action, [multipart: true], fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> + <%= if @changeset.data.__meta__.state != :loaded do %> +
+ <%= label(f, :image, "Upload image:") %> + <%= file_input(f, :image, class: "input input--wide") %> + <%= error_tag(f, :image) %> + <%= error_tag(f, :image_mime_type) %> + <%= error_tag(f, :image_size) %> + <%= error_tag(f, :image_width) %> + <%= error_tag(f, :image_height) %> +
+ <% else %> +
+ <%= link("Change image", to: ~p"/admin/adverts/#{@changeset.data}/image/edit", class: "button") %> +
+ <% end %> +
+ <%= label(f, :link, "Link which the advert should take users to:") %> + <%= url_input(f, :link, class: "input input--wide", placeholder: "Link", required: true) %> + <%= error_tag(f, :link) %> +
+
+ <%= label(f, :title, "Title/alt-text for the advert:") %> + <%= text_input(f, :title, class: "input input--wide", placeholder: "Title", required: true) %> + <%= error_tag(f, :title) %> +
+
+ <%= label(f, :start_time, "Start time for the advert (usually \"now\"):") %> + <%= text_input(f, :start_time, class: "input input--wide", placeholder: "Start") %> + <%= error_tag(f, :start_time) %> +
+
+ <%= label(f, :finish_time, "Finish time for the advert (e.g. \"2 weeks from now\"):") %> + <%= text_input(f, :finish_time, class: "input input--wide", placeholder: "Finish") %> + <%= error_tag(f, :finish_time) %> +
+
+ <%= label(f, :notes, "Notes (Payment details, contact info, etc):") %> + <%= text_input(f, :notes, class: "input input--wide", placeholder: "Notes") %> + <%= error_tag(f, :notes) %> +
+
+ <%= label(f, :restrictions, "Restriction:") %> + <%= select(f, :restrictions, restrictions(), class: "input") %> + <%= error_tag(f, :restrictions) %> +
+
+ <%= checkbox(f, :live, class: "checkbox") %> + <%= label(f, :live, "Live") %> +
+ <%= submit("Save Advert", class: "button") %> +<% end %> diff --git a/lib/philomena_web/templates/admin/advert/_form.html.slime b/lib/philomena_web/templates/admin/advert/_form.html.slime deleted file mode 100644 index 9fcd46c7..00000000 --- a/lib/philomena_web/templates/admin/advert/_form.html.slime +++ /dev/null @@ -1,53 +0,0 @@ -= form_for @changeset, @action, [multipart: true], fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - = if @changeset.data.__meta__.state != :loaded do - .field - => label f, :image, "Upload image:" - = file_input f, :image, class: "input input--wide" - = error_tag f, :image - = error_tag f, :image_mime_type - = error_tag f, :image_size - = error_tag f, :image_width - = error_tag f, :image_height - - else - .field - = link "Change image", to: ~p"/admin/adverts/#{@changeset.data}/image/edit", class: "button" - - .field - => label f, :link, "Link which the advert should take users to:" - = url_input f, :link, class: "input input--wide", placeholder: "Link", required: true - = error_tag f, :link - - .field - => label f, :title, "Title/alt-text for the advert:" - = text_input f, :title, class: "input input--wide", placeholder: "Title", required: true - = error_tag f, :title - - .field - => label f, :start_time, "Start time for the advert (usually \"now\"):" - = text_input f, :start_time, class: "input input--wide", placeholder: "Start" - = error_tag f, :start_time - - .field - => label f, :finish_time, "Finish time for the advert (e.g. \"2 weeks from now\"):" - = text_input f, :finish_time, class: "input input--wide", placeholder: "Finish" - = error_tag f, :finish_time - - .field - => label f, :notes, "Notes (Payment details, contact info, etc):" - = text_input f, :notes, class: "input input--wide", placeholder: "Notes" - = error_tag f, :notes - - .field - => label f, :restrictions, "Restriction:" - = select f, :restrictions, restrictions(), class: "input" - = error_tag f, :restrictions - - .field - => checkbox f, :live, class: "checkbox" - = label f, :live, "Live" - - = submit "Save Advert", class: "button" diff --git a/lib/philomena_web/templates/admin/advert/edit.html.heex b/lib/philomena_web/templates/admin/advert/edit.html.heex new file mode 100644 index 00000000..3d4ce9a1 --- /dev/null +++ b/lib/philomena_web/templates/admin/advert/edit.html.heex @@ -0,0 +1,4 @@ +

+ Editing advert +

+<%= render(PhilomenaWeb.Admin.AdvertView, "_form.html", changeset: @changeset, action: ~p"/admin/adverts/#{@advert}", conn: @conn) %> diff --git a/lib/philomena_web/templates/admin/advert/edit.html.slime b/lib/philomena_web/templates/admin/advert/edit.html.slime deleted file mode 100644 index a3764720..00000000 --- a/lib/philomena_web/templates/admin/advert/edit.html.slime +++ /dev/null @@ -1,2 +0,0 @@ -h1 Editing advert -= render PhilomenaWeb.Admin.AdvertView, "_form.html", changeset: @changeset, action: ~p"/admin/adverts/#{@advert}", conn: @conn diff --git a/lib/philomena_web/templates/admin/advert/image/edit.html.heex b/lib/philomena_web/templates/admin/advert/image/edit.html.heex new file mode 100644 index 00000000..f068bae4 --- /dev/null +++ b/lib/philomena_web/templates/admin/advert/image/edit.html.heex @@ -0,0 +1,22 @@ +

+ Edit Advert +

+<%= form_for @changeset, ~p"/admin/adverts/#{@advert}/image", [multipart: true], fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+ <%= label(f, :image, "Upload image:") %> + <%= file_input(f, :image, class: "input input--wide") %> + <%= error_tag(f, :image) %> + <%= error_tag(f, :image_mime_type) %> + <%= error_tag(f, :image_size) %> + <%= error_tag(f, :image_width) %> + <%= error_tag(f, :image_height) %> +
+ <%= submit("Save Advert", class: "button") %> +<% end %> diff --git a/lib/philomena_web/templates/admin/advert/image/edit.html.slime b/lib/philomena_web/templates/admin/advert/image/edit.html.slime deleted file mode 100644 index 6374e9c3..00000000 --- a/lib/philomena_web/templates/admin/advert/image/edit.html.slime +++ /dev/null @@ -1,17 +0,0 @@ -h2 Edit Advert - -= form_for @changeset, ~p"/admin/adverts/#{@advert}/image", [multipart: true], fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .field - => label f, :image, "Upload image:" - = file_input f, :image, class: "input input--wide" - = error_tag f, :image - = error_tag f, :image_mime_type - = error_tag f, :image_size - = error_tag f, :image_width - = error_tag f, :image_height - - = submit "Save Advert", class: "button" diff --git a/lib/philomena_web/templates/admin/advert/index.html.heex b/lib/philomena_web/templates/admin/advert/index.html.heex new file mode 100644 index 00000000..9732ca92 --- /dev/null +++ b/lib/philomena_web/templates/admin/advert/index.html.heex @@ -0,0 +1,99 @@ +<% route = fn p -> ~p"/admin/adverts?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @adverts, route: route) %> +
+
+ + + New advert + + <%= pagination %> +
+
+ + + + + + + + + + + + + + + <%= for advert <- @adverts do %> + + + + + + + + + + + <% end %> + +
+ Image + + Ad Information + + Start + + Finish + + Enabled + + Restriction + + Statistics + + Options +
+ + + + URL: + + <%= link(advert.link, to: advert.link) %> +
+ + Title: + + + <%= advert.title %> + + <%= if present?(advert.notes) do %> +
+ + Notes: + + <%= advert.notes %> + <% end %> +
+ <%= pretty_time(advert.start_date) %> + + <%= pretty_time(advert.finish_date) %> + + <%= live_text(advert) %> + + <%= advert.restrictions %> + + Impressions: + <%= advert.impressions %> +
+ Clicks: + <%= advert.clicks %> +
+ <%= link("Edit", to: ~p"/admin/adverts/#{advert}/edit") %> + • + <%= link("Destroy", to: ~p"/admin/adverts/#{advert}", data: [confirm: "Are you really, really sure?", method: "delete"]) %> +
+
+
+ <%= pagination %> +
+
diff --git a/lib/philomena_web/templates/admin/advert/index.html.slime b/lib/philomena_web/templates/admin/advert/index.html.slime deleted file mode 100644 index 609d468e..00000000 --- a/lib/philomena_web/templates/admin/advert/index.html.slime +++ /dev/null @@ -1,73 +0,0 @@ -- route = fn p -> ~p"/admin/adverts?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @adverts, route: route - -.block - .block__header - a href=~p"/admin/adverts/new" - i.fa.fa-plus> - ' New advert - - = pagination - - .block__content - table.table - thead - tr - th.table--adverts__image Image - th Ad Information - th Start - th Finish - th Enabled - th Restriction - th Statistics - th Options - tbody - = for advert <- @adverts do - tr - td - img src=advert_image_url(advert) - - td - strong - ' URL: - = link advert.link, to: advert.link - br - - strong - ' Title: - em - = advert.title - - = if present?(advert.notes) do - br - strong - ' Notes: - = advert.notes - - td class=time_column_class(advert.start_date) - = pretty_time advert.start_date - - td class=time_column_class(advert.finish_date) - = pretty_time advert.finish_date - - td - = live_text(advert) - - td - = advert.restrictions - - td - ' Impressions: - = advert.impressions - - br - ' Clicks: - = advert.clicks - - td - => link "Edit", to: ~p"/admin/adverts/#{advert}/edit" - ' • - = link "Destroy", to: ~p"/admin/adverts/#{advert}", data: [confirm: "Are you really, really sure?", method: "delete"] - - .block__header.block__header--light - = pagination diff --git a/lib/philomena_web/templates/admin/advert/new.html.heex b/lib/philomena_web/templates/admin/advert/new.html.heex new file mode 100644 index 00000000..084b3743 --- /dev/null +++ b/lib/philomena_web/templates/admin/advert/new.html.heex @@ -0,0 +1,4 @@ +

+ New advert +

+<%= render(PhilomenaWeb.Admin.AdvertView, "_form.html", changeset: @changeset, action: ~p"/admin/adverts", conn: @conn) %> diff --git a/lib/philomena_web/templates/admin/advert/new.html.slime b/lib/philomena_web/templates/admin/advert/new.html.slime deleted file mode 100644 index 76472e47..00000000 --- a/lib/philomena_web/templates/admin/advert/new.html.slime +++ /dev/null @@ -1,2 +0,0 @@ -h1 New advert -= render PhilomenaWeb.Admin.AdvertView, "_form.html", changeset: @changeset, action: ~p"/admin/adverts", conn: @conn diff --git a/lib/philomena_web/templates/admin/approval/_approvals.html.heex b/lib/philomena_web/templates/admin/approval/_approvals.html.heex new file mode 100644 index 00000000..d983c9b0 --- /dev/null +++ b/lib/philomena_web/templates/admin/approval/_approvals.html.heex @@ -0,0 +1,70 @@ +
+
+
+
+ + ID + + + Image + + + Uploader + + + Time + +
+ +
+
+ <%= for image <- @images do %> +
+
+
+ + <%= link(">>#{image.id}", to: ~p"/images/#{image}") %> + +
+ + <%= image_thumb(@conn, image) %> + + + <%= warning_text(image) %> + +
+ + <%= if image.user do %> + <%= link(image.user.name, to: ~p"/profiles/#{image.user}") %> + <% else %> + + <%= truncated_ip_link(image.ip) %> + + <%= link_to_fingerprint(@conn, image.fingerprint) %> + <% end %> + + + <%= pretty_time(image.created_at) %> + +
+ +
+
+ <% end %> +
diff --git a/lib/philomena_web/templates/admin/approval/_approvals.html.slime b/lib/philomena_web/templates/admin/approval/_approvals.html.slime deleted file mode 100644 index d3d3f5fc..00000000 --- a/lib/philomena_web/templates/admin/approval/_approvals.html.slime +++ /dev/null @@ -1,34 +0,0 @@ -.block - .block__header - .block__header__title.approval-grid - .approval-items--main - span ID - span Image - span Uploader - span Time - .approval-items--footer.hide-mobile - span.hide-mobile Actions - = for image <- @images do - .block__content.alternating-color - .approval-grid - .approval-items--main - span = link ">>#{image.id}", to: ~p"/images/#{image}" - .approval-items__details class=class_for_image(image) - span = image_thumb(@conn, image) - span = warning_text(image) - span - = if image.user do - = link image.user.name, to: ~p"/profiles/#{image.user}" - - else - em> - = truncated_ip_link(image.ip) - = link_to_fingerprint(@conn, image.fingerprint) - span = pretty_time(image.created_at) - .approval-items--footer - = if can?(@conn, :approve, image) do - = button_to "Approve", ~p"/images/#{image}/approve", method: "post", class: "button button--state-success" - = if can?(@conn, :hide, image) do - = form_for :image, ~p"/images/#{image}/delete", [method: "post"], fn f -> - .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" diff --git a/lib/philomena_web/templates/admin/approval/index.html.heex b/lib/philomena_web/templates/admin/approval/index.html.heex new file mode 100644 index 00000000..83212608 --- /dev/null +++ b/lib/philomena_web/templates/admin/approval/index.html.heex @@ -0,0 +1,18 @@ +<% route = fn p -> ~p"/admin/approvals?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @images, route: route) %> +

+ Approval Queue +

+
+
+ <%= pagination %> +
+ <%= if Enum.any?(@images) do %> + <%= render(PhilomenaWeb.Admin.ApprovalView, "_approvals.html", images: @images, conn: @conn) %> + <% else %> + No images are pending approval. Good job! + <% end %> +
+ <%= pagination %> +
+
diff --git a/lib/philomena_web/templates/admin/approval/index.html.slime b/lib/philomena_web/templates/admin/approval/index.html.slime deleted file mode 100644 index d3f8e098..00000000 --- a/lib/philomena_web/templates/admin/approval/index.html.slime +++ /dev/null @@ -1,16 +0,0 @@ -- route = fn p -> ~p"/admin/approvals?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @images, route: route - -h1 Approval Queue - -.block - .block__header - = pagination - - = if Enum.any?(@images) do - = render PhilomenaWeb.Admin.ApprovalView, "_approvals.html", images: @images, conn: @conn - - else - ' No images are pending approval. Good job! - - .block__header.block__header--light - = pagination diff --git a/lib/philomena_web/templates/admin/artist_link/index.html.heex b/lib/philomena_web/templates/admin/artist_link/index.html.heex new file mode 100644 index 00000000..515d3eab --- /dev/null +++ b/lib/philomena_web/templates/admin/artist_link/index.html.heex @@ -0,0 +1,108 @@ +

+ Artist Links +

+

+ Link creation is done via the Users menu. +

+

+ Verifying a link will automatically award an artist badge if the link is public, no artist badge exists, and an "artist:" tag is specified. +

+<%= form_for :artist_link, ~p"/admin/artist_links", [method: "get", class: "hform"], fn f -> %> +
+ <%= text_input(f, :q, name: :q, value: @conn.params["q"], class: "input hform__text", placeholder: "Search query", autocapitalize: "none") %> + <%= submit("Search", class: "hform__button button") %> +
+<% end %> +<% route = fn p -> ~p"/admin/artist_links?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @artist_links, route: route, params: link_scope(@conn), conn: @conn) %> +
+
+ <%= if @conn.params["all"] do %> + <%= link("Show unverified only", to: ~p"/admin/artist_links") %> + <% else %> + <%= link("Show all", to: ~p"/admin/artist_links?#{[all: "true"]}") %> + <% end %> + <%= pagination %> +
+
+ + + + + + + + + + + + + <%= for link <- @artist_links do %> + + + + + + + + + <% end %> + +
+ State + + User + + URL + + Options + + Mark + + Public +
+ <%= render(PhilomenaWeb.UserAttributionView, "_user.html", object: link, awards: true, conn: @conn) %> + <%= render(PhilomenaWeb.TagView, "_tag_list.html", tags: display_order(link.user.linked_tags), conn: @conn) %> + + <%= link(String.slice(link.uri, 0, 100), to: link.uri) %> + <%= if link.tag do %> +
+ <%= render(PhilomenaWeb.TagView, "_tag.html", tag: link.tag, conn: @conn) %> + <% end %> +
+ <%= link("View", to: ~p"/profiles/#{link.user}/artist_links/#{link}") %> + • + <%= link("Edit", to: ~p"/profiles/#{link.user}/artist_links/#{link}/edit") %> + + <%= link("Verify", to: ~p"/admin/artist_links/#{link}/verification", method: :post) %> + • + <%= link("Reject", to: ~p"/admin/artist_links/#{link}/reject", method: :post) %> +
+ <%= if not verified?(link) do %> + <%= if contacted?(link) do %> + Artist contacted + <% else %> + <%= link("Artist contacted", to: ~p"/admin/artist_links/#{link}/contact", method: :post) %> + <% end %> + <% end %> +
+ <%= public_text(link) %> +
+
+
+ <%= pagination %> +
+
diff --git a/lib/philomena_web/templates/admin/artist_link/index.html.slime b/lib/philomena_web/templates/admin/artist_link/index.html.slime deleted file mode 100644 index 633ff2c1..00000000 --- a/lib/philomena_web/templates/admin/artist_link/index.html.slime +++ /dev/null @@ -1,78 +0,0 @@ -h1 Artist Links -p Link creation is done via the Users menu. -p Verifying a link will automatically award an artist badge if the link is public, no artist badge exists, and an "artist:" tag is specified. - -= form_for :artist_link, ~p"/admin/artist_links", [method: "get", class: "hform"], fn f -> - .field - = text_input f, :q, name: :q, value: @conn.params["q"], class: "input hform__text", placeholder: "Search query", autocapitalize: "none" - = submit "Search", class: "hform__button button" - -- route = fn p -> ~p"/admin/artist_links?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @artist_links, route: route, params: link_scope(@conn), conn: @conn - -.block - .block__header - = if @conn.params["all"] do - = link "Show unverified only", to: ~p"/admin/artist_links" - - else - = link "Show all", to: ~p"/admin/artist_links?#{[all: "true"]}" - - = pagination - - .block__content - table.table - thead - tr - th State - th User - th URL - th Options - th Mark - th Public - tbody - = for link <- @artist_links do - tr - td class=link_state_class(link) - strong - = link_state_name(link) - - = if contacted?(link) do - br - ' by - = link.contacted_by_user.name - br - | ( - = pretty_time link.contacted_at - | ) - - td - = render PhilomenaWeb.UserAttributionView, "_user.html", object: link, awards: true, conn: @conn - = render PhilomenaWeb.TagView, "_tag_list.html", tags: display_order(link.user.linked_tags), conn: @conn - - td - = link String.slice(link.uri, 0, 100), to: link.uri - = if link.tag do - br - = render PhilomenaWeb.TagView, "_tag.html", tag: link.tag, conn: @conn - - td - => link "View", to: ~p"/profiles/#{link.user}/artist_links/#{link}" - ' • - = link "Edit", to: ~p"/profiles/#{link.user}/artist_links/#{link}/edit" - - td - => link "Verify", to: ~p"/admin/artist_links/#{link}/verification", method: :post - ' • - => link "Reject", to: ~p"/admin/artist_links/#{link}/reject", method: :post - br - = if not verified?(link) do - = if contacted?(link) do - ' Artist contacted - - else - = link "Artist contacted", to: ~p"/admin/artist_links/#{link}/contact", method: :post - - td - = public_text(link) - - .block__header.block__header--light - = pagination diff --git a/lib/philomena_web/templates/admin/badge/_form.html.heex b/lib/philomena_web/templates/admin/badge/_form.html.heex new file mode 100644 index 00000000..8b91c22a --- /dev/null +++ b/lib/philomena_web/templates/admin/badge/_form.html.heex @@ -0,0 +1,43 @@ +<%= form_for @changeset, @action, [multipart: true], fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+ <%= label(f, :title, "Badge name:") %> + <%= text_input(f, :title, class: "input input--wide", placeholder: "Name", required: true) %> + <%= error_tag(f, :title) %> +
+
+ <%= label(f, :description, "An optional short description:") %> + <%= text_input(f, :description, class: "input input--wide", placeholder: "Description") %> + <%= error_tag(f, :description) %> +
+
+ <%= checkbox(f, :disable_award, class: "checkbox") %> + <%= label(f, :disable_award, "Prevent image from appearing in \"Badge to award\" list") %> +
+
+ <%= checkbox(f, :priority, class: "checkbox") %> + <%= label(f, :priority, "Displays before badges that don't have this checkbox checked") %> +
+ <%= if @changeset.data.__meta__.state != :loaded do %> +

+ Image +

+
+ <%= label(f, :image, "Upload SVG image:") %> + <%= file_input(f, :image, class: "input input--wide") %> + <%= error_tag(f, :image) %> + <%= error_tag(f, :image_mime_type) %> +
+ <% else %> +
+ <%= link("Change image", to: ~p"/admin/badges/#{@changeset.data}/image/edit", class: "button") %> +
+ <% end %> + <%= submit("Save Badge", class: "button", data: [disable_with: raw("Saving…")]) %> +<% end %> diff --git a/lib/philomena_web/templates/admin/badge/_form.html.slime b/lib/philomena_web/templates/admin/badge/_form.html.slime deleted file mode 100644 index 1e5dc79b..00000000 --- a/lib/philomena_web/templates/admin/badge/_form.html.slime +++ /dev/null @@ -1,35 +0,0 @@ -= form_for @changeset, @action, [multipart: true], fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .field - => label f, :title, "Badge name:" - = text_input f, :title, class: "input input--wide", placeholder: "Name", required: true - = error_tag f, :title - - .field - => label f, :description, "An optional short description:" - = text_input f, :description, class: "input input--wide", placeholder: "Description" - = error_tag f, :description - - .field - => checkbox f, :disable_award, class: "checkbox" - = label f, :disable_award, "Prevent image from appearing in \"Badge to award\" list" - - .field - => checkbox f, :priority, class: "checkbox" - = label f, :priority, "Displays before badges that don't have this checkbox checked" - - = if @changeset.data.__meta__.state != :loaded do - h4 Image - .field - => label f, :image, "Upload SVG image:" - = file_input f, :image, class: "input input--wide" - = error_tag f, :image - = error_tag f, :image_mime_type - - else - .field - = link "Change image", to: ~p"/admin/badges/#{@changeset.data}/image/edit", class: "button" - - = submit "Save Badge", class: "button", data: [disable_with: raw("Saving…")] diff --git a/lib/philomena_web/templates/admin/badge/edit.html.heex b/lib/philomena_web/templates/admin/badge/edit.html.heex new file mode 100644 index 00000000..95f232fd --- /dev/null +++ b/lib/philomena_web/templates/admin/badge/edit.html.heex @@ -0,0 +1,5 @@ +

+ Edit Badge +

+<%= render("_form.html", Map.put(assigns, :action, ~p"/admin/badges/#{@badge}")) %> +<%= link("Back", to: ~p"/admin/badges") %> diff --git a/lib/philomena_web/templates/admin/badge/edit.html.slime b/lib/philomena_web/templates/admin/badge/edit.html.slime deleted file mode 100644 index da713050..00000000 --- a/lib/philomena_web/templates/admin/badge/edit.html.slime +++ /dev/null @@ -1,5 +0,0 @@ -h2 Edit Badge - -= render "_form.html", Map.put(assigns, :action, ~p"/admin/badges/#{@badge}") - -= link "Back", to: ~p"/admin/badges" diff --git a/lib/philomena_web/templates/admin/badge/image/edit.html.heex b/lib/philomena_web/templates/admin/badge/image/edit.html.heex new file mode 100644 index 00000000..fa47904e --- /dev/null +++ b/lib/philomena_web/templates/admin/badge/image/edit.html.heex @@ -0,0 +1,22 @@ +

+ Edit Badge +

+<%= form_for @changeset, ~p"/admin/badges/#{@badge}/image", [multipart: true], fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +

+ Image +

+
+ <%= label(f, :image, "Upload SVG image:") %> + <%= file_input(f, :image, class: "input input--wide") %> + <%= error_tag(f, :image) %> + <%= error_tag(f, :image_mime_type) %> +
+ <%= submit("Save Badge", class: "button", data: [disable_with: raw("Saving…")]) %> +<% end %> diff --git a/lib/philomena_web/templates/admin/badge/image/edit.html.slime b/lib/philomena_web/templates/admin/badge/image/edit.html.slime deleted file mode 100644 index 90042dbb..00000000 --- a/lib/philomena_web/templates/admin/badge/image/edit.html.slime +++ /dev/null @@ -1,15 +0,0 @@ -h2 Edit Badge - -= form_for @changeset, ~p"/admin/badges/#{@badge}/image", [multipart: true], fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - h4 Image - .field - => label f, :image, "Upload SVG image:" - = file_input f, :image, class: "input input--wide" - = error_tag f, :image - = error_tag f, :image_mime_type - - = submit "Save Badge", class: "button", data: [disable_with: raw("Saving…")] diff --git a/lib/philomena_web/templates/admin/badge/index.html.heex b/lib/philomena_web/templates/admin/badge/index.html.heex new file mode 100644 index 00000000..a556b5d1 --- /dev/null +++ b/lib/philomena_web/templates/admin/badge/index.html.heex @@ -0,0 +1,51 @@ +

+ Badges +

+<% route = fn p -> ~p"/admin/badges?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @badges, route: route, conn: @conn) %> +
+
+ + + New Badge + + <%= pagination %> +
+
+ + + + + + + + + + <%= for badge <- @badges do %> + + + + + + <% end %> + +
+ Badge + + Image + + Options +
+ <%= badge.title %> + + <%= badge_image(badge, width: 32, height: 32) %> + + <%= link("Users", to: ~p"/admin/badges/#{badge}/users") %> + • + <%= link("Edit", to: ~p"/admin/badges/#{badge}/edit") %> +
+
+
+ <%= pagination %> +
+
diff --git a/lib/philomena_web/templates/admin/badge/index.html.slime b/lib/philomena_web/templates/admin/badge/index.html.slime deleted file mode 100644 index f3949858..00000000 --- a/lib/philomena_web/templates/admin/badge/index.html.slime +++ /dev/null @@ -1,36 +0,0 @@ -h2 Badges - -- route = fn p -> ~p"/admin/badges?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @badges, route: route, conn: @conn - -.block - .block__header - a href=~p"/admin/badges/new" - i.fa.fa-plus> - ' New Badge - - = pagination - - .block__content - table.table - thead - tr - th Badge - th Image - th Options - tbody - = for badge <- @badges do - tr - td - = badge.title - - td - = badge_image(badge, width: 32, height: 32) - - td - => link "Users", to: ~p"/admin/badges/#{badge}/users" - ' • - = link "Edit", to: ~p"/admin/badges/#{badge}/edit" - - .block__header.block__header--light - = pagination diff --git a/lib/philomena_web/templates/admin/badge/new.html.heex b/lib/philomena_web/templates/admin/badge/new.html.heex new file mode 100644 index 00000000..dc80c8ae --- /dev/null +++ b/lib/philomena_web/templates/admin/badge/new.html.heex @@ -0,0 +1,5 @@ +

+ New Badge +

+<%= render("_form.html", Map.put(assigns, :action, ~p"/admin/badges")) %> +<%= link("Back", to: ~p"/admin/badges") %> diff --git a/lib/philomena_web/templates/admin/badge/new.html.slime b/lib/philomena_web/templates/admin/badge/new.html.slime deleted file mode 100644 index 57fc8273..00000000 --- a/lib/philomena_web/templates/admin/badge/new.html.slime +++ /dev/null @@ -1,5 +0,0 @@ -h2 New Badge - -= render "_form.html", Map.put(assigns, :action, ~p"/admin/badges") - -= link "Back", to: ~p"/admin/badges" diff --git a/lib/philomena_web/templates/admin/badge/user/index.html.heex b/lib/philomena_web/templates/admin/badge/user/index.html.heex new file mode 100644 index 00000000..ee4095b5 --- /dev/null +++ b/lib/philomena_web/templates/admin/badge/user/index.html.heex @@ -0,0 +1,35 @@ +

+ Users with + <%= @badge.title %> + badge +

+<% route = fn p -> ~p"/admin/badges/#{@badge}/users?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @users, route: route, conn: @conn) %> +
+
+ <%= pagination %> +
+
+ + + + + + + + <%= for user <- @users do %> + + + + <% end %> + +
+ User +
+ <%= link(user.name, to: ~p"/profiles/#{user}") %> +
+
+
+ <%= pagination %> +
+
diff --git a/lib/philomena_web/templates/admin/badge/user/index.html.slime b/lib/philomena_web/templates/admin/badge/user/index.html.slime deleted file mode 100644 index bbb1c116..00000000 --- a/lib/philomena_web/templates/admin/badge/user/index.html.slime +++ /dev/null @@ -1,25 +0,0 @@ -h1 - ' Users with - => @badge.title - ' badge - -- route = fn p -> ~p"/admin/badges/#{@badge}/users?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @users, route: route, conn: @conn - -.block - .block__header - = pagination - - .block__content - table.table - thead - tr - th User - tbody - = for user <- @users do - tr - td - = link user.name, to: ~p"/profiles/#{user}" - - .block__header.block__header--light - = pagination diff --git a/lib/philomena_web/templates/admin/dnp_entry/index.html.heex b/lib/philomena_web/templates/admin/dnp_entry/index.html.heex new file mode 100644 index 00000000..98391e09 --- /dev/null +++ b/lib/philomena_web/templates/admin/dnp_entry/index.html.heex @@ -0,0 +1,113 @@ +

+ Do-Not-Post Requests +

+<%= form_for :dnp_entry, ~p"/admin/dnp_entries", [method: "get", class: "hform"], fn f -> %> +
+ <%= text_input(f, :q, name: :q, value: @conn.params["q"], class: "input hform__text", placeholder: "Search query", autocapitalize: "none") %> + <%= submit("Search", class: "hform__button button") %> +
+<% end %> +<% route = fn p -> ~p"/admin/dnp_entries?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @dnp_entries, route: route, params: [states: state_param(@conn.params["states"])]) %> +
+
+ <%= pagination %> + + Display Only: + + <%= link("All Open", to: ~p"/admin/dnp_entries?#{[states: ~W(requested claimed rescinded acknowledged)]}") %> + <%= link("Listed", to: ~p"/admin/dnp_entries?#{[states: ~W(listed)]}") %> + <%= link("Rescinded", to: ~p"/admin/dnp_entries?#{[states: ~W(rescinded acknowledged)]}") %> + <%= link("Closed", to: ~p"/admin/dnp_entries?#{[states: ~W(closed)]}") %> +
+
+ + + + + + + + + + + + + + + <%= for {body, request} <- @dnp_entries do %> + + + + + + + + + + + <% end %> + +
+ Tag + + Requesting User + + Type + + Conditions + + Status + + Created + + Modified + + Options +
+ <%= render(PhilomenaWeb.TagView, "_tag.html", tag: request.tag, conn: @conn) %> + + <%= link(request.requesting_user.name, to: ~p"/profiles/#{request.requesting_user}") %> + + <%= request.dnp_type %> + + <%= body %> + + <%= pretty_state(request) %> + <%= if request.modifying_user do %> + by + <%= link(request.modifying_user.name, to: ~p"/profiles/#{request.modifying_user}") %> + <% end %> + + <%= pretty_time(request.created_at) %> + + <%= pretty_time(request.updated_at) %> + + <%= link("Show", to: ~p"/dnp/#{request}") %> + • + <%= link("Send PM", to: ~p"/conversations/new?#{[recipient: request.requesting_user.name]}") %> + <%= case request.aasm_state do %> + <% s when s in ["requested", "claimed"] -> %> + • + <%= link("Claim", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "claimed"]}", data: [method: "post", confirm: "Are you really, really sure?"]) %> + • + <%= link("Approve", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "listed"]}", data: [method: "post", confirm: "Are you really, really sure?"]) %> + • + <%= link("Close", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "closed"]}", data: [method: "post", confirm: "Are you really, really sure?"]) %> + <% "listed" -> %> + • + <%= link("Rescind", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "rescinded"]}", data: [method: "post", confirm: "Are you really, really sure?"]) %> + • + <%= link("Close", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "closed"]}", data: [method: "post", confirm: "Are you really, really sure?"]) %> + <% s when s in ["rescinded", "acknowledged"] -> %> + • + <%= link("Claim", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "acknowledged"]}", data: [method: "post", confirm: "Are you really, really sure?"]) %> + • + <%= link("Close", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "closed"]}", data: [method: "post", confirm: "Are you really, really sure?"]) %> + <% _state -> %> + • + <%= link("Claim", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "claimed"]}", data: [method: "post", confirm: "Are you really, really sure?"]) %> + <% end %> +
+
+
diff --git a/lib/philomena_web/templates/admin/dnp_entry/index.html.slime b/lib/philomena_web/templates/admin/dnp_entry/index.html.slime deleted file mode 100644 index bf932f69..00000000 --- a/lib/philomena_web/templates/admin/dnp_entry/index.html.slime +++ /dev/null @@ -1,90 +0,0 @@ -h2 Do-Not-Post Requests - -= form_for :dnp_entry, ~p"/admin/dnp_entries", [method: "get", class: "hform"], fn f -> - .field - = text_input f, :q, name: :q, value: @conn.params["q"], class: "input hform__text", placeholder: "Search query", autocapitalize: "none" - = submit "Search", class: "hform__button button" - -- route = fn p -> ~p"/admin/dnp_entries?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @dnp_entries, route: route, params: [states: state_param(@conn.params["states"])] - -.block - .block__header - = pagination - - span.block__header__title Display Only: - => link "All Open", to: ~p"/admin/dnp_entries?#{[states: ~W(requested claimed rescinded acknowledged)]}" - => link "Listed", to: ~p"/admin/dnp_entries?#{[states: ~W(listed)]}" - => link "Rescinded", to: ~p"/admin/dnp_entries?#{[states: ~W(rescinded acknowledged)]}" - => link "Closed", to: ~p"/admin/dnp_entries?#{[states: ~W(closed)]}" - - .block__content - table.table - thead - tr - td Tag - td Requesting User - td Type - td Conditions - td Status - td Created - td Modified - td Options - - tbody - = for {body, request} <- @dnp_entries do - tr - td - = render PhilomenaWeb.TagView, "_tag.html", tag: request.tag, conn: @conn - - td - = link request.requesting_user.name, to: ~p"/profiles/#{request.requesting_user}" - - td - = request.dnp_type - - td - = body - - td class=dnp_entry_row_class(request) - => pretty_state(request) - - = if request.modifying_user do - ' by - = link request.modifying_user.name, to: ~p"/profiles/#{request.modifying_user}" - - td - = pretty_time(request.created_at) - - td - = pretty_time(request.updated_at) - - td - => link "Show", to: ~p"/dnp/#{request}" - ' • - => link "Send PM", to: ~p"/conversations/new?#{[recipient: request.requesting_user.name]}" - - = case request.aasm_state do - - s when s in ["requested", "claimed"] -> - ' • - => link "Claim", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "claimed"]}", data: [method: "post", confirm: "Are you really, really sure?"] - ' • - => link "Approve", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "listed"]}", data: [method: "post", confirm: "Are you really, really sure?"] - ' • - => link "Close", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "closed"]}", data: [method: "post", confirm: "Are you really, really sure?"] - - - "listed" -> - ' • - => link "Rescind", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "rescinded"]}", data: [method: "post", confirm: "Are you really, really sure?"] - ' • - = link "Close", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "closed"]}", data: [method: "post", confirm: "Are you really, really sure?"] - - - s when s in ["rescinded", "acknowledged"] -> - ' • - => link "Claim", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "acknowledged"]}", data: [method: "post", confirm: "Are you really, really sure?"] - ' • - = link "Close", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "closed"]}", data: [method: "post", confirm: "Are you really, really sure?"] - - - _state -> - ' • - => link "Claim", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "claimed"]}", data: [method: "post", confirm: "Are you really, really sure?"] diff --git a/lib/philomena_web/templates/admin/donation/_table.html.heex b/lib/philomena_web/templates/admin/donation/_table.html.heex new file mode 100644 index 00000000..a50c2903 --- /dev/null +++ b/lib/philomena_web/templates/admin/donation/_table.html.heex @@ -0,0 +1,44 @@ + + + + + + + + + + + + <%= for donation <- @donations do %> + + + + + + + + <% end %> + +
+ User + + Email + + Amount + + Note + + At +
+ <%= if donation.user do %> + <%= link(donation.user.name, to: ~p"/profiles/#{donation.user}") %> + <% end %> + + <%= donation.email %> + + <%= donation.amount %> + + <%= String.slice(donation.note, 0, 30) %> + + <%= pretty_time(donation.created_at) %> +
diff --git a/lib/philomena_web/templates/admin/donation/_table.html.slime b/lib/philomena_web/templates/admin/donation/_table.html.slime deleted file mode 100644 index 023369b4..00000000 --- a/lib/philomena_web/templates/admin/donation/_table.html.slime +++ /dev/null @@ -1,27 +0,0 @@ -table.table - thead - tr - th User - th Email - th Amount - th Note - th At - - tbody - = for donation <- @donations do - tr - td - = if donation.user do - = link donation.user.name, to: ~p"/profiles/#{donation.user}" - - td - = donation.email - - td - = donation.amount - - td title=donation.note - = String.slice(donation.note, 0, 30) - - td - = pretty_time donation.created_at diff --git a/lib/philomena_web/templates/admin/donation/index.html.heex b/lib/philomena_web/templates/admin/donation/index.html.heex new file mode 100644 index 00000000..c29bb682 --- /dev/null +++ b/lib/philomena_web/templates/admin/donation/index.html.heex @@ -0,0 +1,16 @@ +<% route = fn p -> ~p"/admin/donations?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @donations, route: route, conn: @conn) %> +

+ Donations +

+
+
+ <%= pagination %> +
+
+ <%= render(PhilomenaWeb.Admin.DonationView, "_table.html", donations: @donations, conn: @conn) %> +
+
+ <%= pagination %> +
+
diff --git a/lib/philomena_web/templates/admin/donation/index.html.slime b/lib/philomena_web/templates/admin/donation/index.html.slime deleted file mode 100644 index 97ed6cac..00000000 --- a/lib/philomena_web/templates/admin/donation/index.html.slime +++ /dev/null @@ -1,14 +0,0 @@ -- route = fn p -> ~p"/admin/donations?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @donations, route: route, conn: @conn - -h1 Donations - -.block - .block__header - = pagination - - .block__content - = render PhilomenaWeb.Admin.DonationView, "_table.html", donations: @donations, conn: @conn - - .block__header.block__header--light - = pagination diff --git a/lib/philomena_web/templates/admin/donation/user/index.html.heex b/lib/philomena_web/templates/admin/donation/user/index.html.heex new file mode 100644 index 00000000..14d6e81d --- /dev/null +++ b/lib/philomena_web/templates/admin/donation/user/index.html.heex @@ -0,0 +1,29 @@ +
+

+ <%= @user.name %> + 's Donations +

+ <%= render(PhilomenaWeb.Admin.DonationView, "_table.html", donations: @donations, conn: @conn) %> +

+ Add Donation +

+ <%= form_for @changeset, ~p"/admin/donations", fn f -> %> +
+ <%= label(f, :user_id, "User ID:") %> + <%= number_input(f, :user_id, class: "input input--short", value: @user.id) %> +
+
+ <%= label(f, :email, "Email:") %> + <%= text_input(f, :email, class: "input input--wide", value: @user.email) %> +
+
+ <%= label(f, :amount, "Amount:") %> + <%= number_input(f, :amount, class: "input input--wide", min: 0, step: 0.01) %> +
+
+ <%= label(f, :note, "Note:") %> + <%= textarea(f, :note, class: "input input--wide") %> +
+ <%= submit("Create Donation", class: "button") %> + <% end %> +
diff --git a/lib/philomena_web/templates/admin/donation/user/index.html.slime b/lib/philomena_web/templates/admin/donation/user/index.html.slime deleted file mode 100644 index daf4f6c1..00000000 --- a/lib/philomena_web/templates/admin/donation/user/index.html.slime +++ /dev/null @@ -1,26 +0,0 @@ -.walloftext - h1 - = @user.name - | 's Donations - - = render PhilomenaWeb.Admin.DonationView, "_table.html", donations: @donations, conn: @conn - - h1 Add Donation - = form_for @changeset, ~p"/admin/donations", fn f -> - .field - => label f, :user_id, "User ID:" - = number_input f, :user_id, class: "input input--short", value: @user.id - - .field - => label f, :email, "Email:" - = text_input f, :email, class: "input input--wide", value: @user.email - - .field - => label f, :amount, "Amount:" - = number_input f, :amount, class: "input input--wide", min: 0, step: 0.01 - - .field - => label f, :note, "Note:" - = textarea f, :note, class: "input input--wide" - - = submit "Create Donation", class: "button" diff --git a/lib/philomena_web/templates/admin/fingerprint_ban/_form.html.heex b/lib/philomena_web/templates/admin/fingerprint_ban/_form.html.heex new file mode 100644 index 00000000..986721a9 --- /dev/null +++ b/lib/philomena_web/templates/admin/fingerprint_ban/_form.html.heex @@ -0,0 +1,34 @@ +<%= form_for @changeset, @action, fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+ <%= label(f, :fingerprint, "Fingerprint:") %> + <%= text_input(f, :fingerprint, class: "input", placeholder: "Fingerprint", required: true) %> +
+
+ <%= label(f, :reason, "Reason (shown to the banned user, and to staff on the user's profile page):") %> + <%= text_input(f, :reason, class: "input input--wide", placeholder: "Reason", required: true) %> + <%= error_tag(f, :reason) %> +
+
+ <%= label(f, :note, "Admin-only note:") %> + <%= text_input(f, :note, class: "input input--wide", placeholder: "Note") %> +
+
+ <%= label(f, :until, "End time relative to now, in simple English (e.g. \"1 week from now\"):") %> + <%= text_input(f, :until, class: "input input--wide", placeholder: "Until", required: true) %> + <%= error_tag(f, :until) %> +
+
+
+ <%= checkbox(f, :enabled) %> + <%= label(f, :enabled) %> +
+
+ <%= submit("Save Ban", class: "button") %> +<% end %> diff --git a/lib/philomena_web/templates/admin/fingerprint_ban/_form.html.slime b/lib/philomena_web/templates/admin/fingerprint_ban/_form.html.slime deleted file mode 100644 index e81456ee..00000000 --- a/lib/philomena_web/templates/admin/fingerprint_ban/_form.html.slime +++ /dev/null @@ -1,30 +0,0 @@ -= form_for @changeset, @action, fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .field - => label f, :fingerprint, "Fingerprint:" - = text_input f, :fingerprint, class: "input", placeholder: "Fingerprint", required: true - - .field - => label f, :reason, "Reason (shown to the banned user, and to staff on the user's profile page):" - = text_input f, :reason, class: "input input--wide", placeholder: "Reason", required: true - = error_tag f, :reason - - .field - => label f, :note, "Admin-only note:" - = text_input f, :note, class: "input input--wide", placeholder: "Note" - - .field - => label f, :until, "End time relative to now, in simple English (e.g. \"1 week from now\"):" - = text_input f, :until, class: "input input--wide", placeholder: "Until", required: true - = error_tag f, :until - - br - .field - => checkbox f, :enabled - = label f, :enabled - br - - = submit "Save Ban", class: "button" diff --git a/lib/philomena_web/templates/admin/fingerprint_ban/edit.html.heex b/lib/philomena_web/templates/admin/fingerprint_ban/edit.html.heex new file mode 100644 index 00000000..2b738f6d --- /dev/null +++ b/lib/philomena_web/templates/admin/fingerprint_ban/edit.html.heex @@ -0,0 +1,6 @@ +

+ Editing ban +

+<%= render(PhilomenaWeb.Admin.FingerprintBanView, "_form.html", changeset: @changeset, action: ~p"/admin/fingerprint_bans/#{@fingerprint}", conn: @conn) %> +
+<%= link("Back", to: ~p"/admin/fingerprint_bans") %> diff --git a/lib/philomena_web/templates/admin/fingerprint_ban/edit.html.slime b/lib/philomena_web/templates/admin/fingerprint_ban/edit.html.slime deleted file mode 100644 index eb424776..00000000 --- a/lib/philomena_web/templates/admin/fingerprint_ban/edit.html.slime +++ /dev/null @@ -1,6 +0,0 @@ -h1 Editing ban - -= render PhilomenaWeb.Admin.FingerprintBanView, "_form.html", changeset: @changeset, action: ~p"/admin/fingerprint_bans/#{@fingerprint}", conn: @conn - -br -= link "Back", to: ~p"/admin/fingerprint_bans" diff --git a/lib/philomena_web/templates/admin/fingerprint_ban/index.html.heex b/lib/philomena_web/templates/admin/fingerprint_ban/index.html.heex new file mode 100644 index 00000000..6d1a9a64 --- /dev/null +++ b/lib/philomena_web/templates/admin/fingerprint_ban/index.html.heex @@ -0,0 +1,86 @@ +

+ Fingerprint Bans +

+<% route = fn p -> ~p"/admin/fingerprint_bans?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @fingerprint_bans, route: route, params: page_params(@conn.params)) %> +<%= form_for :fingerprint_ban, ~p"/admin/fingerprint_bans", [method: "get", class: "hform"], fn f -> %> +
+ <%= text_input(f, :q, name: "q", class: "hform__text input", placeholder: "Search") %> + <%= submit("Search", class: "button hform__button") %> +
+<% end %> +
+
+ + + New fingerprint ban + + <%= pagination %> +
+
+ + + + + + + + + + + + + <%= for ban <- @fingerprint_bans do %> + + + + + + + + + <% end %> + +
+ Fingerprint + + Created + + Expires + + Reason/Note + + Ban ID + + Options +
+ <%= link(ban.fingerprint, to: ~p"/fingerprint_profiles/#{ban.fingerprint}") %> + + <%= pretty_time(ban.created_at) %> + <%= user_abbrv(ban.banning_user) %> + + <%= pretty_time(ban.valid_until) %> + + <%= ban.reason %> + <%= if present?(ban.note) do %> +

+ + Note: + <%= ban.note %> + +

+ <% end %> +
+ <%= ban.generated_ban_id %> + + <%= link("Edit", to: ~p"/admin/fingerprint_bans/#{ban}/edit") %> + <%= if @current_user.role == "admin" do %> + • + <%= link("Destroy", to: ~p"/admin/fingerprint_bans/#{ban}", data: [confirm: "Are you really, really sure?", method: "delete"]) %> + <% end %> +
+
+
+ <%= pagination %> +
+
diff --git a/lib/philomena_web/templates/admin/fingerprint_ban/index.html.slime b/lib/philomena_web/templates/admin/fingerprint_ban/index.html.slime deleted file mode 100644 index 7e42314a..00000000 --- a/lib/philomena_web/templates/admin/fingerprint_ban/index.html.slime +++ /dev/null @@ -1,62 +0,0 @@ -h1 Fingerprint Bans - -- route = fn p -> ~p"/admin/fingerprint_bans?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @fingerprint_bans, route: route, params: page_params(@conn.params) - -= form_for :fingerprint_ban, ~p"/admin/fingerprint_bans", [method: "get", class: "hform"], fn f -> - .field - = text_input f, :q, name: "q", class: "hform__text input", placeholder: "Search" - = submit "Search", class: "button hform__button" - -.block - .block__header - a href=~p"/admin/fingerprint_bans/new" - i.fa.fa-plus> - ' New fingerprint ban - - = pagination - - .block__content - table.table - thead - tr - th Fingerprint - th Created - th Expires - th Reason/Note - th Ban ID - th Options - - tbody - = for ban <- @fingerprint_bans do - tr - td - = link ban.fingerprint, to: ~p"/fingerprint_profiles/#{ban.fingerprint}" - - td - => pretty_time ban.created_at - = user_abbrv ban.banning_user - - td class=ban_row_class(ban) - = pretty_time ban.valid_until - - td - = ban.reason - - = if present?(ban.note) do - p.block.block--fixed - em - ' Note: - = ban.note - - td - = ban.generated_ban_id - - td - => link "Edit", to: ~p"/admin/fingerprint_bans/#{ban}/edit" - = if @current_user.role == "admin" do - ' • - => link "Destroy", to: ~p"/admin/fingerprint_bans/#{ban}", data: [confirm: "Are you really, really sure?", method: "delete"] - - .block__header.block__header--light - = pagination diff --git a/lib/philomena_web/templates/admin/fingerprint_ban/new.html.heex b/lib/philomena_web/templates/admin/fingerprint_ban/new.html.heex new file mode 100644 index 00000000..be70c71a --- /dev/null +++ b/lib/philomena_web/templates/admin/fingerprint_ban/new.html.heex @@ -0,0 +1,6 @@ +

+ New Fingerprint Ban +

+<%= render(PhilomenaWeb.Admin.FingerprintBanView, "_form.html", changeset: @changeset, action: ~p"/admin/fingerprint_bans", conn: @conn) %> +
+<%= link("Back", to: ~p"/admin/fingerprint_bans") %> diff --git a/lib/philomena_web/templates/admin/fingerprint_ban/new.html.slime b/lib/philomena_web/templates/admin/fingerprint_ban/new.html.slime deleted file mode 100644 index 02d20b60..00000000 --- a/lib/philomena_web/templates/admin/fingerprint_ban/new.html.slime +++ /dev/null @@ -1,5 +0,0 @@ -h1 New Fingerprint Ban -= render PhilomenaWeb.Admin.FingerprintBanView, "_form.html", changeset: @changeset, action: ~p"/admin/fingerprint_bans", conn: @conn - -br -= link "Back", to: ~p"/admin/fingerprint_bans" diff --git a/lib/philomena_web/templates/admin/forum/_form.html.heex b/lib/philomena_web/templates/admin/forum/_form.html.heex new file mode 100644 index 00000000..eb7c6e29 --- /dev/null +++ b/lib/philomena_web/templates/admin/forum/_form.html.heex @@ -0,0 +1,30 @@ +<%= form_for @changeset, @action, fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+ <%= label(f, :name, "Name:") %> + <%= text_input(f, :name, class: "input input--wide") %> + <%= error_tag(f, :name) %> +
+
+ <%= label(f, :short_name, "Slug:") %> + <%= text_input(f, :short_name, class: "input input--wide") %> + <%= error_tag(f, :short_name) %> +
+
+ <%= label(f, :description, "Description:") %> + <%= textarea(f, :description, class: "input input--wide") %> + <%= error_tag(f, :description) %> +
+
+ <%= label(f, :access_level, "Access level:") %> + <%= select(f, :access_level, ["normal", "assistant", "staff"], class: "input") %> + <%= error_tag(f, :access_level) %> +
+ <%= submit("Save Forum", class: "button") %> +<% end %> diff --git a/lib/philomena_web/templates/admin/forum/_form.html.slime b/lib/philomena_web/templates/admin/forum/_form.html.slime deleted file mode 100644 index 4e6465b8..00000000 --- a/lib/philomena_web/templates/admin/forum/_form.html.slime +++ /dev/null @@ -1,26 +0,0 @@ -= form_for @changeset, @action, fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .field - => label f, :name, "Name:" - = text_input f, :name, class: "input input--wide" - = error_tag f, :name - - .field - => label f, :short_name, "Slug:" - = text_input f, :short_name, class: "input input--wide" - = error_tag f, :short_name - - .field - => label f, :description, "Description:" - = textarea f, :description, class: "input input--wide" - = error_tag f, :description - - .field - => label f, :access_level, "Access level:" - = select f, :access_level, ["normal", "assistant", "staff"], class: "input" - = error_tag f, :access_level - - = submit "Save Forum", class: "button" diff --git a/lib/philomena_web/templates/admin/forum/edit.html.heex b/lib/philomena_web/templates/admin/forum/edit.html.heex new file mode 100644 index 00000000..9a6be2a7 --- /dev/null +++ b/lib/philomena_web/templates/admin/forum/edit.html.heex @@ -0,0 +1,5 @@ +

+ Edit Forum +

+<%= render("_form.html", Map.put(assigns, :action, ~p"/admin/forums/#{@forum}")) %> +<%= link("Back", to: ~p"/admin/forums") %> diff --git a/lib/philomena_web/templates/admin/forum/edit.html.slime b/lib/philomena_web/templates/admin/forum/edit.html.slime deleted file mode 100644 index 8d0e959b..00000000 --- a/lib/philomena_web/templates/admin/forum/edit.html.slime +++ /dev/null @@ -1,5 +0,0 @@ -h2 Edit Forum - -= render "_form.html", Map.put(assigns, :action, ~p"/admin/forums/#{@forum}") - -= link "Back", to: ~p"/admin/forums" diff --git a/lib/philomena_web/templates/admin/forum/index.html.heex b/lib/philomena_web/templates/admin/forum/index.html.heex new file mode 100644 index 00000000..cc58e761 --- /dev/null +++ b/lib/philomena_web/templates/admin/forum/index.html.heex @@ -0,0 +1,28 @@ +

+ Listing Forums +

+ + + + + + + + + <%= for forum <- @forums do %> + + + + + <% end %> + +
+ Name + + Options +
+ <%= link(forum.name, to: ~p"/forums/#{forum}") %> + + <%= link("Edit", to: ~p"/admin/forums/#{forum}/edit") %> +
+<%= link("New Forum", to: ~p"/admin/forums/new") %> diff --git a/lib/philomena_web/templates/admin/forum/index.html.slime b/lib/philomena_web/templates/admin/forum/index.html.slime deleted file mode 100644 index c1423ece..00000000 --- a/lib/philomena_web/templates/admin/forum/index.html.slime +++ /dev/null @@ -1,17 +0,0 @@ -h2 Listing Forums - -table.table - thead - tr - th Name - th Options - tbody - = for forum <- @forums do - tr - td - = link forum.name, to: ~p"/forums/#{forum}" - - td class="text-right" - = link "Edit", to: ~p"/admin/forums/#{forum}/edit" - -= link "New Forum", to: ~p"/admin/forums/new" diff --git a/lib/philomena_web/templates/admin/forum/new.html.heex b/lib/philomena_web/templates/admin/forum/new.html.heex new file mode 100644 index 00000000..72653a7d --- /dev/null +++ b/lib/philomena_web/templates/admin/forum/new.html.heex @@ -0,0 +1,5 @@ +

+ New Forum +

+<%= render("_form.html", Map.put(assigns, :action, ~p"/admin/forums")) %> +<%= link("Back", to: ~p"/admin/forums") %> diff --git a/lib/philomena_web/templates/admin/forum/new.html.slime b/lib/philomena_web/templates/admin/forum/new.html.slime deleted file mode 100644 index 602d7d14..00000000 --- a/lib/philomena_web/templates/admin/forum/new.html.slime +++ /dev/null @@ -1,5 +0,0 @@ -h2 New Forum - -= render "_form.html", Map.put(assigns, :action, ~p"/admin/forums") - -= link "Back", to: ~p"/admin/forums" diff --git a/lib/philomena_web/templates/admin/mod_note/_form.html.heex b/lib/philomena_web/templates/admin/mod_note/_form.html.heex new file mode 100644 index 00000000..384bb534 --- /dev/null +++ b/lib/philomena_web/templates/admin/mod_note/_form.html.heex @@ -0,0 +1,19 @@ +<%= form_for @changeset, @action, fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+ <%= label(f, :body, "Note") %> + <%= text_input(f, :body, class: "input input--wide", required: true) %> + <%= error_tag(f, :body) %> +
+ <%= hidden_input(f, :notable_id) %> + <%= hidden_input(f, :notable_type) %> +
+ <%= submit("Save", class: "button") %> +
+<% end %> diff --git a/lib/philomena_web/templates/admin/mod_note/_form.html.slime b/lib/philomena_web/templates/admin/mod_note/_form.html.slime deleted file mode 100644 index 494735ef..00000000 --- a/lib/philomena_web/templates/admin/mod_note/_form.html.slime +++ /dev/null @@ -1,15 +0,0 @@ -= form_for @changeset, @action, fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .field - => label f, :body, "Note" - = text_input f, :body, class: "input input--wide", required: true - = error_tag f, :body - - = hidden_input f, :notable_id - = hidden_input f, :notable_type - - .field - = submit "Save", class: "button" diff --git a/lib/philomena_web/templates/admin/mod_note/_table.html.heex b/lib/philomena_web/templates/admin/mod_note/_table.html.heex new file mode 100644 index 00000000..6d155fe2 --- /dev/null +++ b/lib/philomena_web/templates/admin/mod_note/_table.html.heex @@ -0,0 +1,44 @@ + + + + + + + + + + + + <%= for {body, note} <- @mod_notes do %> + + + + + + + + <% end %> + +
+ Object + + Note + + Time + + Moderator + + Actions +
+ <%= link_to_noted_thing(note.notable) %> + + <%= body %> + + <%= pretty_time(note.created_at) %> + + <%= link(note.moderator.name, to: ~p"/profiles/#{note.moderator}") %> + + <%= link("Edit", to: ~p"/admin/mod_notes/#{note}/edit") %> + • + <%= link("Delete", to: ~p"/admin/mod_notes/#{note}", data: [confirm: "Are you really, really sure?", method: "delete"]) %> +
diff --git a/lib/philomena_web/templates/admin/mod_note/_table.html.slime b/lib/philomena_web/templates/admin/mod_note/_table.html.slime deleted file mode 100644 index 45207800..00000000 --- a/lib/philomena_web/templates/admin/mod_note/_table.html.slime +++ /dev/null @@ -1,27 +0,0 @@ -table.table - thead - tr - td Object - td Note - td Time - td Moderator - td Actions - tbody - = for {body, note} <- @mod_notes do - tr - td - = link_to_noted_thing(note.notable) - - td - = body - - td - = pretty_time note.created_at - - td - = link note.moderator.name, to: ~p"/profiles/#{note.moderator}" - - td - => link "Edit", to: ~p"/admin/mod_notes/#{note}/edit" - ' • - => link "Delete", to: ~p"/admin/mod_notes/#{note}", data: [confirm: "Are you really, really sure?", method: "delete"] diff --git a/lib/philomena_web/templates/admin/mod_note/edit.html.heex b/lib/philomena_web/templates/admin/mod_note/edit.html.heex new file mode 100644 index 00000000..db8cb4db --- /dev/null +++ b/lib/philomena_web/templates/admin/mod_note/edit.html.heex @@ -0,0 +1,6 @@ +

+ Editing mod note for + <%= @mod_note.notable_type %> + <%= @mod_note.notable_id %> +

+<%= render(PhilomenaWeb.Admin.ModNoteView, "_form.html", changeset: @changeset, action: ~p"/admin/mod_notes/#{@mod_note}", conn: @conn) %> diff --git a/lib/philomena_web/templates/admin/mod_note/edit.html.slime b/lib/philomena_web/templates/admin/mod_note/edit.html.slime deleted file mode 100644 index aed68f42..00000000 --- a/lib/philomena_web/templates/admin/mod_note/edit.html.slime +++ /dev/null @@ -1,6 +0,0 @@ -h2 - ' Editing mod note for - => @mod_note.notable_type - => @mod_note.notable_id - -= render PhilomenaWeb.Admin.ModNoteView, "_form.html", changeset: @changeset, action: ~p"/admin/mod_notes/#{@mod_note}", conn: @conn diff --git a/lib/philomena_web/templates/admin/mod_note/index.html.heex b/lib/philomena_web/templates/admin/mod_note/index.html.heex new file mode 100644 index 00000000..e1679744 --- /dev/null +++ b/lib/philomena_web/templates/admin/mod_note/index.html.heex @@ -0,0 +1,16 @@ +<% route = fn p -> ~p"/admin/mod_notes?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @mod_notes, route: route, conn: @conn) %> +

+ Mod Notes +

+
+
+ + Mod Notes + + <%= pagination %> +
+
+ <%= render(PhilomenaWeb.Admin.ModNoteView, "_table.html", mod_notes: @mod_notes, conn: @conn) %> +
+
diff --git a/lib/philomena_web/templates/admin/mod_note/index.html.slime b/lib/philomena_web/templates/admin/mod_note/index.html.slime deleted file mode 100644 index 580366fc..00000000 --- a/lib/philomena_web/templates/admin/mod_note/index.html.slime +++ /dev/null @@ -1,12 +0,0 @@ -- route = fn p -> ~p"/admin/mod_notes?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @mod_notes, route: route, conn: @conn - -h2 Mod Notes - -.block - .block__header - span.block__header__title Mod Notes - = pagination - - .block__content - = render PhilomenaWeb.Admin.ModNoteView, "_table.html", mod_notes: @mod_notes, conn: @conn diff --git a/lib/philomena_web/templates/admin/mod_note/new.html.heex b/lib/philomena_web/templates/admin/mod_note/new.html.heex new file mode 100644 index 00000000..491ae650 --- /dev/null +++ b/lib/philomena_web/templates/admin/mod_note/new.html.heex @@ -0,0 +1,6 @@ +

+ New mod note for + <%= @conn.params["notable_type"] %> + <%= @conn.params["notable_id"] %> +

+<%= render(PhilomenaWeb.Admin.ModNoteView, "_form.html", changeset: @changeset, action: ~p"/admin/mod_notes", conn: @conn) %> diff --git a/lib/philomena_web/templates/admin/mod_note/new.html.slime b/lib/philomena_web/templates/admin/mod_note/new.html.slime deleted file mode 100644 index 09d7291e..00000000 --- a/lib/philomena_web/templates/admin/mod_note/new.html.slime +++ /dev/null @@ -1,6 +0,0 @@ -h2 - ' New mod note for - => @conn.params["notable_type"] - => @conn.params["notable_id"] - -= render PhilomenaWeb.Admin.ModNoteView, "_form.html", changeset: @changeset, action: ~p"/admin/mod_notes", conn: @conn diff --git a/lib/philomena_web/templates/admin/report/_reports.html.heex b/lib/philomena_web/templates/admin/report/_reports.html.heex new file mode 100644 index 00000000..c7c372ba --- /dev/null +++ b/lib/philomena_web/templates/admin/report/_reports.html.heex @@ -0,0 +1,78 @@ + + + + + + + + + + + + + <%= for report <- @reports do %> + + + + + + + + + <% end %> + +
+ Thing + + Reason + + User + + Opened + + State + + Options +
+ <%= reported_image(@conn, report.reportable) %> + <%= link_to_reported_thing(report.reportable) %> + + + <%= truncate(report.reason) %> + + + <%= if report.user do %> + <%= link(report.user.name, to: ~p"/profiles/#{report.user}") %> + <% else %> + + <%= truncated_ip_link(report.ip) %> + + <%= link_to_fingerprint(@conn, report.fingerprint) %> + <% end %> + <%= if not is_nil(report.user) and Enum.any?(report.user.linked_tags) do %> + <%= render(PhilomenaWeb.TagView, "_tag_list.html", tags: ordered_tags(report.user.linked_tags), conn: @conn) %> + <% end %> + + <%= pretty_time(report.created_at) %> + + <%= pretty_state(report) %> + <%= user_abbrv(report.admin) %> + + <%= link("Show", to: ~p"/admin/reports/#{report}") %> + <%= if report.open do %> + <%= if report.user do %> + • + <%= link("Send PM", to: ~p"/conversations/new?#{[recipient: report.user.name]}") %> + <% end %> + <%= if is_nil(report.admin) and not current?(report.admin, @conn.assigns.current_user) do %> + • + <%= link("Claim", to: ~p"/admin/reports/#{report}/claim", data: [method: "post"]) %> + <% end %> + <%= if current?(report.admin, @conn.assigns.current_user) do %> + • + <%= link("Release", to: ~p"/admin/reports/#{report}/claim", data: [method: "delete"]) %> + <% end %> + • + <%= link("Close", to: ~p"/admin/reports/#{report}/close", data: [method: "post", confirm: "Are you really, really sure?"]) %> + <% end %> +
diff --git a/lib/philomena_web/templates/admin/report/_reports.html.slime b/lib/philomena_web/templates/admin/report/_reports.html.slime deleted file mode 100644 index 30b4ad36..00000000 --- a/lib/philomena_web/templates/admin/report/_reports.html.slime +++ /dev/null @@ -1,53 +0,0 @@ -table.table - thead - tr - th Thing - th Reason - th User - th.hide-mobile Opened - th State - th Options - tbody - = for report <- @reports do - tr - td - => reported_image @conn, report.reportable - = link_to_reported_thing report.reportable - td - span title=report.reason - = truncate(report.reason) - td - = if report.user do - = link report.user.name, to: ~p"/profiles/#{report.user}" - - else - em> - = truncated_ip_link(report.ip) - = link_to_fingerprint(@conn, report.fingerprint) - - = if not is_nil(report.user) and Enum.any?(report.user.linked_tags) do - = render PhilomenaWeb.TagView, "_tag_list.html", tags: ordered_tags(report.user.linked_tags), conn: @conn - - td.hide-mobile - = pretty_time report.created_at - - td class=report_row_class(report) - => pretty_state(report) - = user_abbrv report.admin - td - => link "Show", to: ~p"/admin/reports/#{report}" - - = if report.open do - = if report.user do - ' • - => link "Send PM", to: ~p"/conversations/new?#{[recipient: report.user.name]}" - - = if is_nil(report.admin) and not current?(report.admin, @conn.assigns.current_user) do - ' • - => link "Claim", to: ~p"/admin/reports/#{report}/claim", data: [method: "post"] - - = if current?(report.admin, @conn.assigns.current_user) do - ' • - => link "Release", to: ~p"/admin/reports/#{report}/claim", data: [method: "delete"] - - ' • - => link "Close", to: ~p"/admin/reports/#{report}/close", data: [method: "post", confirm: "Are you really, really sure?"] diff --git a/lib/philomena_web/templates/admin/report/index.html.heex b/lib/philomena_web/templates/admin/report/index.html.heex new file mode 100644 index 00000000..d5903302 --- /dev/null +++ b/lib/philomena_web/templates/admin/report/index.html.heex @@ -0,0 +1,62 @@ +<% route = fn p -> ~p"/admin/reports?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", route: route, page: @reports, conn: @conn, params: [rq: @conn.params["rq"] || "*"]) %> +

+ Reports +

+<%= if Enum.any?(@my_reports) do %> +
+
+ + Your Reports + +
+
+ <%= render(PhilomenaWeb.Admin.ReportView, "_reports.html", reports: @my_reports, conn: @conn) %> +
+
+<% end %> +<%= if Enum.any?(@system_reports) do %> +
+
+ + System Reports + +
+
+ <%= render(PhilomenaWeb.Admin.ReportView, "_reports.html", reports: @system_reports, conn: @conn) %> +
+
+<% end %> +
+
+ + All Reports + + <%= pagination %> +
+
+ <%= if Enum.any?(@reports) do %> + <%= render(PhilomenaWeb.Admin.ReportView, "_reports.html", reports: @reports, conn: @conn) %> + <% else %> +

+ We couldn't find any reports for you, sorry! +

+ <% end %> +
+
+ <%= pagination %> +
+
+<%= form_for :report, ~p"/admin/reports", [method: "get", class: "hform"], fn f -> %> +
+ <%= text_input(f, :rq, name: :rq, value: @conn.params["rq"], class: "input hform__text", placeholder: "Search reports", autocapitalize: "none") %> + <%= submit("Search", class: "hform__button button") %> +
+<% end %> +
+ +
diff --git a/lib/philomena_web/templates/admin/report/index.html.slime b/lib/philomena_web/templates/admin/report/index.html.slime deleted file mode 100644 index 83c45312..00000000 --- a/lib/philomena_web/templates/admin/report/index.html.slime +++ /dev/null @@ -1,42 +0,0 @@ -- route = fn p -> ~p"/admin/reports?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", route: route, page: @reports, conn: @conn, params: [rq: @conn.params["rq"] || "*"] - -h1 Reports - -= if Enum.any?(@my_reports) do - .block - .block__header - span.block__header__title Your Reports - .block__content - = render PhilomenaWeb.Admin.ReportView, "_reports.html", reports: @my_reports, conn: @conn - -= if Enum.any?(@system_reports) do - .block - .block__header.block--danger - span.block__header__title System Reports - .block__content - = render PhilomenaWeb.Admin.ReportView, "_reports.html", reports: @system_reports, conn: @conn - -.block - .block__header - span.block__header__title All Reports - = pagination - .block__content - = if Enum.any?(@reports) do - = render PhilomenaWeb.Admin.ReportView, "_reports.html", reports: @reports, conn: @conn - - else - p We couldn't find any reports for you, sorry! - - .block__header.block__header--light - = pagination - -= form_for :report, ~p"/admin/reports", [method: "get", class: "hform"], fn f -> - .field - = text_input f, :rq, name: :rq, value: @conn.params["rq"], class: "input hform__text", placeholder: "Search reports", autocapitalize: "none" - = submit "Search", class: "hform__button button" - -.field - label for="rq" - ' Searchable fields: id, created_at, reason, state, open, user, user_id, admin, admin_id, ip, fingerprint, reportable_type, reportable_id, image_id - br - ' Report reason is used if you don't specify a field. diff --git a/lib/philomena_web/templates/admin/report/show.html.heex b/lib/philomena_web/templates/admin/report/show.html.heex new file mode 100644 index 00000000..a7f185a7 --- /dev/null +++ b/lib/philomena_web/templates/admin/report/show.html.heex @@ -0,0 +1,62 @@ +

+ Showing Report +

+

+ <%= link_to_reported_thing(@report.reportable) %> +

+
+
+
+ <%= render(PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @report, conn: @conn) %> +
+
+ + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @report, awards: true, conn: @conn) %> + +
+ <%= render(PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @report, conn: @conn) %> +
+ <%= @body %> +
+
+
+
+
+
+ Reported + <%= pretty_time(@report.created_at) %> +
+
+ <%= link_to_ip(@conn, @report.ip) %> + <%= link_to_fingerprint(@conn, @report.fingerprint) %> +
+
+
+ User-Agent: + + <%= @report.user_agent %> + +
+
+
+<%= if assigns[:mod_notes] do %> +

+ Mod Notes +

+ <%= render(PhilomenaWeb.Admin.ModNoteView, "_table.html", mod_notes: @mod_notes, conn: @conn) %> + <%= link("Add New Note", to: ~p"/admin/mod_notes/new?#{[notable_id: @report.id, notable_type: "Report"]}") %> +<% end %> +

+ <%= if @report.user do %> + <%= link("Send PM", to: ~p"/conversations/new?#{[recipient: @report.user.name]}", class: "button button--link") %> + <% end %> + <%= if @report.open do %> + <%= link("Close", to: ~p"/admin/reports/#{@report}/close", class: "button", data: [method: "post"]) %> + <%= if current?(@report.admin, @conn.assigns.current_user) do %> + <%= link("Release", to: ~p"/admin/reports/#{@report}/claim", class: "button", data: [method: "delete"]) %> + <% else %> + <%= link("Claim", to: ~p"/admin/reports/#{@report}/claim", class: "button", data: [method: "post"]) %> + <% end %> + <% end %> +

+<%= link("Back", to: ~p"/admin/reports", class: "button button-link") %> diff --git a/lib/philomena_web/templates/admin/report/show.html.slime b/lib/philomena_web/templates/admin/report/show.html.slime deleted file mode 100644 index 20835cdd..00000000 --- a/lib/philomena_web/templates/admin/report/show.html.slime +++ /dev/null @@ -1,48 +0,0 @@ -h1 Showing Report -p - = link_to_reported_thing @report.reportable - -article.block.communication - .block__content.flex.flex--no-wrap - .flex__fixed.spacing-right - = render PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @report, conn: @conn - .flex__grow.communication__body - span.communication__body__sender-name = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @report, awards: true, conn: @conn - br - = render PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @report, conn: @conn - .communication__body__text - =<> @body - - .block__content.communication__options - .flex.flex--wrap.flex--spaced-out - div - ' Reported - = pretty_time @report.created_at - - .flex__right - => link_to_ip @conn, @report.ip - => link_to_fingerprint @conn, @report.fingerprint - - div - ' User-Agent: - code - = @report.user_agent - -= if assigns[:mod_notes] do - h4 Mod Notes - = render PhilomenaWeb.Admin.ModNoteView, "_table.html", mod_notes: @mod_notes, conn: @conn - = link "Add New Note", to: ~p"/admin/mod_notes/new?#{[notable_id: @report.id, notable_type: "Report"]}" - -p - = if @report.user do - => link "Send PM", to: ~p"/conversations/new?#{[recipient: @report.user.name]}", class: "button button--link" - - = if @report.open do - => link "Close", to: ~p"/admin/reports/#{@report}/close", class: "button", data: [method: "post"] - - = if current?(@report.admin, @conn.assigns.current_user) do - => link "Release", to: ~p"/admin/reports/#{@report}/claim", class: "button", data: [method: "delete"] - - else - => link "Claim", to: ~p"/admin/reports/#{@report}/claim", class: "button", data: [method: "post"] - -= link "Back", to: ~p"/admin/reports", class: "button button-link" diff --git a/lib/philomena_web/templates/admin/site_notice/_form.html.heex b/lib/philomena_web/templates/admin/site_notice/_form.html.heex new file mode 100644 index 00000000..eedb4e80 --- /dev/null +++ b/lib/philomena_web/templates/admin/site_notice/_form.html.heex @@ -0,0 +1,56 @@ +<%= form_for @changeset, @action, fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+ <%= label(f, :title, "Title (the bold bit) for the site notice; keep this short:") %> + <%= text_input(f, :title, class: "input input--wide", placeholder: "Title", required: true) %> + <%= error_tag(f, :title) %> +
+
+ <%= label(f, :text, "Main body of the site notice:") %> + <%= text_input(f, :text, class: "input input--wide", placeholder: "Text", required: true) %> + <%= error_tag(f, :text) %> +
+

+ Link + + (optional; leave these two fields blank for no link) + +

+
+ <%= label(f, :link_text, "Text which will contain the link:") %> + <%= text_input(f, :link_text, class: "input input--wide", placeholder: "Link text") %> + <%= error_tag(f, :link_text) %> +
+
+ <%= label(f, :link, "Link which the site notice should take users to:") %> + <%= text_input(f, :link, class: "input input--wide", placeholder: "Link") %> + <%= error_tag(f, :link) %> +
+

+ Run Time +

+
+ <%= label(f, :start_time, "Start time for the site notice (usually \"now\"):") %> + <%= text_input(f, :start_time, class: "input input--wide", required: true) %> + <%= error_tag(f, :start_time) %> +
+
+ <%= label(f, :finish_time, "Finish time for the site notice (e.g. \"2 weeks from now\"):") %> + <%= text_input(f, :finish_time, class: "input input--wide", required: true) %> + <%= error_tag(f, :finish_time) %> +
+

+ Enable +

+
+ <%= checkbox(f, :live, class: "checkbox") %> + <%= label(f, :live, "Live") %> +
+ <%= submit("Save Site Notice", class: "button") %> +<% end %> diff --git a/lib/philomena_web/templates/admin/site_notice/_form.html.slime b/lib/philomena_web/templates/admin/site_notice/_form.html.slime deleted file mode 100644 index 2e614917..00000000 --- a/lib/philomena_web/templates/admin/site_notice/_form.html.slime +++ /dev/null @@ -1,47 +0,0 @@ -= form_for @changeset, @action, fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .field - => label f, :title, "Title (the bold bit) for the site notice; keep this short:" - = text_input f, :title, class: "input input--wide", placeholder: "Title", required: true - = error_tag f, :title - - .field - => label f, :text, "Main body of the site notice:" - = text_input f, :text, class: "input input--wide", placeholder: "Text", required: true - = error_tag f, :text - - h3 - ' Link - small - ' (optional; leave these two fields blank for no link) - - .field - => label f, :link_text, "Text which will contain the link:" - = text_input f, :link_text, class: "input input--wide", placeholder: "Link text" - = error_tag f, :link_text - - .field - => label f, :link, "Link which the site notice should take users to:" - = text_input f, :link, class: "input input--wide", placeholder: "Link" - = error_tag f, :link - - h3 Run Time - .field - => label f, :start_time, "Start time for the site notice (usually \"now\"):" - = text_input f, :start_time, class: "input input--wide", required: true - = error_tag f, :start_time - - .field - => label f, :finish_time, "Finish time for the site notice (e.g. \"2 weeks from now\"):" - = text_input f, :finish_time, class: "input input--wide", required: true - = error_tag f, :finish_time - - h3 Enable - .field - => checkbox f, :live, class: "checkbox" - = label f, :live, "Live" - - = submit "Save Site Notice", class: "button" diff --git a/lib/philomena_web/templates/admin/site_notice/edit.html.heex b/lib/philomena_web/templates/admin/site_notice/edit.html.heex new file mode 100644 index 00000000..71330796 --- /dev/null +++ b/lib/philomena_web/templates/admin/site_notice/edit.html.heex @@ -0,0 +1,4 @@ +

+ Editing site notice +

+<%= render(PhilomenaWeb.Admin.SiteNoticeView, "_form.html", changeset: @changeset, action: ~p"/admin/site_notices/#{@site_notice}", conn: @conn) %> diff --git a/lib/philomena_web/templates/admin/site_notice/edit.html.slime b/lib/philomena_web/templates/admin/site_notice/edit.html.slime deleted file mode 100644 index de39c73e..00000000 --- a/lib/philomena_web/templates/admin/site_notice/edit.html.slime +++ /dev/null @@ -1,2 +0,0 @@ -h1 Editing site notice -= render PhilomenaWeb.Admin.SiteNoticeView, "_form.html", changeset: @changeset, action: ~p"/admin/site_notices/#{@site_notice}", conn: @conn diff --git a/lib/philomena_web/templates/admin/site_notice/index.html.heex b/lib/philomena_web/templates/admin/site_notice/index.html.heex new file mode 100644 index 00000000..b7cd35dc --- /dev/null +++ b/lib/philomena_web/templates/admin/site_notice/index.html.heex @@ -0,0 +1,65 @@ +

+ Site Notices +

+<% route = fn p -> ~p"/admin/site_notices?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @admin_site_notices, route: route, conn: @conn) %> +
+
+ + + New site notice + + <%= pagination %> +
+
+ + + + + + + + + + + + <%= for site_notice <- @admin_site_notices do %> + + + + + + + + <% end %> + +
+ Title + + Start + + Finish + + Live? + + Options +
+ + <%= site_notice.title %> + + + <%= pretty_time(site_notice.start_date) %> + + <%= pretty_time(site_notice.finish_date) %> + + <%= live_text(site_notice) %> + + <%= link("Edit", to: ~p"/admin/site_notices/#{site_notice}/edit") %> + • + <%= link("Destroy", to: ~p"/admin/site_notices/#{site_notice}", data: [confirm: "Are you really, really sure?", method: "delete"]) %> +
+
+
+ <%= pagination %> +
+
diff --git a/lib/philomena_web/templates/admin/site_notice/index.html.slime b/lib/philomena_web/templates/admin/site_notice/index.html.slime deleted file mode 100644 index 21cac767..00000000 --- a/lib/philomena_web/templates/admin/site_notice/index.html.slime +++ /dev/null @@ -1,44 +0,0 @@ -h1 Site Notices - -- route = fn p -> ~p"/admin/site_notices?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @admin_site_notices, route: route, conn: @conn - -.block - .block__header - a href=~p"/admin/site_notices/new" - i.fa.fa-plus> - ' New site notice - - = pagination - - .block__content - table.table - thead - tr - th Title - th Start - th Finish - th Live? - th Options - tbody - = for site_notice <- @admin_site_notices do - tr - td - em = site_notice.title - - td class=time_column_class(site_notice.start_date) - = pretty_time site_notice.start_date - - td class=time_column_class(site_notice.finish_date) - = pretty_time site_notice.finish_date - - td - = live_text site_notice - - td - => link "Edit", to: ~p"/admin/site_notices/#{site_notice}/edit" - ' • - => link "Destroy", to: ~p"/admin/site_notices/#{site_notice}", data: [confirm: "Are you really, really sure?", method: "delete"] - - .block__header.block__header--light - = pagination diff --git a/lib/philomena_web/templates/admin/site_notice/new.html.heex b/lib/philomena_web/templates/admin/site_notice/new.html.heex new file mode 100644 index 00000000..55032b5d --- /dev/null +++ b/lib/philomena_web/templates/admin/site_notice/new.html.heex @@ -0,0 +1,4 @@ +

+ New site notice +

+<%= render(PhilomenaWeb.Admin.SiteNoticeView, "_form.html", changeset: @changeset, action: ~p"/admin/site_notices", conn: @conn) %> diff --git a/lib/philomena_web/templates/admin/site_notice/new.html.slime b/lib/philomena_web/templates/admin/site_notice/new.html.slime deleted file mode 100644 index cf85b793..00000000 --- a/lib/philomena_web/templates/admin/site_notice/new.html.slime +++ /dev/null @@ -1,2 +0,0 @@ -h1 New site notice -= render PhilomenaWeb.Admin.SiteNoticeView, "_form.html", changeset: @changeset, action: ~p"/admin/site_notices", conn: @conn diff --git a/lib/philomena_web/templates/admin/subnet_ban/_form.html.heex b/lib/philomena_web/templates/admin/subnet_ban/_form.html.heex new file mode 100644 index 00000000..f1cd39cc --- /dev/null +++ b/lib/philomena_web/templates/admin/subnet_ban/_form.html.heex @@ -0,0 +1,34 @@ +<%= form_for @changeset, @action, fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+ <%= label(f, :specification, "Specification:") %> + <%= text_input(f, :specification, class: "input", placeholder: "Specification", required: true) %> +
+
+ <%= label(f, :reason, "Reason (shown to the banned user, and to staff on the user's profile page):") %> + <%= text_input(f, :reason, class: "input input--wide", placeholder: "Reason", required: true) %> + <%= error_tag(f, :reason) %> +
+
+ <%= label(f, :note, "Admin-only note:") %> + <%= text_input(f, :note, class: "input input--wide", placeholder: "Note") %> +
+
+ <%= label(f, :until, "End time relative to now, in simple English (e.g. \"1 week from now\"):") %> + <%= text_input(f, :until, class: "input input--wide", placeholder: "Until", required: true) %> + <%= error_tag(f, :until) %> +
+
+
+ <%= checkbox(f, :enabled) %> + <%= label(f, :enabled) %> +
+
+ <%= submit("Save Ban", class: "button") %> +<% end %> diff --git a/lib/philomena_web/templates/admin/subnet_ban/_form.html.slime b/lib/philomena_web/templates/admin/subnet_ban/_form.html.slime deleted file mode 100644 index bf87b2ce..00000000 --- a/lib/philomena_web/templates/admin/subnet_ban/_form.html.slime +++ /dev/null @@ -1,30 +0,0 @@ -= form_for @changeset, @action, fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .field - => label f, :specification, "Specification:" - = text_input f, :specification, class: "input", placeholder: "Specification", required: true - - .field - => label f, :reason, "Reason (shown to the banned user, and to staff on the user's profile page):" - = text_input f, :reason, class: "input input--wide", placeholder: "Reason", required: true - = error_tag f, :reason - - .field - => label f, :note, "Admin-only note:" - = text_input f, :note, class: "input input--wide", placeholder: "Note" - - .field - => label f, :until, "End time relative to now, in simple English (e.g. \"1 week from now\"):" - = text_input f, :until, class: "input input--wide", placeholder: "Until", required: true - = error_tag f, :until - - br - .field - => checkbox f, :enabled - = label f, :enabled - br - - = submit "Save Ban", class: "button" diff --git a/lib/philomena_web/templates/admin/subnet_ban/edit.html.heex b/lib/philomena_web/templates/admin/subnet_ban/edit.html.heex new file mode 100644 index 00000000..4dba2560 --- /dev/null +++ b/lib/philomena_web/templates/admin/subnet_ban/edit.html.heex @@ -0,0 +1,6 @@ +

+ Editing ban +

+<%= render(PhilomenaWeb.Admin.SubnetBanView, "_form.html", changeset: @changeset, action: ~p"/admin/subnet_bans/#{@subnet}", conn: @conn) %> +
+<%= link("Back", to: ~p"/admin/subnet_bans") %> diff --git a/lib/philomena_web/templates/admin/subnet_ban/edit.html.slime b/lib/philomena_web/templates/admin/subnet_ban/edit.html.slime deleted file mode 100644 index dc451983..00000000 --- a/lib/philomena_web/templates/admin/subnet_ban/edit.html.slime +++ /dev/null @@ -1,6 +0,0 @@ -h1 Editing ban - -= render PhilomenaWeb.Admin.SubnetBanView, "_form.html", changeset: @changeset, action: ~p"/admin/subnet_bans/#{@subnet}", conn: @conn - -br -= link "Back", to: ~p"/admin/subnet_bans" diff --git a/lib/philomena_web/templates/admin/subnet_ban/index.html.heex b/lib/philomena_web/templates/admin/subnet_ban/index.html.heex new file mode 100644 index 00000000..fdef24f5 --- /dev/null +++ b/lib/philomena_web/templates/admin/subnet_ban/index.html.heex @@ -0,0 +1,86 @@ +

+ Subnet Bans +

+<% route = fn p -> ~p"/admin/subnet_bans?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @subnet_bans, route: route, params: page_params(@conn.params)) %> +<%= form_for :subnet_ban, ~p"/admin/subnet_bans", [method: "get", class: "hform"], fn f -> %> +
+ <%= text_input(f, :q, name: "q", class: "hform__text input", placeholder: "Search") %> + <%= submit("Search", class: "button hform__button") %> +
+<% end %> +
+
+ + + New subnet ban + + <%= pagination %> +
+
+ + + + + + + + + + + + + <%= for ban <- @subnet_bans do %> + + + + + + + + + <% end %> + +
+ Specification + + Created + + Expires + + Reason/Note + + Ban ID + + Options +
+ <%= link(ban.specification, to: ~p"/ip_profiles/#{to_string(ban.specification)}") %> + + <%= pretty_time(ban.created_at) %> + <%= user_abbrv(ban.banning_user) %> + + <%= pretty_time(ban.valid_until) %> + + <%= ban.reason %> + <%= if present?(ban.note) do %> +

+ + Note: + <%= ban.note %> + +

+ <% end %> +
+ <%= ban.generated_ban_id %> + + <%= link("Edit", to: ~p"/admin/subnet_bans/#{ban}/edit") %> + <%= if @current_user.role == "admin" do %> + • + <%= link("Destroy", to: ~p"/admin/subnet_bans/#{ban}", data: [confirm: "Are you really, really sure?", method: "delete"]) %> + <% end %> +
+
+
+ <%= pagination %> +
+
diff --git a/lib/philomena_web/templates/admin/subnet_ban/index.html.slime b/lib/philomena_web/templates/admin/subnet_ban/index.html.slime deleted file mode 100644 index c051a10a..00000000 --- a/lib/philomena_web/templates/admin/subnet_ban/index.html.slime +++ /dev/null @@ -1,62 +0,0 @@ -h1 Subnet Bans - -- route = fn p -> ~p"/admin/subnet_bans?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @subnet_bans, route: route, params: page_params(@conn.params) - -= form_for :subnet_ban, ~p"/admin/subnet_bans", [method: "get", class: "hform"], fn f -> - .field - = text_input f, :q, name: "q", class: "hform__text input", placeholder: "Search" - = submit "Search", class: "button hform__button" - -.block - .block__header - a href=~p"/admin/subnet_bans/new" - i.fa.fa-plus> - ' New subnet ban - - = pagination - - .block__content - table.table - thead - tr - th Specification - th Created - th Expires - th Reason/Note - th Ban ID - th Options - - tbody - = for ban <- @subnet_bans do - tr - td - = link ban.specification, to: ~p"/ip_profiles/#{to_string(ban.specification)}" - - td - => pretty_time ban.created_at - = user_abbrv ban.banning_user - - td class=ban_row_class(ban) - = pretty_time ban.valid_until - - td - = ban.reason - - = if present?(ban.note) do - p.block.block--fixed - em - ' Note: - = ban.note - - td - = ban.generated_ban_id - - td - => link "Edit", to: ~p"/admin/subnet_bans/#{ban}/edit" - = if @current_user.role == "admin" do - ' • - => link "Destroy", to: ~p"/admin/subnet_bans/#{ban}", data: [confirm: "Are you really, really sure?", method: "delete"] - - .block__header.block__header--light - = pagination diff --git a/lib/philomena_web/templates/admin/subnet_ban/new.html.heex b/lib/philomena_web/templates/admin/subnet_ban/new.html.heex new file mode 100644 index 00000000..d7e84b6c --- /dev/null +++ b/lib/philomena_web/templates/admin/subnet_ban/new.html.heex @@ -0,0 +1,6 @@ +

+ New Subnet Ban +

+<%= render(PhilomenaWeb.Admin.SubnetBanView, "_form.html", changeset: @changeset, action: ~p"/admin/subnet_bans", conn: @conn) %> +
+<%= link("Back", to: ~p"/admin/subnet_bans") %> diff --git a/lib/philomena_web/templates/admin/subnet_ban/new.html.slime b/lib/philomena_web/templates/admin/subnet_ban/new.html.slime deleted file mode 100644 index 7732231b..00000000 --- a/lib/philomena_web/templates/admin/subnet_ban/new.html.slime +++ /dev/null @@ -1,5 +0,0 @@ -h1 New Subnet Ban -= render PhilomenaWeb.Admin.SubnetBanView, "_form.html", changeset: @changeset, action: ~p"/admin/subnet_bans", conn: @conn - -br -= link "Back", to: ~p"/admin/subnet_bans" diff --git a/lib/philomena_web/templates/admin/user/_form.html.heex b/lib/philomena_web/templates/admin/user/_form.html.heex new file mode 100644 index 00000000..33472e60 --- /dev/null +++ b/lib/philomena_web/templates/admin/user/_form.html.heex @@ -0,0 +1,121 @@ +<%= form_for @changeset, @action, fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+
+ + Essential user details + +
+ + + + + + + +
+
+ Avatar +
+
+ <%= link("Remove avatar", to: ~p"/admin/users/#{@user}/avatar", class: "button", data: [method: "delete", confirm: "Are you really, really sure?"]) %> +
+
+
+
+
+ + General user flags + +
+ + +
+
+
+ + Special roles for assistants + +
+ +
+
+
+ + Special roles for moderators + +
+ +
+ <%= submit("Save User", class: "button") %> +<% end %> diff --git a/lib/philomena_web/templates/admin/user/_form.html.slime b/lib/philomena_web/templates/admin/user/_form.html.slime deleted file mode 100644 index faf4218a..00000000 --- a/lib/philomena_web/templates/admin/user/_form.html.slime +++ /dev/null @@ -1,58 +0,0 @@ -= form_for @changeset, @action, fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .block - .block__header - span.block__header__title Essential user details - label.table-list__label - .table-list__label__text Name: - .table-list__label__input - = error_tag f, :name - = text_input f, :name, class: "input" - label.table-list__label - .table-list__label__text Email: - .table-list__label__input - = error_tag f, :email - = text_input f, :email, class: "input" - label.table-list__label - .table-list__label__text Role: - .table-list__label__input = select f, :role, ["user", "assistant", "moderator", "admin"], class: "input" - label.table-list__label - .table-list__label__text Secondary banner: - .table-list__label__input = select f, :secondary_role, [[key: "-", value: ""], "Site Developer", "Devops", "Philomena Contributor", "Public Relations"], class: "input" - label.table-list__label - .table-list__label__text Hide staff banner: - .table-list__label__input = checkbox f, :hide_default_role, class: "checkbox" - label.table-list__label - .table-list__label__text Senior staff: - .table-list__label__input = checkbox f, :senior_staff, class: "checkbox" - label.table-list__label - .table-list__label__text Bypass rate limits: - .table-list__label__input = checkbox f, :bypass_rate_limits, class: "checkbox" - .table-list__label - .table-list__label__text Avatar - .table-list__label__input - = link "Remove avatar", to: ~p"/admin/users/#{@user}/avatar", class: "button", data: [method: "delete", confirm: "Are you really, really sure?"] - - .block - .block__header - span.block__header__title General user flags - ul - p - strong> Be careful when issuing these permissions to staff members! - | Staff members with relevant roles may have these permissions anyway. Issuing them may break things, such as tag aliasing. - ul = collection_checkboxes f, :roles, filtered_roles(general_permissions(), @roles), mapper: &checkbox_mapper/6 - - .block - .block__header.warning - span.block__header__title Special roles for assistants - ul = collection_checkboxes f, :roles, filtered_roles(assistant_permissions(), @roles), mapper: &checkbox_mapper/6 - - .block - .block__header.danger - span.block__header__title Special roles for moderators - ul = collection_checkboxes f, :roles, filtered_roles(moderator_permissions(), @roles), mapper: &checkbox_mapper/6 - - = submit "Save User", class: "button" diff --git a/lib/philomena_web/templates/admin/user/edit.html.heex b/lib/philomena_web/templates/admin/user/edit.html.heex new file mode 100644 index 00000000..ad55588d --- /dev/null +++ b/lib/philomena_web/templates/admin/user/edit.html.heex @@ -0,0 +1,4 @@ +

+ Editing user +

+<%= render(PhilomenaWeb.Admin.UserView, "_form.html", Map.put(assigns, :action, ~p"/admin/users/#{@user}")) %> diff --git a/lib/philomena_web/templates/admin/user/edit.html.slime b/lib/philomena_web/templates/admin/user/edit.html.slime deleted file mode 100644 index e7a649de..00000000 --- a/lib/philomena_web/templates/admin/user/edit.html.slime +++ /dev/null @@ -1,3 +0,0 @@ -h1 Editing user - -= render PhilomenaWeb.Admin.UserView, "_form.html", Map.put(assigns, :action, ~p"/admin/users/#{@user}") diff --git a/lib/philomena_web/templates/admin/user/force_filter/new.html.heex b/lib/philomena_web/templates/admin/user/force_filter/new.html.heex new file mode 100644 index 00000000..62d5b791 --- /dev/null +++ b/lib/philomena_web/templates/admin/user/force_filter/new.html.heex @@ -0,0 +1,12 @@ +

+ Force-assigning a filter for user + <%= @user.name %> +

+<%= form_for @changeset, ~p"/admin/users/#{@user}/force_filter", [method: "post"], fn f -> %> +
+ <%= text_input(f, :forced_filter_id, placeholder: "Filter ID", class: "input", required: true) %> +
+
+ <%= submit("Force", class: "button button--state-primary") %> +
+<% end %> diff --git a/lib/philomena_web/templates/admin/user/force_filter/new.html.slime b/lib/philomena_web/templates/admin/user/force_filter/new.html.slime deleted file mode 100644 index eda33725..00000000 --- a/lib/philomena_web/templates/admin/user/force_filter/new.html.slime +++ /dev/null @@ -1,9 +0,0 @@ -h1 - ' Force-assigning a filter for user - = @user.name - -= form_for @changeset, ~p"/admin/users/#{@user}/force_filter", [method: "post"], fn f -> - .field - => text_input f, :forced_filter_id, placeholder: "Filter ID", class: "input", required: true - .field - = submit "Force", class: "button button--state-primary" diff --git a/lib/philomena_web/templates/admin/user/index.html.heex b/lib/philomena_web/templates/admin/user/index.html.heex new file mode 100644 index 00000000..0ab2db37 --- /dev/null +++ b/lib/philomena_web/templates/admin/user/index.html.heex @@ -0,0 +1,124 @@ +

+ Users +

+<%= form_for :user, ~p"/admin/users", [method: "get", class: "hform"], fn f -> %> +
+ <%= text_input(f, :q, name: "q", class: "hform__text input", placeholder: "Search query") %> + <%= submit("Search", class: "button hform__button") %> +
+<% end %> +<%= link("Site staff", to: ~p"/admin/users?#{[staff: 1]}") %> +• +<%= link("2FA users", to: ~p"/admin/users?#{[twofactor: 1]}") %> +<% route = fn p -> ~p"/admin/users?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @users, route: route, conn: @conn, params: page_params(@conn.params)) %> +
+
+ <%= pagination %> +
+
+ + + + + + + + + + + + + <%= for user <- @users do %> + + + + + + + + + <% end %> + +
+ Name + + Email + + Activated + + Role + + Created + + Options +
+ <%= link(user.name, to: ~p"/profiles/#{user}") %> + <%= cond do %> + <% user.otp_required_for_login -> %> + + <% user.role != "user" and !user.otp_required_for_login -> %> + + <% true -> %> + <% end %> + + <%= if can?(@conn, :edit, Philomena.Users.User) do %> + <%= user.email %> + <% else %> + + N/A + + <% end %> + + <%= cond do %> + <% user.deleted_at -> %> + + Deactivated + + <%= pretty_time(user.deleted_at) %> + <% user.confirmed_at -> %> + Active + <% true -> %> + + Unconfirmed + + <% end %> + + <%= String.capitalize(user.role) %> + + <%= pretty_time(user.created_at) %> + + <%= if can?(@conn, :edit, user) do %> + <%= link to: ~p"/admin/users/#{user}/edit" do %> + + Edit + <% end %> + <% end %> + <% # = if user.deleted_at do %> + <% # => link_to 'Reactivate', admin_user_activation_path(user), data: { confirm: t('are_you_sure') }, method: :create %> + <% # - else %> + <% # => link_to 'Deactivate', admin_user_activation_path(user), data: { confirm: t('are_you_sure') }, method: :delete %> + <% # ' • %> + <%= if can?(@conn, :index, Philomena.Bans.User) do %> + <%= link to: ~p"/admin/user_bans/new?#{[username: user.name]}" do %> + + Ban + <% end %> + <% end %> + <%= if can?(@conn, :edit, Philomena.ArtistLinks.ArtistLink) do %> + <%= link to: ~p"/profiles/#{user}/artist_links/new" do %> + + Add link + <% end %> + <% end %> +
+
+ <%= pagination %> +
+
diff --git a/lib/philomena_web/templates/admin/user/index.html.slime b/lib/philomena_web/templates/admin/user/index.html.slime deleted file mode 100644 index 7157e7d9..00000000 --- a/lib/philomena_web/templates/admin/user/index.html.slime +++ /dev/null @@ -1,94 +0,0 @@ -h1 Users - -= form_for :user, ~p"/admin/users", [method: "get", class: "hform"], fn f -> - .field - => text_input f, :q, name: "q", class: "hform__text input", placeholder: "Search query" - = submit "Search", class: "button hform__button" - -=> link "Site staff", to: ~p"/admin/users?#{[staff: 1]}" -' • -=> link "2FA users", to: ~p"/admin/users?#{[twofactor: 1]}" - -- route = fn p -> ~p"/admin/users?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @users, route: route, conn: @conn, params: page_params(@conn.params) - -.block - .block__header - = pagination - - .block__content - table.table - thead - tr - th Name - th Email - th Activated - th Role - th Created - th Options - tbody - = for user <- @users do - tr - td - = link user.name, to: ~p"/profiles/#{user}" - - = cond do - - user.otp_required_for_login -> - span.banner__2fa.success - i.fas.fa-check> - ' 2FA - - - user.role != "user" and !user.otp_required_for_login -> - span.banner__2fa.danger - i.fas.fa-times> - ' 2FA - - - true -> - - td - = if can?(@conn, :edit, Philomena.Users.User) do - = user.email - - else - i N/A - - td - = cond do - - user.deleted_at -> - strong> Deactivated - = pretty_time user.deleted_at - - - user.confirmed_at -> - ' Active - - - true -> - strong> Unconfirmed - - td - = String.capitalize(user.role) - - td - = pretty_time user.created_at - - td - = if can?(@conn, :edit, user) do - => link to: ~p"/admin/users/#{user}/edit" do - i.fa.fa-fw.fa-user-edit - ' Edit - - /= if user.deleted_at do - / => link_to 'Reactivate', admin_user_activation_path(user), data: { confirm: t('are_you_sure') }, method: :create - /- else - / => link_to 'Deactivate', admin_user_activation_path(user), data: { confirm: t('are_you_sure') }, method: :delete - /' • - - = if can?(@conn, :index, Philomena.Bans.User) do - => link to: ~p"/admin/user_bans/new?#{[username: user.name]}" do - i.fa.fa-fw.fa-ban - ' Ban - = if can?(@conn, :edit, Philomena.ArtistLinks.ArtistLink) do - => link to: ~p"/profiles/#{user}/artist_links/new" do - i.fa.fa-fw.fa-link - ' Add link - - .block__header.block__header--light - = pagination diff --git a/lib/philomena_web/templates/admin/user_ban/_form.html.heex b/lib/philomena_web/templates/admin/user_ban/_form.html.heex new file mode 100644 index 00000000..6040d459 --- /dev/null +++ b/lib/philomena_web/templates/admin/user_ban/_form.html.heex @@ -0,0 +1,34 @@ +<%= form_for @changeset, @action, fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+ <%= label(f, :username, "Username:") %> + <%= text_input(f, :username, class: "input", placeholder: "Username", required: true) %> +
+
+ <%= label(f, :reason, "Reason (shown to the banned user, and to staff on the user's profile page):") %> + <%= text_input(f, :reason, class: "input input--wide", placeholder: "Reason", required: true) %> + <%= error_tag(f, :reason) %> +
+
+ <%= label(f, :note, "Admin-only note:") %> + <%= text_input(f, :note, class: "input input--wide", placeholder: "Note") %> +
+
+ <%= label(f, :until, "End time relative to now, in simple English (e.g. \"1 week from now\"):") %> + <%= text_input(f, :until, class: "input input--wide", placeholder: "Until", required: true) %> + <%= error_tag(f, :until) %> +
+
+
+ <%= checkbox(f, :enabled) %> + <%= label(f, :enabled) %> +
+
+ <%= submit("Save Ban", class: "button") %> +<% end %> diff --git a/lib/philomena_web/templates/admin/user_ban/_form.html.slime b/lib/philomena_web/templates/admin/user_ban/_form.html.slime deleted file mode 100644 index 292f07eb..00000000 --- a/lib/philomena_web/templates/admin/user_ban/_form.html.slime +++ /dev/null @@ -1,30 +0,0 @@ -= form_for @changeset, @action, fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .field - => label f, :username, "Username:" - = text_input f, :username, class: "input", placeholder: "Username", required: true - - .field - => label f, :reason, "Reason (shown to the banned user, and to staff on the user's profile page):" - = text_input f, :reason, class: "input input--wide", placeholder: "Reason", required: true - = error_tag f, :reason - - .field - => label f, :note, "Admin-only note:" - = text_input f, :note, class: "input input--wide", placeholder: "Note" - - .field - => label f, :until, "End time relative to now, in simple English (e.g. \"1 week from now\"):" - = text_input f, :until, class: "input input--wide", placeholder: "Until", required: true - = error_tag f, :until - - br - .field - => checkbox f, :enabled - = label f, :enabled - br - - = submit "Save Ban", class: "button" diff --git a/lib/philomena_web/templates/admin/user_ban/edit.html.heex b/lib/philomena_web/templates/admin/user_ban/edit.html.heex new file mode 100644 index 00000000..b56447d0 --- /dev/null +++ b/lib/philomena_web/templates/admin/user_ban/edit.html.heex @@ -0,0 +1,6 @@ +

+ Editing ban +

+<%= render(PhilomenaWeb.Admin.UserBanView, "_form.html", changeset: @changeset, action: ~p"/admin/user_bans/#{@user}", conn: @conn) %> +
+<%= link("Back", to: ~p"/admin/user_bans") %> diff --git a/lib/philomena_web/templates/admin/user_ban/edit.html.slime b/lib/philomena_web/templates/admin/user_ban/edit.html.slime deleted file mode 100644 index 604f0ed6..00000000 --- a/lib/philomena_web/templates/admin/user_ban/edit.html.slime +++ /dev/null @@ -1,6 +0,0 @@ -h1 Editing ban - -= render PhilomenaWeb.Admin.UserBanView, "_form.html", changeset: @changeset, action: ~p"/admin/user_bans/#{@user}", conn: @conn - -br -= link "Back", to: ~p"/admin/user_bans" diff --git a/lib/philomena_web/templates/admin/user_ban/index.html.heex b/lib/philomena_web/templates/admin/user_ban/index.html.heex new file mode 100644 index 00000000..ce2a5832 --- /dev/null +++ b/lib/philomena_web/templates/admin/user_ban/index.html.heex @@ -0,0 +1,86 @@ +

+ User Bans +

+<% route = fn p -> ~p"/admin/user_bans?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @user_bans, route: route, params: page_params(@conn.params)) %> +<%= form_for :user_ban, ~p"/admin/user_bans", [method: "get", class: "hform"], fn f -> %> +
+ <%= text_input(f, :q, name: "q", class: "hform__text input", placeholder: "Search") %> + <%= submit("Search", class: "button hform__button") %> +
+<% end %> +
+
+ + + New user ban + + <%= pagination %> +
+
+ + + + + + + + + + + + + <%= for ban <- @user_bans do %> + + + + + + + + + <% end %> + +
+ User + + Created + + Expires + + Reason/Note + + Ban ID + + Options +
+ <%= link(ban.user.name, to: ~p"/profiles/#{ban.user}") %> + + <%= pretty_time(ban.created_at) %> + <%= user_abbrv(ban.banning_user) %> + + <%= pretty_time(ban.valid_until) %> + + <%= ban.reason %> + <%= if present?(ban.note) do %> +

+ + Note: + <%= ban.note %> + +

+ <% end %> +
+ <%= ban.generated_ban_id %> + + <%= link("Edit", to: ~p"/admin/user_bans/#{ban}/edit") %> + <%= if @current_user.role == "admin" do %> + • + <%= link("Destroy", to: ~p"/admin/user_bans/#{ban}", data: [confirm: "Are you really, really sure?", method: "delete"]) %> + <% end %> +
+
+
+ <%= pagination %> +
+
diff --git a/lib/philomena_web/templates/admin/user_ban/index.html.slime b/lib/philomena_web/templates/admin/user_ban/index.html.slime deleted file mode 100644 index 5b60fc21..00000000 --- a/lib/philomena_web/templates/admin/user_ban/index.html.slime +++ /dev/null @@ -1,62 +0,0 @@ -h1 User Bans - -- route = fn p -> ~p"/admin/user_bans?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @user_bans, route: route, params: page_params(@conn.params) - -= form_for :user_ban, ~p"/admin/user_bans", [method: "get", class: "hform"], fn f -> - .field - = text_input f, :q, name: "q", class: "hform__text input", placeholder: "Search" - = submit "Search", class: "button hform__button" - -.block - .block__header - a href=~p"/admin/user_bans/new" - i.fa.fa-plus> - ' New user ban - - = pagination - - .block__content - table.table - thead - tr - th User - th Created - th Expires - th Reason/Note - th Ban ID - th Options - - tbody - = for ban <- @user_bans do - tr - td - = link ban.user.name, to: ~p"/profiles/#{ban.user}" - - td - => pretty_time ban.created_at - = user_abbrv ban.banning_user - - td class=ban_row_class(ban) - = pretty_time ban.valid_until - - td - = ban.reason - - = if present?(ban.note) do - p.block.block--fixed - em - ' Note: - = ban.note - - td - = ban.generated_ban_id - - td - => link "Edit", to: ~p"/admin/user_bans/#{ban}/edit" - = if @current_user.role == "admin" do - ' • - => link "Destroy", to: ~p"/admin/user_bans/#{ban}", data: [confirm: "Are you really, really sure?", method: "delete"] - - .block__header.block__header--light - = pagination diff --git a/lib/philomena_web/templates/admin/user_ban/new.html.heex b/lib/philomena_web/templates/admin/user_ban/new.html.heex new file mode 100644 index 00000000..7c721c20 --- /dev/null +++ b/lib/philomena_web/templates/admin/user_ban/new.html.heex @@ -0,0 +1,6 @@ +

+ New User Ban +

+<%= render(PhilomenaWeb.Admin.UserBanView, "_form.html", changeset: @changeset, action: ~p"/admin/user_bans", conn: @conn) %> +
+<%= link("Back", to: ~p"/admin/user_bans") %> diff --git a/lib/philomena_web/templates/admin/user_ban/new.html.slime b/lib/philomena_web/templates/admin/user_ban/new.html.slime deleted file mode 100644 index cdd82ff8..00000000 --- a/lib/philomena_web/templates/admin/user_ban/new.html.slime +++ /dev/null @@ -1,5 +0,0 @@ -h1 New User Ban -= render PhilomenaWeb.Admin.UserBanView, "_form.html", changeset: @changeset, action: ~p"/admin/user_bans", conn: @conn - -br -= link "Back", to: ~p"/admin/user_bans" diff --git a/lib/philomena_web/templates/advert/_box.html.heex b/lib/philomena_web/templates/advert/_box.html.heex new file mode 100644 index 00000000..822f92ef --- /dev/null +++ b/lib/philomena_web/templates/advert/_box.html.heex @@ -0,0 +1,17 @@ +
+
+ Interested in advertising on Derpibooru? + <%= link("Click here", to: "/pages/advertising") %> + for information! +
+ + {@advert.title} + +

+ + Derpibooru costs over $25 a day to operate - + <%= link("help support us financially", to: "/pages/donations") %> + ! + +

+
diff --git a/lib/philomena_web/templates/advert/_box.html.slime b/lib/philomena_web/templates/advert/_box.html.slime deleted file mode 100644 index 0193d67c..00000000 --- a/lib/philomena_web/templates/advert/_box.html.slime +++ /dev/null @@ -1,14 +0,0 @@ -.block#imagespns - .spnstxt - ' Interested in advertising on Derpibooru? - => link "Click here", to: "/pages/advertising" - ' for information! - - a#imagespns__link href=~p"/adverts/#{@advert}" rel="nofollow" title=@advert.title - img src=advert_image_url(@advert) alt=@advert.title - - p - strong - ' Derpibooru costs over $25 a day to operate - - = link "help support us financially", to: "/pages/donations" - ' ! diff --git a/lib/philomena_web/templates/avatar/edit.html.heex b/lib/philomena_web/templates/avatar/edit.html.heex new file mode 100644 index 00000000..a3f1d65d --- /dev/null +++ b/lib/philomena_web/templates/avatar/edit.html.heex @@ -0,0 +1,61 @@ +
+
+ <%= render(PhilomenaWeb.UserAttributionView, "_user_avatar.html", object: %{user: @current_user}, conn: @conn) %> +
+ +
diff --git a/lib/philomena_web/templates/avatar/edit.html.slime b/lib/philomena_web/templates/avatar/edit.html.slime deleted file mode 100644 index 3ee56baf..00000000 --- a/lib/philomena_web/templates/avatar/edit.html.slime +++ /dev/null @@ -1,46 +0,0 @@ -.profile-top - .profile-top__avatar - = render PhilomenaWeb.UserAttributionView, "_user_avatar.html", object: %{user: @current_user}, conn: @conn - .profile-top__name-and-links - div - h1 Your avatar - - p Add a new avatar or remove your existing one here. - p Avatars must be less than 1000px tall and wide, and smaller than 300 kilobytes in size. PNG, JPEG, and GIF are acceptable. - - = form_for @changeset, ~p"/avatar", [method: "put", multipart: true], fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - / todo: extract this - h4 Select an image - .image-other - #js-image-upload-previews - p Upload a file from your computer, or provide a link to the page containing the image and click Fetch. - .field - = file_input f, :avatar, class: "input js-scraper" - = error_tag f, :avatar_size - = error_tag f, :avatar_width - = error_tag f, :avatar_height - = error_tag f, :avatar_mime_type - - .field.field--inline - = url_input f, :scraper_url, class: "input input--wide js-scraper", placeholder: "Link a deviantART page, a Tumblr post, or the image directly" - button.button.button--separate-left#js-scraper-preview(type="button" title="Fetch the image at the specified URL" data-disable-with="Fetch" disabled) - ' Fetch - - .field-error-js.hidden.js-scraper - - br - - => submit "Update my avatar", class: "button" - - br - = button_to "Remove my avatar", ~p"/avatar", method: "delete", class: "button", data: [confirm: "Are you really, really sure?"] - - br - = if blank?(@conn.params["profile"]) do - = link "Back", to: ~p"/registrations/edit" - - else - = link "Back", to: ~p"/profiles/#{@current_user}" diff --git a/lib/philomena_web/templates/ban/_ban_reason.html.heex b/lib/philomena_web/templates/ban/_ban_reason.html.heex new file mode 100644 index 00000000..416c0dd4 --- /dev/null +++ b/lib/philomena_web/templates/ban/_ban_reason.html.heex @@ -0,0 +1,20 @@ +
+

+ You've been banned! +

+

+ You cannot create comments or posts or update metadata (or do anything but read, really) until + <%= pretty_time(@conn.assigns.current_ban.valid_until) %> + . +

+

+ The reason given by the administrator who banned you is: +
+ + <%= @conn.assigns.current_ban.reason %> + + (Ban ID: + <%= @conn.assigns.current_ban.generated_ban_id %> + ). +

+
diff --git a/lib/philomena_web/templates/ban/_ban_reason.html.slime b/lib/philomena_web/templates/ban/_ban_reason.html.slime deleted file mode 100644 index 2537bc2e..00000000 --- a/lib/philomena_web/templates/ban/_ban_reason.html.slime +++ /dev/null @@ -1,16 +0,0 @@ -.block.block--fixed.block--warning - h4 - ' You've been banned! - p - ' You cannot create comments or posts or update metadata (or do anything but read, really) until - = pretty_time @conn.assigns.current_ban.valid_until - ' . - - p - ' The reason given by the administrator who banned you is: - br - strong> - = @conn.assigns.current_ban.reason - ' (Ban ID: - = @conn.assigns.current_ban.generated_ban_id - ' ). diff --git a/lib/philomena_web/templates/ban/_bans.html.heex b/lib/philomena_web/templates/ban/_bans.html.heex new file mode 100644 index 00000000..5e580729 --- /dev/null +++ b/lib/philomena_web/templates/ban/_bans.html.heex @@ -0,0 +1,54 @@ + + + + + + + + + + + + + <%= for b <- @bans do %> + + + + + <%= if active?(b) do %> + + <% else %> + + <% end %> + + + + <% end %> + +
+ Ban Enacted + + Ban Expires + + Duration + + Active? + + Reason + + Ban ID +
+ <%= pretty_time(b.created_at) %> + + <%= pretty_time(b.valid_until) %> + + <%= distance_of_time_in_words(b.created_at, b.valid_until) %> + + Yes + + No + + <%= b.reason %> + + <%= b.generated_ban_id %> +
diff --git a/lib/philomena_web/templates/ban/_bans.html.slime b/lib/philomena_web/templates/ban/_bans.html.slime deleted file mode 100644 index 62a694cb..00000000 --- a/lib/philomena_web/templates/ban/_bans.html.slime +++ /dev/null @@ -1,21 +0,0 @@ -table.table - thead - tr - th Ban Enacted - th Ban Expires - th.hide-mobile Duration - th Active? - th Reason - th Ban ID - tbody - = for b <- @bans do - tr - td = pretty_time b.created_at - td = pretty_time b.valid_until - td.hide-mobile = distance_of_time_in_words b.created_at, b.valid_until - = if active?(b) do - td.success Yes - - else - td.danger No - td = b.reason - td = b.generated_ban_id diff --git a/lib/philomena_web/templates/captcha/_captcha.html.heex b/lib/philomena_web/templates/captcha/_captcha.html.heex new file mode 100644 index 00000000..7c26c476 --- /dev/null +++ b/lib/philomena_web/templates/captcha/_captcha.html.heex @@ -0,0 +1,9 @@ +<%= if is_nil(@conn.assigns.current_user) do %> + <% challenge = challenge_name(@name) %> +
+
+ <%= checkbox(:captcha, challenge, class: "js-captcha", value: 0, autocomplete: "off", data: [sitekey: hcaptcha_site_key()]) %> + <%= label(:captcha, challenge, "I am not a robot!") %> +
+
+<% end %> diff --git a/lib/philomena_web/templates/captcha/_captcha.html.slime b/lib/philomena_web/templates/captcha/_captcha.html.slime deleted file mode 100644 index 87c92fc4..00000000 --- a/lib/philomena_web/templates/captcha/_captcha.html.slime +++ /dev/null @@ -1,8 +0,0 @@ -= if is_nil(@conn.assigns.current_user) do - - challenge = challenge_name(@name) - - .field.js-captcha-box - br - => checkbox :captcha, challenge, class: "js-captcha", value: 0, autocomplete: "off", data: [sitekey: hcaptcha_site_key()] - = label :captcha, challenge, "I am not a robot!" - br diff --git a/lib/philomena_web/templates/channel/_channel_box.html.heex b/lib/philomena_web/templates/channel/_channel_box.html.heex new file mode 100644 index 00000000..e0d2d8b6 --- /dev/null +++ b/lib/philomena_web/templates/channel/_channel_box.html.heex @@ -0,0 +1,56 @@ +<% link_class = "media-box__header media-box__header--channel media-box__header--link" %> +
+ + <%= @channel.title || @channel.short_name %> + +
+ <%= if @channel.is_live do %> +
+ + LIVE NOW + +
+ <%= @channel.viewers %> + <%= pluralize("viewer", "viewers", @channel.viewers) %> + <% else %> +
+ + OFF AIR + +
+ <% end %> +
+ <%= if @channel.nsfw do %> +
+ NSFW +
+ <% end %> +
+ +
+ {@channel.title} +
+
+
+ <%= if @channel.associated_artist_tag do %> + + + <%= @channel.associated_artist_tag.name %> + + <% else %> +
+ No artist tag +
+ <% end %> + <%= if can?(@conn, :edit, @channel) do %> + + + Edit + + + + Delete + + <% end %> + <%= render(PhilomenaWeb.Channel.SubscriptionView, "_subscription.html", conn: @conn, watching: @subscriptions[@channel.id], channel: @channel) %> +
diff --git a/lib/philomena_web/templates/channel/_channel_box.html.slime b/lib/philomena_web/templates/channel/_channel_box.html.slime deleted file mode 100644 index 5182f56c..00000000 --- a/lib/philomena_web/templates/channel/_channel_box.html.slime +++ /dev/null @@ -1,39 +0,0 @@ -- link_class = "media-box__header media-box__header--channel media-box__header--link" - -.media-box - a.media-box__header.media-box__header--channel.media-box__header--link href=~p"/channels/#{@channel}" title=@channel.title - = @channel.title || @channel.short_name - - .media-box__header.media-box__header--channel - = if @channel.is_live do - .spacing-right.label.label--success.label--block.label--small: strong LIVE NOW - => @channel.viewers - => pluralize "viewer", "viewers", @channel.viewers - - else - .label.label--danger.label--block.label--small: strong OFF AIR - - = if @channel.nsfw do - .media-box__overlay - | NSFW - - .media-box__content.media-box__content--channel - a href=~p"/channels/#{@channel}" - .image-constrained.media-box__content--channel - img src=channel_image(@channel) alt="#{@channel.title}" - - = if @channel.associated_artist_tag do - a href=~p"/tags/#{@channel.associated_artist_tag}" class=link_class - i.fa.fa-fw.fa-tags> - = @channel.associated_artist_tag.name - - else - .media-box__header.media-box__header--channel No artist tag - - = if can?(@conn, :edit, @channel) do - a href=~p"/channels/#{@channel}/edit" class=link_class - i.fas.fa-fw.fa-edit> - ' Edit - a href=~p"/channels/#{@channel}" class=link_class data-method="delete" data-confirm="Are you really, really sure?" - i.fas.fa-fw.fa-trash> - ' Delete - - = render PhilomenaWeb.Channel.SubscriptionView, "_subscription.html", conn: @conn, watching: @subscriptions[@channel.id], channel: @channel diff --git a/lib/philomena_web/templates/channel/_form.html.heex b/lib/philomena_web/templates/channel/_form.html.heex new file mode 100644 index 00000000..c486a214 --- /dev/null +++ b/lib/philomena_web/templates/channel/_form.html.heex @@ -0,0 +1,52 @@ +<%= form_for @changeset, @action, fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+ The short name of + + https://picarto.tv/ + + picarto_channel_name + + + is + + picarto_channel_name + + . +
+
+ The short name of + + https://piczel.tv/watch/ + + piczel_channel_name + + + is + + piczel_channel_name + + . +
+
+
+
+ <%= label(f, :short_name, "Short name") %> + <%= text_input(f, :short_name, class: "input", placeholder: "Short name", required: true) %> +
+
+ <%= label(f, :type, "Type") %> + <%= select(f, :type, ["PicartoChannel", "PiczelChannel"], class: "input") %> +
+
+ <%= label(f, :artist_tag, "Artist tag") %> + <%= text_input(f, :artist_tag, class: "input", placeholder: "Artist tag") %> +
+ <%= submit("Save", class: "button") %> +<% end %> diff --git a/lib/philomena_web/templates/channel/_form.html.slime b/lib/philomena_web/templates/channel/_form.html.slime deleted file mode 100644 index 6cbb43d1..00000000 --- a/lib/philomena_web/templates/channel/_form.html.slime +++ /dev/null @@ -1,37 +0,0 @@ -= form_for @changeset, @action, fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .fieldlabel - ' The short name of - code> - | https://picarto.tv/ - em picarto_channel_name - ' is - code picarto_channel_name - ' . - .fieldlabel - ' The short name of - code> - | https://piczel.tv/watch/ - em piczel_channel_name - ' is - code piczel_channel_name - ' . - br - br - - .field - => label f, :short_name, "Short name" - = text_input f, :short_name, class: "input", placeholder: "Short name", required: true - - .field - => label f, :type, "Type" - = select f, :type, ["PicartoChannel", "PiczelChannel"], class: "input" - - .field - => label f, :artist_tag, "Artist tag" - = text_input f, :artist_tag, class: "input", placeholder: "Artist tag" - - = submit "Save", class: "button" diff --git a/lib/philomena_web/templates/channel/edit.html.heex b/lib/philomena_web/templates/channel/edit.html.heex new file mode 100644 index 00000000..beeba0a3 --- /dev/null +++ b/lib/philomena_web/templates/channel/edit.html.heex @@ -0,0 +1,4 @@ +

+ Editing Channel +

+<%= render(PhilomenaWeb.ChannelView, "_form.html", changeset: @changeset, action: ~p"/channels/#{@channel}", conn: @conn) %> diff --git a/lib/philomena_web/templates/channel/edit.html.slime b/lib/philomena_web/templates/channel/edit.html.slime deleted file mode 100644 index 6eb25d31..00000000 --- a/lib/philomena_web/templates/channel/edit.html.slime +++ /dev/null @@ -1,3 +0,0 @@ -h1 Editing Channel - -= render PhilomenaWeb.ChannelView, "_form.html", changeset: @changeset, action: ~p"/channels/#{@channel}", conn: @conn diff --git a/lib/philomena_web/templates/channel/index.html.heex b/lib/philomena_web/templates/channel/index.html.heex new file mode 100644 index 00000000..6f98a666 --- /dev/null +++ b/lib/philomena_web/templates/channel/index.html.heex @@ -0,0 +1,59 @@ +

+ Livestreams +

+<% route = fn p -> ~p"/channels?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @channels, route: route, conn: @conn, params: [cq: @conn.params["cq"]]) %> +<%= form_for :channels, ~p"/channels", [method: "get", class: "hform", enforce_utf8: false], fn f -> %> +
+ <%= text_input(f, :cq, name: :cq, value: @conn.params["cq"], class: "input hform__text", placeholder: "Search channels", autocapitalize: "none") %> + <%= submit("Search", class: "hform__button button") %> +
+<% end %> +
+ +
+ <%= for channel <- @channels do %> + <%= render(PhilomenaWeb.ChannelView, "_channel_box.html", channel: channel, conn: @conn, subscriptions: @subscriptions) %> + <% end %> +
+ +
+
+<%= if can?(@conn, :create, Philomena.Channels.Channel) do %> + <%= link("New Channel", to: ~p"/channels/new") %> +<% end %> +

+ FAQ +

+

+ + Q: Do you host streams? + + A: No, we cheat and just link to streams on Picarto since that's where (almost) everyone is already. This is simply a nice way to track streaming artists. +

+

+ + Q: How do I get my stream/a friend's stream/<artist>'s stream here? + + A: Send a private message to a site administrator + with a link to the stream and the artist tag if applicable. +

diff --git a/lib/philomena_web/templates/channel/index.html.slime b/lib/philomena_web/templates/channel/index.html.slime deleted file mode 100644 index 50b0bbaa..00000000 --- a/lib/philomena_web/templates/channel/index.html.slime +++ /dev/null @@ -1,42 +0,0 @@ -h1 Livestreams - -- route = fn p -> ~p"/channels?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @channels, route: route, conn: @conn, params: [cq: @conn.params["cq"]] - -= form_for :channels, ~p"/channels", [method: "get", class: "hform", enforce_utf8: false], fn f -> - .field - = text_input f, :cq, name: :cq, value: @conn.params["cq"], class: "input hform__text", placeholder: "Search channels", autocapitalize: "none" - = submit "Search", class: "hform__button button" - -.block - .block__header.page__header - .page__pagination = pagination - - = if @conn.cookies["chan_nsfw"] == "true" do - a href=~p"/channels/nsfw" data-method="delete" - i.fa.fa-eye-slash> - ' Hide NSFW streams - - else - a href=~p"/channels/nsfw" data-method="create" - i.fa.fa-eye> - ' Show NSFW streams - - .block__content - = for channel <- @channels do - = render PhilomenaWeb.ChannelView, "_channel_box.html", channel: channel, conn: @conn, subscriptions: @subscriptions - - .block__header.page__header - .page__pagination = pagination - -br -= if can?(@conn, :create, Philomena.Channels.Channel) do - = link "New Channel", to: ~p"/channels/new" - -h2 FAQ -p - strong> Q: Do you host streams? - | A: No, we cheat and just link to streams on Picarto since that's where (almost) everyone is already. This is simply a nice way to track streaming artists. -p - strong> Q: How do I get my stream/a friend's stream/<artist>'s stream here? - ' A: Send a private message to a site administrator - ' with a link to the stream and the artist tag if applicable. diff --git a/lib/philomena_web/templates/channel/new.html.heex b/lib/philomena_web/templates/channel/new.html.heex new file mode 100644 index 00000000..96faca37 --- /dev/null +++ b/lib/philomena_web/templates/channel/new.html.heex @@ -0,0 +1,4 @@ +

+ Adding Channel +

+<%= render(PhilomenaWeb.ChannelView, "_form.html", changeset: @changeset, action: ~p"/channels", conn: @conn) %> diff --git a/lib/philomena_web/templates/channel/new.html.slime b/lib/philomena_web/templates/channel/new.html.slime deleted file mode 100644 index a7361ef7..00000000 --- a/lib/philomena_web/templates/channel/new.html.slime +++ /dev/null @@ -1,3 +0,0 @@ -h1 Adding Channel - -= render PhilomenaWeb.ChannelView, "_form.html", changeset: @changeset, action: ~p"/channels", conn: @conn diff --git a/lib/philomena_web/templates/channel/subscription/_error.html.heex b/lib/philomena_web/templates/channel/subscription/_error.html.heex new file mode 100644 index 00000000..74b8d64e --- /dev/null +++ b/lib/philomena_web/templates/channel/subscription/_error.html.heex @@ -0,0 +1,3 @@ +
+ Error! +
diff --git a/lib/philomena_web/templates/channel/subscription/_error.html.slime b/lib/philomena_web/templates/channel/subscription/_error.html.slime deleted file mode 100644 index dd079424..00000000 --- a/lib/philomena_web/templates/channel/subscription/_error.html.slime +++ /dev/null @@ -1,2 +0,0 @@ -.js-subscription-target - ' Error! diff --git a/lib/philomena_web/templates/channel/subscription/_subscription.html.heex b/lib/philomena_web/templates/channel/subscription/_subscription.html.heex new file mode 100644 index 00000000..f3740d08 --- /dev/null +++ b/lib/philomena_web/templates/channel/subscription/_subscription.html.heex @@ -0,0 +1,42 @@ +<% + watch_path = ~p"/channels/#{@channel}/subscription" + + watch_class = + if @watching do + "hidden" + else + "" + end + + unwatch_path = ~p"/channels/#{@channel}/subscription" + + unwatch_class = + if @watching do + "" + else + "hidden" + end +%> +<%= if @conn.assigns.current_user do %> + + + + + Subscribe + + + + + + Unsubscribe + + + +<% else %> + + + + Subscribe + + +<% end %> diff --git a/lib/philomena_web/templates/channel/subscription/_subscription.html.slime b/lib/philomena_web/templates/channel/subscription/_subscription.html.slime deleted file mode 100644 index b0fdd6e3..00000000 --- a/lib/philomena_web/templates/channel/subscription/_subscription.html.slime +++ /dev/null @@ -1,23 +0,0 @@ -elixir: - watch_path = ~p"/channels/#{@channel}/subscription" - watch_class = if @watching, do: "hidden", else: "" - - unwatch_path = ~p"/channels/#{@channel}/subscription" - unwatch_class = if @watching, do: "", else: "hidden" - -= if @conn.assigns.current_user do - span.js-subscription-target - a.js-subscription-link.media-box__header.media-box__header--channel.media-box__header--link href=watch_path class=watch_class data-remote="true" data-method="post" - i.fa.fa-bell> - span.hide-mobile - ' Subscribe - - a.js-subscription-link.media-box__header.media-box__header--channel.media-box__header--link href=unwatch_path class=unwatch_class data-remote="true" data-method="delete" - i.fa.fa-bell-slash> - span.hide-mobile - ' Unsubscribe -- else - a.media-box__header.media-box__header--channel.media-box__header--link href=~p"/sessions/new" - i.fa.fa-bell> - span.hide-mobile - ' Subscribe diff --git a/lib/philomena_web/templates/comment/_comment.html.heex b/lib/philomena_web/templates/comment/_comment.html.heex new file mode 100644 index 00000000..8b59b888 --- /dev/null +++ b/lib/philomena_web/templates/comment/_comment.html.heex @@ -0,0 +1,112 @@ +
+ <%= if not @comment.approved and not @comment.hidden_from_users and (can?(@conn, :hide, @comment) or @comment.user_id == @conn.assigns.current_user.id) do %> +
+
+

+ + This comment is pending approval from a staff member. +

+ <%= if can?(@conn, :approve, @comment) do %> +

+

    +
  • + <%= link(to: ~p"/images/#{@comment.image_id}/comments/#{@comment}/approve", data: [confirm: "Are you sure?"], method: "post", class: "button") do %> + + Approve + <% end %> +
  • +
  • + + + Reject + +
  • +
+ <%= form_for :comment, ~p"/images/#{@comment.image_id}/comments/#{@comment}/hide", [class: "togglable-delete-form hidden flex", id: "inline-reject-form-comment-#{@comment.id}"], fn f -> %> + <%= text_input(f, :deletion_reason, class: "input input--wide", placeholder: "Deletion Reason", id: "inline-reject-reason-comment-#{@comment.id}", required: true) %> + <%= submit("Delete", class: "button") %> + <% end %> +

+ <% end %> +
+
+ <% end %> +
+
+ <%= render(PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @comment, conn: @conn) %> +
+
+ + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @comment, awards: true, conn: @conn) %> + +
+ <%= render(PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @comment, conn: @conn) %> +
+ <%= if @comment.hidden_from_users do %> + + Deletion reason: + <%= @comment.deletion_reason %> + <%= if can?(@conn, :hide, @comment) and not is_nil(@comment.deleted_by) do %> + ( + <%= @comment.deleted_by.name %> + ) + <% end %> + + <%= if can?(@conn, :hide, @comment) do %> + <%= if @comment.destroyed_content do %> +
+ + This comment's contents have been destroyed. + + <% else %> +
+ <%= @body %> + <% end %> + <% end %> + <% else %> + <%= @body %> + <% end %> +
+
+
+
+
+ <%= render(PhilomenaWeb.CommentView, "_comment_options.html", comment: @comment, conn: @conn) %> +
+ <%= if can?(@conn, :hide, @comment) do %> +
+ <%= cond do %> + <% @comment.hidden_from_users and not @comment.destroyed_content -> %> + <%= link(to: ~p"/images/#{@comment.image_id}/comments/#{@comment}/hide", data: [confirm: "Are you sure?"], method: "delete", class: "communication__interaction") do %> + + Restore + <% end %> + <%= if can?(@conn, :delete, @comment) do %> + <%= link(to: ~p"/images/#{@comment.image_id}/comments/#{@comment}/delete", data: [confirm: "Are you sure?"], method: "post", class: "communication__interaction") do %> + + Delete Contents + <% end %> + <% end %> + <% not @comment.hidden_from_users and not @comment.destroyed_content -> %> + + + Delete + + <% true -> %> + <% end %> + <%= if can?(@conn, :show, :ip_address) do %> +
+ <%= link_to_ip(@conn, @comment.ip) %> +
+
+ <%= link_to_fingerprint(@conn, @comment.fingerprint) %> +
+ <% end %> + <%= form_for :comment, ~p"/images/#{@comment.image_id}/comments/#{@comment}/hide", [class: "togglable-delete-form hidden flex", id: "inline-del-form-comment-#{@comment.id}"], fn f -> %> + <%= text_input(f, :deletion_reason, class: "input input--wide", placeholder: "Deletion Reason", id: "inline-del-reason-comment-#{@comment.id}", required: true) %> + <%= submit("Delete", class: "button") %> + <% end %> +
+ <% end %> +
+
diff --git a/lib/philomena_web/templates/comment/_comment.html.slime b/lib/philomena_web/templates/comment/_comment.html.slime deleted file mode 100644 index 1ec574dd..00000000 --- a/lib/philomena_web/templates/comment/_comment.html.slime +++ /dev/null @@ -1,85 +0,0 @@ -article.block.communication id="comment_#{@comment.id}" - = if not @comment.approved and not @comment.hidden_from_users and (can?(@conn, :hide, @comment) or @comment.user_id == @conn.assigns.current_user.id) do - .block__content - .block.block--fixed.block--danger - p - i.fas.fa-exclamation-triangle> - ' This comment is pending approval from a staff member. - = if can?(@conn, :approve, @comment) do - p - ul.horizontal-list - li - = link(to: ~p"/images/#{@comment.image_id}/comments/#{@comment}/approve", data: [confirm: "Are you sure?"], method: "post", class: "button") do - i.fas.fa-check> - ' Approve - li - a.button.togglable-delete-form-link href="#" data-click-toggle="#inline-reject-form-comment-#{@comment.id}" - i.fa.fa-times> - ' Reject - - = form_for :comment, ~p"/images/#{@comment.image_id}/comments/#{@comment}/hide", [class: "togglable-delete-form hidden flex", id: "inline-reject-form-comment-#{@comment.id}"], fn f -> - = text_input f, :deletion_reason, class: "input input--wide", placeholder: "Deletion Reason", id: "inline-reject-reason-comment-#{@comment.id}", required: true - = submit "Delete", class: "button" - - .block__content.flex.flex--no-wrap class=communication_body_class(@comment) - .flex__fixed.spacing-right - = render PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @comment, conn: @conn - .flex__grow.communication__body - span.communication__body__sender-name = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @comment, awards: true, conn: @conn - br - = render PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @comment, conn: @conn - .communication__body__text - = if @comment.hidden_from_users do - strong.comment_deleted - ' Deletion reason: - =<> @comment.deletion_reason - = if can?(@conn, :hide, @comment) and not is_nil(@comment.deleted_by) do - | ( - = @comment.deleted_by.name - | ) - - = if can?(@conn, :hide, @comment) do - = if @comment.destroyed_content do - br - strong.comment_deleted> - | This comment's contents have been destroyed. - - else - br - =<> @body - - - else - =<> @body - - .block__content.communication__options - .flex.flex--wrap.flex--spaced-out - = render PhilomenaWeb.CommentView, "_comment_options.html", comment: @comment, conn: @conn - - = if can?(@conn, :hide, @comment) do - .js-staff-action - = cond do - - @comment.hidden_from_users and not @comment.destroyed_content -> - = link(to: ~p"/images/#{@comment.image_id}/comments/#{@comment}/hide", data: [confirm: "Are you sure?"], method: "delete", class: "communication__interaction") do - i.fas.fa-check> - ' Restore - - = if can?(@conn, :delete, @comment) do - = link(to: ~p"/images/#{@comment.image_id}/comments/#{@comment}/delete", data: [confirm: "Are you sure?"], method: "post", class: "communication__interaction") do - i.fas.fa-times> - ' Delete Contents - - - not @comment.hidden_from_users and not @comment.destroyed_content -> - a.communication__interaction.togglable-delete-form-link href="#" data-click-toggle="#inline-del-form-comment-#{@comment.id}" - i.fas.fa-times> - ' Delete - - - true -> - - = if can?(@conn, :show, :ip_address) do - .communication__info.js-staff-action - =<> link_to_ip(@conn, @comment.ip) - .communication__info.js-staff-action - =<> link_to_fingerprint(@conn, @comment.fingerprint) - - = form_for :comment, ~p"/images/#{@comment.image_id}/comments/#{@comment}/hide", [class: "togglable-delete-form hidden flex", id: "inline-del-form-comment-#{@comment.id}"], fn f -> - = text_input f, :deletion_reason, class: "input input--wide", placeholder: "Deletion Reason", id: "inline-del-reason-comment-#{@comment.id}", required: true - = submit "Delete", class: "button" diff --git a/lib/philomena_web/templates/comment/_comment_options.html.heex b/lib/philomena_web/templates/comment/_comment_options.html.heex new file mode 100644 index 00000000..aa128dd5 --- /dev/null +++ b/lib/philomena_web/templates/comment/_comment_options.html.heex @@ -0,0 +1,53 @@ +
+ Posted + <%= pretty_time(@comment.created_at) %> + + + Report + + <%= if not is_nil(@comment.edited_at) and can?(@conn, :show, @comment) do %> +
+ + Edited + <%= pretty_time(@comment.edited_at) %> + <%= if @comment.edit_reason not in [nil, ""] do %> + because: + <%= @comment.edit_reason %> + <% end %> + + <% end %> +
+
+ <% link_path = ~p"/images/#{@comment.image}" <> "#comment_#{@comment.id}" %> + <% safe_author = PhilomenaWeb.PostView.markdown_safe_author(@comment) %> + <% + quote_body = + if @comment.hidden_from_users do + "" + else + @comment.body + end + %> + + + Link + + + + Quote + + + + Reply + + <%= if can?(@conn, :edit, @comment) do %> + + + + + Edit + + + + <% end %> +
diff --git a/lib/philomena_web/templates/comment/_comment_options.html.slime b/lib/philomena_web/templates/comment/_comment_options.html.slime deleted file mode 100644 index 36167c77..00000000 --- a/lib/philomena_web/templates/comment/_comment_options.html.slime +++ /dev/null @@ -1,41 +0,0 @@ -div - ' Posted - => pretty_time(@comment.created_at) - - a.communication__interaction href=~p"/images/#{@comment.image}/comments/#{@comment}/reports/new" - i.fa.fa-flag> - ' Report - - = if not is_nil(@comment.edited_at) and can?(@conn, :show, @comment) do - br - a href=~p"/images/#{@comment.image}/comments/#{@comment}/history" - ' Edited - => pretty_time(@comment.edited_at) - - = if @comment.edit_reason not in [nil, ""] do - ' because: - => @comment.edit_reason - -div - - link_path = ~p"/images/#{@comment.image}" <> "#comment_#{@comment.id}" - - safe_author = PhilomenaWeb.PostView.markdown_safe_author(@comment) - - quote_body = if @comment.hidden_from_users, do: "", else: @comment.body - - a.communication__interaction title="Link to comment" href=link_path - i.fa.fa-link> - ' Link - - a.communication__interaction.post-reply.post-reply-quote href=link_path data-reply-url=link_path data-author=safe_author data-post=quote_body - i.fa.fa-quote-right> - ' Quote - - a.communication__interaction.post-reply href=link_path data-reply-url=link_path data-author=safe_author - i.fa.fa-reply> - ' Reply - - = if can?(@conn, :edit, @comment) do - span.owner-options - strong - a.communication__interaction href=~p"/images/#{@comment.image}/comments/#{@comment}/edit" - i.fas.fa-edit> - ' Edit diff --git a/lib/philomena_web/templates/comment/_comment_with_image.html.heex b/lib/philomena_web/templates/comment/_comment_with_image.html.heex new file mode 100644 index 00000000..019ddc6f --- /dev/null +++ b/lib/philomena_web/templates/comment/_comment_with_image.html.heex @@ -0,0 +1,82 @@ +
+
+
+
+ <%= render(PhilomenaWeb.ImageView, "_image_container.html", image: @comment.image, size: :thumb_tiny, conn: @conn) %> +
+
+
+ + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @comment, awards: true, conn: @conn) %> + +
+ <%= render(PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @comment, conn: @conn) %> +
+ <%= if @comment.hidden_from_users do %> + + Deletion reason: + <%= @comment.deletion_reason %> + <%= if can?(@conn, :hide, @comment) and not is_nil(@comment.deleted_by) do %> + ( + <%= @comment.deleted_by.name %> + ) + <% end %> + + <%= if can?(@conn, :hide, @comment) do %> + <%= if @comment.destroyed_content do %> +
+ + This comment's contents have been destroyed. + + <% else %> +
+ <%= @body %> + <% end %> + <% end %> + <% else %> + <%= @body %> + <% end %> +
+
+
+
+
+ <%= render(PhilomenaWeb.CommentView, "_comment_options.html", comment: @comment, conn: @conn) %> +
+ <%= if can?(@conn, :hide, @comment) do %> +
+ <%= cond do %> + <% @comment.hidden_from_users and not @comment.destroyed_content -> %> + <%= link(to: ~p"/images/#{@comment.image_id}/comments/#{@comment}/hide", data: [confirm: "Are you sure?"], method: "delete", class: "communication__interaction") do %> + + Restore + <% end %> + <%= if can?(@conn, :delete, @comment) do %> + <%= link(to: ~p"/images/#{@comment.image_id}/comments/#{@comment}/delete", data: [confirm: "Are you sure?"], method: "post", class: "communication__interaction") do %> + + Delete Contents + <% end %> + <% end %> + <% not @comment.hidden_from_users and not @comment.destroyed_content -> %> + + + Delete + + <% true -> %> + <% end %> + <%= if can?(@conn, :show, :ip_address) do %> +
+ <%= link_to_ip(@conn, @comment.ip) %> +
+
+ <%= link_to_fingerprint(@conn, @comment.fingerprint) %> +
+ <% end %> + <%= form_for :comment, ~p"/images/#{@comment.image_id}/comments/#{@comment}/hide", [class: "togglable-delete-form hidden flex", id: "inline-del-form-comment-#{@comment.id}"], fn f -> %> + <%= text_input(f, :deletion_reason, class: "input input--wide", placeholder: "Deletion Reason", id: "inline-del-reason-comment-#{@comment.id}", required: true) %> + <%= submit("Delete", class: "button") %> + <% end %> +
+ <% end %> +
+
diff --git a/lib/philomena_web/templates/comment/_comment_with_image.html.slime b/lib/philomena_web/templates/comment/_comment_with_image.html.slime deleted file mode 100644 index fce128bf..00000000 --- a/lib/philomena_web/templates/comment/_comment_with_image.html.slime +++ /dev/null @@ -1,68 +0,0 @@ -article.block.communication id="comment_#{@comment.id}" - .block__content.flex.flex--no-wrap class=communication_body_class(@comment) - .flex__fixed.spacing-right - .post-image-container - = render PhilomenaWeb.ImageView, "_image_container.html", image: @comment.image, size: :thumb_tiny, conn: @conn - - .flex__grow.communication__body - span.communication__body__sender-name = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @comment, awards: true, conn: @conn - br - - = render PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @comment, conn: @conn - - .communication__body__text - = if @comment.hidden_from_users do - strong.comment_deleted - ' Deletion reason: - =<> @comment.deletion_reason - - = if can?(@conn, :hide, @comment) and not is_nil(@comment.deleted_by) do - | ( - = @comment.deleted_by.name - | ) - - = if can?(@conn, :hide, @comment) do - = if @comment.destroyed_content do - br - strong.comment_deleted> - | This comment's contents have been destroyed. - - else - br - =<> @body - - - else - =<> @body - - .block__content.communication__options - .flex.flex--wrap.flex--spaced-out - = render PhilomenaWeb.CommentView, "_comment_options.html", comment: @comment, conn: @conn - - = if can?(@conn, :hide, @comment) do - .js-staff-action - = cond do - - @comment.hidden_from_users and not @comment.destroyed_content -> - = link(to: ~p"/images/#{@comment.image_id}/comments/#{@comment}/hide", data: [confirm: "Are you sure?"], method: "delete", class: "communication__interaction") do - i.fas.fa-check> - ' Restore - - = if can?(@conn, :delete, @comment) do - = link(to: ~p"/images/#{@comment.image_id}/comments/#{@comment}/delete", data: [confirm: "Are you sure?"], method: "post", class: "communication__interaction") do - i.fas.fa-times> - ' Delete Contents - - - not @comment.hidden_from_users and not @comment.destroyed_content -> - a.communication__interaction.togglable-delete-form-link href="#" data-click-toggle="#inline-del-form-comment-#{@comment.id}" - i.fas.fa-times> - ' Delete - - - true -> - - = if can?(@conn, :show, :ip_address) do - .communication__info.js-staff-action - =<> link_to_ip(@conn, @comment.ip) - .communication__info.js-staff-action - =<> link_to_fingerprint(@conn, @comment.fingerprint) - - = form_for :comment, ~p"/images/#{@comment.image_id}/comments/#{@comment}/hide", [class: "togglable-delete-form hidden flex", id: "inline-del-form-comment-#{@comment.id}"], fn f -> - = text_input f, :deletion_reason, class: "input input--wide", placeholder: "Deletion Reason", id: "inline-del-reason-comment-#{@comment.id}", required: true - = submit "Delete", class: "button" diff --git a/lib/philomena_web/templates/comment/index.html.heex b/lib/philomena_web/templates/comment/index.html.heex new file mode 100644 index 00000000..8934719d --- /dev/null +++ b/lib/philomena_web/templates/comment/index.html.heex @@ -0,0 +1,233 @@ +

+ Comments +

+<%= form_for :comments, ~p"/comments", [method: "get", class: "hform", enforce_utf8: false], fn f -> %> +
+ <%= text_input(f, :cq, name: :cq, value: @conn.params["cq"], class: "input hform__text", placeholder: "Search comments", autocapitalize: "none") %> + <%= submit("Search", class: "hform__button button") %> +
+
+ For more information, see the + + search syntax documentation + + . Search results are sorted by creation date. +
+<% end %> +

+ Search Results +

+<%= cond do %> + <% Enum.any?(@comments) -> %> + <% route = fn p -> ~p"/comments?#{p}" end %> + <% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @comments, route: route, params: [cq: @conn.params["cq"]], conn: @conn) %> + <%= for {body, comment} <- @comments, comment.image.hidden_from_users == false do %> + <%= render(PhilomenaWeb.CommentView, "_comment_with_image.html", body: body, comment: comment, conn: @conn) %> + <% end %> +
+ +
+ <% assigns[:error] -> %> +

+ Oops, there was an error evaluating your query: +

+
+      <%= assigns[:error] %>
+    
+ <% true -> %> +

+ No comments found! +

+<% end %> +

+ Default search +

+

+ If you do not specify a field to search over, the search engine will + search for comments with a body that is similar to the query's + + word stems + + . For example, comments containing the words + + winged humanization + + , + + wings + + , and + + spread wings + + would all be found by a search for + + wing + + , but + + sewing + + would not be. +

+

+ Allowed fields +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Field Selector + + Type + + Description + + Example +
+ + author + + + Literal + + Matches the author of this comment. Anonymous authors will never match this term. + + + <%= link("author:Joey", to: ~p"/comments?#{[cq: "author:Joey"]}") %> + +
+ + body + + + Full Text + + Matches the body of this comment. This is the default field. + + + <%= link("body:test", to: ~p"/comments?#{[cq: "body:test"]}") %> + +
+ + created_at + + + Date/Time Range + + Matches the creation time of this comment. + + + <%= link("created_at:2015", to: ~p"/comments?#{[cq: "created_at:2015"]}") %> + +
+ + id + + + Numeric Range + + Matches the numeric surrogate key for this comment. + + + <%= link("id:1000000", to: ~p"/comments?#{[cq: "id:1000000"]}") %> + +
+ + image_id + + + Literal + + Matches the numeric surrogate key for the image this comment belongs to. + + + <%= link("image_id:1000000", to: ~p"/comments?#{[cq: "image_id:1000000"]}") %> + +
+ + my + + + Meta + + + my:comments + + matches comments you have posted if you are signed in. + + + <%= link("my:comments", to: ~p"/comments?#{[cq: "my:comments"]}") %> + +
+ + user_id + + + Literal + + Matches comments with the specified user_id. Anonymous users will never match this term. + + + <%= link("user_id:211190", to: ~p"/comments?#{[cq: "user_id:211190"]}") %> + +
diff --git a/lib/philomena_web/templates/comment/index.html.slime b/lib/philomena_web/templates/comment/index.html.slime deleted file mode 100644 index ae3e2eb0..00000000 --- a/lib/philomena_web/templates/comment/index.html.slime +++ /dev/null @@ -1,115 +0,0 @@ -h1 Comments - -= form_for :comments, ~p"/comments", [method: "get", class: "hform", enforce_utf8: false], fn f -> - .field - = text_input f, :cq, name: :cq, value: @conn.params["cq"], class: "input hform__text", placeholder: "Search comments", autocapitalize: "none" - = submit "Search", class: "hform__button button" - - .fieldlabel - ' For more information, see the - a href="/pages/search_syntax" search syntax documentation - ' . Search results are sorted by creation date. - -h2 Search Results - -= cond do - - Enum.any?(@comments) -> - - route = fn p -> ~p"/comments?#{p}" end - - pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @comments, route: route, params: [cq: @conn.params["cq"]], conn: @conn - - = for {body, comment} <- @comments, comment.image.hidden_from_users == false do - = render PhilomenaWeb.CommentView, "_comment_with_image.html", body: body, comment: comment, conn: @conn - - .block - .block__header.block__header--light.page__header - .page__pagination = pagination - .page__info - span.block__header__title - = render PhilomenaWeb.PaginationView, "_pagination_info.html", page: @comments, conn: @conn - - - assigns[:error] -> - p - ' Oops, there was an error evaluating your query: - pre = assigns[:error] - - - true -> - p - ' No comments found! - -h3 Default search -p - ' If you do not specify a field to search over, the search engine will - ' search for comments with a body that is similar to the query's - em word stems - ' . For example, comments containing the words - code winged humanization - ' , - code wings - ' , and - code> spread wings - ' would all be found by a search for - code wing - ' , but - code> sewing - ' would not be. - -h3 Allowed fields -table.table - thead - tr - th Field Selector - th Type - th Description - th Example - tbody - tr - td - code author - td Literal - td Matches the author of this comment. Anonymous authors will never match this term. - td - code = link "author:Joey", to: ~p"/comments?#{[cq: "author:Joey"]}" - tr - td - code body - td Full Text - td Matches the body of this comment. This is the default field. - td - code = link "body:test", to: ~p"/comments?#{[cq: "body:test"]}" - tr - td - code created_at - td Date/Time Range - td Matches the creation time of this comment. - td - code = link "created_at:2015", to: ~p"/comments?#{[cq: "created_at:2015"]}" - tr - td - code id - td Numeric Range - td Matches the numeric surrogate key for this comment. - td - code = link "id:1000000", to: ~p"/comments?#{[cq: "id:1000000"]}" - tr - td - code image_id - td Literal - td Matches the numeric surrogate key for the image this comment belongs to. - td - code = link "image_id:1000000", to: ~p"/comments?#{[cq: "image_id:1000000"]}" - tr - td - code my - td Meta - td - code> my:comments - ' matches comments you have posted if you are signed in. - td - code = link "my:comments", to: ~p"/comments?#{[cq: "my:comments"]}" - tr - td - code user_id - td Literal - td Matches comments with the specified user_id. Anonymous users will never match this term. - td - code = link "user_id:211190", to: ~p"/comments?#{[cq: "user_id:211190"]}" diff --git a/lib/philomena_web/templates/commission/_directory_results.html.heex b/lib/philomena_web/templates/commission/_directory_results.html.heex new file mode 100644 index 00000000..fc5b8506 --- /dev/null +++ b/lib/philomena_web/templates/commission/_directory_results.html.heex @@ -0,0 +1,85 @@ +<% + route = fn p -> ~p"/commissions?#{p}" end + pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @commissions, route: route, conn: @conn, params: [commission: @conn.params["commission"]]) +%> +
+ +
+ <%= cond do %> + <% Enum.any?(@commissions) -> %> + <%= for c <- @commissions do %> +
+
+
+ <%= render(PhilomenaWeb.UserAttributionView, "_user_avatar.html", object: c, conn: @conn) %> +
+
+ + <%= render(PhilomenaWeb.UserAttributionView, "_user.html", object: c, badges: true, conn: @conn) %> + +
+ <% {min, max} = Enum.min_max_by(c.items, &Decimal.to_float(&1.base_price)) %> +

+ + Price Range: + + $ + <%= Decimal.round(min.base_price, 2) |> Decimal.to_string() %> + - $ + <%= Decimal.round(max.base_price, 2) |> Decimal.to_string() %> + USD +

+

+ + Categories: + + <%= Enum.join(c.categories, ", ") %> +

+

+ + Offers: + + <%= Enum.map(c.items, & &1.item_type) |> Enum.join(", ") %> +

+

+ + Example Artwork: + +
+ <%= for item <- Enum.take_random(c.items, 5), not is_nil(item.example_image) do %> + <%= render(PhilomenaWeb.ImageView, "_image_container.html", image: item.example_image, size: :thumb_small, conn: @conn) %> + <% end %> +

+

+ + <%= link("More information", to: ~p"/profiles/#{c.user}/commission") %> + +

+
+
+
+
+ <% end %> + <% true -> %> +

+ We couldn't find any commission listings to display. Sorry! +

+ <% end %> +
+
diff --git a/lib/philomena_web/templates/commission/_directory_results.html.slime b/lib/philomena_web/templates/commission/_directory_results.html.slime deleted file mode 100644 index a5e7ed0d..00000000 --- a/lib/philomena_web/templates/commission/_directory_results.html.slime +++ /dev/null @@ -1,64 +0,0 @@ -elixir: - route = fn p -> ~p"/commissions?#{p}" end - pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @commissions, route: route, conn: @conn, params: [commission: @conn.params["commission"]] - -.block - .block__header.page__header - span.block__header__title.page__title Open Commissions - .page__pagination = pagination - .page__options - = cond do - - not is_nil(@conn.assigns.current_user) and not is_nil(@conn.assigns.current_user.commission) -> - = link "View my listing", to: ~p"/profiles/#{@conn.assigns.current_user}/commission" - - - not is_nil(@conn.assigns.current_user) -> - = link "Create my listing", to: ~p"/profiles/#{@conn.assigns.current_user}/commission/new" - - - true -> - - .block__content - = cond do - - Enum.any?(@commissions) -> - = for c <- @commissions do - .block.commission - .block__content.flex.flex--no-wrap - .flex__fixed.spacing-right - = render PhilomenaWeb.UserAttributionView, "_user_avatar.html", object: c, conn: @conn - - .flex__grow.commission__listing_body - span.commission__listing_artist - = render PhilomenaWeb.UserAttributionView, "_user.html", object: c, badges: true, conn: @conn - - .commission__listing__body_text - - {min, max} = Enum.min_max_by(c.items, &Decimal.to_float(&1.base_price)) - - p - strong> Price Range: - | $ - => Decimal.round(min.base_price, 2) |> Decimal.to_string() - | - $ - => Decimal.round(max.base_price, 2) |> Decimal.to_string() - ' USD - - p - strong> Categories: - = Enum.join(c.categories, ", ") - - p - strong> Offers: - = Enum.map(c.items, & &1.item_type) |> Enum.join(", ") - - p - strong> Example Artwork: - - br - - = for item <- Enum.take_random(c.items, 5), not is_nil(item.example_image) do - = render PhilomenaWeb.ImageView, "_image_container.html", image: item.example_image, size: :thumb_small, conn: @conn - - p - strong - = link "More information", to: ~p"/profiles/#{c.user}/commission" - - - true -> - p We couldn't find any commission listings to display. Sorry! diff --git a/lib/philomena_web/templates/commission/_directory_sidebar.html.heex b/lib/philomena_web/templates/commission/_directory_sidebar.html.heex new file mode 100644 index 00000000..bce4f942 --- /dev/null +++ b/lib/philomena_web/templates/commission/_directory_sidebar.html.heex @@ -0,0 +1,46 @@ +
+
+ + Search + +
+
+ <%= form_for @conn, ~p"/commissions", [as: :commission, method: "get", class: "hform"], fn f -> %> +
+ <%= label(f, :categories, "Art Categories:") %> +
+ <%= for {name, value} <- categories() do %> + <% checked = @conn.params["commission"]["category"] && Atom.to_string(name) in @conn.params["commission"]["category"] %> +
+ <%= checkbox(f, value, checked_value: name, checked: checked, name: "commission[category][]", class: "checkbox spacing-right", hidden_input: false) %> + <%= label(f, value, name) %> +
+ <% end %> +
+
+ <%= label(f, :item_type, "Commission Type:") %> +
+
+ <%= select(f, :item_type, types(), class: "input") %> +
+
+
+ <%= label(f, :price_min, "Price:") %> +
+
+ <%= number_input(f, :price_min, class: "input input--short", placeholder: "At Least", step: "any", min: 0) %> +
+
+ <%= number_input(f, :price_max, class: "input input--short", placeholder: "At Most", step: "any", min: 0) %> +
+
+
+ <%= label(f, :keywords, "Search:") %> +
+
+ <%= text_input(f, :keywords, class: "input input--short", placeholder: "Keywords") %> +
+ <%= submit("Search", class: "button") %> + <% end %> +
+
diff --git a/lib/philomena_web/templates/commission/_directory_sidebar.html.slime b/lib/philomena_web/templates/commission/_directory_sidebar.html.slime deleted file mode 100644 index 6bf4c0a2..00000000 --- a/lib/philomena_web/templates/commission/_directory_sidebar.html.slime +++ /dev/null @@ -1,30 +0,0 @@ -.block - .block__header - span.block__header__title Search - .block__content - = form_for @conn, ~p"/commissions", [as: :commission, method: "get", class: "hform"], fn f -> - .field = label f, :categories, "Art Categories:" - - = for {name, value} <- categories() do - - checked = @conn.params["commission"]["category"] && Atom.to_string(name) in @conn.params["commission"]["category"] - .field - => checkbox f, value, checked_value: name, checked: checked, name: "commission[category][]", class: "checkbox spacing-right", hidden_input: false - => label f, value, name - - br - - .field = label f, :item_type, "Commission Type:" - .field = select f, :item_type, types(), class: "input" - - br - - .field = label f, :price_min, "Price:" - .field = number_input f, :price_min, class: "input input--short", placeholder: "At Least", step: "any", min: 0 - .field = number_input f, :price_max, class: "input input--short", placeholder: "At Most", step: "any", min: 0 - - br - - .field = label f, :keywords, "Search:" - .field = text_input f, :keywords, class: "input input--short", placeholder: "Keywords" - - = submit "Search", class: "button" diff --git a/lib/philomena_web/templates/commission/index.html.heex b/lib/philomena_web/templates/commission/index.html.heex new file mode 100644 index 00000000..fbd885d0 --- /dev/null +++ b/lib/philomena_web/templates/commission/index.html.heex @@ -0,0 +1,26 @@ +

+ Commissions Directory +

+
+

+ Disclaimer +

+

+ This is only a directory meant to help connect artists offering + commissions with potential commissioners. We don't have any way + for users to make payments through the site, so we can't be held + responsible for any issues regarding payment. + + More info. + +

+
+
+
+
+ <%= render(PhilomenaWeb.CommissionView, "_directory_sidebar.html", conn: @conn) %> +
+
+ <%= render(PhilomenaWeb.CommissionView, "_directory_results.html", commissions: @commissions, conn: @conn) %> +
+
diff --git a/lib/philomena_web/templates/commission/index.html.slime b/lib/philomena_web/templates/commission/index.html.slime deleted file mode 100644 index 0581d86c..00000000 --- a/lib/philomena_web/templates/commission/index.html.slime +++ /dev/null @@ -1,18 +0,0 @@ -h1 Commissions Directory - -.dnp-warning - h4 Disclaimer - p - ' This is only a directory meant to help connect artists offering - ' commissions with potential commissioners. We don't have any way - ' for users to make payments through the site, so we can't be held - ' responsible for any issues regarding payment. - a href="/pages/rules#9" More info. - -br - -.column-layout - .column-layout__left - = render PhilomenaWeb.CommissionView, "_directory_sidebar.html", conn: @conn - .column-layout__main - = render PhilomenaWeb.CommissionView, "_directory_results.html", commissions: @commissions, conn: @conn \ No newline at end of file diff --git a/lib/philomena_web/templates/confirmation/new.html.heex b/lib/philomena_web/templates/confirmation/new.html.heex new file mode 100644 index 00000000..e33f80da --- /dev/null +++ b/lib/philomena_web/templates/confirmation/new.html.heex @@ -0,0 +1,12 @@ +

+ Resend confirmation instructions +

+<%= form_for :user, ~p"/confirmations", fn f -> %> +
+ <%= email_input(f, :email, placeholder: "Email", class: "input", required: true) %> +
+ <%= render(PhilomenaWeb.CaptchaView, "_captcha.html", name: "confirmation", conn: @conn) %> +
+ <%= submit("Resend confirmation instructions", class: "button") %> +
+<% end %> diff --git a/lib/philomena_web/templates/confirmation/new.html.slime b/lib/philomena_web/templates/confirmation/new.html.slime deleted file mode 100644 index 7972f595..00000000 --- a/lib/philomena_web/templates/confirmation/new.html.slime +++ /dev/null @@ -1,10 +0,0 @@ -h1 Resend confirmation instructions - -= form_for :user, ~p"/confirmations", fn f -> - .field - = email_input f, :email, placeholder: "Email", class: "input", required: true - - = render PhilomenaWeb.CaptchaView, "_captcha.html", name: "confirmation", conn: @conn - - div - = submit "Resend confirmation instructions", class: "button" diff --git a/lib/philomena_web/templates/conversation/index.html.heex b/lib/philomena_web/templates/conversation/index.html.heex new file mode 100644 index 00000000..2e8f5601 --- /dev/null +++ b/lib/philomena_web/templates/conversation/index.html.heex @@ -0,0 +1,67 @@ +<% + route = fn p -> ~p"/conversations?#{p}" end + pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @conversations, route: route, conn: @conn) +%> +

+ My Conversations +

+
+ +
+ + + + + + + + + + <%= for {c, count} <- @conversations do %> + + + + + + <% end %> + +
+ Conversation + + With + + Options +
+ <%= link(c.title, to: ~p"/conversations/#{c}") %> +
+ <%= count %> + <%= pluralize("message", "messages", count) %> + ; started + <%= pretty_time(c.created_at) %> + , last message + <%= pretty_time(c.last_message_at) %> +
+
+ <%= render(PhilomenaWeb.UserAttributionView, "_user.html", object: %{user: other_party(@current_user, c)}, conn: @conn) %> + + <%= link("Last message", to: last_message_path(c, count)) %> + • + <%= link("Hide", to: ~p"/conversations/#{c}/hide", data: [method: "post"], data: [confirm: "Are you really, really sure?"]) %> +
+
+ +
diff --git a/lib/philomena_web/templates/conversation/index.html.slime b/lib/philomena_web/templates/conversation/index.html.slime deleted file mode 100644 index 611610e0..00000000 --- a/lib/philomena_web/templates/conversation/index.html.slime +++ /dev/null @@ -1,44 +0,0 @@ -elixir: - route = fn p -> ~p"/conversations?#{p}" end - pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @conversations, route: route, conn: @conn - -h1 My Conversations -.block - .block__header.page__header - .page__pagination = pagination - - .page__info - a href=~p"/conversations/new" - i.fa.fa-paper-plane> - ' Create New Conversation - - .block__content - table.table.table--communication-list - thead - tr - th.table--communication-list__name Conversation - th.table--communication-list__stats With - th.table--communication-list__options Options - tbody - = for {c, count} <- @conversations do - tr class=conversation_class(@conn.assigns.current_user, c) - td.table--communication-list__name - => link c.title, to: ~p"/conversations/#{c}" - - .small-text.hide-mobile - => count - = pluralize("message", "messages", count) - ' ; started - = pretty_time(c.created_at) - ' , last message - = pretty_time(c.last_message_at) - - td.table--communication-list__stats - = render PhilomenaWeb.UserAttributionView, "_user.html", object: %{user: other_party(@current_user, c)}, conn: @conn - td.table--communication-list__options - => link "Last message", to: last_message_path(c, count) - ' • - => link "Hide", to: ~p"/conversations/#{c}/hide", data: [method: "post"], data: [confirm: "Are you really, really sure?"] - - .block__header.block__header--light.page__header - .page__pagination = pagination diff --git a/lib/philomena_web/templates/conversation/message/_form.html.heex b/lib/philomena_web/templates/conversation/message/_form.html.heex new file mode 100644 index 00000000..d2103a0e --- /dev/null +++ b/lib/philomena_web/templates/conversation/message/_form.html.heex @@ -0,0 +1,10 @@ +<%= form_for @changeset, ~p"/conversations/#{@conversation}/messages", fn f -> %> +
+
+ <%= render(PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, action_icon: "pencil-alt", action_text: "Reply") %> +
+
+ <%= submit("Send", class: "button", autocomplete: "off", data: [disable_with: raw("Sending…")]) %> +
+
+<% end %> diff --git a/lib/philomena_web/templates/conversation/message/_form.html.slime b/lib/philomena_web/templates/conversation/message/_form.html.slime deleted file mode 100644 index cbaec375..00000000 --- a/lib/philomena_web/templates/conversation/message/_form.html.slime +++ /dev/null @@ -1,7 +0,0 @@ -= form_for @changeset, ~p"/conversations/#{@conversation}/messages", fn f -> - .block - .communication-edit__wrap - = render PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, action_icon: "pencil-alt", action_text: "Reply" - - .block__content.communication-edit__actions - = submit "Send", class: "button", autocomplete: "off", data: [disable_with: raw("Sending…")] diff --git a/lib/philomena_web/templates/conversation/new.html.heex b/lib/philomena_web/templates/conversation/new.html.heex new file mode 100644 index 00000000..2fe65c41 --- /dev/null +++ b/lib/philomena_web/templates/conversation/new.html.heex @@ -0,0 +1,64 @@ +

+ New Conversation +

+
+
+ <%= link("Conversations", to: ~p"/conversations") %> + » + + New Conversation + +
+
+<%= case DateTime.compare(DateTime.utc_now(), DateTime.add(@conn.assigns.current_user.created_at, 1_209_600)) do %> + <% :lt -> %> + + <% _ -> %> + <% # Nothing %> +<% end %> +<%= form_for @changeset, ~p"/conversations", fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+
+ Specify any user's exact name here, case-sensitive +
+ <%= text_input(f, :recipient, class: "input input--wide", placeholder: "Recipient", required: true) %> + <%= error_tag(f, :to) %> +
+
+ <%= text_input(f, :title, class: "input input--wide", placeholder: "Title", required: true) %> + <%= error_tag(f, :title) %> +
+ <%= inputs_for f, :messages, fn fm -> %> +
+ <%= render(PhilomenaWeb.MarkdownView, "_input.html", changeset: @changeset, conn: @conn, f: fm, action_icon: "pencil-alt", action_text: "Compose") %> +
+ <% end %> +
+ <%= submit("Send", class: "button", autocomplete: "off", data: [disable_with: "Sending..."]) %> +
+<% end %> diff --git a/lib/philomena_web/templates/conversation/new.html.slime b/lib/philomena_web/templates/conversation/new.html.slime deleted file mode 100644 index 595daccc..00000000 --- a/lib/philomena_web/templates/conversation/new.html.slime +++ /dev/null @@ -1,42 +0,0 @@ -h1 New Conversation -.block - .block__header - => link "Conversations", to: ~p"/conversations" - ' » - span.block__header__title New Conversation - -= case DateTime.compare(DateTime.utc_now(), DateTime.add(@conn.assigns.current_user.created_at, 1_209_600)) do - - :lt -> - .block.block--fixed.block--warning.hidden.js-hidden-warning - h2 Warning! - p - strong> Your account is too new, so your PM will need to be reviewed by staff members. - ' This is because it contains an external image. If you are not okay with a moderator viewing this PM conversation, please consider linking the image instead of embedding it (change - code<> ![ - ' to - code< - | [ - | ). - - _ -> - / Nothing - -= form_for @changeset, ~p"/conversations", fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .field - .fieldlabel Specify any user's exact name here, case-sensitive - = text_input f, :recipient, class: "input input--wide", placeholder: "Recipient", required: true - = error_tag f, :to - - .field - = text_input f, :title, class: "input input--wide", placeholder: "Title", required: true - = error_tag f, :title - - = inputs_for f, :messages, fn fm -> - div - = render PhilomenaWeb.MarkdownView, "_input.html", changeset: @changeset, conn: @conn, f: fm, action_icon: "pencil-alt", action_text: "Compose" - - .block__content.communication-edit__actions - = submit "Send", class: "button", autocomplete: "off", data: [disable_with: "Sending..."] diff --git a/lib/philomena_web/templates/conversation/show.html.heex b/lib/philomena_web/templates/conversation/show.html.heex new file mode 100644 index 00000000..49cf5cb9 --- /dev/null +++ b/lib/philomena_web/templates/conversation/show.html.heex @@ -0,0 +1,91 @@ +<% + route = fn p -> ~p"/conversations/#{@conversation}?#{p}" end + pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @messages, route: route, conn: @conn) + other = other_party(@current_user, @conversation) +%> +

+ <%= @conversation.title %> +

+
+
+ <%= link("Message Center", to: ~p"/conversations") %> + » + <%= link(@conversation.title, to: ~p"/conversations/#{@conversation}") %> + Conversation with + <%= render(PhilomenaWeb.UserAttributionView, "_user.html", object: %{user: other}, conn: @conn) %> +
+ +
+<%= for {message, body} <- @messages do %> + <%= render(PhilomenaWeb.MessageView, "_message.html", message: message, body: body, conn: @conn) %> +<% end %> +
+ +
+<%= case DateTime.compare(DateTime.utc_now(), DateTime.add(@conn.assigns.current_user.created_at, 1_209_600)) do %> + <% :lt -> %> + + <% _ -> %> + <% # Nothing %> +<% end %> +<%= cond do %> + <% @conn.assigns.current_ban -> %> + <%= render(PhilomenaWeb.BanView, "_ban_reason.html", conn: @conn) %> + <% @messages.total_entries < 1_000 -> %> + <%= render(PhilomenaWeb.Conversation.MessageView, "_form.html", conversation: @conversation, changeset: @changeset, conn: @conn) %> + <% true -> %> +
+

+ Okay, we're impressed +

+

+ You've managed to send over 1,000 messages in this conversation! +

+

+ We'd like to ask you to make a new conversation. Don't worry, this one won't go anywhere if you need to refer back to it. +

+

+ <%= link("Click here", to: ~p"/conversations/new?#{[receipient: other.name]}") %> + to make a new conversation with this user. +

+
+<% end %> diff --git a/lib/philomena_web/templates/conversation/show.html.slime b/lib/philomena_web/templates/conversation/show.html.slime deleted file mode 100644 index 5af5ead9..00000000 --- a/lib/philomena_web/templates/conversation/show.html.slime +++ /dev/null @@ -1,63 +0,0 @@ -elixir: - route = fn p -> ~p"/conversations/#{@conversation}?#{p}" end - pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @messages, route: route, conn: @conn - other = other_party(@current_user, @conversation) - -h1 = @conversation.title -.block - .block__header - => link "Message Center", to: ~p"/conversations" - ' » - => link @conversation.title, to: ~p"/conversations/#{@conversation}" - ' Conversation with - => render PhilomenaWeb.UserAttributionView, "_user.html", object: %{user: other}, conn: @conn - .block__header--sub.block__header--light.page__header - span.block__header__title.page__title> - => @messages.total_entries - = pluralize("message", "messages", @messages.total_entries) - .page__pagination = pagination - .page__info - = if hidden_by?(@current_user, @conversation) do - = link "Restore conversation", to: ~p"/conversations/#{@conversation}/hide", data: [method: "delete"] - - else - = link "Remove conversation", to: ~p"/conversations/#{@conversation}/hide", data: [method: "post", confirm: "Are you really, really sure?"] - = link "Report conversation", to: ~p"/conversations/#{@conversation}/reports/new" - = link "Mark as unread", to: ~p"/conversations/#{@conversation}/read", data: [method: "delete"] - -= for {message, body} <- @messages do - = render PhilomenaWeb.MessageView, "_message.html", message: message, body: body, conn: @conn - -.block - .block__header.block__header--light.page__header - .page__pagination = pagination - -= case DateTime.compare(DateTime.utc_now(), DateTime.add(@conn.assigns.current_user.created_at, 1_209_600)) do - - :lt -> - .block.block--fixed.block--warning.hidden.js-hidden-warning - h2 Warning! - p - strong> Your account is too new, so your PM will need to be reviewed by staff members. - ' This is because it contains an external image. If you are not okay with a moderator viewing this PM conversation, please consider linking the image instead of embedding it (change - code<> ![ - ' to - code< - | [ - | ). - - _ -> - / Nothing - -= cond do - - @conn.assigns.current_ban -> - = render PhilomenaWeb.BanView, "_ban_reason.html", conn: @conn - - - @messages.total_entries < 1_000 -> - = render PhilomenaWeb.Conversation.MessageView, "_form.html", conversation: @conversation, changeset: @changeset, conn: @conn - - - true -> - div - h2 Okay, we're impressed - p You've managed to send over 1,000 messages in this conversation! - p We'd like to ask you to make a new conversation. Don't worry, this one won't go anywhere if you need to refer back to it. - p - => link "Click here", to: ~p"/conversations/new?#{[receipient: other.name]}" - ' to make a new conversation with this user. diff --git a/lib/philomena_web/templates/dnp_entry/_form.html.heex b/lib/philomena_web/templates/dnp_entry/_form.html.heex new file mode 100644 index 00000000..fc3ebdd9 --- /dev/null +++ b/lib/philomena_web/templates/dnp_entry/_form.html.heex @@ -0,0 +1,135 @@ +<%= if show_steps?(@changeset) do %> +
+

+ Getting on the DNP list? +

+

+ We offer the DNP list in order to give artists the last say on their art, but we + won't deny that we are sad whenever we see good art and artists disappear. + Because we know that many who seek a DNP do so on their first contact with the site, + we'd be very grateful if you as the artist would like to give the site a shot first. + Why not upload some of your own art? The community might appreciate it more than you think. +

+

+ Do you wish to submit a DNP Request? + +

+
+ +<% end %> +<%= form_for @changeset, @action, fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+
+ + DNP Request Form + +
+
+ <% # Option (set by script depending on the option chosen above) %> + + Type + +
+ <%= select(f, :dnp_type, selectable_types(), class: "js-dnp-type input input--wide") %> + <%= error_tag(f, :dnp_type) %> +
+ <% # Artist Tag %> + + Artist Tag + +

+ Select the artist tag you would like to request a DNP entry for +

+
+ <%= select(f, :tag_id, selectable_options(@selectable_tags), class: "input") %> + <%= error_tag(f, :tag_id) %> +
+
+ <% # Conditions %> + + Conditions + +

+ If you selected "Other", or have other conditions applicable to your request, please enter them here. If someone always has permission to upload your artwork, enter their name here. (Optional) +

+
+ <%= textarea(f, :conditions, class: "input input--wide", placeholder: "Conditions") %> + <%= error_tag(f, :conditions) %> +
+
+ <% # Reason %> + + Reason For Request + +

+ Please indicate the reason why you would like your artwork to be removed. (Required) +

+
+ <%= textarea(f, :reason, class: "input input--wide", placeholder: "Reason", required: true) %> + <%= error_tag(f, :reason) %> +
+
+ <%= checkbox(f, :hide_reason, class: "checkbox") %> + <%= label(f, :hide_reason, "Hide request reason") %> +
+

+ Only select this box if your request contains sensitive or private information that you do not wish to be publicly available. Reasons that do not contain such information will not be hidden. +

+
+ <% # Instructions %> + + Instructions + +

+ If you would like existing artwork to be removed under this request, please provide instructions, such as "Remove all art with my artist tag that contain the "edit" tag." (Optional) +

+
+ <%= textarea(f, :instructions, class: "input input--wide", placeholder: "Instructions") %> + <%= error_tag(f, :instructions) %> +
+
+ <% # Feedback %> + + Feedback + +

+ If you have any additional feedback for the site staff, you may enter it here. (Optional) +

+
+ <%= textarea(f, :feedback, class: "input input--wide", placeholder: "Feedback") %> + <%= error_tag(f, :feedback) %> +
+
+ <%= submit("Submit Request", class: "button") %> +
+
+<% end %> diff --git a/lib/philomena_web/templates/dnp_entry/_form.html.slime b/lib/philomena_web/templates/dnp_entry/_form.html.slime deleted file mode 100644 index 81a6bfd0..00000000 --- a/lib/philomena_web/templates/dnp_entry/_form.html.slime +++ /dev/null @@ -1,89 +0,0 @@ -= if show_steps?(@changeset) do - .block.block--fixed.block--success.walloftext - h3 Getting on the DNP list? - - p - ' We offer the DNP list in order to give artists the last say on their art, but we - ' won't deny that we are sad whenever we see good art and artists disappear. - ' Because we know that many who seek a DNP do so on their first contact with the site, - ' we'd be very grateful if you as the artist would like to give the site a shot first. - ' Why not upload some of your own art? The community might appreciate it more than you think. - - p - ' Do you wish to submit a DNP Request? - button.button.button--separate-left.js-dnp-yes data-click-show=".js-dnp-common-options" data-click-disable=".js-dnp-yes" - ' Yes - - .block.block--fixed.walloftext.js-dnp-common-options.hidden - h3 Options - - p - ' We are aware of several common reasons for why artists seek a DNP. - ' They include things such as unwanted edits or a wish to disassociate - ' their name from their artwork. Many of these concerns can be addressed - ' without removing art. - - p We have created several options for you below: - - ul.line-spacing - = for {type, description} <- reasons() do - li - = link description, to: "#", data: [click_show: ".js-dnp-form", click_hide: ".js-dnp-common-options", click_inputvalue: ".js-dnp-type", set_value: type] - -= form_for @changeset, @action, fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .block.js-dnp-form class=form_class(@changeset) - .block__header - span.block__header__title DNP Request Form - - .block__content - / Option (set by script depending on the option chosen above) - strong Type - .field - = select f, :dnp_type, selectable_types(), class: "js-dnp-type input input--wide" - = error_tag f, :dnp_type - - / Artist Tag - strong Artist Tag - p Select the artist tag you would like to request a DNP entry for - .field - = select f, :tag_id, selectable_options(@selectable_tags), class: "input" - = error_tag f, :tag_id - hr - / Conditions - strong Conditions - p If you selected "Other", or have other conditions applicable to your request, please enter them here. If someone always has permission to upload your artwork, enter their name here. (Optional) - .field - = textarea f, :conditions, class: "input input--wide", placeholder: "Conditions" - = error_tag f, :conditions - hr - / Reason - strong Reason For Request - p Please indicate the reason why you would like your artwork to be removed. (Required) - .field - = textarea f, :reason, class: "input input--wide", placeholder: "Reason", required: true - = error_tag f, :reason - .field - => checkbox f, :hide_reason, class: "checkbox" - = label f, :hide_reason, "Hide request reason" - p Only select this box if your request contains sensitive or private information that you do not wish to be publicly available. Reasons that do not contain such information will not be hidden. - hr - / Instructions - strong Instructions - p If you would like existing artwork to be removed under this request, please provide instructions, such as "Remove all art with my artist tag that contain the "edit" tag." (Optional) - .field - = textarea f, :instructions, class: "input input--wide", placeholder: "Instructions" - = error_tag f, :instructions - hr - / Feedback - strong Feedback - p If you have any additional feedback for the site staff, you may enter it here. (Optional) - .field - = textarea f, :feedback, class: "input input--wide", placeholder: "Feedback" - = error_tag f, :feedback - - hr - = submit "Submit Request", class: "button" diff --git a/lib/philomena_web/templates/dnp_entry/edit.html.heex b/lib/philomena_web/templates/dnp_entry/edit.html.heex new file mode 100644 index 00000000..9f681f80 --- /dev/null +++ b/lib/philomena_web/templates/dnp_entry/edit.html.heex @@ -0,0 +1,4 @@ +

+ Edit DNP Request +

+<%= render(PhilomenaWeb.DnpEntryView, "_form.html", changeset: @changeset, action: ~p"/dnp/#{@dnp_entry}?#{[tag_id: @dnp_entry.tag_id]}", conn: @conn, selectable_tags: @selectable_tags) %> diff --git a/lib/philomena_web/templates/dnp_entry/edit.html.slime b/lib/philomena_web/templates/dnp_entry/edit.html.slime deleted file mode 100644 index 969f4ffd..00000000 --- a/lib/philomena_web/templates/dnp_entry/edit.html.slime +++ /dev/null @@ -1,2 +0,0 @@ -h2 Edit DNP Request -= render PhilomenaWeb.DnpEntryView, "_form.html", changeset: @changeset, action: ~p"/dnp/#{@dnp_entry}?#{[tag_id: @dnp_entry.tag_id]}", conn: @conn, selectable_tags: @selectable_tags diff --git a/lib/philomena_web/templates/dnp_entry/index.html.heex b/lib/philomena_web/templates/dnp_entry/index.html.heex new file mode 100644 index 00000000..c168fb7e --- /dev/null +++ b/lib/philomena_web/templates/dnp_entry/index.html.heex @@ -0,0 +1,118 @@ +

+ The Do-Not-Post (DNP) List +

+<% # Information block %> +

+ Information +

+
+
+ + About + +
+
+

+ This is a list of artists who have asked us to place a restriction on the uploading of their artwork. These restrictions can include anything from requesting that no edits of their work be allowed, to requesting that no uploads be allowed unless uploaded by the artists themselves. +

+

+ We ask that you please respect the wishes of artists in regards to their artworks, and check the list before uploading. Note that just because an artist is not listed may not mean that their artwork is ok to post, especially if they have a note at their "source" that they do not wish for their artwork to be reposted. +

+
+
+
+
+
+ + Manage My Listings + +
+
+ <%= cond do %> + <% not is_nil(@current_user) and Enum.any?(@linked_tags) -> %> + <%= link("Create an entry", to: ~p"/dnp/new") %> +
+ <%= link("My Listings", to: ~p"/dnp?#{[mine: "1"]}") %> + <% not is_nil(@current_user) -> %> + You must have a verified artist link to create and manage DNP entries. + <%= link("Request an artist link", to: ~p"/profiles/#{@current_user}/artist_links/new") %> + . + <% true -> %> + You must be logged in and have a verified artist link to create and manage DNP entries. + <% end %> +
+
+

+ The List +

+
+ <% route = fn p -> ~p"/dnp?#{p}" end %> + <% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @dnp_entries, route: route, conn: @conn) %> + +
+ + + + + + + <%= if @status_column do %> + + + <% end %> + + + + + <%= for {body, entry} <- @dnp_entries do %> + + + + + <%= if @status_column do %> + + + <% end %> + + + <% end %> + +
+ Tag + + Restriction + + Conditions + + Status + + Created + + Options +
+ <%= render(PhilomenaWeb.TagView, "_tag.html", tag: entry.tag, conn: @conn) %> + + <%= entry.dnp_type %> + + <%= body %> + + <%= pretty_state(entry) %> + + <%= pretty_time(entry.created_at) %> + + <%= link("More Info", to: ~p"/dnp/#{entry}") %> +
+
+ +
diff --git a/lib/philomena_web/templates/dnp_entry/index.html.slime b/lib/philomena_web/templates/dnp_entry/index.html.slime deleted file mode 100644 index b4463eb5..00000000 --- a/lib/philomena_web/templates/dnp_entry/index.html.slime +++ /dev/null @@ -1,75 +0,0 @@ -h2 The Do-Not-Post (DNP) List - -/ Information block -h3 Information -.block - .block__header - span.block__header__title About - .block__content - p This is a list of artists who have asked us to place a restriction on the uploading of their artwork. These restrictions can include anything from requesting that no edits of their work be allowed, to requesting that no uploads be allowed unless uploaded by the artists themselves. - p We ask that you please respect the wishes of artists in regards to their artworks, and check the list before uploading. Note that just because an artist is not listed may not mean that their artwork is ok to post, especially if they have a note at their "source" that they do not wish for their artwork to be reposted. -br - -.block - .block__header - span.block__header__title Manage My Listings - .block__content - = cond do - - not is_nil(@current_user) and Enum.any?(@linked_tags) -> - = link "Create an entry", to: ~p"/dnp/new" - br - = link "My Listings", to: ~p"/dnp?#{[mine: "1"]}" - - - not is_nil(@current_user) -> - ' You must have a verified artist link to create and manage DNP entries. - = link "Request an artist link", to: ~p"/profiles/#{@current_user}/artist_links/new" - | . - - - true -> - ' You must be logged in and have a verified artist link to create and manage DNP entries. - - -h3 The List -.block - - route = fn p -> ~p"/dnp?#{p}" end - - pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @dnp_entries, route: route, conn: @conn - - .block__header.page__header - span.block__header__title.page__title The DNP List - .page__pagination = pagination - - .block__content - table.table - thead - tr - th Tag - th Restriction - th Conditions - = if @status_column do - th Status - th Created - th Options - tbody - = for {body, entry} <- @dnp_entries do - tr - td - = render PhilomenaWeb.TagView, "_tag.html", tag: entry.tag, conn: @conn - - td - = entry.dnp_type - - td - = body - - = if @status_column do - td - = pretty_state(entry) - - td - = pretty_time(entry.created_at) - - td - = link "More Info", to: ~p"/dnp/#{entry}" - - .block__header.page__header - .page__pagination = pagination diff --git a/lib/philomena_web/templates/dnp_entry/new.html.heex b/lib/philomena_web/templates/dnp_entry/new.html.heex new file mode 100644 index 00000000..504d7c3a --- /dev/null +++ b/lib/philomena_web/templates/dnp_entry/new.html.heex @@ -0,0 +1,4 @@ +

+ New DNP Request +

+<%= render(PhilomenaWeb.DnpEntryView, "_form.html", changeset: @changeset, action: ~p"/dnp?#{[tag_id: @conn.params["tag_id"]]}", conn: @conn, selectable_tags: @selectable_tags) %> diff --git a/lib/philomena_web/templates/dnp_entry/new.html.slime b/lib/philomena_web/templates/dnp_entry/new.html.slime deleted file mode 100644 index 1bb616f8..00000000 --- a/lib/philomena_web/templates/dnp_entry/new.html.slime +++ /dev/null @@ -1,2 +0,0 @@ -h2 New DNP Request -= render PhilomenaWeb.DnpEntryView, "_form.html", changeset: @changeset, action: ~p"/dnp?#{[tag_id: @conn.params["tag_id"]]}", conn: @conn, selectable_tags: @selectable_tags diff --git a/lib/philomena_web/templates/dnp_entry/show.html.heex b/lib/philomena_web/templates/dnp_entry/show.html.heex new file mode 100644 index 00000000..933c89af --- /dev/null +++ b/lib/philomena_web/templates/dnp_entry/show.html.heex @@ -0,0 +1,116 @@ +

+ DNP Listing for Tag + <%= @dnp_entry.tag.name %> +

+
+
+ + DNP Information + + <%= if can?(@conn, :edit, @dnp_entry) do %> + <%= link("Edit listing", to: ~p"/dnp/#{@dnp_entry}/edit?#{[tag_id: @dnp_entry.tag_id]}") %> + <% end %> + <%= link("Back to DNP List", to: ~p"/dnp") %> +
+
+ + + + + + + + + + + + + + + + + + + <%= if can?(@conn, :show_reason, @dnp_entry) do %> + + + + + <% end %> + <%= if can?(@conn, :show_feedback, @dnp_entry) do %> + + + + + + + + + + + + + <% end %> + +
+ Created: + + <%= pretty_time(@dnp_entry.created_at) %> +
+ Tag: + + <%= render(PhilomenaWeb.TagView, "_tag.html", tag: @dnp_entry.tag, conn: @conn) %> +
+ Restriction Type: + + <%= @dnp_entry.dnp_type %> +
+ Conditions: + + <%= @conditions %> +
+ Reason: + + <%= @reason %> +
+ Instructions: + + <%= @instructions %> +
+ Feedback: + + <%= @dnp_entry.feedback %> +
+ Status: + + <%= String.capitalize(@dnp_entry.aasm_state) %> +
+
+
+<%= if can?(@conn, :index, Philomena.DnpEntries.DnpEntry) do %> + <%= case @dnp_entry.aasm_state do %> + <% s when s in ["requested", "claimed"] -> %> + <%= link("Claim", to: ~p"/admin/dnp_entries/#{@dnp_entry}/transition?#{[state: "claimed"]}", data: [method: "post", confirm: "Are you really, really sure?"]) %> + • + <%= link("Approve", to: ~p"/admin/dnp_entries/#{@dnp_entry}/transition?#{[state: "listed"]}", data: [method: "post", confirm: "Are you really, really sure?"]) %> + • + <%= link("Close", to: ~p"/admin/dnp_entries/#{@dnp_entry}/transition?#{[state: "closed"]}", data: [method: "post", confirm: "Are you really, really sure?"]) %> + <% "listed" -> %> + <%= link("Rescind", to: ~p"/admin/dnp_entries/#{@dnp_entry}/transition?#{[state: "rescinded"]}", data: [method: "post", confirm: "Are you really, really sure?"]) %> + • + <%= link("Close", to: ~p"/admin/dnp_entries/#{@dnp_entry}/transition?#{[state: "closed"]}", data: [method: "post", confirm: "Are you really, really sure?"]) %> + <% s when s in ["rescinded", "acknowledged"] -> %> + <%= link("Claim", to: ~p"/admin/dnp_entries/#{@dnp_entry}/transition?#{[state: "acknowledged"]}", data: [method: "post", confirm: "Are you really, really sure?"]) %> + • + <%= link("Close", to: ~p"/admin/dnp_entries/#{@dnp_entry}/transition?#{[state: "closed"]}", data: [method: "post", confirm: "Are you really, really sure?"]) %> + <% _state -> %> + <%= link("Claim", to: ~p"/admin/dnp_entries/#{@dnp_entry}/transition?#{[state: "claimed"]}", data: [method: "post", confirm: "Are you really, really sure?"]) %> + <% end %> +<% end %> +<%= if assigns[:mod_notes] do %> +

+ Mod Notes +

+ <%= render(PhilomenaWeb.Admin.ModNoteView, "_table.html", mod_notes: @mod_notes, conn: @conn) %> + <%= link("Add New Note", to: ~p"/admin/mod_notes/new?#{[notable_id: @dnp_entry.id, notable_type: "DnpEntry"]}") %> +<% end %> diff --git a/lib/philomena_web/templates/dnp_entry/show.html.slime b/lib/philomena_web/templates/dnp_entry/show.html.slime deleted file mode 100644 index 31b893ea..00000000 --- a/lib/philomena_web/templates/dnp_entry/show.html.slime +++ /dev/null @@ -1,78 +0,0 @@ -h2 - ' DNP Listing for Tag - = @dnp_entry.tag.name - -.block - .block__header - span.block__header__title DNP Information - = if can?(@conn, :edit, @dnp_entry) do - = link "Edit listing", to: ~p"/dnp/#{@dnp_entry}/edit?#{[tag_id: @dnp_entry.tag_id]}" - - = link "Back to DNP List", to: ~p"/dnp" - - .block__content - table.table - tbody - tr - td Created: - td - = pretty_time(@dnp_entry.created_at) - tr - td Tag: - td - = render PhilomenaWeb.TagView, "_tag.html", tag: @dnp_entry.tag, conn: @conn - tr - td Restriction Type: - td - = @dnp_entry.dnp_type - tr - td Conditions: - td - = @conditions - - = if can?(@conn, :show_reason, @dnp_entry) do - tr - td Reason: - td - = @reason - - = if can?(@conn, :show_feedback, @dnp_entry) do - tr - td Instructions: - td - = @instructions - tr - td Feedback: - td - = @dnp_entry.feedback - tr - td Status: - td - = String.capitalize(@dnp_entry.aasm_state) - -= if can?(@conn, :index, Philomena.DnpEntries.DnpEntry) do - = case @dnp_entry.aasm_state do - - s when s in ["requested", "claimed"] -> - => link "Claim", to: ~p"/admin/dnp_entries/#{@dnp_entry}/transition?#{[state: "claimed"]}", data: [method: "post", confirm: "Are you really, really sure?"] - ' • - => link "Approve", to: ~p"/admin/dnp_entries/#{@dnp_entry}/transition?#{[state: "listed"]}", data: [method: "post", confirm: "Are you really, really sure?"] - ' • - => link "Close", to: ~p"/admin/dnp_entries/#{@dnp_entry}/transition?#{[state: "closed"]}", data: [method: "post", confirm: "Are you really, really sure?"] - - - "listed" -> - => link "Rescind", to: ~p"/admin/dnp_entries/#{@dnp_entry}/transition?#{[state: "rescinded"]}", data: [method: "post", confirm: "Are you really, really sure?"] - ' • - = link "Close", to: ~p"/admin/dnp_entries/#{@dnp_entry}/transition?#{[state: "closed"]}", data: [method: "post", confirm: "Are you really, really sure?"] - - - s when s in ["rescinded", "acknowledged"] -> - => link "Claim", to: ~p"/admin/dnp_entries/#{@dnp_entry}/transition?#{[state: "acknowledged"]}", data: [method: "post", confirm: "Are you really, really sure?"] - ' • - = link "Close", to: ~p"/admin/dnp_entries/#{@dnp_entry}/transition?#{[state: "closed"]}", data: [method: "post", confirm: "Are you really, really sure?"] - - - _state -> - => link "Claim", to: ~p"/admin/dnp_entries/#{@dnp_entry}/transition?#{[state: "claimed"]}", data: [method: "post", confirm: "Are you really, really sure?"] - -= if assigns[:mod_notes] do - h4 Mod Notes - = render PhilomenaWeb.Admin.ModNoteView, "_table.html", mod_notes: @mod_notes, conn: @conn - = link "Add New Note", to: ~p"/admin/mod_notes/new?#{[notable_id: @dnp_entry.id, notable_type: "DnpEntry"]}" diff --git a/lib/philomena_web/templates/duplicate_report/_form.html.heex b/lib/philomena_web/templates/duplicate_report/_form.html.heex new file mode 100644 index 00000000..026f9ad0 --- /dev/null +++ b/lib/philomena_web/templates/duplicate_report/_form.html.heex @@ -0,0 +1,11 @@ +<%= form_for @changeset, ~p"/duplicate_reports", fn f -> %> + <%= hidden_input(f, :image_id, value: @image.id) %> +
+ Delete this image and redirect to + <%= number_input(f, :duplicate_of_image_id, class: "input", min: 0, placeholder: "image number.", required: true) %> + <%= text_input(f, :reason, class: "input input--separate-left", placeholder: "Explanation") %> +
+
+ <%= submit("Report Duplicate", class: "button", data: [disable_with: raw("Saving…")]) %> +
+<% end %> diff --git a/lib/philomena_web/templates/duplicate_report/_form.html.slime b/lib/philomena_web/templates/duplicate_report/_form.html.slime deleted file mode 100644 index 19d1ec64..00000000 --- a/lib/philomena_web/templates/duplicate_report/_form.html.slime +++ /dev/null @@ -1,8 +0,0 @@ -= form_for @changeset, ~p"/duplicate_reports", fn f -> - = hidden_input f, :image_id, value: @image.id - .field - ' Delete this image and redirect to - = number_input f, :duplicate_of_image_id, class: "input", min: 0, placeholder: "image number.", required: true - = text_input f, :reason, class: "input input--separate-left", placeholder: "Explanation" - .actions - = submit "Report Duplicate", class: "button", data: [disable_with: raw("Saving…")] diff --git a/lib/philomena_web/templates/duplicate_report/_image_cell.html.heex b/lib/philomena_web/templates/duplicate_report/_image_cell.html.heex new file mode 100644 index 00000000..c4050137 --- /dev/null +++ b/lib/philomena_web/templates/duplicate_report/_image_cell.html.heex @@ -0,0 +1,36 @@ +
+

+ <%= if is_nil(@image) do %> + (Image now hard-deleted) + <% else %> + # + <%= @image.id %> + <% end %> +

+ <%= render(PhilomenaWeb.ImageView, "_image_container.html", image: @image, size: :thumb_small, conn: @conn) %> +

+ <%= @image.image_width %> + x + <%= @image.image_height %> +

+

+ <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @image, conn: @conn) %> +

+ <%= if can?(@conn, :edit, @report) and mergeable?(@report) do %> + <%= if @source do %> + + + + <% else %> + + + + <% end %> + <% end %> +
diff --git a/lib/philomena_web/templates/duplicate_report/_image_cell.html.slime b/lib/philomena_web/templates/duplicate_report/_image_cell.html.slime deleted file mode 100644 index 9e52462c..00000000 --- a/lib/philomena_web/templates/duplicate_report/_image_cell.html.slime +++ /dev/null @@ -1,29 +0,0 @@ -.grid--dupe-report-list__cell.flex.flex--column.flex--spaced-out.flex--centered.flex--no-wrap.center.dr__image-cell.border-vertical - p - = if is_nil(@image) do - | (Image now hard-deleted) - - else - | # - = @image.id - - = render PhilomenaWeb.ImageView, "_image_container.html", image: @image, size: :thumb_small, conn: @conn - - p - = @image.image_width - | x - = @image.image_height - - p - = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @image, conn: @conn - - = if can?(@conn, :edit, @report) and mergeable?(@report) do - = if @source do - a href=~p"/duplicate_reports/#{@report}/accept_reverse" data-method="post" - button.button - ' Keep Source - i.fa.fa-arrow-left - - else - a href=~p"/duplicate_reports/#{@report}/accept" data-method="post" - button.button - i.fa.fa-arrow-right> - | Keep Target diff --git a/lib/philomena_web/templates/duplicate_report/_list.html.heex b/lib/philomena_web/templates/duplicate_report/_list.html.heex new file mode 100644 index 00000000..ee417de1 --- /dev/null +++ b/lib/philomena_web/templates/duplicate_report/_list.html.heex @@ -0,0 +1,231 @@ +
+

+ Source image +

+

+ Target image +

+

+ Diff +

+

+ Status/options +

+ <%= for report <- @duplicate_reports do %> + <% background_class = background_class(report) %> + <%= render(PhilomenaWeb.DuplicateReportView, "_image_cell.html", image: report.image, source: true, report: report, conn: @conn) %> + <%= render(PhilomenaWeb.DuplicateReportView, "_image_cell.html", image: report.duplicate_of_image, source: false, report: report, conn: @conn) %> +
+ + + <%= if same_aspect_ratio?(report) do %> + + <% else %> + + <% end %> + + + <%= cond do %> + <% both_are_edits?(report) -> %> + + <% target_is_edit?(report) -> %> + + <% source_is_edit?(report) -> %> + + <% true -> %> + + <% end %> + + + <%= cond do %> + <% both_are_alternate_versions?(report) -> %> + + <% target_is_alternate_version?(report) -> %> + + <% source_is_alternate_version?(report) -> %> + + <% true -> %> + + <% end %> + + + <%= cond do %> + <% same_res?(report) -> %> + + <% higher_res?(report) -> %> + + <% true -> %> + + <% end %> + + + <%= cond do %> + <% same_format?(report) -> %> + + <% better_format?(report) -> %> + + <% true -> %> + + <% end %> + + + <%= cond do %> + <% same_artist_tags?(report) -> %> + + <% more_artist_tags_on_target?(report) -> %> + + <% more_artist_tags_on_source?(report) -> %> + + <% true -> %> + + <% end %> + + + <%= cond do %> + <% neither_have_source?(report) -> %> + + <% same_source?(report) -> %> + + <% similar_source?(report) -> %> + + <% source_on_target?(report) -> %> + + <% source_on_source?(report) -> %> + + <% true -> %> + + <% end %> + + + <%= if same_rating_tags?(report) do %> + + <% else %> + + <% end %> + + + <%= cond do %> + <% not source_approved?(report) -> %> + + <% not target_approved?(report) -> %> + + <% forward_merge?(report) -> %> + + <% true -> %> + + <% end %> + +
+ + Visual diff + + (Same aspect ratio) + + Different aspect ratio +
+ Both are edits + + Target is an edit + + Source is an edit + + Neither is an edit +
+ Both are alternate versions + + Target is an alternate version + + Source is an alternate version + + Neither is an alternate version +
+ Same resolution + + Target resolution better + + Source resolution better +
+ Same format + <%= file_types(report) %> + + Target format better + <%= file_types(report) %> + + Source format better + <%= file_types(report) %> +
+ Same artist tags + + More artist tags on target + + More artist tags on source + + Different artist tags +
+ Neither have sources + + Same sources + + Same hostname + + Target has a source + + Source has a source + + Different sources +
+ Same rating tags + + Different rating tags +
+ Source is not approved + + Target is not approved + + Target newer + + Target older +
+
+
+
+ <%= String.capitalize(report.state) %> + <%= if can?(@conn, :edit, report) and not is_nil(report.modifier) do %> + by + <%= report.modifier.name %> + <% end %> + <%= if can?(@conn, :edit, report) do %> +
+ <%= if report.state == "open" do %> + "#report_options_#{report.id}")}> + + + <% end %> + <%= if report.state != "rejected" do %> + + + + <% end %> +
+ <% end %> +
+
+
+ Reported + <%= pretty_time(report.created_at) %> + <%= if report.user do %> + by + <%= link(report.user.name, to: ~p"/profiles/#{report.user}") %> + <% end %> +
+ <%= escape_nl2br(report.reason) %> +
+
+ <% end %> +
diff --git a/lib/philomena_web/templates/duplicate_report/_list.html.slime b/lib/philomena_web/templates/duplicate_report/_list.html.slime deleted file mode 100644 index bb18bb50..00000000 --- a/lib/philomena_web/templates/duplicate_report/_list.html.slime +++ /dev/null @@ -1,162 +0,0 @@ -.grid.grid--dupe-report-list - p Source image - p Target image - p Diff - p Status/options - - = for report <- @duplicate_reports do - - background_class = background_class(report) - - = render PhilomenaWeb.DuplicateReportView, "_image_cell.html", image: report.image, source: true, report: report, conn: @conn - = render PhilomenaWeb.DuplicateReportView, "_image_cell.html", image: report.duplicate_of_image, source: false, report: report, conn: @conn - - .grid--dupe-report-list__cell.dr__diff.border-vertical - table.table - tr - = if same_aspect_ratio?(report) do - td.success - a href=~p"/duplicate_reports/#{report}" - ' Visual diff - | (Same aspect ratio) - - - else - td.warning Different aspect ratio - tr - = cond do - - both_are_edits?(report) -> - td.warning Both are edits - - - target_is_edit?(report) -> - td.danger Target is an edit - - - source_is_edit?(report) -> - td.danger Source is an edit - - - true -> - td.success Neither is an edit - - tr - = cond do - - both_are_alternate_versions?(report) -> - td.warning Both are alternate versions - - - target_is_alternate_version?(report) -> - td.danger Target is an alternate version - - - source_is_alternate_version?(report) -> - td.danger Source is an alternate version - - - true -> - td.success Neither is an alternate version - - tr - = cond do - - same_res?(report) -> - td.success Same resolution - - - higher_res?(report) -> - td.warning Target resolution better - - - true -> - td.warning Source resolution better - - tr - = cond do - - same_format?(report) -> - td.success - ' Same format - = file_types(report) - - - better_format?(report) -> - td.warning - ' Target format better - = file_types(report) - - - true -> - td.warning - ' Source format better - = file_types(report) - - tr - = cond do - - same_artist_tags?(report) -> - td.success Same artist tags - - - more_artist_tags_on_target?(report) -> - td.warning More artist tags on target - - - more_artist_tags_on_source?(report) -> - td.warning More artist tags on source - - - true -> - td.danger Different artist tags - - tr - = cond do - - neither_have_source?(report) -> - td.warning Neither have sources - - - same_source?(report) -> - td.success Same sources - - - similar_source?(report) -> - td.warning Same hostname - - - source_on_target?(report) -> - td.warning Target has a source - - - source_on_source?(report) -> - td.warning Source has a source - - - true -> - td.danger Different sources - - tr - = if same_rating_tags?(report) do - td.success Same rating tags - - else - td.danger Different rating tags - - tr - = cond do - - not source_approved?(report) -> - td.danger Source is not approved - - not target_approved?(report) -> - td.danger Target is not approved - - forward_merge?(report) -> - td.warning Target newer - - true -> - td.success Target older - - .flex.flex--column.grid--dupe-report-list__cell.border-vertical id="report_options_#{report.id}" - .dr__status-options class=background_class - => String.capitalize(report.state) - - = if can?(@conn, :edit, report) and not is_nil(report.modifier) do - ' by - = report.modifier.name - - = if can?(@conn, :edit, report) do - div - = if report.state == "open" do - a href=(~p"/duplicate_reports/#{report}/claim" <> "#report_options_#{report.id}") data-method="post" - button.button.button--separate-right - i.fa.fa-clipboard> - ' Claim - - = if report.state != "rejected" do - a href=~p"/duplicate_reports/#{report}/reject" data-method="post" - button.button - i.fa.fa-times> - ' Reject - - .dr__status-options - div - ' Reported - => pretty_time(report.created_at) - - = if report.user do - ' by - =< link report.user.name, to: ~p"/profiles/#{report.user}" - - = escape_nl2br(report.reason) diff --git a/lib/philomena_web/templates/duplicate_report/index.html.heex b/lib/philomena_web/templates/duplicate_report/index.html.heex new file mode 100644 index 00000000..300d77ee --- /dev/null +++ b/lib/philomena_web/templates/duplicate_report/index.html.heex @@ -0,0 +1,33 @@ +

+ Duplicate Reports +

+<% route = fn p -> ~p"/duplicate_reports?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @duplicate_reports, route: route, conn: @conn, params: [states: @conn.params["states"] || ["open", "claimed"]]) %> +
+ + <%= render(PhilomenaWeb.DuplicateReportView, "_list.html", duplicate_reports: @duplicate_reports, conn: @conn) %> +
+ +
+
diff --git a/lib/philomena_web/templates/duplicate_report/index.html.slime b/lib/philomena_web/templates/duplicate_report/index.html.slime deleted file mode 100644 index ef46cf6a..00000000 --- a/lib/philomena_web/templates/duplicate_report/index.html.slime +++ /dev/null @@ -1,24 +0,0 @@ -h1 Duplicate Reports - -- route = fn p -> ~p"/duplicate_reports?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @duplicate_reports, route: route, conn: @conn, params: [states: @conn.params["states"] || ["open", "claimed"]] - -.block - .block__header.page__header - .page__pagination = pagination - .page__info - span.block__header__title Display only: - => link "Open (All)", to: ~p"/duplicate_reports?#{[states: ~W(open claimed)]}" - => link "Open (Unclaimed)", to: ~p"/duplicate_reports?#{[states: ~W(open)]}" - => link "Open (Claimed)", to: ~p"/duplicate_reports?#{[states: ~W(claimed)]}" - => link "Open + Rejected", to: ~p"/duplicate_reports?#{[states: ~W(open rejected)]}" - => link "Rejected", to: ~p"/duplicate_reports?#{[states: ~W(rejected)]}" - => link "Rejected + Accepted", to: ~p"/duplicate_reports?#{[states: ~W(rejected accepted)]}" - => link "Accepted", to: ~p"/duplicate_reports?#{[states: ~W(accepted)]}" - = link "All", to: ~p"/duplicate_reports?#{[states: ~W(open rejected accepted claimed)]}" - - = render PhilomenaWeb.DuplicateReportView, "_list.html", duplicate_reports: @duplicate_reports, conn: @conn - - .block - .block__header.block__header--light.page__header - .page__pagination = pagination diff --git a/lib/philomena_web/templates/duplicate_report/show.html.heex b/lib/philomena_web/templates/duplicate_report/show.html.heex new file mode 100644 index 00000000..2a91c799 --- /dev/null +++ b/lib/philomena_web/templates/duplicate_report/show.html.heex @@ -0,0 +1,66 @@ +<% + source_url = comparison_url(@conn, @duplicate_report.image) + target_url = comparison_url(@conn, @duplicate_report.duplicate_of_image) + {width, height} = largest_dimensions([@duplicate_report.image, @duplicate_report.duplicate_of_image]) +%> +

+ Difference +

+
+ + + + + + + <% # Contrast-boost matrix = (5I|0) [4x5] %> + + + + + +
+

+ Swipe +

+
+ + + + + + + + + + + + + + + + + +
+

+ Onion Skin +

+
+ + + + + + + + + + + + + + +
+

+ Left is source, right is target +

diff --git a/lib/philomena_web/templates/duplicate_report/show.html.slime b/lib/philomena_web/templates/duplicate_report/show.html.slime deleted file mode 100644 index fd64d50f..00000000 --- a/lib/philomena_web/templates/duplicate_report/show.html.slime +++ /dev/null @@ -1,49 +0,0 @@ -elixir: - source_url = comparison_url(@conn, @duplicate_report.image) - target_url = comparison_url(@conn, @duplicate_report.duplicate_of_image) - {width, height} = largest_dimensions([@duplicate_report.image, @duplicate_report.duplicate_of_image]) - -h1 Difference -.difference - svg.difference__image viewBox="0 0 #{width} #{height}" height=height - defs - filter#overlay-diff - feImage#source xlink:href=source_url result="source" width="100%" height="100%" x="0" y="0" - feImage#target xlink:href=target_url result="target" width="100%" height="100%" x="0" y="0" - feBlend in="source" in2="target" mode="difference" result="diff" - - / Contrast-boost matrix = (5I|0) [4x5] - feColorMatrix in="diff" type="matrix" values="5 0 0 0 0 0 5 0 0 0 0 0 5 0 0 0 0 0 5 0" - rect width=width height=height filter="url(#overlay-diff)" - -h1 Swipe -.swipe - svg.swipe__image viewBox="0 0 #{width} #{height}" height=height - defs - pattern#checkerboard width="16" height="16" patternUnits="userSpaceOnUse" - rect width="8" height="8" x="0" y="0" fill="#ffffff44" - rect width="8" height="8" x="0" y="8" fill="#00000044" - rect width="8" height="8" x="8" y="0" fill="#00000044" - rect width="8" height="8" x="8" y="8" fill="#ffffff44" - clipPath#clip - rect width=div(width, 2) height=height - rect width=width height=height fill="url(#checkerboard)" - image#target width="100%" height="100%" xlink:href=target_url - image#source width="100%" height="100%" xlink:href=source_url clip-path="url(#clip)" - rect#divider width="3" height=height x=div(width, 2) fill="#000" stroke="#fff" stroke-width="1" - -h1 Onion Skin -.onion-skin - svg.onion-skin__image viewBox="0 0 #{width} #{height}" height=height - defs - pattern#checkerboard width="16" height="16" patternUnits="userSpaceOnUse" - rect width="8" height="8" x="0" y="0" fill="#ffffff44" - rect width="8" height="8" x="0" y="8" fill="#00000044" - rect width="8" height="8" x="8" y="0" fill="#00000044" - rect width="8" height="8" x="8" y="8" fill="#ffffff44" - rect width=width height=height fill="url(#checkerboard)" - image#source width="100%" height="100%" xlink:href=source_url - image#target width="100%" height="100%" xlink:href=target_url - input.onion-skin__slider type="range" min="0" max="1" step="0.01" - -p Left is source, right is target \ No newline at end of file diff --git a/lib/philomena_web/templates/error/show.html.heex b/lib/philomena_web/templates/error/show.html.heex new file mode 100644 index 00000000..87e1a86b --- /dev/null +++ b/lib/philomena_web/templates/error/show.html.heex @@ -0,0 +1,30 @@ + + + + + + <%= viewport_meta_tag(@conn) %> + + <%= @status %> + - Philomena + + + + + + + +
+

+ + Philomena +

+

+ <%= @short_msg %> +

+

+ <%= @long_msg %> +

+
+ + diff --git a/lib/philomena_web/templates/error/show.html.slime b/lib/philomena_web/templates/error/show.html.slime deleted file mode 100644 index a48ae8f3..00000000 --- a/lib/philomena_web/templates/error/show.html.slime +++ /dev/null @@ -1,23 +0,0 @@ -doctype html -html lang="en" - head - meta charset="utf-8" - meta http-equiv="X-UA-Compatible" content="IE=edge" - = viewport_meta_tag(@conn) - - title - => @status - | - Philomena - link rel="stylesheet" href=stylesheet_path(nil) - link rel="stylesheet" href=dark_stylesheet_path() media="(prefers-color-scheme: dark)" - link rel="icon" href="/favicon.ico" type="image/x-icon" - link rel="icon" href="/favicon.svg" type="image/svg+xml" - - body.minimal - .minimal__message - h1.minimal__message__header - i.fa.fw.favicon-home> - ' Philomena - - h3 = @short_msg - p = @long_msg diff --git a/lib/philomena_web/templates/filter/_filter.html.heex b/lib/philomena_web/templates/filter/_filter.html.heex new file mode 100644 index 00000000..c0c6a0d4 --- /dev/null +++ b/lib/philomena_web/templates/filter/_filter.html.heex @@ -0,0 +1,53 @@ +
+

+ <%= @filter.name %> +

+ <%= if @filter.user do %> +

+ Maintained by + <%= render(PhilomenaWeb.UserAttributionView, "_user.html", object: @filter, conn: @conn) %> +

+ <% end %> + <%= if @filter.system do %> +

+ Maintained by staff +

+ <% end %> +
+ +

+ + <%= @filter.description %> + +

+
+
diff --git a/lib/philomena_web/templates/filter/_filter.html.slime b/lib/philomena_web/templates/filter/_filter.html.slime deleted file mode 100644 index ab4e9260..00000000 --- a/lib/philomena_web/templates/filter/_filter.html.slime +++ /dev/null @@ -1,39 +0,0 @@ -.filter - h3 - = @filter.name - - = if @filter.user do - p - ' Maintained by - = render PhilomenaWeb.UserAttributionView, "_user.html", object: @filter, conn: @conn - - = if @filter.system do - p - ' Maintained by staff - - .filter-options - ul - li - ' Spoilers - = length(@filter.spoilered_tag_ids) - ' , hides - = length(@filter.hidden_tag_ids) - - li - = link "View this filter", to: ~p"/filters/#{@filter}", class: "button" - li - = link "Copy and Customize", to: ~p"/filters/new?#{[based_on: @filter]}", class: "button" - - = if can?(@conn, :edit, @filter) do - li - = link "Edit this filter", to: ~p"/filters/#{@filter}/edit", class: "button" - - = if @filter.id == @conn.assigns.current_filter.id do - li - strong Your current filter - - else - li - = button_to "Use this filter", ~p"/filters/current?#{[id: @filter]}", method: "put", class: "button" - p - em - = @filter.description diff --git a/lib/philomena_web/templates/filter/_form.html.heex b/lib/philomena_web/templates/filter/_form.html.heex new file mode 100644 index 00000000..5c06334e --- /dev/null +++ b/lib/philomena_web/templates/filter/_form.html.heex @@ -0,0 +1,110 @@ +
+ <%= form_for @filter, @route, fn f -> %> + <%= if @filter.action do %> +
+ Oops, something went wrong! Please check the errors below. +
+ <% end %> +
+ <%= text_input(f, :name, class: "input input--wide", placeholder: "Name") %> + <%= error_tag(f, :name) %> +
+
+ This is a friendly name for this filter - it should be short and descriptive. +
+
+ <%= textarea(f, :description, class: "input input--wide", placeholder: "Description") %> + <%= error_tag(f, :description) %> +
+
+ Here you can describe your filter in a bit more detail. +
+
+ <%= label(f, :spoilered_tag_list, "Spoilered Tags") %> +
+ <%= render(PhilomenaWeb.TagView, "_tag_editor.html", f: f, name: :spoilered_tag_list, type: "edit") %> + <%= error_tag(f, :spoilered_tag_list) %> +
+
+ These tags will spoiler the images they're associated with. +
+
+ <%= label(f, :spoilered_complex_str, "Complex Spoiler Filter") %> +
+ <%= textarea(f, :spoilered_complex_str, class: "input input--wide", autocapitalize: "none") %> +
+ <%= error_tag(f, :spoilered_complex_str) %> +
+
+

+ Use the search syntax here to specify an additional filter. + For multiple filters, separate with a newline (or use the OR operator). Search fields excepting + + faved_by + + are supported. See the search syntax guide + for more information. +

+

+ + WARNING: + + This filter is applied along with your tag filters. Tag filters may spoiler images that you mean to filter more precisely here. Double-check to make sure they don't interfere. +

+
+
+ <%= label(f, :hidden_tag_list, "Hidden Tags") %> +
+ <%= render(PhilomenaWeb.TagView, "_tag_editor.html", f: f, name: :hidden_tag_list, type: "edit") %> + <%= error_tag(f, :hidden_tag_list) %> +
+
+ These tags will hide images entirely from the site; if you go directly to an image, it will spoiler it. +
+
+ <%= label(f, :hidden_complex_str, "Complex Hide Filter") %> +
+ <%= textarea(f, :hidden_complex_str, class: "input input--wide", autocapitalize: "none") %> +
+ <%= error_tag(f, :hidden_complex_str) %> +
+
+

+ Use the search syntax here to specify an additional filter. + For multiple filters, separate with a newline (or use the OR operator). Search fields excepting + + faved_by + + are supported. See the search syntax guide + for more information. +

+

+ + WARNING: + + This filter is applied along with your tag filters. Tag filters may hide images that you mean to filter more precisely here. Double-check to make sure they don't interfere. +

+
+ <%= cond do %> + <% is_nil(input_value(f, :id)) -> %> +
+ <%= checkbox(f, :public, class: "checkbox") %> + <%= label(f, :public) %> +
+
+ + You probably do not want to check this unless you know what you are doing - it cannot be changed later + + . Pulic filters can be shared with other users and used by them; if you make changes to a filter, it will update all users of that filter. +
+ <% input_value(f, :public) == true -> %> +
+ + Changes made to this filter will affect anyone else using this filter! Check your changes, and make sure your changes don't change the filter's intent. + +
+ <% true -> %> + <% end %> + <%= submit("Save Filter", class: "button") %> + <% end %> +
diff --git a/lib/philomena_web/templates/filter/_form.html.slime b/lib/philomena_web/templates/filter/_form.html.slime deleted file mode 100644 index 77965906..00000000 --- a/lib/philomena_web/templates/filter/_form.html.slime +++ /dev/null @@ -1,84 +0,0 @@ -.form - = form_for @filter, @route, fn f -> - = if @filter.action do - #error_explanation - ' Oops, something went wrong! Please check the errors below. - - .field - = text_input f, :name, class: "input input--wide", placeholder: "Name" - = error_tag f, :name - .fieldlabel - ' This is a friendly name for this filter - it should be short and descriptive. - .field - = textarea f, :description, class: "input input--wide", placeholder: "Description" - = error_tag f, :description - .fieldlabel - ' Here you can describe your filter in a bit more detail. - - - .field - = label f, :spoilered_tag_list, "Spoilered Tags" - br - = render PhilomenaWeb.TagView, "_tag_editor.html", f: f, name: :spoilered_tag_list, type: "edit" - = error_tag f, :spoilered_tag_list - .fieldlabel - ' These tags will spoiler the images they're associated with. - .field - = label f, :spoilered_complex_str, "Complex Spoiler Filter" - br - = textarea f, :spoilered_complex_str, class: "input input--wide", autocapitalize: "none" - br - = error_tag f, :spoilered_complex_str - .fieldlabel - p - ' Use the search syntax here to specify an additional filter. - ' For multiple filters, separate with a newline (or use the OR operator). Search fields excepting - code<> faved_by - ' are supported. See the search syntax guide - ' for more information. - p - strong> WARNING: - ' This filter is applied along with your tag filters. Tag filters may spoiler images that you mean to filter more precisely here. Double-check to make sure they don't interfere. - - - .field - = label f, :hidden_tag_list, "Hidden Tags" - br - = render PhilomenaWeb.TagView, "_tag_editor.html", f: f, name: :hidden_tag_list, type: "edit" - = error_tag f, :hidden_tag_list - .fieldlabel - ' These tags will hide images entirely from the site; if you go directly to an image, it will spoiler it. - .field - = label f, :hidden_complex_str, "Complex Hide Filter" - br - = textarea f, :hidden_complex_str, class: "input input--wide", autocapitalize: "none" - br - = error_tag f, :hidden_complex_str - .fieldlabel - p - ' Use the search syntax here to specify an additional filter. - ' For multiple filters, separate with a newline (or use the OR operator). Search fields excepting - code<> faved_by - ' are supported. See the search syntax guide - ' for more information. - p - strong> WARNING: - ' This filter is applied along with your tag filters. Tag filters may hide images that you mean to filter more precisely here. Double-check to make sure they don't interfere. - - = cond do - - is_nil(input_value(f, :id)) -> - .field - = checkbox f, :public, class: "checkbox" - = label f, :public - - .fieldlabel - strong You probably do not want to check this unless you know what you are doing - it cannot be changed later - | . Pulic filters can be shared with other users and used by them; if you make changes to a filter, it will update all users of that filter. - - - input_value(f, :public) == true -> - .fieldlabel - strong Changes made to this filter will affect anyone else using this filter! Check your changes, and make sure your changes don't change the filter's intent. - - - true -> - - = submit "Save Filter", class: "button" diff --git a/lib/philomena_web/templates/filter/edit.html.heex b/lib/philomena_web/templates/filter/edit.html.heex new file mode 100644 index 00000000..aedd13df --- /dev/null +++ b/lib/philomena_web/templates/filter/edit.html.heex @@ -0,0 +1,29 @@ +

+ Editing Filter +

+<%= render(PhilomenaWeb.FilterView, "_form.html", filter: @changeset, route: ~p"/filters/#{@filter}") %> +<%= if not @filter.public and not @filter.system do %> +
+
+ + +
+
+

+ This filter is currently private and only accessible to you. If you + click the button below, this will make the filter public and + accessible to other users. +

+

+ This process is + + irreversible + + . Once you make a filter public, you cannot make it private again. +

+ <%= button_to("Convert to Public Filter", ~p"/filters/#{@filter}/public", class: "button", method: "create", data: [confirm: "Are you really, really sure?"]) %> +
+
+<% end %> diff --git a/lib/philomena_web/templates/filter/edit.html.slime b/lib/philomena_web/templates/filter/edit.html.slime deleted file mode 100644 index db0bf5d6..00000000 --- a/lib/philomena_web/templates/filter/edit.html.slime +++ /dev/null @@ -1,22 +0,0 @@ -h2 Editing Filter -= render PhilomenaWeb.FilterView, "_form.html", filter: @changeset, route: ~p"/filters/#{@filter}" - -= if not @filter.public and not @filter.system do - br - br - - input.toggle-box id="public-tools" type="checkbox" checked=false - label for="public-tools" Advanced Options - .toggle-box-container - .toggle-box-container__content - p - ' This filter is currently private and only accessible to you. If you - ' click the button below, this will make the filter public and - ' accessible to other users. - - p - ' This process is - strong irreversible - ' . Once you make a filter public, you cannot make it private again. - - = button_to "Convert to Public Filter", ~p"/filters/#{@filter}/public", class: "button", method: "create", data: [confirm: "Are you really, really sure?"] diff --git a/lib/philomena_web/templates/filter/index.html.heex b/lib/philomena_web/templates/filter/index.html.heex new file mode 100644 index 00000000..3e3547b9 --- /dev/null +++ b/lib/philomena_web/templates/filter/index.html.heex @@ -0,0 +1,361 @@ +
+
+

+ Content Safety +

+

+ By default, content that is safe and suitable for all ages is all you'll see on the site, and how most of our users browse. The default filters focus on art, so filter out things like memes and what some users would consider "spam". +

+

+ Filters let you customize what content you see on the site. This means that with the appropriate filter selected, you can access content which is not suitable for everyone, such as sexually explicit, grimdark or gory material. +

+

+ + By changing away from the default filters, you accept you are legally permitted to view this content in your jurisdiction. If in doubt, stick with the recommended default filters. + +

+
+

+ Browsing Filters +

+

+ Images posted on the site are tagged, allowing you to easily search for content. You can also filter out content you'd rather not see using filters. Filters are sets of tags - spoilered tags and hidden tags. Spoilers are images that show up as thumbnails instead of the image, letting you click through and find out more about an image before deciding to view it or not. Hidden tags will simply hide images. +

+

+ There are set of global filters to pick from which cover some common use-cases. + If you're logged in you can also customize these filters and make your own, as well as quickly switch (via the menu on every page) between them. +

+

+ So how do these work? +

+

+ You can select any filter you can see. This will become your + + active filter + + and will affect how you see the site. You can edit filters if you own them - you can create a filter from scratch with the link under "My Filters" (if you're logged in, of course) or by clicking "Customize", which will copy an existing filter for you to edit. +

+

+ By default all the filters you create are private and only visible by you. You can have as many as you like and switch between them instantly with no limits. You can also create a public filter, which can be seen and used by any user on the site, allowing you to share useful filters with others. +

+ <%= if !@conn.params["fq"] do %> +

+ My Filters +

+ <%= if @current_user do %> +

+ <%= link("Click here to make a new filter from scratch", to: ~p"/filters/new") %> +

+ <%= for filter <- @my_filters do %> + <%= render(PhilomenaWeb.FilterView, "_filter.html", conn: @conn, filter: filter) %> + <% end %> + <% else %> +

+ If you're logged in, you can create and maintain custom filters here. +

+ <% end %> +

+ Global Filters +

+ <%= for filter <- @system_filters do %> + <%= render(PhilomenaWeb.FilterView, "_filter.html", conn: @conn, filter: filter) %> + <% end %> + <%= if @current_user do %> +

+ Recent Filters +

+

+ Clicking this button will clear the recent filters list in the header dropdown. + <%= button_to("Clear recent filter list", ~p"/filters/clear_recent", method: "delete", class: "button") %> +

+ <% end %> + <% end %> +

+ Search Filters +

+

+ Some users maintain custom filters which are publicly shared; you can search these filters with the box below. +

+ <%= form_for :filters, ~p"/filters", [method: "get", class: "hform", enforce_utf8: false], fn f -> %> +
+ <%= text_input(f, :fq, name: :fq, value: @conn.params["fq"], class: "input hform__text", placeholder: "Search filters", autocapitalize: "none") %> + <%= submit("Search", class: "hform__button button") %> +
+ <% end %> +
+ For more information, see the + + search syntax documentation + + . Search results are sorted alphabetically. +
+ <%= if @conn.params["fq"] do %> +

+ Search Results +

+ <%= cond do %> + <% Enum.any?(@filters) -> %> + <% route = fn p -> ~p"/filters?#{p}" end %> + <% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @filters, route: route, params: [fq: @conn.params["fq"]], conn: @conn) %> + <%= for filter <- @filters do %> + <%= render(PhilomenaWeb.FilterView, "_filter.html", conn: @conn, filter: filter) %> + <% end %> +
+ +
+ <% assigns[:error] -> %> +

+ Oops, there was an error evaluating your query: +

+
+          <%= assigns[:error] %>
+        
+ <% true -> %> +

+ No filters found! +

+ <% end %> + <% end %> +
+

+ Allowed fields +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Field Selector + + Type + + Description + + Example +
+ + creator + + + Literal + + Matches the creator of this filter. + + + <%= link("creator:AppleDash", to: ~p"/filters?#{[fq: "creator:AppleDash"]}") %> + +
+ + name + + + Literal + + Matches the name of this filter. This is the default field. + + + <%= link("name:default", to: ~p"/filters?#{[fq: "name:default"]}") %> + +
+ + description + + + Full Text + + Matches the description of this filter. + + + <%= link("description:the show's rating", to: ~p"/filters?#{[fq: "description:the show's rating"]}") %> + +
+ + created_at + + + Date/Time Range + + Matches the creation time of this filter. + + + <%= link("created_at:2015", to: ~p"/filters?#{[fq: "created_at:2015"]}") %> + +
+ + id + + + Numeric Range + + Matches the numeric surrogate key for this filter. + + + <%= link("id:1", to: ~p"/filters?#{[fq: "id:1"]}") %> + +
+ + spoilered_count + + + Numeric Range + + Matches the number of spoilered tags in this filter. + + + <%= link("spoilered_count:1", to: ~p"/filters?#{[fq: "spoilered_count:1"]}") %> + +
+ + hidden_count + + + Numeric Range + + Matches the number of hidden tags in this filter. + + + <%= link("hidden_count:1", to: ~p"/filters?#{[fq: "hidden_count:1"]}") %> + +
+ + my + + + Meta + + + my:filters + + matches filters you have published if you are signed in. + + + <%= link("my:filters", to: ~p"/filters?#{[fq: "my:filters"]}") %> + +
+ + system + + + Boolean + + Matches system filters + + + <%= link("system:true", to: ~p"/filters?#{[fq: "system:true"]}") %> + +
+ + public + + + Boolean + + Matches public filters. Note that + + public:false + + matches only your own private filters. + + + <%= link("public:false", to: ~p"/filters?#{[fq: "public:false"]}") %> + +
+ + user_id + + + Literal + + Matches filters with the specified user_id. + + + <%= link("user_id:307505", to: ~p"/filters?#{[fq: "user_id:307505"]}") %> + +
+<%= if @conn.params["fq"] do %> +

+ <%= link("Back to filters", to: ~p"/filters") %> +

+<% end %> diff --git a/lib/philomena_web/templates/filter/index.html.slime b/lib/philomena_web/templates/filter/index.html.slime deleted file mode 100644 index 3474b6fb..00000000 --- a/lib/philomena_web/templates/filter/index.html.slime +++ /dev/null @@ -1,180 +0,0 @@ -.walloftext - .block.block--fixed.block--warning - h2 Content Safety - p - ' By default, content that is safe and suitable for all ages is all you'll see on the site, and how most of our users browse. The default filters focus on art, so filter out things like memes and what some users would consider "spam". - p - ' Filters let you customize what content you see on the site. This means that with the appropriate filter selected, you can access content which is not suitable for everyone, such as sexually explicit, grimdark or gory material. - p - strong - ' By changing away from the default filters, you accept you are legally permitted to view this content in your jurisdiction. If in doubt, stick with the recommended default filters. - h1 Browsing Filters - p - ' Images posted on the site are tagged, allowing you to easily search for content. You can also filter out content you'd rather not see using filters. Filters are sets of tags - spoilered tags and hidden tags. Spoilers are images that show up as thumbnails instead of the image, letting you click through and find out more about an image before deciding to view it or not. Hidden tags will simply hide images. - p - ' There are set of global filters to pick from which cover some common use-cases. - ' If you're logged in you can also customize these filters and make your own, as well as quickly switch (via the menu on every page) between them. - - h2 So how do these work? - p - ' You can select any filter you can see. This will become your - strong - ' active filter - ' and will affect how you see the site. You can edit filters if you own them - you can create a filter from scratch with the link under "My Filters" (if you're logged in, of course) or by clicking "Customize", which will copy an existing filter for you to edit. - p - ' By default all the filters you create are private and only visible by you. You can have as many as you like and switch between them instantly with no limits. You can also create a public filter, which can be seen and used by any user on the site, allowing you to share useful filters with others. - - = if !@conn.params["fq"] do - h2 My Filters - = if @current_user do - p - = link("Click here to make a new filter from scratch", to: ~p"/filters/new") - = for filter <- @my_filters do - = render PhilomenaWeb.FilterView, "_filter.html", conn: @conn, filter: filter - - else - p - ' If you're logged in, you can create and maintain custom filters here. - - h2 Global Filters - = for filter <- @system_filters do - = render PhilomenaWeb.FilterView, "_filter.html", conn: @conn, filter: filter - - = if @current_user do - h2 Recent Filters - p - ' Clicking this button will clear the recent filters list in the header dropdown. - = button_to "Clear recent filter list", ~p"/filters/clear_recent", method: "delete", class: "button" - - h2 Search Filters - p - ' Some users maintain custom filters which are publicly shared; you can search these filters with the box below. - = form_for :filters, ~p"/filters", [method: "get", class: "hform", enforce_utf8: false], fn f -> - .field - = text_input f, :fq, name: :fq, value: @conn.params["fq"], class: "input hform__text", placeholder: "Search filters", autocapitalize: "none" - = submit "Search", class: "hform__button button" - - .fieldlabel - ' For more information, see the - a href="/pages/search_syntax" search syntax documentation - ' . Search results are sorted alphabetically. - - = if @conn.params["fq"] do - h2 Search Results - = cond do - - Enum.any?(@filters) -> - - route = fn p -> ~p"/filters?#{p}" end - - pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @filters, route: route, params: [fq: @conn.params["fq"]], conn: @conn - - = for filter <- @filters do - = render PhilomenaWeb.FilterView, "_filter.html", conn: @conn, filter: filter - - .block - .block__header.block__header--light.page__header - .page__pagination = pagination - .page__info - span.block__header__title - = render PhilomenaWeb.PaginationView, "_pagination_info.html", page: @filters, conn: @conn - - - assigns[:error] -> - p - ' Oops, there was an error evaluating your query: - pre = assigns[:error] - - - true -> - p - ' No filters found! - -h3 Allowed fields -table.table - thead - tr - th Field Selector - th Type - th Description - th Example - tbody - tr - td - code creator - td Literal - td Matches the creator of this filter. - td - code = link "creator:AppleDash", to: ~p"/filters?#{[fq: "creator:AppleDash"]}" - tr - td - code name - td Literal - td Matches the name of this filter. This is the default field. - td - code = link "name:default", to: ~p"/filters?#{[fq: "name:default"]}" - tr - td - code description - td Full Text - td Matches the description of this filter. - td - code = link "description:the show's rating", to: ~p"/filters?#{[fq: "description:the show's rating"]}" - tr - td - code created_at - td Date/Time Range - td Matches the creation time of this filter. - td - code = link "created_at:2015", to: ~p"/filters?#{[fq: "created_at:2015"]}" - tr - td - code id - td Numeric Range - td Matches the numeric surrogate key for this filter. - td - code = link "id:1", to: ~p"/filters?#{[fq: "id:1"]}" - tr - td - code spoilered_count - td Numeric Range - td Matches the number of spoilered tags in this filter. - td - code = link "spoilered_count:1", to: ~p"/filters?#{[fq: "spoilered_count:1"]}" - tr - td - code hidden_count - td Numeric Range - td Matches the number of hidden tags in this filter. - td - code = link "hidden_count:1", to: ~p"/filters?#{[fq: "hidden_count:1"]}" - tr - td - code my - td Meta - td - code> my:filters - ' matches filters you have published if you are signed in. - td - code = link "my:filters", to: ~p"/filters?#{[fq: "my:filters"]}" - tr - td - code system - td Boolean - td Matches system filters - td - code = link "system:true", to: ~p"/filters?#{[fq: "system:true"]}" - tr - td - code public - td Boolean - td - ' Matches public filters. Note that - code> public:false - ' matches only your own private filters. - td - code = link "public:false", to: ~p"/filters?#{[fq: "public:false"]}" - tr - td - code user_id - td Literal - td Matches filters with the specified user_id. - td - code = link "user_id:307505", to: ~p"/filters?#{[fq: "user_id:307505"]}" - -= if @conn.params["fq"] do - p = link("Back to filters", to: ~p"/filters") diff --git a/lib/philomena_web/templates/filter/new.html.heex b/lib/philomena_web/templates/filter/new.html.heex new file mode 100644 index 00000000..98fe9a46 --- /dev/null +++ b/lib/philomena_web/templates/filter/new.html.heex @@ -0,0 +1,4 @@ +

+ Creating New Filter +

+<%= render(PhilomenaWeb.FilterView, "_form.html", filter: @changeset, route: ~p"/filters") %> diff --git a/lib/philomena_web/templates/filter/new.html.slime b/lib/philomena_web/templates/filter/new.html.slime deleted file mode 100644 index 26dc5513..00000000 --- a/lib/philomena_web/templates/filter/new.html.slime +++ /dev/null @@ -1,2 +0,0 @@ -h2 Creating New Filter -= render PhilomenaWeb.FilterView, "_form.html", filter: @changeset, route: ~p"/filters" \ No newline at end of file diff --git a/lib/philomena_web/templates/filter/show.html.heex b/lib/philomena_web/templates/filter/show.html.heex new file mode 100644 index 00000000..149e6ce0 --- /dev/null +++ b/lib/philomena_web/templates/filter/show.html.heex @@ -0,0 +1,80 @@ +

+ Viewing full filter details for + <%= @filter.name %> +

+
+
+ +
+ <%= if @filter.user do %> +

+ This filter is maintained by + <%= render(PhilomenaWeb.UserAttributionView, "_user.html", object: @filter, conn: @conn) %> +

+ <% end %> +

+ <%= @filter.description %> +

+ <%= if length(@spoilered_tags) > 0 or !!@filter.spoilered_complex_str do %> +
+ This filter spoilers... +
+ <%= for tag <- @spoilered_tags do %> + <%= render(PhilomenaWeb.TagView, "_tag.html", tag: tag, conn: @conn) %> + <% end %> +
+      <%= @filter.spoilered_complex_str %>
+    
+ <% else %> +

+ This filter doesn't spoiler any tags. +

+ <% end %> + <%= if length(@hidden_tags) > 0 or !!@filter.hidden_complex_str do %> +
+ This filter hides... +
+ <%= for tag <- @hidden_tags do %> + <%= render(PhilomenaWeb.TagView, "_tag.html", tag: tag, conn: @conn) %> + <% end %> +
+      <%= @filter.hidden_complex_str %>
+    
+ <% else %> +

+ This filter doesn't hide any tags. +

+ <% end %> +
+<% # p = link("Report filter to moderators", new_report_path(reportable_class: 'filter', reportable_id: @filter.id) %> +

+ <%= link("Back to filters", to: ~p"/filters") %> +

diff --git a/lib/philomena_web/templates/filter/show.html.slime b/lib/philomena_web/templates/filter/show.html.slime deleted file mode 100644 index 6e1221f3..00000000 --- a/lib/philomena_web/templates/filter/show.html.slime +++ /dev/null @@ -1,64 +0,0 @@ -h1 - ' Viewing full filter details for - = @filter.name - -.filter - .filter-options - ul - li - ' Spoilers - => number_with_delimiter(length(@filter.spoilered_tag_ids)) - => pluralize("tag", "tags", length(@filter.spoilered_tag_ids)) - ' and hides - => number_with_delimiter(length(@filter.hidden_tag_ids)) - => pluralize("tag", "tags", length(@filter.hidden_tag_ids)) - - = if @filter.id == @conn.assigns.current_filter.id do - li - strong Your current filter - - else - li - = button_to "Use this filter", ~p"/filters/current?#{[id: @filter]}", method: "put", class: "button" - - = if can?(@conn, :edit, @filter) do - li - = link "Edit this filter", to: ~p"/filters/#{@filter}/edit", class: "button" - - = if can?(@conn, :delete, @filter) do - = button_to "Destroy this filter", ~p"/filters/#{@filter}", method: "delete", class: "button", data: [confirm: "Are you really, really sure?"] - - = if @filter.user do - p.filter-maintainer - ' This filter is maintained by - = render PhilomenaWeb.UserAttributionView, "_user.html", object: @filter, conn: @conn - - p.filter-description - = @filter.description - - = if length(@spoilered_tags) > 0 or !!@filter.spoilered_complex_str do - h5 This filter spoilers... - - = for tag <- @spoilered_tags do - = render PhilomenaWeb.TagView, "_tag.html", tag: tag, conn: @conn - pre.spoiler-filter-code - = @filter.spoilered_complex_str - - - else - p This filter doesn't spoiler any tags. - - - = if length(@hidden_tags) > 0 or !!@filter.hidden_complex_str do - h5 This filter hides... - - = for tag <- @hidden_tags do - = render PhilomenaWeb.TagView, "_tag.html", tag: tag, conn: @conn - pre.spoiler-filter-code - = @filter.hidden_complex_str - - - else - p This filter doesn't hide any tags. - - - -/p = link("Report filter to moderators", new_report_path(reportable_class: 'filter', reportable_id: @filter.id) -p = link("Back to filters", to: ~p"/filters") diff --git a/lib/philomena_web/templates/fingerprint_profile/show.html.heex b/lib/philomena_web/templates/fingerprint_profile/show.html.heex new file mode 100644 index 00000000..1f1e5ed3 --- /dev/null +++ b/lib/philomena_web/templates/fingerprint_profile/show.html.heex @@ -0,0 +1,92 @@ +

+ <%= @fingerprint %> + 's fingerprint profile +

+ +<%= render(PhilomenaWeb.BanView, "_bans.html", bans: @fingerprint_bans, conn: @conn) %> +

+ Administration Options +

+ +

+ Actions +

+ +

+ Observed users +

+ + + + + + + + + + + <%= for ufp <- @user_fps do %> + + + + + + + <% end %> + +
+ Username + + Account Used + + Last Seen + + Created At +
+ <%= link(ufp.user.name, to: ~p"/profiles/#{ufp.user}") %> + + <%= ufp.uses %> + times + + <%= pretty_time(ufp.updated_at) %> + + <%= pretty_time(ufp.user.created_at) %> +
diff --git a/lib/philomena_web/templates/fingerprint_profile/show.html.slime b/lib/philomena_web/templates/fingerprint_profile/show.html.slime deleted file mode 100644 index cfb36e1e..00000000 --- a/lib/philomena_web/templates/fingerprint_profile/show.html.slime +++ /dev/null @@ -1,44 +0,0 @@ -h1 - = @fingerprint - ' 's fingerprint profile - -ul - li = link "View images this fingerprint has uploaded", to: ~p"/search?#{[q: "fingerprint:#{@fingerprint}"]}" - li = link "View comments this fingerprint has posted", to: ~p"/comments?#{[cq: "fingerprint:#{@fingerprint}"]}" - li = link "View posts this fingerprint has made", to: ~p"/posts?#{[pq: "fingerprint:#{@fingerprint}"]}" - -= render PhilomenaWeb.BanView, "_bans.html", bans: @fingerprint_bans, conn: @conn - -h2 Administration Options -ul - li = link "View tag changes", to: ~p"/fingerprint_profiles/#{@fingerprint}/tag_changes" - li = link "View source URL history", to: ~p"/fingerprint_profiles/#{@fingerprint}/source_changes" - li = link "View reports this fingerprint has made", to: ~p"/admin/reports?#{[rq: "fingerprint:#{@fingerprint}"]}" - li = link "View fingerprint ban history", to: ~p"/admin/fingerprint_bans?#{[fingerprint: @fingerprint]}" - li = link "Ban this sucker", to: ~p"/admin/fingerprint_bans/new?#{[fingerprint: @fingerprint]}" - -h2 Actions -ul - li = link "Revert all tag changes", to: ~p"/tag_changes/full_revert?#{[fingerprint: @fingerprint]}", data: [confirm: "Are you really, really sure?", method: "create"] - li = link "...the button above didn't work (use carefully, this is resource-intensive)", to: ~p"/tag_changes/full_revert?#{[fingerprint: @fingerprint, batch_size: 1]}", data: [confirm: "Please confirm that you're aware that this may crash the site and are ready to take on the full wrath of the admins if it does so after you press this button.", method: "create"] - -h4 Observed users -table.table - thead - tr - th Username - th Account Used - th Last Seen - th Created At - tbody - = for ufp <- @user_fps do - tr - td - = link ufp.user.name, to: ~p"/profiles/#{ufp.user}" - td - => ufp.uses - ' times - td - => pretty_time ufp.updated_at - td - => pretty_time ufp.user.created_at diff --git a/lib/philomena_web/templates/fingerprint_profile/source_change/index.html.heex b/lib/philomena_web/templates/fingerprint_profile/source_change/index.html.heex new file mode 100644 index 00000000..a8597b9d --- /dev/null +++ b/lib/philomena_web/templates/fingerprint_profile/source_change/index.html.heex @@ -0,0 +1,7 @@ +

+ Source changes by + <%= @fingerprint %> +

+<% route = fn p -> ~p"/fingerprint_profiles/#{@fingerprint}/source_changes?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @source_changes, route: route, conn: @conn) %> +<%= render(PhilomenaWeb.SourceChangeView, "index.html", conn: @conn, source_changes: @source_changes, pagination: pagination) %> diff --git a/lib/philomena_web/templates/fingerprint_profile/source_change/index.html.slime b/lib/philomena_web/templates/fingerprint_profile/source_change/index.html.slime deleted file mode 100644 index 0c92e88d..00000000 --- a/lib/philomena_web/templates/fingerprint_profile/source_change/index.html.slime +++ /dev/null @@ -1,8 +0,0 @@ -h1 - ' Source changes by - = @fingerprint - -- route = fn p -> ~p"/fingerprint_profiles/#{@fingerprint}/source_changes?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @source_changes, route: route, conn: @conn - -= render PhilomenaWeb.SourceChangeView, "index.html", conn: @conn, source_changes: @source_changes, pagination: pagination diff --git a/lib/philomena_web/templates/fingerprint_profile/tag_change/index.html.heex b/lib/philomena_web/templates/fingerprint_profile/tag_change/index.html.heex new file mode 100644 index 00000000..8df89999 --- /dev/null +++ b/lib/philomena_web/templates/fingerprint_profile/tag_change/index.html.heex @@ -0,0 +1,23 @@ +

+ Tag changes by + <%= @fingerprint %> +

+<% route = fn p -> ~p"/fingerprint_profiles/#{@fingerprint}/tag_changes?#{p}" end %> +<% + params = + if @conn.params["added"] do + [added: @conn.params["added"]] + end +%> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @tag_changes, route: route, conn: @conn, params: params) %> +
+
+ + Display only: + + <%= link("Removed", to: ~p"/fingerprint_profiles/#{@fingerprint}/tag_changes?#{[added: 0]}") %> + <%= link("Added", to: ~p"/fingerprint_profiles/#{@fingerprint}/tag_changes?#{[added: 1]}") %> + <%= link("All", to: ~p"/fingerprint_profiles/#{@fingerprint}/tag_changes") %> +
+ <%= render(PhilomenaWeb.TagChangeView, "index.html", conn: @conn, tag_changes: @tag_changes, pagination: pagination) %> +
diff --git a/lib/philomena_web/templates/fingerprint_profile/tag_change/index.html.slime b/lib/philomena_web/templates/fingerprint_profile/tag_change/index.html.slime deleted file mode 100644 index 9a486e91..00000000 --- a/lib/philomena_web/templates/fingerprint_profile/tag_change/index.html.slime +++ /dev/null @@ -1,18 +0,0 @@ -h1 - ' Tag changes by - = @fingerprint - -- route = fn p -> ~p"/fingerprint_profiles/#{@fingerprint}/tag_changes?#{p}" end -- params = if @conn.params["added"], do: [added: @conn.params["added"]] -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @tag_changes, route: route, conn: @conn, params: params - -.block - .block__header - span.block__header__title - | Display only: - - = link "Removed", to: ~p"/fingerprint_profiles/#{@fingerprint}/tag_changes?#{[added: 0]}" - = link "Added", to: ~p"/fingerprint_profiles/#{@fingerprint}/tag_changes?#{[added: 1]}" - = link "All", to: ~p"/fingerprint_profiles/#{@fingerprint}/tag_changes" - - = render PhilomenaWeb.TagChangeView, "index.html", conn: @conn, tag_changes: @tag_changes, pagination: pagination diff --git a/lib/philomena_web/templates/forum/index.html.heex b/lib/philomena_web/templates/forum/index.html.heex new file mode 100644 index 00000000..56bf05d9 --- /dev/null +++ b/lib/philomena_web/templates/forum/index.html.heex @@ -0,0 +1,66 @@ +

+ Discussion Forums +

+
+
+ + + Search Posts + + + <%= @topic_count %> + topics + +
+
+ + + + + + + + + + + <%= for forum <- @forums do %> + + + + + + + <% end %> + +
+ Forum + + Topics + + Posts + + Last Post +
+ <%= link(forum.name, to: ~p"/forums/#{forum}") %> +
+ <%= forum.description %> +
+
+ <%= forum.topic_count %> + + <%= forum.post_count %> + + <%= if forum.last_post do %> + + <%= link(forum.last_post.topic.title, to: ~p"/forums/#{forum.last_post.topic.forum}/topics/#{forum.last_post.topic}") %> + +
+ <%= link("Go to post", to: ~p"/forums/#{forum.last_post.topic.forum}/topics/#{forum.last_post.topic}?#{[post_id: forum.last_post.id]}" <> "#post_#{forum.last_post.id}") %> + by + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: forum.last_post, conn: @conn) %> +
+ <%= pretty_time(forum.last_post.created_at) %> + <% end %> +
+
+
diff --git a/lib/philomena_web/templates/forum/index.html.slime b/lib/philomena_web/templates/forum/index.html.slime deleted file mode 100644 index 616376fc..00000000 --- a/lib/philomena_web/templates/forum/index.html.slime +++ /dev/null @@ -1,35 +0,0 @@ -h1 Discussion Forums -.block - .block__header - a href=~p"/posts" - i.fa.fa-fw.fa-search> - ' Search Posts - span.block__header__item - => @topic_count - ' topics - .block__content - table.table.table--communication-list - thead - tr - th.table--communication-list__name Forum - th.table--communication-list__stats.hide-mobile Topics - th.table--communication-list__stats.hide-mobile Posts - th.table--communication-list__last-post Last Post - tbody - = for forum <- @forums do - tr - td.table--communication-list__name - => link(forum.name, to: ~p"/forums/#{forum}") - .small-text = forum.description - td.table--communication-list__stats.hide-mobile = forum.topic_count - td.table--communication-list__stats.hide-mobile = forum.post_count - td.table--communication-list__last-post - = if forum.last_post do - strong - => link(forum.last_post.topic.title, to: ~p"/forums/#{forum.last_post.topic.forum}/topics/#{forum.last_post.topic}") - br - => link("Go to post", to: ~p"/forums/#{forum.last_post.topic.forum}/topics/#{forum.last_post.topic}?#{[post_id: forum.last_post.id]}" <> "#post_#{forum.last_post.id}") - ' by - => render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: forum.last_post, conn: @conn - br - => pretty_time(forum.last_post.created_at) diff --git a/lib/philomena_web/templates/forum/show.html.heex b/lib/philomena_web/templates/forum/show.html.heex new file mode 100644 index 00000000..79268395 --- /dev/null +++ b/lib/philomena_web/templates/forum/show.html.heex @@ -0,0 +1,94 @@ +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @topics, route: fn p -> ~p"/forums/#{@forum}?#{p}" end) %> +

+ <%= @forum.name %> +

+
+
+ <%= link("Forums", to: ~p"/forums") %> + » + <%= link(@forum.name, to: ~p"/forums/#{@forum}") %> + + + New Topic + + + + Search Posts + + + <%= @forum.topic_count %> + topics + +
+ +
+ + + + + + + + + + <%= for topic <- @topics do %> + + + + + + <% end %> + +
+ Topic + + Posts + + Last Post +
+ <%= if topic.sticky do %> + + <% end %> + <%= if topic.locked_at do %> + + <% end %> + <%= if topic.poll do %> + + <% end %> + <%= link(topic.title, to: ~p"/forums/#{@forum}/topics/#{topic}") %> +
+ Posted + <%= pretty_time(topic.created_at) %> + by + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: topic, conn: @conn) %> +
+
+ <%= topic.post_count %> + + <%= if topic.last_post do %> + <%= link("Go to post", to: ~p"/forums/#{topic.forum}/topics/#{topic}?#{[post_id: topic.last_post]}" <> "#post_#{topic.last_post.id}") %> + by + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: topic.last_post, conn: @conn) %> +
+ <%= pretty_time(topic.last_post.created_at) %> + <% end %> +
+
+ +
+<% # - if current_user %> +<% # = render partial: 'topics/form' %> diff --git a/lib/philomena_web/templates/forum/show.html.slime b/lib/philomena_web/templates/forum/show.html.slime deleted file mode 100644 index 870427ff..00000000 --- a/lib/philomena_web/templates/forum/show.html.slime +++ /dev/null @@ -1,59 +0,0 @@ -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @topics, route: fn p -> ~p"/forums/#{@forum}?#{p}" end - -h1 = @forum.name -.block - .block__header - => link("Forums", to: ~p"/forums") - ' » - => link(@forum.name, to: ~p"/forums/#{@forum}") - a href=~p"/forums/#{@forum}/topics/new" - i.fa.fa-fw.fa-edit> - ' New Topic - - a href=~p"/posts?#{[pq: "forum:#{@forum.short_name}"]}" - i.fa.fa-fw.fa-search> - ' Search Posts - span.spacing-left - => @forum.topic_count - ' topics - .block__header--sub.block__header--light.page__header - .page__pagination = pagination - .page__info - span.block__header__title = @forum.description - = render PhilomenaWeb.Forum.SubscriptionView, "_subscription.html", forum: @forum, watching: @watching, conn: @conn - .block__content - table.table.table--communication-list - thead - tr - th.table--communication-list__name Topic - th.table--communication-list__stats.hide-mobile Posts - th.table--communication-list__last-post Last Post - tbody - = for topic <- @topics do - tr - td.table--communication-list__name - = if topic.sticky do - i.fa.fa-thumbtack - = if topic.locked_at do - i.fa.fa-lock - = if topic.poll do - i.fas.fa-poll-h - =< link(topic.title, to: ~p"/forums/#{@forum}/topics/#{topic}") - .small-text - ' Posted - => pretty_time(topic.created_at) - ' by - = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: topic, conn: @conn - td.table--communication-list__stats.hide-mobile = topic.post_count - td.table--communication-list__last-post - = if topic.last_post do - => link("Go to post", to: ~p"/forums/#{topic.forum}/topics/#{topic}?#{[post_id: topic.last_post]}" <> "#post_#{topic.last_post.id}") - ' by - = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: topic.last_post, conn: @conn - br - => pretty_time(topic.last_post.created_at) - .block__header.block__header--light.page__header - .page__pagination = pagination - -/- if current_user -/ = render partial: 'topics/form' diff --git a/lib/philomena_web/templates/forum/subscription/_subscription.html.heex b/lib/philomena_web/templates/forum/subscription/_subscription.html.heex new file mode 100644 index 00000000..330fe5ca --- /dev/null +++ b/lib/philomena_web/templates/forum/subscription/_subscription.html.heex @@ -0,0 +1,42 @@ +<% + watch_path = ~p"/forums/#{@forum}/subscription" + + watch_class = + if @watching do + "hidden" + else + "" + end + + unwatch_path = ~p"/forums/#{@forum}/subscription" + + unwatch_class = + if @watching do + "" + else + "hidden" + end +%> +<%= if @conn.assigns.current_user do %> + + + + + Subscribe + + + + + + Unsubscribe + + + +<% else %> + + + + Subscribe + + +<% end %> diff --git a/lib/philomena_web/templates/forum/subscription/_subscription.html.slime b/lib/philomena_web/templates/forum/subscription/_subscription.html.slime deleted file mode 100644 index 42172150..00000000 --- a/lib/philomena_web/templates/forum/subscription/_subscription.html.slime +++ /dev/null @@ -1,23 +0,0 @@ -elixir: - watch_path = ~p"/forums/#{@forum}/subscription" - watch_class = if @watching, do: "hidden", else: "" - - unwatch_path = ~p"/forums/#{@forum}/subscription" - unwatch_class = if @watching, do: "", else: "hidden" - -= if @conn.assigns.current_user do - span.js-subscription-target - a.js-subscription-link href=watch_path class=watch_class data-remote="true" data-method="post" - i.fa.fa-bell> - span.hide-mobile - ' Subscribe - - a.js-subscription-link href=unwatch_path class=unwatch_class data-remote="true" data-method="delete" - i.fa.fa-bell-slash> - span.hide-mobile - ' Unsubscribe -- else - a href=~p"/sessions/new" - i.fa.fa-bell> - span.hide-mobile - ' Subscribe diff --git a/lib/philomena_web/templates/gallery/_form.html.heex b/lib/philomena_web/templates/gallery/_form.html.heex new file mode 100644 index 00000000..407870e0 --- /dev/null +++ b/lib/philomena_web/templates/gallery/_form.html.heex @@ -0,0 +1,37 @@ +<%= form_for @changeset, @action, fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+ <%= label(f, :title, "Choose a title displayed in gallery preview") %> + <%= text_input(f, :title, class: "input input--wide", placeholder: "Title", required: true) %> + <%= error_tag(f, :title) %> +
+
+ <%= label(f, :spoiler_warning, "If you are going to have NSFW images in the gallery, leave a warning for users who may not want to see it") %> + <%= text_input(f, :spoiler_warning, class: "input input--wide", placeholder: "Spoiler warning") %> + <%= error_tag(f, :spoiler_warning) %> +
+
+ <%= label(:description, "Describe the gallery in a few words") %> + <%= textarea(f, :description, class: "input input--wide", placeholder: "Description") %> + <%= error_tag(f, :description) %> +
+
+ <%= label(f, :thumbnail_id, "Set an existing image as the gallery cover") %> +
+ <%= number_input(f, :thumbnail_id, value: input_value(f, :thumbnail_id) || @conn.params["with_image"], class: "input", placeholder: "Image ID (e.g. 100)", min: 0) %> + <%= error_tag(f, :thumbnail_id) %> +
+
+ <%= label(f, :order_position_asc, "Reverse gallery order (images will be inserted at the end of the gallery)") %> + <%= checkbox(f, :order_position_asc, class: "checkbox") %> + <%= error_tag(f, :order_position_asc) %> +
+
+ <%= submit("Save Gallery", class: "button") %> +<% end %> diff --git a/lib/philomena_web/templates/gallery/_form.html.slime b/lib/philomena_web/templates/gallery/_form.html.slime deleted file mode 100644 index 416c2c9d..00000000 --- a/lib/philomena_web/templates/gallery/_form.html.slime +++ /dev/null @@ -1,29 +0,0 @@ -= form_for @changeset, @action, fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .field - = label f, :title, "Choose a title displayed in gallery preview" - = text_input f, :title, class: "input input--wide", placeholder: "Title", required: true - = error_tag f, :title - .field - = label f, :spoiler_warning, "If you are going to have NSFW images in the gallery, leave a warning for users who may not want to see it" - = text_input f, :spoiler_warning, class: "input input--wide", placeholder: "Spoiler warning" - = error_tag f, :spoiler_warning - .field - = label :description, "Describe the gallery in a few words" - = textarea f, :description, class: "input input--wide", placeholder: "Description" - = error_tag f, :description - .field - = label f, :thumbnail_id, "Set an existing image as the gallery cover" - br - = number_input f, :thumbnail_id, value: input_value(f, :thumbnail_id) || @conn.params["with_image"], class: "input", placeholder: "Image ID (e.g. 100)", min: 0 - = error_tag f, :thumbnail_id - .field - = label f, :order_position_asc, "Reverse gallery order (images will be inserted at the end of the gallery)" - = checkbox f, :order_position_asc, class: "checkbox" - = error_tag f, :order_position_asc - .field - - = submit "Save Gallery", class: "button" diff --git a/lib/philomena_web/templates/gallery/_gallery.html.heex b/lib/philomena_web/templates/gallery/_gallery.html.heex new file mode 100644 index 00000000..80255859 --- /dev/null +++ b/lib/philomena_web/templates/gallery/_gallery.html.heex @@ -0,0 +1,12 @@ +<% link = ~p"/galleries/#{@gallery}" %> +
+ + <%= @gallery.title %> +
+ <%= @gallery.spoiler_warning %> +
+
+
+ <%= render(PhilomenaWeb.ImageView, "_image_container.html", image: @gallery.thumbnail, size: :thumb, conn: @conn, link: link) %> +
+
diff --git a/lib/philomena_web/templates/gallery/_gallery.html.slime b/lib/philomena_web/templates/gallery/_gallery.html.slime deleted file mode 100644 index 60ae2d56..00000000 --- a/lib/philomena_web/templates/gallery/_gallery.html.slime +++ /dev/null @@ -1,11 +0,0 @@ -- link = ~p"/galleries/#{@gallery}" - -.media-box - a.media-box__header.media-box__header--link href=link title=@gallery.title - = @gallery.title - - .media-box__overlay - = @gallery.spoiler_warning - - .media-box__content.media-box__content--large - = render PhilomenaWeb.ImageView, "_image_container.html", image: @gallery.thumbnail, size: :thumb, conn: @conn, link: link \ No newline at end of file diff --git a/lib/philomena_web/templates/gallery/edit.html.heex b/lib/philomena_web/templates/gallery/edit.html.heex new file mode 100644 index 00000000..560fce96 --- /dev/null +++ b/lib/philomena_web/templates/gallery/edit.html.heex @@ -0,0 +1,4 @@ +

+ Editing Gallery +

+<%= render(PhilomenaWeb.GalleryView, "_form.html", conn: @conn, changeset: @changeset, action: ~p"/galleries/#{@gallery}") %> diff --git a/lib/philomena_web/templates/gallery/edit.html.slime b/lib/philomena_web/templates/gallery/edit.html.slime deleted file mode 100644 index 80687435..00000000 --- a/lib/philomena_web/templates/gallery/edit.html.slime +++ /dev/null @@ -1,3 +0,0 @@ -h1 Editing Gallery - -= render PhilomenaWeb.GalleryView, "_form.html", conn: @conn, changeset: @changeset, action: ~p"/galleries/#{@gallery}" \ No newline at end of file diff --git a/lib/philomena_web/templates/gallery/index.html.heex b/lib/philomena_web/templates/gallery/index.html.heex new file mode 100644 index 00000000..3510a583 --- /dev/null +++ b/lib/philomena_web/templates/gallery/index.html.heex @@ -0,0 +1,82 @@ +<% + route = fn p -> ~p"/galleries?#{p}" end + pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @galleries, route: route, params: [gallery: @conn.params["gallery"]]) +%> +
+
+
+
+

+ Search Galleries +

+ <%= form_for @conn, ~p"/galleries", [as: :gallery, method: "get", class: "hform"], fn f -> %> +
+ <%= label(f, :title, "Title") %> +
+
+ <%= text_input(f, :title, class: "input hform__text", placeholder: "Gallery title (* as wildcard)") %> +
+
+ <%= label(f, :description, "Description") %> +
+
+ <%= textarea(f, :description, class: "input hform__text", placeholder: "Gallery description") %> +
+
+ <%= label(f, :creator, "Creator") %> +
+
+ <%= text_input(f, :creator, class: "input hform__text", placeholder: "Gallery creator (exact match)") %> +
+
+ <%= label(f, :include_image, "Include image") %> +
+
+ <%= number_input(f, :include_image, class: "input hform__text", placeholder: "Image ID (e.g. 100)") %> +
+
+ <%= label(f, :sf, "Sort by") %> +
+
+ <%= select(f, :sf, ["Creation Date": "created_at", "Update Date": "updated_at", "Image Count": "image_count", Relevance: "_score"], class: "input") %> + <%= select(f, :sd, [Descending: "desc", Ascending: "asc"], class: "input") %> +
+
+ <%= submit("Search", class: "button button--state-primary") %> + <% end %> +
+
+ +
+
+
+ +
+ <%= if Enum.any?(@galleries) do %> + <%= for gallery <- @galleries do %> + <%= render(PhilomenaWeb.GalleryView, "_gallery.html", gallery: gallery, conn: @conn) %> + <% end %> + <% else %> +
+ No galleries found! +
+ <% end %> +
+ +
+
+
diff --git a/lib/philomena_web/templates/gallery/index.html.slime b/lib/philomena_web/templates/gallery/index.html.slime deleted file mode 100644 index 9750364c..00000000 --- a/lib/philomena_web/templates/gallery/index.html.slime +++ /dev/null @@ -1,51 +0,0 @@ -elixir: - route = fn p -> ~p"/galleries?#{p}" end - pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @galleries, route: route, params: [gallery: @conn.params["gallery"]] - -.column-layout - .column-layout__left - .block - .block__content - h3 Search Galleries - - = form_for @conn, ~p"/galleries", [as: :gallery, method: "get", class: "hform"], fn f -> - .field = label f, :title, "Title" - .field = text_input f, :title, class: "input hform__text", placeholder: "Gallery title (* as wildcard)" - - .field = label f, :description, "Description" - .field = textarea f, :description, class: "input hform__text", placeholder: "Gallery description" - - .field = label f, :creator, "Creator" - .field = text_input f, :creator, class: "input hform__text", placeholder: "Gallery creator (exact match)" - - .field = label f, :include_image, "Include image" - .field = number_input f, :include_image, class: "input hform__text", placeholder: "Image ID (e.g. 100)" - - .field = label f, :sf, "Sort by" - .field - => select f, :sf, ["Creation Date": "created_at", "Update Date": "updated_at", "Image Count": "image_count", "Relevance": "_score"], class: "input" - => select f, :sd, ["Descending": "desc", "Ascending": "asc"], class: "input" - - .field - = submit "Search", class: "button button--state-primary" - .block - .block__header - a href="/galleries/new" title="Create Gallery" - ' Create Gallery - - .column-layout__main - .block - .block__header.page__header - .page__pagination = pagination - - .block__content.js-resizable-media-container - = if Enum.any?(@galleries) do - = for gallery <- @galleries do - = render PhilomenaWeb.GalleryView, "_gallery.html", gallery: gallery, conn: @conn - - - else - .block.block--fixed.block--no-margin.block--warning - ' No galleries found! - - .block__header.block__header--light.page__header - .page__pagination = pagination diff --git a/lib/philomena_web/templates/gallery/new.html.heex b/lib/philomena_web/templates/gallery/new.html.heex new file mode 100644 index 00000000..b2eac208 --- /dev/null +++ b/lib/philomena_web/templates/gallery/new.html.heex @@ -0,0 +1,4 @@ +

+ Create a Gallery +

+<%= render(PhilomenaWeb.GalleryView, "_form.html", conn: @conn, changeset: @changeset, action: ~p"/galleries") %> diff --git a/lib/philomena_web/templates/gallery/new.html.slime b/lib/philomena_web/templates/gallery/new.html.slime deleted file mode 100644 index 3aa4a7f3..00000000 --- a/lib/philomena_web/templates/gallery/new.html.slime +++ /dev/null @@ -1,3 +0,0 @@ -h1 Create a Gallery - -= render PhilomenaWeb.GalleryView, "_form.html", conn: @conn, changeset: @changeset, action: ~p"/galleries" \ No newline at end of file diff --git a/lib/philomena_web/templates/gallery/show.html.heex b/lib/philomena_web/templates/gallery/show.html.heex new file mode 100644 index 00000000..61903b3c --- /dev/null +++ b/lib/philomena_web/templates/gallery/show.html.heex @@ -0,0 +1,113 @@ +<% + scope = scope(@conn) + image_url = fn image, hit -> ~p"/images/#{image}?#{Keyword.put(scope, :sort, hit["sort"])}" end + route = fn p -> ~p"/galleries/#{@gallery}?#{p}" end + pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @images, route: route, params: scope) + info = render(PhilomenaWeb.PaginationView, "_pagination_info.html", page: @images) +%> +
+
+ +
+ + A gallery by + + <%= link(@gallery.creator.name, to: ~p"/profiles/#{@gallery.creator}") %> + with + <%= @gallery.image_count %> + <%= pluralize("image", "images", @gallery.image_count) %> + + , last updated + <%= pretty_time(@gallery.updated_at) %> + +
+
+
+ <%= render(PhilomenaWeb.ImageView, "_image_container.html", image: @gallery.thumbnail, size: :thumb_tiny, conn: @conn) %> +
+
+ <%= if @gallery.spoiler_warning not in [nil, ""] do %> + + Warning: + + <%= @gallery.spoiler_warning %> + <% end %> + <%= if @gallery.description not in [nil, ""] do %> +

+ <%= @gallery.description %> +

+ <% end %> +
+
+ +
+ <%= for {image, hit} <- @gallery_images do %> + <%= render(PhilomenaWeb.ImageView, "_image_box.html", image: image, link: image_url.(image, hit), size: :thumb, conn: @conn) %> + <% end %> +
+ +
+
diff --git a/lib/philomena_web/templates/gallery/show.html.slime b/lib/philomena_web/templates/gallery/show.html.slime deleted file mode 100644 index 3c61643a..00000000 --- a/lib/philomena_web/templates/gallery/show.html.slime +++ /dev/null @@ -1,84 +0,0 @@ -elixir: - scope = scope(@conn) - image_url = fn image, hit -> ~p"/images/#{image}?#{Keyword.put(scope, :sort, hit["sort"])}" end - route = fn p -> ~p"/galleries/#{@gallery}?#{p}" end - pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @images, route: route, params: scope - info = render PhilomenaWeb.PaginationView, "_pagination_info.html", page: @images - -#sortable class=sortable_classes(@conn) - .block#imagelist-container - section.block__header.flex.page__header - span.block__header__title.page__title - span - ' Viewing gallery - strong> - = @gallery.title - - .page__pagination = pagination - - .flex__right.page__options - = render PhilomenaWeb.ImageView, "_random_button.html", conn: @conn, params: scope - - a href=~p"/galleries/#{@gallery}/reports/new" - i.fa.fa-exclamation-triangle> - span.hide-mobile Report - - = if can?(@conn, :edit, @gallery) do - a href=~p"/galleries/#{@gallery}/edit" - i.fas.fa-edit> - span.hide-mobile Edit - - = if can?(@conn, :edit, @gallery) do - a.rearrange-button.js-rearrange href="#" data-click-hide=".js-rearrange" data-click-show=".js-save,#gallery-rearrange-info" - i.fa.fa-sort> - ' Rearrange - - a.rearrange-button.js-save.hidden href="#" data-click-hide=".js-save,#gallery-rearrange-info" data-click-show=".js-rearrange" data-reorder-path=~p"/galleries/#{@gallery}/order" - i.fa.fa-check> - ' Save - - a href=~p"/galleries/#{@gallery}" data-method="delete" data-confirm="Are you really, really sure?" - i.fa.fa-trash> - span.hide-mobile Delete - - = if show_subscription_link?(@gallery.creator, @conn.assigns.current_user) do - = render PhilomenaWeb.Gallery.SubscriptionView, "_subscription.html", watching: @watching, gallery: @gallery, conn: @conn - - .block__header.block__header--light.block__header--sub - span.block__header__title A gallery by - - => link @gallery.creator.name, to: ~p"/profiles/#{@gallery.creator}" - ' with - => @gallery.image_count - = pluralize("image", "images", @gallery.image_count) - span.hide-mobile-t - ' , last updated - = pretty_time(@gallery.updated_at) - - .block__content.flex.js-imagelist-info - .flex__fixed.thumb-tiny-container.spacing-right - = render PhilomenaWeb.ImageView, "_image_container.html", image: @gallery.thumbnail, size: :thumb_tiny, conn: @conn - - .flex__grow - = if @gallery.spoiler_warning not in [nil, ""] do - strong> Warning: - = @gallery.spoiler_warning - - = if @gallery.description not in [nil, ""] do - p = @gallery.description - - .block__content.hidden#gallery-rearrange-info - .block.block--fixed.block--primary - | Click the image and drag. - br - strong Note that you may have to wait a couple of seconds before the order is applied. - - .block__content.js-resizable-media-container - = for {image, hit} <- @gallery_images do - = render PhilomenaWeb.ImageView, "_image_box.html", image: image, link: image_url.(image, hit), size: :thumb, conn: @conn - - .block__header.block__header--light.flex.page__header - .page__pagination = pagination - - span.block__header__title.page__info - = info diff --git a/lib/philomena_web/templates/gallery/subscription/_error.html.heex b/lib/philomena_web/templates/gallery/subscription/_error.html.heex new file mode 100644 index 00000000..74b8d64e --- /dev/null +++ b/lib/philomena_web/templates/gallery/subscription/_error.html.heex @@ -0,0 +1,3 @@ +
+ Error! +
diff --git a/lib/philomena_web/templates/gallery/subscription/_error.html.slime b/lib/philomena_web/templates/gallery/subscription/_error.html.slime deleted file mode 100644 index dd079424..00000000 --- a/lib/philomena_web/templates/gallery/subscription/_error.html.slime +++ /dev/null @@ -1,2 +0,0 @@ -.js-subscription-target - ' Error! diff --git a/lib/philomena_web/templates/gallery/subscription/_subscription.html.heex b/lib/philomena_web/templates/gallery/subscription/_subscription.html.heex new file mode 100644 index 00000000..6bf70ba1 --- /dev/null +++ b/lib/philomena_web/templates/gallery/subscription/_subscription.html.heex @@ -0,0 +1,42 @@ +<% + watch_path = ~p"/galleries/#{@gallery}/subscription" + + watch_class = + if @watching do + "hidden" + else + "" + end + + unwatch_path = ~p"/galleries/#{@gallery}/subscription" + + unwatch_class = + if @watching do + "" + else + "hidden" + end +%> +<%= if @conn.assigns.current_user do %> + + + + + Subscribe + + + + + + Unsubscribe + + + +<% else %> + + + + Subscribe + + +<% end %> diff --git a/lib/philomena_web/templates/gallery/subscription/_subscription.html.slime b/lib/philomena_web/templates/gallery/subscription/_subscription.html.slime deleted file mode 100644 index cf40adf9..00000000 --- a/lib/philomena_web/templates/gallery/subscription/_subscription.html.slime +++ /dev/null @@ -1,23 +0,0 @@ -elixir: - watch_path = ~p"/galleries/#{@gallery}/subscription" - watch_class = if @watching, do: "hidden", else: "" - - unwatch_path = ~p"/galleries/#{@gallery}/subscription" - unwatch_class = if @watching, do: "", else: "hidden" - -= if @conn.assigns.current_user do - span.js-subscription-target - a.js-subscription-link href=watch_path class=watch_class data-remote="true" data-method="post" - i.fa.fa-bell> - span.hide-mobile - ' Subscribe - - a.js-subscription-link href=unwatch_path class=unwatch_class data-remote="true" data-method="delete" - i.fa.fa-bell-slash> - span.hide-mobile - ' Unsubscribe -- else - a href=~p"/sessions/new" - i.fa.fa-bell> - span.hide-mobile - ' Subscribe diff --git a/lib/philomena_web/templates/image/_add_to_gallery_dropdown.html.heex b/lib/philomena_web/templates/image/_add_to_gallery_dropdown.html.heex new file mode 100644 index 00000000..1cad303b --- /dev/null +++ b/lib/philomena_web/templates/image/_add_to_gallery_dropdown.html.heex @@ -0,0 +1,69 @@ + diff --git a/lib/philomena_web/templates/image/_add_to_gallery_dropdown.html.slime b/lib/philomena_web/templates/image/_add_to_gallery_dropdown.html.slime deleted file mode 100644 index 9c5174bb..00000000 --- a/lib/philomena_web/templates/image/_add_to_gallery_dropdown.html.slime +++ /dev/null @@ -1,41 +0,0 @@ -.dropdown.block__header__dropdown-tab - a href="#" - i.fa.fa-images> - span.hide-limited-desktop.hide-mobile Galleries - span data-click-preventdefault="true" - i.fa.fa-caret-down> - .dropdown__content.dropdown__content-right - .block - .block__content.add-to-gallery-list - .block__list - a.block__list__link.primary href=~p"/galleries?#{[gallery: [include_image: @image.id]]}" - i.fa.fa-table> - span.hide-mobile Featured in - - = if Enum.any?(@user_galleries) do - ul.block__list.js-gallery-list - = for {gallery, present} <- @user_galleries do - = if present do - / Options to remove - li id="gallery_#{gallery.id}" - a.block__list__link.js-gallery-add.hidden data-fetchcomplete-hide="#gallery_#{gallery.id} .js-gallery-add" data-fetchcomplete-show="#gallery_#{gallery.id} .js-gallery-remove" data-method="post" data-remote="true" href=~p"/galleries/#{gallery}/images?#{[image_id: @image.id]}" - = gallery.title - a.block__list__link.active.js-gallery-remove data-fetchcomplete-hide="#gallery_#{gallery.id} .js-gallery-remove" data-fetchcomplete-show="#gallery_#{gallery.id} .js-gallery-add" data-method="delete" data-remote="true" href=~p"/galleries/#{gallery}/images?#{[image_id: @image.id]}" - = gallery.title - - else - / Options to add - li id="gallery_#{gallery.id}" - a.block__list__link.js-gallery-add data-fetchcomplete-hide="#gallery_#{gallery.id} .js-gallery-add" data-fetchcomplete-show="#gallery_#{gallery.id} .js-gallery-remove" data-method="post" data-remote="true" href=~p"/galleries/#{gallery}/images?#{[image_id: @image.id]}" - = gallery.title - a.block__list__link.active.js-gallery-remove.hidden data-fetchcomplete-hide="#gallery_#{gallery.id} .js-gallery-remove" data-fetchcomplete-show="#gallery_#{gallery.id} .js-gallery-add" data-method="delete" data-remote="true" href=~p"/galleries/#{gallery}/images?#{[image_id: @image.id]}" - = gallery.title - - .block__list - = if @conn.assigns.current_user do - a.block__list__link.primary href=~p"/galleries/new?#{[with_image: @image.id]}" - i.fa.fa-plus> - span.hide-limited-desktop.hide-mobile Create a gallery - - else - a.block__list__link.primary href=~p"/sessions/new" - i.fa.fa-user-plus> - span.hide-limited-desktop.hide-mobile Sign in to create a gallery diff --git a/lib/philomena_web/templates/image/_deleted_toggle.html.heex b/lib/philomena_web/templates/image/_deleted_toggle.html.heex new file mode 100644 index 00000000..fabec248 --- /dev/null +++ b/lib/philomena_web/templates/image/_deleted_toggle.html.heex @@ -0,0 +1,46 @@ +<% del = @conn.params["del"] %> +<%= if blank?(del) do %> + + + + + Show Deleted + + +<% end %> +<%= if del != "only" do %> + + + + + Only Deleted + + +<% end %> +<%= if del == "only" do %> + + + + + Show Non-Deleted + + +<% end %> +<%= if present?(del) do %> + + + + + Hide Deleted + + +<% end %> +<%= if present?(del) and del != "deleted" do %> + + + + + Exclude Merges + + +<% end %> diff --git a/lib/philomena_web/templates/image/_deleted_toggle.html.slime b/lib/philomena_web/templates/image/_deleted_toggle.html.slime deleted file mode 100644 index bcc61343..00000000 --- a/lib/philomena_web/templates/image/_deleted_toggle.html.slime +++ /dev/null @@ -1,31 +0,0 @@ -- del = @conn.params["del"] - -= if blank?(del) do - a.js-staff-action href=@route.(Keyword.put(@params, :del, 1)) title="Include Deleted/Merged Images" - i.fa.fa-plus - i.fa.fa-exclamation> - span.hide-mobile.hide-limited-desktop Show Deleted - -= if del != "only" do - a.js-staff-action href=@route.(Keyword.put(@params, :del, "only")) title="Only Deleted/Merged Images" - i.fa.fa-minus - i.fa.fa-check> - span.hide-mobile.hide-limited-desktop Only Deleted - -= if del == "only" do - a.js-staff-action href=@route.(Keyword.put(@params, :del, 1)) title="Include Images Visible to Users" - i.fa.fa-plus - i.fa.fa-check> - span.hide-mobile.hide-limited-desktop Show Non-Deleted - -= if present?(del) do - a.js-staff-action href=@route.(Keyword.delete(@params, :del)) title="Hide Deleted/Merged Images" - i.fa.fa-minus - i.fa.fa-exclamation> - span.hide-mobile.hide-limited-desktop Hide Deleted - -= if present?(del) and del != "deleted" do - a.js-staff-action href=@route.(Keyword.put(@params, :del, "deleted")) title="Only Deleted (Strict)" - i.fa.fa-minus - i.fa.fa-object-group> - span.hide-mobile.hide-limited-desktop Exclude Merges diff --git a/lib/philomena_web/templates/image/_description.html.heex b/lib/philomena_web/templates/image/_description.html.heex new file mode 100644 index 00000000..e09e8d51 --- /dev/null +++ b/lib/philomena_web/templates/image/_description.html.heex @@ -0,0 +1,27 @@ +
+
+ + + Description + + <%= if can?(@conn, :edit_description, @image) do %> + + <% end %> +
+
+

+ <%= if String.length(@image.description) > 0 do %> + <%= @body %> + <% else %> + + No description provided. + + <% end %> +

+
+
diff --git a/lib/philomena_web/templates/image/_description.html.slime b/lib/philomena_web/templates/image/_description.html.slime deleted file mode 100644 index 5f1fa052..00000000 --- a/lib/philomena_web/templates/image/_description.html.slime +++ /dev/null @@ -1,16 +0,0 @@ -.block - .block__header.flex - span.block__header__title - i.fas.fa-file-lines> - ' Description - = if can?(@conn, :edit_description, @image) do - .block__header__buttons - a.button.button--inline#edit-description href="#" data-click-focus="#description" data-click-hide=".image-description" data-click-show="#description-form" title="Edit description" accessKey="d" - i.fas.fa-edit> - ' Edit - .block__content - p - = if String.length(@image.description) > 0 do - = @body - - else - em No description provided. diff --git a/lib/philomena_web/templates/image/_hidden_toggle.html.heex b/lib/philomena_web/templates/image/_hidden_toggle.html.heex new file mode 100644 index 00000000..3937eb3b --- /dev/null +++ b/lib/philomena_web/templates/image/_hidden_toggle.html.heex @@ -0,0 +1,15 @@ +<%= if present?(@conn.params["hidden"]) do %> + + + + Hide Hidden + + +<% else %> + + + + Show Hidden + + +<% end %> diff --git a/lib/philomena_web/templates/image/_hidden_toggle.html.slime b/lib/philomena_web/templates/image/_hidden_toggle.html.slime deleted file mode 100644 index a138aa9a..00000000 --- a/lib/philomena_web/templates/image/_hidden_toggle.html.slime +++ /dev/null @@ -1,9 +0,0 @@ -= if present?(@conn.params["hidden"]) do - a href=@route.(Keyword.delete(@params, :hidden)) title="Hide Hidden Images" - i.fa.fa-eye-slash> - span.hide-mobile.hide-limited-desktop Hide Hidden - -- else - a href=@route.(Keyword.put(@params, :hidden, "1")) title="Show Hidden Images" - i.fa.fa-eye-slash> - span.hide-mobile.hide-limited-desktop Show Hidden diff --git a/lib/philomena_web/templates/image/_image_approval_banner.html.heex b/lib/philomena_web/templates/image/_image_approval_banner.html.heex new file mode 100644 index 00000000..c25b828e --- /dev/null +++ b/lib/philomena_web/templates/image/_image_approval_banner.html.heex @@ -0,0 +1,24 @@ +<%= if not @image.approved and not @image.hidden_from_users do %> +
+

+ Hold up! +

+

+ This image is pending approval from a staff member. It will appear on the site once it's reviewed and approved. +

+

+ Don't worry, + + the image will not lose any viewership, + + it will appear on the homepage and in search results as normal (as if it was uploaded at the time of approval). +

+

+ + + Click here to learn more about image approval and verification. + + +

+
+<% end %> diff --git a/lib/philomena_web/templates/image/_image_approval_banner.html.slime b/lib/philomena_web/templates/image/_image_approval_banner.html.slime deleted file mode 100644 index 9c4ec4f1..00000000 --- a/lib/philomena_web/templates/image/_image_approval_banner.html.slime +++ /dev/null @@ -1,12 +0,0 @@ -= if not @image.approved and not @image.hidden_from_users do - .block.block--fixed.block--warning - h2 Hold up! - p This image is pending approval from a staff member. It will appear on the site once it's reviewed and approved. - p - ' Don't worry, - strong - ' the image will not lose any viewership, - ' it will appear on the homepage and in search results as normal (as if it was uploaded at the time of approval). - p - a href="/pages/approval" - strong Click here to learn more about image approval and verification. diff --git a/lib/philomena_web/templates/image/_image_box.html.heex b/lib/philomena_web/templates/image/_image_box.html.heex new file mode 100644 index 00000000..05303da1 --- /dev/null +++ b/lib/philomena_web/templates/image/_image_box.html.heex @@ -0,0 +1,49 @@ +<% + link = assigns[:link] || ~p"/images/#{@image}" + + size_class = + case @size do + :thumb -> "media-box__content--large" + :medium -> "media-box__content--featured" + _ -> "media-box__content--small" + end + + header_class = + case @size do + :thumb_small -> "media-box__header--small" + _ -> nil + end +%> +
+
+ + + + + + <%= @image.faves_count %> + + + + + + + <%= @image.score %> + + + + + + + + <%= @image.comments_count %> + + + + + +
+
+ <%= render(PhilomenaWeb.ImageView, "_image_container.html", link: link, image: @image, size: @size, conn: @conn) %> +
+
diff --git a/lib/philomena_web/templates/image/_image_box.html.slime b/lib/philomena_web/templates/image/_image_box.html.slime deleted file mode 100644 index d8b16dca..00000000 --- a/lib/philomena_web/templates/image/_image_box.html.slime +++ /dev/null @@ -1,38 +0,0 @@ -elixir: - link = assigns[:link] || ~p"/images/#{@image}" - size_class = - case @size do - :thumb -> - "media-box__content--large" - :medium -> - "media-box__content--featured" - _ -> - "media-box__content--small" - end - - header_class = - case @size do - :thumb_small -> - "media-box__header--small" - _ -> - nil - end - -.media-box data-image-id=@image.id - .media-box__header.media-box__header--link-row class=header_class data-image-id=@image.id - a.interaction--fave href="#" rel="nofollow" data-image-id=@image.id - span.fave-span title="Fave!" - i.fa.fa-star - span.favorites title="Favorites" data-image-id=@image.id = @image.faves_count - a.interaction--upvote href="#" rel="nofollow" data-image-id=@image.id - i.fa.fa-arrow-up title="Yay!" - span.score title="Score" data-image-id=@image.id = @image.score - a.interaction--downvote href="#" rel="nofollow" data-image-id=@image.id - i.fa.fa-arrow-down title="Neigh!" - a.interaction--comments href="/#{@image.id}#comments" title="Comments" - i.fa.fa-comments - span.comments_count data-image-id=@image.id = @image.comments_count - a.interaction--hide href="#" rel="nofollow" data-image-id=@image.id - i.fa.fa-eye-slash title="Hide" - .media-box__content.flex.flex--centered.flex--center-distributed class=size_class - = render PhilomenaWeb.ImageView, "_image_container.html", link: link, image: @image, size: @size, conn: @conn diff --git a/lib/philomena_web/templates/image/_image_container.html.heex b/lib/philomena_web/templates/image/_image_container.html.heex new file mode 100644 index 00000000..172f7776 --- /dev/null +++ b/lib/philomena_web/templates/image/_image_container.html.heex @@ -0,0 +1,72 @@ +<% link = assigns[:link] || ~p"/images/#{@image}" %> +<%= image_container @conn, @image, @size, fn -> %> + <%= cond do %> + <% @image.duplicate_id -> %> +
+ + Marked Duplicate + +
+ <% @image.destroyed_content -> %> +
+ + Destroyed Content + +
+ <% @image.hidden_from_users -> %> +
+ + Deleted: + + <%= @image.deletion_reason %> +
+ <% true -> %> + <% end %> + <%= case render_intent(@conn, @image, @size) do %> + <% {:hidpi, small_url, medium_url, hover_text} -> %> +
+ + + {hover_text} + + + <% {:image, small_url, hover_text} -> %> +
+ <%= if @image.image_mime_type == "video/webm" do %> + WebM + <% end %> +
+ + + {hover_text} + + + <% {:video, webm, mp4, hover_text} -> %> +
+ + + {hover_text} + + <% {:filtered_image, hover_text} -> %> +
+ + + {hover_text} + + + <% {:filtered_video, hover_text} -> %> +
+ + + {hover_text} + + <% :not_rendered -> %> +
+ + Thumbnails not yet generated + + <% end %> +<% end %> diff --git a/lib/philomena_web/templates/image/_image_container.html.slime b/lib/philomena_web/templates/image/_image_container.html.slime deleted file mode 100644 index a7ecf49d..00000000 --- a/lib/philomena_web/templates/image/_image_container.html.slime +++ /dev/null @@ -1,59 +0,0 @@ -- link = assigns[:link] || ~p"/images/#{@image}" - -= image_container @conn, @image, @size, fn -> - = cond do - - @image.duplicate_id -> - .media-box__overlay - strong Marked Duplicate - - - @image.destroyed_content -> - .media-box__overlay - strong Destroyed Content - - - @image.hidden_from_users -> - .media-box__overlay - strong Deleted: - =< @image.deletion_reason - - - true -> - - = case render_intent(@conn, @image, @size) do - - {:hidpi, small_url, medium_url, hover_text} -> - .media-box__overlay.js-spoiler-info-overlay - a href=link title=hover_text - picture - img src=small_url srcset="#{small_url} 1x, #{medium_url} 2x" alt=hover_text - - - {:image, small_url, hover_text} -> - .media-box__overlay.js-spoiler-info-overlay - = if @image.image_mime_type == "video/webm" do - | WebM - - a href=link title=hover_text - picture - img src=small_url alt=hover_text - - - {:video, webm, mp4, hover_text} -> - .media-box__overlay.js-spoiler-info-overlay - a href=link title=hover_text - video alt=hover_text autoplay="autoplay" muted="muted" loop="loop" playsinline="playsinline" - source src=webm type="video/webm" - source src=mp4 type="video/mp4" - img alt=hover_text - - - {:filtered_image, hover_text} -> - .media-box__overlay.js-spoiler-info-overlay - a href=link title=hover_text - picture - img alt=hover_text - - - {:filtered_video, hover_text} -> - .media-box__overlay.js-spoiler-info-overlay - a href=link title=hover_text - video autoplay="autoplay" muted="muted" loop="loop" playsinline="playsinline" - img alt=hover_text - - - :not_rendered -> - .media-box__overlay.js-spoiler-info-overlay - a href=link - ' Thumbnails not yet generated diff --git a/lib/philomena_web/templates/image/_image_meta.html.heex b/lib/philomena_web/templates/image/_image_meta.html.heex new file mode 100644 index 00000000..3f9061a7 --- /dev/null +++ b/lib/philomena_web/templates/image/_image_meta.html.heex @@ -0,0 +1,124 @@ +
+
+ + + + +
+
+
+ Uploaded + <%= pretty_time(@image.created_at) %> + <%= render(PhilomenaWeb.ImageView, "_uploader.html", assigns) %> +
+ +   + <%= @image.image_width %> + x + <%= @image.image_height %> + <%= if not is_nil(@image.image_duration) and @image.image_is_animated and @image.image_duration > 0 do %> + +   + <% dur = trunc(@image.image_duration) %> + <% ms = trunc((@image.image_duration - dur) * 100) %> + <% {mm, ss} = {div(dur, 60), rem(dur, 60)} %> + <%= :io_lib.format("~2..0B:~2..0B.~2..0B", [mm, ss, ms]) %> + + <% end %> + <%= String.upcase(to_string(@image.image_format)) %> + <% size_kb = div(@image.image_size, 1000) %> + <% size_mb = Float.round(size_kb / 1000.0, 2) %> + + <%= if size_kb <= 1000 do %> + <%= size_kb %> + kB + <% else %> + <%= size_mb %> + MB + <% end %> + + +
+
diff --git a/lib/philomena_web/templates/image/_image_meta.html.slime b/lib/philomena_web/templates/image/_image_meta.html.slime deleted file mode 100644 index 23c88c19..00000000 --- a/lib/philomena_web/templates/image/_image_meta.html.slime +++ /dev/null @@ -1,82 +0,0 @@ -.block.block__header - .flex.flex--wrap.image-metabar.center--layout id="image_meta_#{@image.id}" - .stretched-mobile-links - a.js-prev href=~p"/images/#{@image}/navigate?#{[rel: "prev"] ++ scope(@conn)}" title="Previous Image (j)" - i.fa.fa-chevron-left - a.js-up href=~p"/images/#{@image}/navigate?#{[rel: "find"] ++ scope(@conn)}" title="Find this image in the global image list (i)" - i.fa.fa-chevron-up - a.js-next href=~p"/images/#{@image}/navigate?#{[rel: "next"] ++ scope(@conn)}" title="Next Image (k)" - i.fa.fa-chevron-right - a.js-rand href=~p"/images/random?#{scope(@conn)}" title="Random (r)" - i.fa.fa-random - .stretched-mobile-links - a.interaction--fave href="#" rel="nofollow" data-image-id=@image.id - span.favorites> title="Favorites" data-image-id=@image.id = @image.faves_count - span.fave-span title="Fave!" - i.fa.fa-star - a.interaction--upvote href="#" rel="nofollow" data-image-id=@image.id - = if show_vote_counts?(@conn.assigns.current_user) do - span.upvotes> title="Upvotes" data-image-id=@image.id = @image.upvotes_count - span.upvote-span title="Yay!" - i.fa.fa-arrow-up - span.score.block__header__title data-image-id=@image.id = @image.score - a.interaction--downvote href="#" rel="nofollow" data-image-id=@image.id - span.downvote-span title="Neigh!" - i.fa.fa-arrow-down - = if show_vote_counts?(@conn.assigns.current_user) do - span.downvotes< title="Downvotes" data-image-id=@image.id = @image.downvotes_count - a.interaction--comments href="#comments" title="Comments" - i.fa.fa-comments - span.comments_count< data-image-id=@image.id = @image.comments_count - a.interaction--hide href="#" rel="nofollow" data-image-id=@image.id - span.hide-span title="Hide" - i.fa.fa-eye-slash - .stretched-mobile-links - = render PhilomenaWeb.Image.SubscriptionView, "_subscription.html", watching: @watching, image: @image, conn: @conn - = render PhilomenaWeb.ImageView, "_add_to_gallery_dropdown.html", image: @image, user_galleries: @user_galleries, conn: @conn - a href=~p"/images/#{@image}/related" title="Related Images" - i.fa.fa-sitemap> - span.hide-limited-desktop.hide-mobile Related - .stretched-mobile-links - a href="#{pretty_url(@image, false, false)}" rel="nofollow" title="View (tags in filename)" - i.fa.fa-eye> - | View - a href="#{pretty_url(@image, true, false)}" rel="nofollow" title="View (no tags in filename)" - i.fa.fa-eye> - | VS - a href="#{pretty_url(@image, false, true)}" rel="nofollow" title="Download (tags in filename)" - i.fa.fa-download> - | Download - a href="#{pretty_url(@image, true, true)}" title="Download (no tags in filename)" - i.fa.fa-download> - | DS - .image-metabar.flex.flex--wrap.block__header--user-credit.center--layout#extrameta - div - ' Uploaded - => pretty_time(@image.created_at) - = render PhilomenaWeb.ImageView, "_uploader.html", assigns - - span.image-size - |   - = @image.image_width - | x - = @image.image_height - - = if not is_nil(@image.image_duration) and @image.image_is_animated and @image.image_duration > 0 do - span.image-size title=@image.image_duration - |   - - dur = trunc(@image.image_duration) - - ms = trunc((@image.image_duration - dur)*100) - - {mm, ss} = {div(dur, 60), rem(dur, 60)} - = :io_lib.format("~2..0B:~2..0B.~2..0B", [mm, ss, ms]) - - =<> String.upcase(to_string(@image.image_format)) - - size_kb = div(@image.image_size, 1000) - - size_mb = Float.round(size_kb / 1000.0, 2) - span title="#{size_kb} kB" - = if size_kb <= 1000 do - => size_kb - | kB - - else - => size_mb - | MB diff --git a/lib/philomena_web/templates/image/_image_page.html.heex b/lib/philomena_web/templates/image/_image_page.html.heex new file mode 100644 index 00000000..22663efc --- /dev/null +++ b/lib/philomena_web/templates/image/_image_page.html.heex @@ -0,0 +1,29 @@ +
+ <%= if @image.thumbnails_generated do %> + <%= render(PhilomenaWeb.ImageView, "_image_target.html", embed_display: false, image: @image, conn: @conn) %> + <% else %> +
+

+ Just a moment +

+ <%= if @image.image_mime_type == "video/webm" do %> +

+ WEBM uploads may take longer to process, it should appear in up to an hour (depending on file size and video length). +

+ <% else %> +

+ The image should appear in a few minutes; report it otherwise. +

+ <% end %> +

+ Implications might have added tags, so check them in the meanwhile. +

+
+ <% end %> + <%= if !@image.processed and @image.thumbnails_generated do %> +
+
+ This image is being processed to optimize the filesize. It should finish shortly. +
+ <% end %> +
diff --git a/lib/philomena_web/templates/image/_image_page.html.slime b/lib/philomena_web/templates/image/_image_page.html.slime deleted file mode 100644 index 1100694a..00000000 --- a/lib/philomena_web/templates/image/_image_page.html.slime +++ /dev/null @@ -1,15 +0,0 @@ -.center--layout--flex - = if @image.thumbnails_generated do - = render PhilomenaWeb.ImageView, "_image_target.html", embed_display: false, image: @image, conn: @conn - - else - #thumbnails-not-yet-generated.block.block--fixed.block--warning.layout--narrow - h3 Just a moment - = if @image.image_mime_type == "video/webm" do - p WEBM uploads may take longer to process, it should appear in up to an hour (depending on file size and video length). - - else - p The image should appear in a few minutes; report it otherwise. - p Implications might have added tags, so check them in the meanwhile. - = if !@image.processed and @image.thumbnails_generated do - br - #image-being-optimized.block.block--fixed.block--warning.layout--narrow - | This image is being processed to optimize the filesize. It should finish shortly. diff --git a/lib/philomena_web/templates/image/_image_target.html.heex b/lib/philomena_web/templates/image/_image_target.html.heex new file mode 100644 index 00000000..13a570e5 --- /dev/null +++ b/lib/philomena_web/templates/image/_image_target.html.heex @@ -0,0 +1,42 @@ +<% size = assigns[:size] || :full %> +<% embed_display = assigns[:embed_display] || false %> +<%= content_tag :div, [data: image_container_data(@conn, @image, size), class: "image-show-container"] do %> + + <%= if size == :full and not embed_display do %> + + <% else %> + + <% end %> +<% end %> diff --git a/lib/philomena_web/templates/image/_image_target.html.slime b/lib/philomena_web/templates/image/_image_target.html.slime deleted file mode 100644 index fba84b3a..00000000 --- a/lib/philomena_web/templates/image/_image_target.html.slime +++ /dev/null @@ -1,32 +0,0 @@ -- size = assigns[:size] || :full -- embed_display = assigns[:embed_display] || false - -= content_tag :div, [data: image_container_data(@conn, @image, size), class: "image-show-container"] do - .block.block--fixed.block--warning.block--no-margin.image-filtered.hidden - strong - = link("This image is blocked by your current filter - click here to display it anyway", to: "#", data: [click_unfilter: @image.id]) - p - = img_tag(static_path(@conn, "/images/tagblocked.svg"), width: 250, height: 250, data: [click_unfilter: @image.id]) - span.filter-explanation - =< link("your current filter", to: ~p"/filters/#{@conn.assigns.current_filter}", class: "filter-link") - ' . - - = if size == :full and not embed_display do - .image-target.hidden.image-show data-scaled=scaled_value(@conn.assigns.current_user) data-uris=Jason.encode!(thumb_urls(@image, can?(@conn, :hide, @image))) data-width=@image.image_width data-height=@image.image_height data-image-size=@image.image_size data-mime-type=@image.image_mime_type - = if @image.image_mime_type == "video/webm" do - video controls=true - - else - picture - - else - .image-show.hidden - a href=~p"/images/#{@image}" title=title_text(@image) - span.imgspoiler - - thumb_url = thumb_url(@image, can?(@conn, :show, @image), size) - - = if @image.image_mime_type == "video/webm" do - video data-image-id=@image.id autoplay="autoplay" loop="loop" muted="muted" playsinline="playsinline" - source src=thumb_url type="video/webm" - source src=String.replace(thumb_url, ".webm", ".mp4") type="video/mp4" - - else - picture data-image-id=@image.id - img src=thumb_url diff --git a/lib/philomena_web/templates/image/_options.html.heex b/lib/philomena_web/templates/image/_options.html.heex new file mode 100644 index 00000000..ea5a8bce --- /dev/null +++ b/lib/philomena_web/templates/image/_options.html.heex @@ -0,0 +1,233 @@ +<% display_mod_tools? = can?(@conn, :hide, @image) %> +
+
+ + + Report + + + + Share + + + + List favoriters + + <%= if display_mod_tools? and not hide_staff_tools?(@conn) do %> + + + Replace + + + + Manage + <%= if present?(@image.scratchpad) do %> + + + <% end %> + + <% end %> +
+ + + + <%= if display_mod_tools? do %> + + + <% end %> +
diff --git a/lib/philomena_web/templates/image/_options.html.slime b/lib/philomena_web/templates/image/_options.html.slime deleted file mode 100644 index a955e063..00000000 --- a/lib/philomena_web/templates/image/_options.html.slime +++ /dev/null @@ -1,151 +0,0 @@ -- display_mod_tools? = can?(@conn, :hide, @image) - -#image_options_area - .block__header.block__header--js-tabbed - a href="#" data-click-tab="reporting" data-load-tab=~p"/images/#{@image}/reporting" - i.fa.fa-exclamation-triangle> - | Report - a href="#" data-click-tab="sharing" - i.fa.fa-share> - | Share - a href="#" data-click-tab="favoriters" data-load-tab=~p"/images/#{@image}/favorites" - i.fa.fa-star> - | List favoriters - = if display_mod_tools? and not hide_staff_tools?(@conn) do - a href="#" data-click-tab="replace" - i.fa.fa-upload> - | Replace - a href="#" data-click-tab="administration" - i.fa.fa-toolbox> - | Manage - = if present?(@image.scratchpad) do - i.fa.fa-sticky-note.fa--important< - i.fa.fa-exclamation.fa--important - - .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_has_sources(@image), do: " - [url=#{image_first_source(@image)}]Original source[/url]", else: " (Original source unknown at time of posting)" - 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=#{url(~p"/images/#{@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" - = "[img]#{thumb_url(@image, false, :medium)}[/img]\n[url=#{url(~p"/images/#{@image}")}]View on Derpibooru[/url]#{source_link}" - - = if display_mod_tools? do - .block__tab.hidden data-tab="replace" - = form_for @changeset, ~p"/images/#{@image}/file", [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" - - .field.field--inline - = url_input f, :scraper_url, class: "input input--wide js-scraper", placeholder: "Link a deviantART page, a Tumblr post, or the image directly" - button.button.button--separate-left#js-scraper-preview(type="button" title="Fetch the image at the specified URL" data-disable-with="Fetch" disabled) - ' Fetch - - .field-error-js.hidden.js-scraper - - = submit "Save changes", class: "button", data: [disable_with: raw("Replacing…")] - - .block__tab.hidden data-tab="administration" - .block.block--danger - a.button.button--link> href=~p"/images/#{@image}/scratchpad/edit" - 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, ~p"/images/#{@image}/delete", [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" - - else - = form_for @changeset, ~p"/images/#{@image}/delete", [method: "put"], 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 "Change hide reason", class: "button button--state-danger button--separate-left" - - .flex.flex--spaced-out.flex--wrap - = if not @image.hidden_from_users do - = form_for @changeset, ~p"/images/#{@image}/feature", [method: "post"], fn _f -> - .field - p Marks the image as featured - = submit "Feature", data: [confirm: "Are you really, really sure?"], class: "button button--state-success" - - else - = button_to "Restore", ~p"/images/#{@image}/delete", method: "delete", class: "button button--state-success" - - = form_for @changeset, ~p"/images/#{@image}/repair", [method: "post"], fn _f -> - .field - = submit "Repair", class: "button button--state-success" - - = form_for @changeset, ~p"/images/#{@image}/hash", [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", ~p"/images/#{@image}/comment_lock", method: "post", class: "button" - - else - = button_to "Unlock commenting", ~p"/images/#{@image}/comment_lock", method: "delete", class: "button" - - = if @image.description_editing_allowed do - = button_to "Lock description editing", ~p"/images/#{@image}/description_lock", method: "post", class: "button" - - else - = button_to "Unlock description editing", ~p"/images/#{@image}/description_lock", method: "delete", class: "button" - - = if @image.tag_editing_allowed do - = button_to "Lock tag editing", ~p"/images/#{@image}/tag_lock", method: "post", class: "button" - - else - = button_to "Unlock tag editing", ~p"/images/#{@image}/tag_lock", method: "delete", class: "button" - - br - .flex.flex--spaced-out - = link "Lock specific tags", to: ~p"/images/#{@image}/tag_lock", class: "button" - = if not @image.approved and can?(@conn, :approve, @image) do - = button_to "Approve image", ~p"/images/#{@image}/approve", method: "post", class: "button button--state-success", data: [confirm: "Are you sure?"] - = if @image.hidden_from_users and can?(@conn, :destroy, @image) do - = button_to "Destroy image", ~p"/images/#{@image}/destroy", method: "post", class: "button button--state-danger", data: [confirm: "This action is IRREVERSIBLE. Are you sure?"] diff --git a/lib/philomena_web/templates/image/_quick_tag.html.heex b/lib/philomena_web/templates/image/_quick_tag.html.heex new file mode 100644 index 00000000..6bcbe1d6 --- /dev/null +++ b/lib/philomena_web/templates/image/_quick_tag.html.heex @@ -0,0 +1,24 @@ + + + + Tag + + + + + diff --git a/lib/philomena_web/templates/image/_quick_tag.html.slime b/lib/philomena_web/templates/image/_quick_tag.html.slime deleted file mode 100644 index 5e555909..00000000 --- a/lib/philomena_web/templates/image/_quick_tag.html.slime +++ /dev/null @@ -1,12 +0,0 @@ -a.js-quick-tag href="#" title="Add tags to the images on this page" - i.fa.fa-tags - span.hide-mobile.hide-limited-desktop<> Tag -a.js-quick-tag--abort.hidden href="#" - i.fa.fa-exclamation-triangle - span.hide-mobile.hide-limited-desktop<> Abort Tagging -a.js-quick-tag--all.hidden href="#" - i.fa.fa-exchange-alt - span.hide-mobile.hide-limited-desktop<> Toggle All -a.js-quick-tag--submit.hidden href="#" - i.fa.fa-tags - span.hide-mobile.hide-limited-desktop<> Submit Tag Changes diff --git a/lib/philomena_web/templates/image/_random_button.html.heex b/lib/philomena_web/templates/image/_random_button.html.heex new file mode 100644 index 00000000..6cba1c28 --- /dev/null +++ b/lib/philomena_web/templates/image/_random_button.html.heex @@ -0,0 +1,6 @@ + + + + Random Image + + diff --git a/lib/philomena_web/templates/image/_random_button.html.slime b/lib/philomena_web/templates/image/_random_button.html.slime deleted file mode 100644 index c613c85c..00000000 --- a/lib/philomena_web/templates/image/_random_button.html.slime +++ /dev/null @@ -1,3 +0,0 @@ -a href=~p"/images/random?#{@params}" title="Random Image" - i.fa.fa-random> - span.hide-mobile.hide-limited-desktop Random Image diff --git a/lib/philomena_web/templates/image/_source.html.heex b/lib/philomena_web/templates/image/_source.html.heex new file mode 100644 index 00000000..ca642278 --- /dev/null +++ b/lib/philomena_web/templates/image/_source.html.heex @@ -0,0 +1,130 @@ +
+ <% has_sources = Enum.any?(@image.sources) %> + <%= form_for @changeset, ~p"/images/#{@image}/sources", [method: "put", class: "hidden", id: "source-form", data: [remote: "true"]], fn f -> %> + <%= if can?(@conn, :edit_metadata, @image) and !@conn.assigns.current_ban do %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +

+ The page(s) you found this image on. Images may have a maximum of + + 10 + + source URLs. Leave any sources you don't want to use blank. +

+ <%= inputs_for f, :sources, [as: "image[old_sources]", skip_hidden: true], fn fs -> %> + <%= hidden_input(fs, :source) %> + <% end %> + <%= inputs_for f, :sources, [skip_hidden: true], fn fs -> %> +
+ <%= text_input(fs, :source, class: "input flex__grow js-source-url", placeholder: "Source URL") %> + <%= error_tag(fs, :source) %> + +
+ <% end %> +
+ + <%= submit("Save sources", class: "button button--separate-left") %> + +
+ <%= render(PhilomenaWeb.CaptchaView, "_captcha.html", name: "source", conn: @conn) %> + <% else %> +

+ You can't edit the source on this image. +

+ <% end %> + <% end %> +
+
+ + + <%= if !has_sources || length(@image.sources) == 1 do %> + Source + <% else %> + Sources + <% end %> + +
+ + + <%= if has_sources do %> + Add/Edit + <% else %> + Add + <% end %> + + <%= if @source_change_count > 0 do %> + + + + History + + ( + <%= @source_change_count %> + ) + + <% end %> + <%= if can?(@conn, :hide, @image) and not hide_staff_tools?(@conn) do %> + <%= form_for @changeset, ~p"/images/#{@image}/source_history", [method: "delete"], fn _f -> %> + + + Wipe + + <% end %> + <% end %> +
+
+
+
+ <%= if has_sources do %> + <% [first_source | sources] = @image.sources %> +
+ +
+ + <%= for source <- sources do %> +
+ +
+ + <% end %> + <% else %> +
+ +
+ + <% end %> +
+
+
+
diff --git a/lib/philomena_web/templates/image/_source.html.slime b/lib/philomena_web/templates/image/_source.html.slime deleted file mode 100644 index 8fa32872..00000000 --- a/lib/philomena_web/templates/image/_source.html.slime +++ /dev/null @@ -1,87 +0,0 @@ -.js-sourcesauce - - has_sources = Enum.any?(@image.sources) - = form_for @changeset, ~p"/images/#{@image}/sources", [method: "put", class: "hidden", id: "source-form", data: [remote: "true"]], fn f -> - = if can?(@conn, :edit_metadata, @image) and !@conn.assigns.current_ban do - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - p - 'The page(s) you found this image on. Images may have a maximum of - span.js-max-source-count> 10 - ' source URLs. Leave any sources you don't want to use blank. - - = inputs_for f, :sources, [as: "image[old_sources]", skip_hidden: true], fn fs -> - = hidden_input fs, :source - = inputs_for f, :sources, [skip_hidden: true], fn fs -> - .field.js-image-source.field--inline.flex--no-wrap.flex--centered - = text_input fs, :source, class: "input flex__grow js-source-url", placeholder: "Source URL" - = error_tag fs, :source - - label.input--separate-left.flex__fixed.flex--centered - a.js-source-remove href="#" - i.fa.fa-trash> - ' Delete - - .field - button.button.js-image-add-source type="button" - i.fa.fa-plus> - ' Add source - = submit "Save sources", class: "button button--separate-left" - button.button.button--separate-left type="reset" data-click-hide="#source-form" data-click-show="#image-source" - ' Cancel - - = render PhilomenaWeb.CaptchaView, "_captcha.html", name: "source", conn: @conn - - - else - p - ' You can't edit the source on this image. - - .block#image-source - .block__header.flex - span.block__header__title - i.fas.fa-link> - = if !has_sources || length(@image.sources) == 1 do - ' Source - - else - ' Sources - - .block__header__buttons - a.button.button--inline#edit-source data-click-focus=".js-image-source" data-click-hide="#image-source" data-click-show="#source-form" title="Edit source" accessKey="s" - i.fas.fa-edit - = if has_sources do - ' Add/Edit - - else - ' Add - = if @source_change_count > 0 do - a.button.button--link.button--inline href=~p"/images/#{@image}/source_changes" title="Source history" - i.fa.fa-history> - spanspan.hide-mobile> History - | ( - = @source_change_count - | ) - = if can?(@conn, :hide, @image) and not hide_staff_tools?(@conn) do - = form_for @changeset, ~p"/images/#{@image}/source_history", [method: "delete"], fn _f -> - a.button.button--state-danger.button--inline type="submit" data-confirm="Are you really, really sure?" title="Wipe sources" - i.fas.fa-eraser> - ' Wipe - .block__content.flex.flex--wrap.flex--column - .image_sources - = if has_sources do - - [first_source | sources] = @image.sources - .image_source__icon - i class=image_source_icon(first_source.source) - .image_source__link - a.js-source-link href=first_source.source - strong = first_source.source - = for source <- sources do - .image_source__icon - i class=image_source_icon(source.source) - .image_source__link - a href=source.source - strong = source.source - - else - .image_source__icon - i.fa.fa-unlink - .image_source__link - em> not provided yet diff --git a/lib/philomena_web/templates/image/_tags.html.heex b/lib/philomena_web/templates/image/_tags.html.heex new file mode 100644 index 00000000..048d0b86 --- /dev/null +++ b/lib/philomena_web/templates/image/_tags.html.heex @@ -0,0 +1,110 @@ +<% + form_class = + if @changeset.action do + "" + else + "hidden" + end +%> +<% tags = display_order(@image.tags) %> +<% tag_input = Enum.map_join(tags, ", ", & &1.name) %> +
+
+ <%= if can?(@conn, :edit_metadata, @image) and !@conn.assigns.current_ban do %> + <%= if Enum.any?(@image.locked_tags) do %> +
+ + The following tags have been restricted on this image: + + <%= Enum.map_join(@image.locked_tags, ", ", & &1.name) %> + +
+ <% end %> + <%= form_for @changeset, ~p"/images/#{@image}/tags", [id: "tags-form", method: "put", data: [remote: "true"]], fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> + <%= hidden_input(f, :old_tag_input, value: tag_input) %> +
+ <%= label f, :tag_input do %> + Separate tags with commas. Use 'artist:name' tags to identify artists. Got questions? Check the + + tag guidelines + + or the + + spoiler guidelines + + . + <% end %> + <%= render(PhilomenaWeb.TagView, "_tag_editor.html", f: f, name: :tag_input, type: :edit, extra: [value: tag_input]) %> + <%= error_tag(f, :tag_input) %> +
+ <%= if !@conn.assigns.current_user do %> +
+ + + Hang on a sec… + + +
+ Make sure you have read and understood our + + tagging guidelines + + before editing tags. +
+ <%= render(PhilomenaWeb.CaptchaView, "_captcha.html", name: "tags", conn: @conn) %> + <% end %> + +
+ <%= PhilomenaWeb.TagView.quick_tags(@conn) %> +
+ <% end %> + <% else %> +

+ You can't edit the tags on this image. +

+ <% end %> +
+
+
+ + + Tags + +
+ + + Edit + + <%= if @tag_change_count > 0 do %> + + + History ( + <%= @tag_change_count %> + ) + + <% end %> +
+
+
+ <%= render(PhilomenaWeb.TagView, "_tag_list.html", tags: tags, conn: @conn) %> +
+
+
diff --git a/lib/philomena_web/templates/image/_tags.html.slime b/lib/philomena_web/templates/image/_tags.html.slime deleted file mode 100644 index c4efb08a..00000000 --- a/lib/philomena_web/templates/image/_tags.html.slime +++ /dev/null @@ -1,75 +0,0 @@ -- form_class = if @changeset.action, do: "", else: "hidden" -- tags = display_order(@image.tags) -- tag_input = Enum.map_join(tags, ", ", & &1.name) - -.js-tagsauce#image_tags_and_source - .js-imageform class=form_class - = if can?(@conn, :edit_metadata, @image) and !@conn.assigns.current_ban do - - = if Enum.any?(@image.locked_tags) do - .block.block--fixed.block--warning - i.fa.fa-lock> - ' The following tags have been restricted on this image: - code= Enum.map_join(@image.locked_tags, ", ", & &1.name) - - = form_for @changeset, ~p"/images/#{@image}/tags", [id: "tags-form", method: "put", data: [remote: "true"]], fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - = hidden_input f, :old_tag_input, value: tag_input - - .field - = label f, :tag_input do - ' Separate tags with commas. Use 'artist:name' tags to identify artists. Got questions? Check the - a> href="/pages/tags" tag guidelines - ' or the - a href="/pages/spoilers" spoiler guidelines - ' . - - = render PhilomenaWeb.TagView, "_tag_editor.html", f: f, name: :tag_input, type: :edit, extra: [value: tag_input] - = error_tag f, :tag_input - - = if !@conn.assigns.current_user do - .block.block--fixed.block--warning - strong - em Hang on a sec… - br - ' Make sure you have read and understood our - a> href="/pages/tags" tagging guidelines - ' before editing tags. - - = render PhilomenaWeb.CaptchaView, "_captcha.html", name: "tags", conn: @conn - - ul.horizontal-list - li - .actions - = submit "Save tags", class: "button", id: "edit_save_button", data: [disable_with: raw("Saving…")] - li - button.button.js-tag-sauce-toggle data-click-toggle=".tagsauce, .js-imageform" data-click-focus=".js-taginput-plain:not(.hidden), .js-taginput-input" - ' Cancel - - .block.js-tagtable data-target="[name="image[tag_input]"]" - = PhilomenaWeb.TagView.quick_tags(@conn) - - - else - p - ' You can't edit the tags on this image. - - .block.tagsauce - .block__header.flex - span.block__header__title - i.fas.fa-tag> - ' Tags - .block__header__buttons - a.button.button--inline.js-tag-sauce-toggle#edit-tags data-click-toggle=".tagsauce, .js-imageform" data-click-focus=".js-taginput-plain:not(.hidden), .js-taginput-input" title="Edit tags" accessKey="t" - i.fas.fa-edit> - ' Edit - = if @tag_change_count > 0 do - a.button.button--link.button--inline href=~p"/images/#{@image}/tag_changes" title="Tag history" - i.fa.fa-history> - | History ( - = @tag_change_count - | ) - .block__content.block__tagbox - = render PhilomenaWeb.TagView, "_tag_list.html", tags: tags, conn: @conn diff --git a/lib/philomena_web/templates/image/_uploader.html.heex b/lib/philomena_web/templates/image/_uploader.html.heex new file mode 100644 index 00000000..7f96a4ba --- /dev/null +++ b/lib/philomena_web/templates/image/_uploader.html.heex @@ -0,0 +1,31 @@ + + by + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @image, awards: true, conn: @conn) %> + <%= if can?(@conn, :show, :ip_address) and not hide_staff_tools?(@conn) do %> + <%= link_to_ip(@conn, @image.ip) %> + <%= link_to_fingerprint(@conn, @image.fingerprint) %> + + + + + + + <% end %> + +<%= if can?(@conn, :show, :ip_address) do %> + <%= form_for @changeset, ~p"/images/#{@image}/uploader", [class: "block__content hidden", id: "uploader-form", data: [remote: "true", method: "put"]], fn f -> %> + <%= label(f, :username, "Uploader") %> + <%= text_input(f, :username, value: username(@image.user), class: "input input--short input--small") %> + <%= submit("Save Changes", class: "button button--small", data: [disable_with: raw("Saving…")]) %> +
+ Changes IP to '127.0.0.1' and FP to 'ffff'. Empty for anonymous. +
+ <% end %> + +<% end %> diff --git a/lib/philomena_web/templates/image/_uploader.html.slime b/lib/philomena_web/templates/image/_uploader.html.slime deleted file mode 100644 index 504ab437..00000000 --- a/lib/philomena_web/templates/image/_uploader.html.slime +++ /dev/null @@ -1,26 +0,0 @@ -span.image_uploader - ' by - => render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @image, awards: true, conn: @conn - - = if can?(@conn, :show, :ip_address) and not hide_staff_tools?(@conn) do - => link_to_ip(@conn, @image.ip) - => link_to_fingerprint(@conn, @image.fingerprint) - a#edit-uploader href="#" data-click-hide=".image_uploader" data-click-show="#uploader-form" - i.fas.fa-edit - a#edit-anonymous href="#" data-click-toggle=".image-anonymous" - i.fas.fa-eye - -= if can?(@conn, :show, :ip_address) do - = form_for @changeset, ~p"/images/#{@image}/uploader", [class: "block__content hidden", id: "uploader-form", data: [remote: "true", method: "put"]], fn f -> - => label f, :username, "Uploader" - => text_input f, :username, value: username(@image.user), class: "input input--short input--small" - - = submit "Save Changes", class: "button button--small", data: [disable_with: raw("Saving…")] - - div Changes IP to '127.0.0.1' and FP to 'ffff'. Empty for anonymous. - - .image-anonymous.hidden - = if @image.anonymous do - = button_to "Reveal author", ~p"/images/#{@image}/anonymous", class: "button button--small", method: "delete", data: [confirm: "Are you really, really sure?"] - - else - = button_to "Hide author", ~p"/images/#{@image}/anonymous", class: "button button--small", method: "create", data: [confirm: "Are you really, really sure?"] diff --git a/lib/philomena_web/templates/image/comment/_form.html.heex b/lib/philomena_web/templates/image/comment/_form.html.heex new file mode 100644 index 00000000..2cf4c212 --- /dev/null +++ b/lib/philomena_web/templates/image/comment/_form.html.heex @@ -0,0 +1,26 @@ +<% + options = + if assigns[:remote] do + [data: [remote: "true"], id: "js-comment-form"] + else + [] + end +%> +<%= form_for @changeset, ~p"/images/#{@image}/comments", options, fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+
+ <%= render(PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, placeholder: "Please read the site rules before posting and use ||spoilers|| for above-rating stuff.") %> +
+
+ <%= submit("Post", class: "button", data: [disable_with: raw("Posting…")]) %> + <%= render(PhilomenaWeb.MarkdownView, "_anon_checkbox.html", conn: @conn, f: f) %> +
+
+<% end %> diff --git a/lib/philomena_web/templates/image/comment/_form.html.slime b/lib/philomena_web/templates/image/comment/_form.html.slime deleted file mode 100644 index 731ba817..00000000 --- a/lib/philomena_web/templates/image/comment/_form.html.slime +++ /dev/null @@ -1,15 +0,0 @@ -- options = if(assigns[:remote], do: [data: [remote: "true"], id: "js-comment-form"], else: []) - -= form_for @changeset, ~p"/images/#{@image}/comments", options, fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .block - div - = render PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, placeholder: "Please read the site rules before posting and use ||spoilers|| for above-rating stuff." - - .block__content.communication-edit__actions - => submit "Post", class: "button", data: [disable_with: raw("Posting…")] - - = render PhilomenaWeb.MarkdownView, "_anon_checkbox.html", conn: @conn, f: f diff --git a/lib/philomena_web/templates/image/comment/edit.html.heex b/lib/philomena_web/templates/image/comment/edit.html.heex new file mode 100644 index 00000000..33364a2e --- /dev/null +++ b/lib/philomena_web/templates/image/comment/edit.html.heex @@ -0,0 +1,21 @@ +<%= form_for @changeset, ~p"/images/#{@comment.image}/comments/#{@comment}", fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+
+ <%= render(PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, placeholder: "Please read the site rules before posting and use ||spoilers|| for above-rating stuff.") %> +
+
+ <%= text_input(f, :edit_reason, class: "input input--wide", placeholder: "Reason for edit") %> + <%= error_tag(f, :edit_reason) %> +
+
+ <%= submit("Edit", class: "button", data: [disable_with: raw("Posting…")]) %> +
+
+<% end %> diff --git a/lib/philomena_web/templates/image/comment/edit.html.slime b/lib/philomena_web/templates/image/comment/edit.html.slime deleted file mode 100644 index 1b17c96a..00000000 --- a/lib/philomena_web/templates/image/comment/edit.html.slime +++ /dev/null @@ -1,15 +0,0 @@ -= form_for @changeset, ~p"/images/#{@comment.image}/comments/#{@comment}", fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .block - .communication-edit__wrap - = render PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, placeholder: "Please read the site rules before posting and use ||spoilers|| for above-rating stuff." - - .block__content.field - = text_input f, :edit_reason, class: "input input--wide", placeholder: "Reason for edit" - = error_tag f, :edit_reason - - .block__content.communication-edit__actions - => submit "Edit", class: "button", data: [disable_with: raw("Posting…")] diff --git a/lib/philomena_web/templates/image/comment/history/index.html.heex b/lib/philomena_web/templates/image/comment/history/index.html.heex new file mode 100644 index 00000000..9e37cc2c --- /dev/null +++ b/lib/philomena_web/templates/image/comment/history/index.html.heex @@ -0,0 +1,59 @@ +

+ Viewing last 25 versions of comment by + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @comment, conn: @conn) %> + on image + + # + <%= @comment.image_id %> + +

+<%= for version <- @versions do %> +
+
+
+ <%= render(PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @comment, conn: @conn) %> +
+
+ + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @comment, awards: true, conn: @conn) %> + +
+ <%= render(PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @comment, conn: @conn) %> +
+ <%= for edit <- version.difference do %> + <%= case edit do %> + <% {:eq, value} -> %> + <%= escape_nl2br(value) %> + <% {:ins, value} -> %> + + <%= escape_nl2br(value) %> + + <% {:del, value} -> %> + + <%= escape_nl2br(value) %> + + <% end %> + <% end %> +
+
+
+
+
+
+ <%= if version.edit_reason not in [nil, ""] do %> + Reason: + <%= version.edit_reason %> + <% else %> + No reason given + <% end %> +
+
+ Edited + <%= pretty_time(version.created_at) %> + by + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: version, conn: @conn) %> +
+
+
+
+<% end %> diff --git a/lib/philomena_web/templates/image/comment/history/index.html.slime b/lib/philomena_web/templates/image/comment/history/index.html.slime deleted file mode 100644 index bb27e827..00000000 --- a/lib/philomena_web/templates/image/comment/history/index.html.slime +++ /dev/null @@ -1,46 +0,0 @@ -h1 - ' Viewing last 25 versions of comment by - = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @comment, conn: @conn - ' on image - a href=~p"/images/#{@comment.image}" - | # - = @comment.image_id - -= for version <- @versions do - article.block.communication - .block__content.flex.flex--no-wrap - .flex__fixed.spacing-right - = render PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @comment, conn: @conn - - .flex__grow.communication__body - span.communication__body__sender-name = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @comment, awards: true, conn: @conn - br - - = render PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @comment, conn: @conn - - .communication__body__text - = for edit <- version.difference do - = case edit do - - {:eq, value} -> - = escape_nl2br(value) - - - {:ins, value} -> - ins.differ = escape_nl2br(value) - - - {:del, value} -> - del.differ = escape_nl2br(value) - - .block__content.communication__options - .flex.flex--wrap.flex--spaced-out - div - = if version.edit_reason not in [nil, ""] do - ' Reason: - = version.edit_reason - - else - ' No reason given - - .flex__right - ' Edited - => pretty_time(version.created_at) - ' by - => render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: version, conn: @conn diff --git a/lib/philomena_web/templates/image/comment/index.html.heex b/lib/philomena_web/templates/image/comment/index.html.heex new file mode 100644 index 00000000..48cbbe1d --- /dev/null +++ b/lib/philomena_web/templates/image/comment/index.html.heex @@ -0,0 +1,34 @@ +<% + route = fn p -> ~p"/images/#{@image}/comments?#{p}" end + pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @comments, route: route) +%> +
+ +
+<%= for {comment, body} <- @comments, can_view_communication?(@conn, comment) do %> + <%= render(PhilomenaWeb.CommentView, "_comment.html", comment: comment, body: body, conn: @conn) %> +<% end %> +
+ +
diff --git a/lib/philomena_web/templates/image/comment/index.html.slime b/lib/philomena_web/templates/image/comment/index.html.slime deleted file mode 100644 index 5e87cfe3..00000000 --- a/lib/philomena_web/templates/image/comment/index.html.slime +++ /dev/null @@ -1,22 +0,0 @@ -elixir: - route = fn p -> ~p"/images/#{@image}/comments?#{p}" end - pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @comments, route: route - -.block - .block__header.page__header - .page__pagination = pagination - .page__info - span.block__header__title - =<> @image.comments_count - => pluralize("comment", "comments", @image.comments_count) - ' posted - button.button#js-refresh-comments title="Refresh" data-disable-with="..." - i.fa.fa-sync - span.hide-mobile<> Refresh - -= for {comment, body} <- @comments, can_view_communication?(@conn, comment) do - = render PhilomenaWeb.CommentView, "_comment.html", comment: comment, body: body, conn: @conn - -.block - .block__header.block__header--light.page__header - .page__pagination = pagination diff --git a/lib/philomena_web/templates/image/comment/show.html.heex b/lib/philomena_web/templates/image/comment/show.html.heex new file mode 100644 index 00000000..e72d80ac --- /dev/null +++ b/lib/philomena_web/templates/image/comment/show.html.heex @@ -0,0 +1 @@ +<%= render(PhilomenaWeb.CommentView, "_comment.html", comment: @comment, body: @body, conn: @conn) %> diff --git a/lib/philomena_web/templates/image/comment/show.html.slime b/lib/philomena_web/templates/image/comment/show.html.slime deleted file mode 100644 index ead59411..00000000 --- a/lib/philomena_web/templates/image/comment/show.html.slime +++ /dev/null @@ -1 +0,0 @@ -= render PhilomenaWeb.CommentView, "_comment.html", comment: @comment, body: @body, conn: @conn diff --git a/lib/philomena_web/templates/image/deleted.html.heex b/lib/philomena_web/templates/image/deleted.html.heex new file mode 100644 index 00000000..3d89fa1a --- /dev/null +++ b/lib/philomena_web/templates/image/deleted.html.heex @@ -0,0 +1,61 @@ +<%= if @image.duplicate_id do %> +
+
+

+ This image has been merged into another image +

+

+ This image was merged into image + <%= link("##{@image.duplicate_id}", to: ~p"/images/#{@image.duplicate_id}") %> + because it was determined to be a duplicate of that image. +

+
+
+<% else %> +
+
+

+ This image has been deleted +

+

+ Reason: + + <%= @image.deletion_reason || "Unknown (likely deleted in error). Please contact a moderator." %> + +

+ <%= if can?(@conn, :hide, @image) do %> +

+ + Spoilers! + + Done by: + + <%= deleter(@image) %> + +

+ <% end %> +
+

+ If you originally uploaded the file previously located here, please don't re-upload it - + <%= link("contact us", to: "/pages/contact") %> + if you feel this was in error and we'll talk! We're only human, and mistakes happen. +

+

+ Here's the + <%= link("tagging guidelines", to: "/pages/tags") %> + and + <%= link("rules of the site", to: "/pages/rules") %> + . Other useful links can be found at the bottom of the page. +

+
+<% end %> +<%= if can?(@conn, :hide, @image) do %> + <%= render(PhilomenaWeb.ImageView, "show.html", assigns) %> +<% else %> +

+ + Tags: + +

+ <%= render(PhilomenaWeb.TagView, "_tag_list.html", tags: display_order(@image.tags), conn: @conn) %> +<% end %> diff --git a/lib/philomena_web/templates/image/deleted.html.slime b/lib/philomena_web/templates/image/deleted.html.slime deleted file mode 100644 index fc425b36..00000000 --- a/lib/philomena_web/templates/image/deleted.html.slime +++ /dev/null @@ -1,40 +0,0 @@ -= if @image.duplicate_id do - .walloftext - .block.block--fixed.block--warning - h1 This image has been merged into another image - p - ' This image was merged into image - => link "##{@image.duplicate_id}", to: ~p"/images/#{@image.duplicate_id}" - ' because it was determined to be a duplicate of that image. - -- else - .walloftext - .block.block--fixed.block--warning - h1 This image has been deleted - p - ' Reason: - strong - = @image.deletion_reason || "Unknown (likely deleted in error). Please contact a moderator." - - = if can?(@conn, :hide, @image) do - p - strong> Spoilers! - ' Done by: - strong = deleter(@image) - p - ' If you originally uploaded the file previously located here, please don't re-upload it - - => link "contact us", to: "/pages/contact" - ' if you feel this was in error and we'll talk! We're only human, and mistakes happen. - p - ' Here's the - => link "tagging guidelines", to: "/pages/tags" - ' and - = link "rules of the site", to: "/pages/rules" - ' . Other useful links can be found at the bottom of the page. - -= if can?(@conn, :hide, @image) do - = render PhilomenaWeb.ImageView, "show.html", assigns -- else - p - strong Tags: - = render PhilomenaWeb.TagView, "_tag_list.html", tags: display_order(@image.tags), conn: @conn diff --git a/lib/philomena_web/templates/image/description/_form.html.heex b/lib/philomena_web/templates/image/description/_form.html.heex new file mode 100644 index 00000000..9b3448a9 --- /dev/null +++ b/lib/philomena_web/templates/image/description/_form.html.heex @@ -0,0 +1,18 @@ +<%= form_for @changeset, ~p"/images/#{@image}/description", [class: "block hidden", id: "description-form", data: [remote: "true"]], fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> + <%= render(PhilomenaWeb.MarkdownView, "_help.html", conn: @conn) %> + <%= render(PhilomenaWeb.MarkdownView, "_toolbar.html", conn: @conn) %> +
+ <%= textarea(f, :description, id: "description", class: "input input--wide js-toolbar-input", placeholder: "Describe this image in plain words - this should generally be info about the image that doesn't belong in the tags or source.") %> +
+ <%= submit("Save changes", class: "button", autocomplete: "off") %> + +<% end %> diff --git a/lib/philomena_web/templates/image/description/_form.html.slime b/lib/philomena_web/templates/image/description/_form.html.slime deleted file mode 100644 index e47b5d3f..00000000 --- a/lib/philomena_web/templates/image/description/_form.html.slime +++ /dev/null @@ -1,15 +0,0 @@ -= form_for @changeset, ~p"/images/#{@image}/description", [class: "block hidden", id: "description-form", data: [remote: "true"]], fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - = render PhilomenaWeb.MarkdownView, "_help.html", conn: @conn - = render PhilomenaWeb.MarkdownView, "_toolbar.html", conn: @conn - - .field - = textarea f, :description, id: "description", class: "input input--wide js-toolbar-input", placeholder: "Describe this image in plain words - this should generally be info about the image that doesn't belong in the tags or source." - - = submit "Save changes", class: "button", autocomplete: "off" - - button.button.button--separate-left type="reset" data-click-hide="#description-form" data-click-show=".image-description" - ' Cancel diff --git a/lib/philomena_web/templates/image/favorite/index.html.heex b/lib/philomena_web/templates/image/favorite/index.html.heex new file mode 100644 index 00000000..1ba80fed --- /dev/null +++ b/lib/philomena_web/templates/image/favorite/index.html.heex @@ -0,0 +1,40 @@ +
+ Faved by + <%= @image.faves_count %> + <%= pluralize("user", "users", @image.faves_count) %> +
+<%= for fave <- Enum.sort_by(@image.faves, & String.downcase(&1.user.name)) do %> + <%= link(fave.user.name, to: ~p"/profiles/#{fave.user}", class: "interaction-user-list-item") %> +<% end %> +<%= if @has_votes do %> +
+ Upvoted by + <%= @image.upvotes_count %> + <%= pluralize("user", "users", @image.upvotes_count) %> +
+ <%= for upvote <- Enum.sort_by(@image.upvotes, & String.downcase(&1.user.name)) do %> + + <%= link(upvote.user.name, to: ~p"/profiles/#{upvote.user}") %> + <%= link("(x)", to: ~p"/images/#{@image}/tamper?#{[user_id: upvote.user_id]}", method: "post") %> + + <% end %> +
+ Downvoted by + <%= @image.downvotes_count %> + <%= pluralize("user", "users", @image.downvotes_count) %> +
+ <%= for downvote <- Enum.sort_by(@image.downvotes, & String.downcase(&1.user.name)) do %> + + <%= link(downvote.user.name, to: ~p"/profiles/#{downvote.user}") %> + <%= link("(x)", to: ~p"/images/#{@image}/tamper?#{[user_id: downvote.user_id]}", method: "post") %> + + <% end %> +
+ Hidden by + <%= @image.hides_count %> + <%= pluralize("user", "users", @image.hides_count) %> +
+ <%= for hide <- Enum.sort_by(@image.hides, & String.downcase(&1.user.name)) do %> + <%= link(hide.user.name, to: ~p"/profiles/#{hide.user}", class: "interaction-user-list-item") %> + <% end %> +<% end %> diff --git a/lib/philomena_web/templates/image/favorite/index.html.slime b/lib/philomena_web/templates/image/favorite/index.html.slime deleted file mode 100644 index ed239797..00000000 --- a/lib/philomena_web/templates/image/favorite/index.html.slime +++ /dev/null @@ -1,36 +0,0 @@ -h5 - ' Faved by - => @image.faves_count - = pluralize("user", "users", @image.faves_count) - -= for fave <- Enum.sort_by(@image.faves, & String.downcase(&1.user.name)) do - => link fave.user.name, to: ~p"/profiles/#{fave.user}", class: "interaction-user-list-item" - -= if @has_votes do - h5 - ' Upvoted by - => @image.upvotes_count - = pluralize("user", "users", @image.upvotes_count) - - = for upvote <- Enum.sort_by(@image.upvotes, & String.downcase(&1.user.name)) do - span.interaction-user-list-item - => link upvote.user.name, to: ~p"/profiles/#{upvote.user}" - => link "(x)", to: ~p"/images/#{@image}/tamper?#{[user_id: upvote.user_id]}", method: "post" - - h5 - ' Downvoted by - => @image.downvotes_count - = pluralize("user", "users", @image.downvotes_count) - - = for downvote <- Enum.sort_by(@image.downvotes, & String.downcase(&1.user.name)) do - span.interaction-user-list-item - => link downvote.user.name, to: ~p"/profiles/#{downvote.user}" - => link "(x)", to: ~p"/images/#{@image}/tamper?#{[user_id: downvote.user_id]}", method: "post" - - h5 - ' Hidden by - => @image.hides_count - = pluralize("user", "users", @image.hides_count) - - = for hide <- Enum.sort_by(@image.hides, & String.downcase(&1.user.name)) do - => link hide.user.name, to: ~p"/profiles/#{hide.user}", class: "interaction-user-list-item" diff --git a/lib/philomena_web/templates/image/index.html.heex b/lib/philomena_web/templates/image/index.html.heex new file mode 100644 index 00000000..5cf4b38f --- /dev/null +++ b/lib/philomena_web/templates/image/index.html.heex @@ -0,0 +1,54 @@ +<% + header = assigns[:header] || "" + params = assigns[:params] || assigns[:scope] || [] + scope = assigns[:scope] || [] + tags = assigns[:tags] || [] + route = assigns[:route] || fn p -> ~p"/images?#{p}" end + image_url = fn image -> ~p"/images/#{image}?#{scope}" end + sorted_url = fn image, hit -> ~p"/images/#{image}?#{Keyword.put(scope, :sort, hit["sort"])}" end + pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @images, route: route, params: params) + info = render(PhilomenaWeb.PaginationView, "_pagination_info.html", page: @images) +%> +
+ + <%= info_row(@conn, tags) %> +
+ <%= for record <- @images do %> + <%= case record do %> + <% {image, hit} -> %> + <%= render(PhilomenaWeb.ImageView, "_image_box.html", image: image, link: sorted_url.(image, hit), size: assigns[:size] || :thumb, conn: @conn) %> + <% image -> %> + <%= render(PhilomenaWeb.ImageView, "_image_box.html", image: image, link: image_url.(image), size: assigns[:size] || :thumb, conn: @conn) %> + <% end %> + <% end %> +
+ +
diff --git a/lib/philomena_web/templates/image/index.html.slime b/lib/philomena_web/templates/image/index.html.slime deleted file mode 100644 index ff5678cf..00000000 --- a/lib/philomena_web/templates/image/index.html.slime +++ /dev/null @@ -1,46 +0,0 @@ -elixir: - header = assigns[:header] || "" - params = assigns[:params] || assigns[:scope] || [] - scope = assigns[:scope] || [] - tags = assigns[:tags] || [] - route = assigns[:route] || fn p -> ~p"/images?#{p}" end - image_url = fn image -> ~p"/images/#{image}?#{scope}" end - sorted_url = fn image, hit -> ~p"/images/#{image}?#{Keyword.put(scope, :sort, hit["sort"])}" end - pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @images, route: route, params: params - info = render PhilomenaWeb.PaginationView, "_pagination_info.html", page: @images - -.block#imagelist-container - section.block__header.page__header.flex - span.block__header__title.page__title.hide-mobile - => header - - .page__pagination = pagination - - .flex__right.page__info - = random_button @conn, params - = hidden_toggle @conn, route, params - = deleted_toggle @conn, route, params - = quick_tag @conn - - = info_row @conn, tags - - .block__content.js-resizable-media-container - = for record <- @images do - = case record do - - {image, hit} -> - = render PhilomenaWeb.ImageView, "_image_box.html", image: image, link: sorted_url.(image, hit), size: assigns[:size] || :thumb, conn: @conn - - - image -> - = render PhilomenaWeb.ImageView, "_image_box.html", image: image, link: image_url.(image), size: assigns[:size] || :thumb, conn: @conn - - .block__header.block__header--light.page__header.flex - .page__pagination = pagination - - span.block__header__title.page__info - = info - - .flex__right.page__options - a href="/settings/edit" title="Display Settings" - i.fa.fa-cog - span.hide-mobile.hide-limited-desktop<> - ' Display Settings diff --git a/lib/philomena_web/templates/image/new.html.heex b/lib/philomena_web/templates/image/new.html.heex new file mode 100644 index 00000000..968241a3 --- /dev/null +++ b/lib/philomena_web/templates/image/new.html.heex @@ -0,0 +1,134 @@ +<%= form_for @changeset, ~p"/images", [multipart: true], fn f -> %> +
+

+ Read the + + site rules + + and check our + + do-not-post list + +

+

+ Don't post content the artist doesn't want here (or shared in general), + + including commercial content. + +

+
+

+ + Please check it isn't already here with + + reverse search. + + +

+ <% # todo: extract this %> +

+ Select an image +

+
+
+

+ Upload a file from your computer, or provide a link to the page containing the image and click Fetch. +

+
+ <%= file_input(f, :image, class: "input js-scraper") %> + <%= error_tag(f, :image) %> + <%= error_tag(f, :image_size) %> + <%= error_tag(f, :image_width) %> + <%= error_tag(f, :image_height) %> + <%= error_tag(f, :image_name) %> + <%= error_tag(f, :image_mime_type) %> + <%= error_tag(f, :image_duration) %> + <%= error_tag(f, :image_orig_sha512_hash) %> +
+
+ <%= url_input(f, :scraper_url, class: "input input--wide js-scraper", placeholder: "Link a deviantART page, a Tumblr post, or the image directly") %> + +
+ +
+

+ About this image +

+

+ The page(s) you found this image on. Images may have a maximum of + + 10 + + source URLs. Leave any sources you don't want to use blank. +

+ <%= inputs_for f, :sources, fn fs -> %> +
+ <%= text_input(fs, :source, class: "input flex__grow js-source-url", placeholder: "Source URL") %> + <%= error_tag(fs, :source) %> + +
+ <% end %> +
+ +
+
+ + <%= render(PhilomenaWeb.TagView, "_tag_editor.html", f: f, name: :tag_input, type: :upload) %> + <%= error_tag(f, :tag_input) %> + + + +

+ You can mouse over tags below to view a description, and click to add. Short tag names can be used and will expand to full. +

+
+ <%= PhilomenaWeb.TagView.quick_tags(@conn) %> +
+
+
+
+
+
+ <%= + render(PhilomenaWeb.MarkdownView, "_input.html", + conn: @conn, + f: f, + action_icon: "pencil-alt", + action_text: "Description", + placeholder: "Describe this image in plain words - this should generally be info about the image that doesn't belong in the tags or source.", + name: :description, + class: "js-image-descr-input", + required: false + ) + %> +
+
+
+ <%= render(PhilomenaWeb.MarkdownView, "_anon_checkbox.html", conn: @conn, f: f, label: "Post anonymously") %> + <%= render(PhilomenaWeb.CaptchaView, "_captcha.html", name: "image", conn: @conn) %> +
+ <%= submit("Upload", class: "button input--separate-top", autocomplete: "off", data: [disable_with: "Please wait..."]) %> +
+<% end %> diff --git a/lib/philomena_web/templates/image/new.html.slime b/lib/philomena_web/templates/image/new.html.slime deleted file mode 100644 index ad596f17..00000000 --- a/lib/philomena_web/templates/image/new.html.slime +++ /dev/null @@ -1,91 +0,0 @@ -= form_for @changeset, ~p"/images", [multipart: true], fn f -> - .dnp-warning - h4 - ' Read the - a> href="/pages/rules" site rules - ' and check our - a> href="/dnp" do-not-post list - p - ' Don't post content the artist doesn't want here (or shared in general), - strong including commercial content. - - p - strong - ' Please check it isn't already here with - a href="/search/reverse" reverse search. - - / todo: extract this - h4 Select an image - .image-other - #js-image-upload-previews - p Upload a file from your computer, or provide a link to the page containing the image and click Fetch. - .field - = file_input f, :image, class: "input js-scraper" - = error_tag f, :image - = error_tag f, :image_size - = error_tag f, :image_width - = error_tag f, :image_height - = error_tag f, :image_name - = error_tag f, :image_mime_type - = error_tag f, :image_duration - = error_tag f, :image_orig_sha512_hash - - .field.field--inline - = url_input f, :scraper_url, class: "input input--wide js-scraper", placeholder: "Link a deviantART page, a Tumblr post, or the image directly" - button.button.button--separate-left#js-scraper-preview(type="button" title="Fetch the image at the specified URL" data-disable-with="Fetch" disabled) - ' Fetch - - .field-error-js.hidden.js-scraper - - h4 About this image - p - 'The page(s) you found this image on. Images may have a maximum of - span.js-max-source-count> 10 - ' source URLs. Leave any sources you don't want to use blank. - - = inputs_for f, :sources, fn fs -> - .field.js-image-source.field--inline.flex--no-wrap.flex--centered - = text_input fs, :source, class: "input flex__grow js-source-url", placeholder: "Source URL" - = error_tag fs, :source - - label.input--separate-left.flex__fixed.flex--centered - a.js-source-remove href="#" - i.fa.fa-trash> - ' Delete - - .field - button.button.js-image-add-source type="button" - i.fa.fa-plus> - ' Add source - - .field - label for="image[tag_input]" - ' Describe with - strong> 3+ - ' tags, including ratings and applicable artist tags - - = render PhilomenaWeb.TagView, "_tag_editor.html", f: f, name: :tag_input, type: :upload - = error_tag f, :tag_input - - button.button.button--state-success.button--separate-left.button--bold id="tagsinput-save" type="button" title="This button saves the tags listed above to your browser, allowing you to retrieve them again by clicking the Load button" Save - button.button.button--state-warning.button--separate-left.button--bold id="tagsinput-load" type="button" title="This button loads any saved tags from your browser" Load - button.button.button--state-danger.button--separate-left.button--bold id="tagsinput-clear" type="button" title="This button will clear the list of tags above" Clear - - p You can mouse over tags below to view a description, and click to add. Short tag names can be used and will expand to full. - - .block.js-tagtable data-target="[name="image[tag_input]"]" - = PhilomenaWeb.TagView.quick_tags(@conn) - - br - - .field - .block - .communication-edit__wrap - = render PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, action_icon: "pencil-alt", action_text: "Description", placeholder: "Describe this image in plain words - this should generally be info about the image that doesn't belong in the tags or source.", name: :description, class: "js-image-descr-input", required: false - - = render PhilomenaWeb.MarkdownView, "_anon_checkbox.html", conn: @conn, f: f, label: "Post anonymously" - - = render PhilomenaWeb.CaptchaView, "_captcha.html", name: "image", conn: @conn - - .actions - = submit "Upload", class: "button input--separate-top", autocomplete: "off", data: [disable_with: "Please wait..."] diff --git a/lib/philomena_web/templates/image/related/index.html.heex b/lib/philomena_web/templates/image/related/index.html.heex new file mode 100644 index 00000000..0f7cba57 --- /dev/null +++ b/lib/philomena_web/templates/image/related/index.html.heex @@ -0,0 +1,16 @@ +
+
+
+ Viewing related images for + + # + <%= @image.id %> + +
+
+
+ <%= for image <- @images do %> + <%= render(PhilomenaWeb.ImageView, "_image_box.html", image: image, link: ~p"/images/#{image}", size: :thumb, conn: @conn) %> + <% end %> +
+
diff --git a/lib/philomena_web/templates/image/related/index.html.slime b/lib/philomena_web/templates/image/related/index.html.slime deleted file mode 100644 index 421cee0a..00000000 --- a/lib/philomena_web/templates/image/related/index.html.slime +++ /dev/null @@ -1,11 +0,0 @@ -.block#imagelist-container - .block__header - .block__header__title.hide-mobile - ' Viewing related images for - strong> - | # - = @image.id - - .block__content.js-resizable-media-container - = for image <- @images do - = render PhilomenaWeb.ImageView, "_image_box.html", image: image, link: ~p"/images/#{image}", size: :thumb, conn: @conn diff --git a/lib/philomena_web/templates/image/reporting/show.html.heex b/lib/philomena_web/templates/image/reporting/show.html.heex new file mode 100644 index 00000000..ee8e93bd --- /dev/null +++ b/lib/philomena_web/templates/image/reporting/show.html.heex @@ -0,0 +1,41 @@ + + + +
+ <% checked = Enum.any?(@dupe_reports, &(&1.state == "open")) %> + + +
+
+ <%= if @conn.assigns.current_user do %> + <%= render(PhilomenaWeb.DuplicateReportView, "_form.html", image: @image, conn: @conn, changeset: @changeset) %> + <% else %> +

+ You must + + log in + + to report duplicate images. +

+ <% end %> + <% target_reports = Enum.filter(@dupe_reports, &(&1.duplicate_of_image_id == @image.id)) %> + <% source_reports = Enum.filter(@dupe_reports, &(&1.image_id == @image.id)) %> + <%= if Enum.any?(@dupe_reports) do %> +

+ Existing duplicate reports +

+ <%= if Enum.any?(target_reports) do %> + <%= render(PhilomenaWeb.DuplicateReportView, "_list.html", duplicate_reports: target_reports, conn: @conn) %> + <% end %> + <%= if Enum.any?(source_reports) do %> + <%= render(PhilomenaWeb.DuplicateReportView, "_list.html", duplicate_reports: source_reports, conn: @conn) %> + <% end %> + <% end %> +
+
+
diff --git a/lib/philomena_web/templates/image/reporting/show.html.slime b/lib/philomena_web/templates/image/reporting/show.html.slime deleted file mode 100644 index 32216dbe..00000000 --- a/lib/philomena_web/templates/image/reporting/show.html.slime +++ /dev/null @@ -1,31 +0,0 @@ -a href=~p"/images/#{@image}/reports/new" - button.button.button--link - i.fa.fa-exclamation-triangle> - ' General reporting - -.report-duplicate - - checked = Enum.any?(@dupe_reports, & &1.state == "open") - - input.toggle-box id="image-dedupe" type="checkbox" checked=checked - label for="image-dedupe" Updating/merging - .toggle-box-container - .toggle-box-container__content - = if @conn.assigns.current_user do - = render PhilomenaWeb.DuplicateReportView, "_form.html", image: @image, conn: @conn, changeset: @changeset - - else - p - ' You must - a> href=~p"/sessions/new" log in - ' to report duplicate images. - - - target_reports = Enum.filter(@dupe_reports, & &1.duplicate_of_image_id == @image.id) - - source_reports = Enum.filter(@dupe_reports, & &1.image_id == @image.id) - - = if Enum.any?(@dupe_reports) do - h4 Existing duplicate reports - - = if Enum.any?(target_reports) do - = render PhilomenaWeb.DuplicateReportView, "_list.html", duplicate_reports: target_reports, conn: @conn - - = if Enum.any?(source_reports) do - = render PhilomenaWeb.DuplicateReportView, "_list.html", duplicate_reports: source_reports, conn: @conn diff --git a/lib/philomena_web/templates/image/scratchpad/edit.html.heex b/lib/philomena_web/templates/image/scratchpad/edit.html.heex new file mode 100644 index 00000000..a4f8ff5f --- /dev/null +++ b/lib/philomena_web/templates/image/scratchpad/edit.html.heex @@ -0,0 +1,10 @@ +

+ Editing moderation notes for image + <%= link("##{@image.id}", to: ~p"/images/#{@image}") %> +

+<%= form_for @changeset, ~p"/images/#{@image}/scratchpad", fn f -> %> +
+ <%= textarea(f, :scratchpad, placeholder: "Scratchpad contents", class: "input input--wide") %> +
+ <%= submit("Update", class: "button", data: [disable_with: raw("Saving…")]) %> +<% end %> diff --git a/lib/philomena_web/templates/image/scratchpad/edit.html.slime b/lib/philomena_web/templates/image/scratchpad/edit.html.slime deleted file mode 100644 index bd27ab6e..00000000 --- a/lib/philomena_web/templates/image/scratchpad/edit.html.slime +++ /dev/null @@ -1,9 +0,0 @@ -h1 - ' Editing moderation notes for image - = link "##{@image.id}", to: ~p"/images/#{@image}" - -= form_for @changeset, ~p"/images/#{@image}/scratchpad", fn f -> - .field - = textarea f, :scratchpad, placeholder: "Scratchpad contents", class: "input input--wide" - - = submit "Update", class: "button", data: [disable_with: raw("Saving…")] diff --git a/lib/philomena_web/templates/image/show.html.heex b/lib/philomena_web/templates/image/show.html.heex new file mode 100644 index 00000000..69145165 --- /dev/null +++ b/lib/philomena_web/templates/image/show.html.heex @@ -0,0 +1,28 @@ +<%= render(PhilomenaWeb.ImageView, "_image_approval_banner.html", image: @image, conn: @conn) %> +<%= render(PhilomenaWeb.ImageView, "_image_meta.html", image: @image, watching: @watching, user_galleries: @user_galleries, changeset: @image_changeset, conn: @conn) %> +<%= render(PhilomenaWeb.ImageView, "_image_page.html", image: @image, conn: @conn) %> +
+ <%= if @conn.assigns.advert do %> + <%= render(PhilomenaWeb.AdvertView, "_box.html", advert: @conn.assigns.advert, conn: @conn) %> + <% end %> +
+ <%= render(PhilomenaWeb.ImageView, "_description.html", image: @image, body: @description, conn: @conn) %> +
+ <%= render(PhilomenaWeb.Image.DescriptionView, "_form.html", image: @image, changeset: @image_changeset, conn: @conn) %> + <%= render(PhilomenaWeb.ImageView, "_tags.html", image: @image, tag_change_count: @tag_change_count, changeset: @image_changeset, conn: @conn) %> + <%= render(PhilomenaWeb.ImageView, "_source.html", image: @image, source_change_count: @source_change_count, changeset: @image_changeset, conn: @conn) %> + <%= render(PhilomenaWeb.ImageView, "_options.html", image: @image, changeset: @image_changeset, conn: @conn) %> +

+ Comments +

+ <%= cond do %> + <% @conn.assigns.current_ban -> %> + <%= render(PhilomenaWeb.BanView, "_ban_reason.html", conn: @conn) %> + <% @image.commenting_allowed -> %> + <%= render(PhilomenaWeb.Image.CommentView, "_form.html", image: @image, changeset: @comment_changeset, remote: true, conn: @conn) %> + <% true -> %> + <% end %> +
+ <%= render(PhilomenaWeb.Image.CommentView, "index.html", image: @image, comments: @comments, conn: @conn) %> +
+
diff --git a/lib/philomena_web/templates/image/show.html.slime b/lib/philomena_web/templates/image/show.html.slime deleted file mode 100644 index 2c2a8f23..00000000 --- a/lib/philomena_web/templates/image/show.html.slime +++ /dev/null @@ -1,28 +0,0 @@ -= render PhilomenaWeb.ImageView, "_image_approval_banner.html", image: @image, conn: @conn -= render PhilomenaWeb.ImageView, "_image_meta.html", image: @image, watching: @watching, user_galleries: @user_galleries, changeset: @image_changeset, conn: @conn -= render PhilomenaWeb.ImageView, "_image_page.html", image: @image, conn: @conn - -.layout--narrow - = if @conn.assigns.advert do - = render PhilomenaWeb.AdvertView, "_box.html", advert: @conn.assigns.advert, conn: @conn - - .image-description - = render PhilomenaWeb.ImageView, "_description.html", image: @image, body: @description, conn: @conn - = render PhilomenaWeb.Image.DescriptionView, "_form.html", image: @image, changeset: @image_changeset, conn: @conn - - = render PhilomenaWeb.ImageView, "_tags.html", image: @image, tag_change_count: @tag_change_count, changeset: @image_changeset, conn: @conn - = render PhilomenaWeb.ImageView, "_source.html", image: @image, source_change_count: @source_change_count, changeset: @image_changeset, conn: @conn - = render PhilomenaWeb.ImageView, "_options.html", image: @image, changeset: @image_changeset, conn: @conn - - h4 Comments - = cond do - - @conn.assigns.current_ban -> - = render PhilomenaWeb.BanView, "_ban_reason.html", conn: @conn - - - @image.commenting_allowed -> - = render PhilomenaWeb.Image.CommentView, "_form.html", image: @image, changeset: @comment_changeset, remote: true, conn: @conn - - - true -> - - #comments data-current-url=~p"/images/#{@image}/comments" data-loaded="true" - = render PhilomenaWeb.Image.CommentView, "index.html", image: @image, comments: @comments, conn: @conn diff --git a/lib/philomena_web/templates/image/source_change/index.html.heex b/lib/philomena_web/templates/image/source_change/index.html.heex new file mode 100644 index 00000000..d1a37265 --- /dev/null +++ b/lib/philomena_web/templates/image/source_change/index.html.heex @@ -0,0 +1,10 @@ +

+ Source changes for + + image # + <%= @image.id %> + +

+<% route = fn p -> ~p"/images/#{@image}/source_changes?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @source_changes, route: route, conn: @conn) %> +<%= render(PhilomenaWeb.SourceChangeView, "index.html", conn: @conn, source_changes: @source_changes, pagination: pagination) %> diff --git a/lib/philomena_web/templates/image/source_change/index.html.slime b/lib/philomena_web/templates/image/source_change/index.html.slime deleted file mode 100644 index bd5f4a57..00000000 --- a/lib/philomena_web/templates/image/source_change/index.html.slime +++ /dev/null @@ -1,10 +0,0 @@ -h1 - ' Source changes for - a href=~p"/images/#{@image}" - | image # - = @image.id - -- route = fn p -> ~p"/images/#{@image}/source_changes?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @source_changes, route: route, conn: @conn - -= render PhilomenaWeb.SourceChangeView, "index.html", conn: @conn, source_changes: @source_changes, pagination: pagination \ No newline at end of file diff --git a/lib/philomena_web/templates/image/subscription/_error.html.heex b/lib/philomena_web/templates/image/subscription/_error.html.heex new file mode 100644 index 00000000..74b8d64e --- /dev/null +++ b/lib/philomena_web/templates/image/subscription/_error.html.heex @@ -0,0 +1,3 @@ +
+ Error! +
diff --git a/lib/philomena_web/templates/image/subscription/_error.html.slime b/lib/philomena_web/templates/image/subscription/_error.html.slime deleted file mode 100644 index dd079424..00000000 --- a/lib/philomena_web/templates/image/subscription/_error.html.slime +++ /dev/null @@ -1,2 +0,0 @@ -.js-subscription-target - ' Error! diff --git a/lib/philomena_web/templates/image/subscription/_subscription.html.heex b/lib/philomena_web/templates/image/subscription/_subscription.html.heex new file mode 100644 index 00000000..504e192b --- /dev/null +++ b/lib/philomena_web/templates/image/subscription/_subscription.html.heex @@ -0,0 +1,36 @@ +<% + watch_path = ~p"/images/#{@image}/subscription" + + watch_class = + if @watching do + "hidden" + else + "" + end + + unwatch_path = ~p"/images/#{@image}/subscription" + + unwatch_class = + if @watching do + "" + else + "hidden" + end +%> +<%= if @conn.assigns.current_user do %> + + + + Subscribe + + + + Unsubscribe + + +<% else %> + + + Subscribe + +<% end %> diff --git a/lib/philomena_web/templates/image/subscription/_subscription.html.slime b/lib/philomena_web/templates/image/subscription/_subscription.html.slime deleted file mode 100644 index 323fc0d5..00000000 --- a/lib/philomena_web/templates/image/subscription/_subscription.html.slime +++ /dev/null @@ -1,20 +0,0 @@ -elixir: - watch_path = ~p"/images/#{@image}/subscription" - watch_class = if @watching, do: "hidden", else: "" - - unwatch_path = ~p"/images/#{@image}/subscription" - unwatch_class = if @watching, do: "", else: "hidden" - -= if @conn.assigns.current_user do - span.js-subscription-target - a.js-subscription-link href=watch_path class=watch_class data-remote="true" data-method="post" - i.fa.fa-bell> - ' Subscribe - - a.js-subscription-link href=unwatch_path class=unwatch_class data-remote="true" data-method="delete" - i.fa.fa-bell-slash> - ' Unsubscribe -- else - a href=~p"/sessions/new" - i.fa.fa-bell> - ' Subscribe diff --git a/lib/philomena_web/templates/image/tag_change/index.html.heex b/lib/philomena_web/templates/image/tag_change/index.html.heex new file mode 100644 index 00000000..630b5ae5 --- /dev/null +++ b/lib/philomena_web/templates/image/tag_change/index.html.heex @@ -0,0 +1,26 @@ +

+ Tag changes for + + image # + <%= @image.id %> + +

+<% route = fn p -> ~p"/images/#{@image}/tag_changes?#{p}" end %> +<% + params = + if @conn.params["added"] do + [added: @conn.params["added"]] + end +%> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @tag_changes, route: route, conn: @conn, params: params) %> +
+
+ + Display only: + + <%= link("Removed", to: ~p"/images/#{@image}/tag_changes?#{[added: 0]}") %> + <%= link("Added", to: ~p"/images/#{@image}/tag_changes?#{[added: 1]}") %> + <%= link("All", to: ~p"/images/#{@image}/tag_changes") %> +
+ <%= render(PhilomenaWeb.TagChangeView, "index.html", conn: @conn, tag_changes: @tag_changes, pagination: pagination) %> +
diff --git a/lib/philomena_web/templates/image/tag_change/index.html.slime b/lib/philomena_web/templates/image/tag_change/index.html.slime deleted file mode 100644 index cd79ec97..00000000 --- a/lib/philomena_web/templates/image/tag_change/index.html.slime +++ /dev/null @@ -1,20 +0,0 @@ -h1 - ' Tag changes for - a href=~p"/images/#{@image}" - | image # - = @image.id - -- route = fn p -> ~p"/images/#{@image}/tag_changes?#{p}" end -- params = if @conn.params["added"], do: [added: @conn.params["added"]] -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @tag_changes, route: route, conn: @conn, params: params - -.block - .block__header - span.block__header__title - | Display only: - - = link "Removed", to: ~p"/images/#{@image}/tag_changes?#{[added: 0]}" - = link "Added", to: ~p"/images/#{@image}/tag_changes?#{[added: 1]}" - = link "All", to: ~p"/images/#{@image}/tag_changes" - - = render PhilomenaWeb.TagChangeView, "index.html", conn: @conn, tag_changes: @tag_changes, pagination: pagination diff --git a/lib/philomena_web/templates/image/tag_lock/show.html.heex b/lib/philomena_web/templates/image/tag_lock/show.html.heex new file mode 100644 index 00000000..18567f9d --- /dev/null +++ b/lib/philomena_web/templates/image/tag_lock/show.html.heex @@ -0,0 +1,14 @@ +<% tag_input = Enum.map_join(@image.locked_tags, ", ", & &1.name) %> +

+ Editing locked tags on image # + <%= @image.id %> +

+<%= form_for @changeset, ~p"/images/#{@image}/tag_lock", fn f -> %> +
+ <%= render(PhilomenaWeb.TagView, "_tag_editor.html", f: f, name: :tag_input, type: :edit, extra: [value: tag_input]) %> + <%= error_tag(f, :tag_input) %> +
+
+ <%= submit("Update", class: "button", autocomplete: "off", data: [disable_with: "Please wait..."]) %> +
+<% end %> diff --git a/lib/philomena_web/templates/image/tag_lock/show.html.slime b/lib/philomena_web/templates/image/tag_lock/show.html.slime deleted file mode 100644 index e5a9841d..00000000 --- a/lib/philomena_web/templates/image/tag_lock/show.html.slime +++ /dev/null @@ -1,13 +0,0 @@ -- tag_input = Enum.map_join(@image.locked_tags, ", ", & &1.name) - -h1 - | Editing locked tags on image # - = @image.id - -= form_for @changeset, ~p"/images/#{@image}/tag_lock", fn f -> - .field - = render PhilomenaWeb.TagView, "_tag_editor.html", f: f, name: :tag_input, type: :edit, extra: [value: tag_input] - = error_tag f, :tag_input - - .actions - = submit "Update", class: "button", autocomplete: "off", data: [disable_with: "Please wait..."] diff --git a/lib/philomena_web/templates/ip_profile/show.html.heex b/lib/philomena_web/templates/ip_profile/show.html.heex new file mode 100644 index 00000000..5d4739fb --- /dev/null +++ b/lib/philomena_web/templates/ip_profile/show.html.heex @@ -0,0 +1,92 @@ +

+ <%= @ip %> + 's IP profile +

+ +<%= render(PhilomenaWeb.BanView, "_bans.html", bans: @subnet_bans, conn: @conn) %> +

+ Administration Options +

+ +

+ Actions +

+ +

+ Observed users +

+ + + + + + + + + + + <%= for uip <- @user_ips do %> + + + + + + + <% end %> + +
+ Username + + Account Used + + Last Seen + + Created At +
+ <%= link(uip.user.name, to: ~p"/profiles/#{uip.user}") %> + + <%= uip.uses %> + times + + <%= pretty_time(uip.updated_at) %> + + <%= pretty_time(uip.user.created_at) %> +
diff --git a/lib/philomena_web/templates/ip_profile/show.html.slime b/lib/philomena_web/templates/ip_profile/show.html.slime deleted file mode 100644 index eb3ac25c..00000000 --- a/lib/philomena_web/templates/ip_profile/show.html.slime +++ /dev/null @@ -1,44 +0,0 @@ -h1 - = @ip - ' 's IP profile - -ul - li = link "View images this IP has uploaded", to: ~p"/search?#{[q: "ip:#{@ip}"]}" - li = link "View comments this IP has posted", to: ~p"/comments?#{[cq: "ip:#{@ip}"]}" - li = link "View posts this IP has made", to: ~p"/posts?#{[pq: "ip:#{@ip}"]}" - -= render PhilomenaWeb.BanView, "_bans.html", bans: @subnet_bans, conn: @conn - -h2 Administration Options -ul - li = link "View tag changes", to: ~p"/ip_profiles/#{to_string(@ip)}/tag_changes" - li = link "View source URL history", to: ~p"/ip_profiles/#{to_string(@ip)}/source_changes" - li = link "View reports this IP has made", to: ~p"/admin/reports?#{[rq: "ip:#{@ip}"]}" - li = link "View IP ban history", to: ~p"/admin/subnet_bans?#{[ip: to_string(@ip)]}" - li = link "Ban this sucker", to: ~p"/admin/subnet_bans/new?#{[specification: to_string(@ip)]}" - -h2 Actions -ul - li = link "Revert all tag changes", to: ~p"/tag_changes/full_revert?#{[ip: to_string(@ip)]}", data: [confirm: "Are you really, really sure?", method: "create"] - li = link "...the button above didn't work (use carefully, this is resource-intensive)", to: ~p"/tag_changes/full_revert?#{[ip: to_string(@ip), batch_size: 1]}", data: [confirm: "Please confirm that you're aware that this may crash the site and are ready to take on the full wrath of the admins if it does so after you press this button.", method: "create"] - -h4 Observed users -table.table - thead - tr - th Username - th Account Used - th Last Seen - th Created At - tbody - = for uip <- @user_ips do - tr - td - = link uip.user.name, to: ~p"/profiles/#{uip.user}" - td - => uip.uses - ' times - td - => pretty_time uip.updated_at - td - => pretty_time uip.user.created_at diff --git a/lib/philomena_web/templates/ip_profile/source_change/index.html.heex b/lib/philomena_web/templates/ip_profile/source_change/index.html.heex new file mode 100644 index 00000000..c00471a4 --- /dev/null +++ b/lib/philomena_web/templates/ip_profile/source_change/index.html.heex @@ -0,0 +1,7 @@ +

+ Source changes by + <%= @ip %> +

+<% route = fn p -> ~p"/ip_profiles/#{to_string(@ip)}/source_changes?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @source_changes, route: route, conn: @conn) %> +<%= render(PhilomenaWeb.SourceChangeView, "index.html", conn: @conn, source_changes: @source_changes, pagination: pagination) %> diff --git a/lib/philomena_web/templates/ip_profile/source_change/index.html.slime b/lib/philomena_web/templates/ip_profile/source_change/index.html.slime deleted file mode 100644 index d31a7968..00000000 --- a/lib/philomena_web/templates/ip_profile/source_change/index.html.slime +++ /dev/null @@ -1,8 +0,0 @@ -h1 - ' Source changes by - = @ip - -- route = fn p -> ~p"/ip_profiles/#{to_string(@ip)}/source_changes?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @source_changes, route: route, conn: @conn - -= render PhilomenaWeb.SourceChangeView, "index.html", conn: @conn, source_changes: @source_changes, pagination: pagination diff --git a/lib/philomena_web/templates/ip_profile/tag_change/index.html.heex b/lib/philomena_web/templates/ip_profile/tag_change/index.html.heex new file mode 100644 index 00000000..e49b2a7e --- /dev/null +++ b/lib/philomena_web/templates/ip_profile/tag_change/index.html.heex @@ -0,0 +1,23 @@ +

+ Tag changes by + <%= @ip %> +

+<% route = fn p -> ~p"/ip_profiles/#{to_string(@ip)}/tag_changes?#{p}" end %> +<% + params = + if @conn.params["added"] do + [added: @conn.params["added"]] + end +%> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @tag_changes, route: route, conn: @conn, params: params) %> +
+
+ + Display only: + + <%= link("Removed", to: ~p"/ip_profiles/#{to_string(@ip)}/tag_changes?#{[added: 0]}") %> + <%= link("Added", to: ~p"/ip_profiles/#{to_string(@ip)}/tag_changes?#{[added: 1]}") %> + <%= link("All", to: ~p"/ip_profiles/#{to_string(@ip)}/tag_changes") %> +
+ <%= render(PhilomenaWeb.TagChangeView, "index.html", conn: @conn, tag_changes: @tag_changes, pagination: pagination) %> +
diff --git a/lib/philomena_web/templates/ip_profile/tag_change/index.html.slime b/lib/philomena_web/templates/ip_profile/tag_change/index.html.slime deleted file mode 100644 index 4eb2f114..00000000 --- a/lib/philomena_web/templates/ip_profile/tag_change/index.html.slime +++ /dev/null @@ -1,18 +0,0 @@ -h1 - ' Tag changes by - = @ip - -- route = fn p -> ~p"/ip_profiles/#{to_string(@ip)}/tag_changes?#{p}" end -- params = if @conn.params["added"], do: [added: @conn.params["added"]] -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @tag_changes, route: route, conn: @conn, params: params - -.block - .block__header - span.block__header__title - | Display only: - - = link "Removed", to: ~p"/ip_profiles/#{to_string(@ip)}/tag_changes?#{[added: 0]}" - = link "Added", to: ~p"/ip_profiles/#{to_string(@ip)}/tag_changes?#{[added: 1]}" - = link "All", to: ~p"/ip_profiles/#{to_string(@ip)}/tag_changes" - - = render PhilomenaWeb.TagChangeView, "index.html", conn: @conn, tag_changes: @tag_changes, pagination: pagination diff --git a/lib/philomena_web/templates/layout/_burger.html.heex b/lib/philomena_web/templates/layout/_burger.html.heex new file mode 100644 index 00000000..fd96fc4a --- /dev/null +++ b/lib/philomena_web/templates/layout/_burger.html.heex @@ -0,0 +1,46 @@ + diff --git a/lib/philomena_web/templates/layout/_burger.html.slime b/lib/philomena_web/templates/layout/_burger.html.slime deleted file mode 100644 index 6d126418..00000000 --- a/lib/philomena_web/templates/layout/_burger.html.slime +++ /dev/null @@ -1,34 +0,0 @@ -nav#burger - a href="/" - i.fa-fw.favicon-home<> - ' Home - a href="/images/new" - i.fa.fa-fw.fa-upload<> - ' Upload - a href="/forums" - i.fas.fa-fw.fa-pen-square<> - ' Forums - a href="/tags" - i.fa.fa-fw.fa-tag<> - ' Tags - a href="/search?q=first_seen_at.gt:3 days ago&sf=wilson_score&sd=desc" - i.fas.fa-fw.fa-poll<> - ' Rankings - a href="/filters" - i.fa.fa-fw.fa-filter<> - ' Filters - a href="/galleries" - i.fa.fa-fw.fa-image<> - ' Galleries - a href="/comments" - i.fa.fa-fw.fa-comments<> - ' Comments - a href="/commissions" - i.fa.fa-fw.fa-address-card<> - ' Commissions - a href="/channels" - i.fa.fa-fw.fa-podcast<> - ' Channels - a href="/pages/donations" - i.fa.fa-fw.fa-heart<> - ' Donate diff --git a/lib/philomena_web/templates/layout/_flash_warnings.html.heex b/lib/philomena_web/templates/layout/_flash_warnings.html.heex new file mode 100644 index 00000000..4cdebfa8 --- /dev/null +++ b/lib/philomena_web/templates/layout/_flash_warnings.html.heex @@ -0,0 +1,41 @@ +<%= for notice <- @conn.assigns.site_notices do %> +
+ + <%= notice.title %> + + <%= notice.text %> + <%= if notice.link not in [nil, ""] do %> + + <%= notice.link_text %> + + <% end %> +
+<% end %> + +<%= if get_flash(@conn, :info) do %> +
+ <%= get_flash(@conn, :info) %> +
+<% end %> +<%= if get_flash(@conn, :alert) do %> +
+ <%= get_flash(@conn, :alert) %> +
+<% end %> +<%= if get_flash(@conn, :error) do %> +
+ <%= get_flash(@conn, :error) %> +
+<% end %> +<%= if get_flash(@conn, :warning) do %> +
+ <%= get_flash(@conn, :warning) %> +
+<% end %> diff --git a/lib/philomena_web/templates/layout/_flash_warnings.html.slime b/lib/philomena_web/templates/layout/_flash_warnings.html.slime deleted file mode 100644 index ad531a26..00000000 --- a/lib/philomena_web/templates/layout/_flash_warnings.html.slime +++ /dev/null @@ -1,22 +0,0 @@ -= for notice <- @conn.assigns.site_notices do - .flash.flash--site-notice - strong> - = notice.title - => notice.text - = if notice.link not in [nil, ""] do - a href=notice.link - = notice.link_text - -noscript.flash.flash--warning - strong You don't appear to have Javascript enabled - ' If you're using an add-on like NoScript, please allow - => cdn_host() - ' for the site to work properly. -= if get_flash(@conn, :info) do - .flash.flash--success = get_flash(@conn, :info) -= if get_flash(@conn, :alert) do - .flash.flash--warning = get_flash(@conn, :alert) -= if get_flash(@conn, :error) do - .flash.flash--warning = get_flash(@conn, :error) -= if get_flash(@conn, :warning) do - .flash.flash--warning = get_flash(@conn, :warning) diff --git a/lib/philomena_web/templates/layout/_footer.html.heex b/lib/philomena_web/templates/layout/_footer.html.heex new file mode 100644 index 00000000..ad685f2f --- /dev/null +++ b/lib/philomena_web/templates/layout/_footer.html.heex @@ -0,0 +1,35 @@ + diff --git a/lib/philomena_web/templates/layout/_footer.html.slime b/lib/philomena_web/templates/layout/_footer.html.slime deleted file mode 100644 index 72fb1d54..00000000 --- a/lib/philomena_web/templates/layout/_footer.html.slime +++ /dev/null @@ -1,22 +0,0 @@ -footer#footer - #footer_content - - footer_data = footer_data() - - = for column <- footer_data["cols"] do - .footercol - h5 = column - - = for row <- footer_data[column] do - = if row["bold"] do - strong - a href=row["url"] target=row["target"]||"_self" = row["title"] - - else - a href=row["url"] target=row["target"]||"_self" = row["title"] - br - - #serving_info - ' Powered by - a> href="https://github.com/philomena-dev/philomena" philomena - | ( - = render_time(@conn) - | ms) diff --git a/lib/philomena_web/templates/layout/_header.html.heex b/lib/philomena_web/templates/layout/_header.html.heex new file mode 100644 index 00000000..c4363efd --- /dev/null +++ b/lib/philomena_web/templates/layout/_header.html.heex @@ -0,0 +1,164 @@ +
+
+ + <%= form_for @conn, ~p"/search", [method: "get", class: "header__search flex flex--no-wrap flex--centered", enforce_utf8: false], fn f -> %> + + <%= if present?(@conn.params["sf"]) do %> + + <% end %> + <%= if present?(@conn.params["sd"]) do %> + + <% end %> + <%= if present?(@conn.params["hidden"]) do %> + + <% end %> + <%= if hides_images?(@conn) do %> + <%= select(f, :del, [{"-D", ""}, {"+D", 1}, {"*D", "deleted"}, {"DO", "only"}], name: "del", class: "input header__input js-staff-action", autocomplete: "off") %> + <% end %> + + + + + + + + <% end %> +
+ <%= if @current_user do %> + + + + <%= @notification_count %> + + + + <%= if @conversation_count > 0 do %> + + + <%= @conversation_count %> + + <% else %> + + + <% end %> + + + + + Filters + + + <%= form_for @user_changeset, ~p"/filters/current", [class: "header__filter-form", id: "filter-quick-form"], fn f -> %> + <%= select(f, :current_filter_id, @available_filters, name: "id", id: "filter-quick-menu", class: "input header__input", data: [change_submit: "#filter-quick-form"], autocomplete: "off") %> + <% end %> + <%= form_for @user_changeset, ~p"/filters/spoiler_type", [class: "header__filter-form hide-mobile hide-limited-desktop", id: "spoiler-quick-form"], fn f -> %> + <%= select(f, :spoiler_type, @spoiler_types, id: "spoiler-quick-menu", class: "input header__input", data: [change_submit: "#spoiler-quick-form"], autocomplete: "off") %> + <% end %> + + <% else %> + + Filters ( + <%= @current_filter.name %> + ) + + + + + Settings + + + + Register + + + Login + + <% end %> +
+
+
+ diff --git a/lib/philomena_web/templates/layout/_header.html.slime b/lib/philomena_web/templates/layout/_header.html.slime deleted file mode 100644 index 27a837c4..00000000 --- a/lib/philomena_web/templates/layout/_header.html.slime +++ /dev/null @@ -1,121 +0,0 @@ -header.header - .flex.flex--centered.flex--start-bunched.flex--maybe-wrap - .flex.flex--centered - #js-burger-toggle.hide-desktop - a.header__link href="#" - i.fa.fa-bars - a.header__link href="/" - i.fa.fw.favicon-home - span.fa__text.hide-limited-desktop.hide-mobile - ' Derpibooru - a.header__link.hide-mobile href="/images/new" title="Upload" - i.fa.fa-upload - - = form_for @conn, ~p"/search", [method: "get", class: "header__search flex flex--no-wrap flex--centered", enforce_utf8: false], fn f -> - input.input.header__input.header__input--search#q name="q" title="For terms all required, separate with ',' or 'AND'; also supports 'OR' for optional terms and '-' or 'NOT' for negation. Search with a blank query for more options or click the ? for syntax help." value=@conn.params["q"] placeholder="Search" autocapitalize="none" - - = if present?(@conn.params["sf"]) do - input type="hidden" name="sf" value=@conn.params["sf"] - = if present?(@conn.params["sd"]) do - input type="hidden" name="sd" value=@conn.params["sd"] - = if present?(@conn.params["hidden"]) do - input type="hidden" name="hidden" value=@conn.params["hidden"] - - = if hides_images?(@conn) do - = select f, :del, [{"-D", ""}, {"+D", 1}, {"*D", "deleted"}, {"DO", "only"}], name: "del", class: "input header__input js-staff-action", autocomplete: "off" - - button.header__search__button type="submit" title="Search" - i.fas.fa-search - a.header__search__button href="/search/reverse" title="Search using an image" - i.fa-search-button.fas.fa-camera - a.header__search__button href="/pages/search_syntax" title="Search syntax help" - i.fa-search-button.fas.fa-question - - .flex.flex--centered.flex--no-wrap.header__force-right - = if @current_user do - a.header__link href="/notifications" title="Notifications" - i.fas.fa-bell> - span.js-notification-ticker.fa__text.header__counter data-notification-count=@notification_count = @notification_count - - a.header__link href="/conversations" title="Conversations" - = if @conversation_count > 0 do - i.fa-unread-icon.fas.fa-envelope-open> - span.header__counter - = @conversation_count - - else - i.fas.fa-envelope> - span.header__counter.hidden - | 0 - - a.header__link.hide-mobile href="/filters" title="Filters" - i.fa.fa-filter - span.hide-limited-desktop< Filters - - = form_for @user_changeset, ~p"/filters/current", [class: "header__filter-form", id: "filter-quick-form"], fn f -> - = select f, :current_filter_id, @available_filters, name: "id", id: "filter-quick-menu", class: "input header__input", data: [change_submit: "#filter-quick-form"], autocomplete: "off" - - = form_for @user_changeset, ~p"/filters/spoiler_type", [class: "header__filter-form hide-mobile hide-limited-desktop", id: "spoiler-quick-form"], fn f -> - = select f, :spoiler_type, @spoiler_types, id: "spoiler-quick-menu", class: "input header__input", data: [change_submit: "#spoiler-quick-form"], autocomplete: "off" - - .dropdown.header__dropdown - a.header__link.header__link-user href=~p"/profiles/#{@current_user}" - = render PhilomenaWeb.UserAttributionView, "_user_avatar.html", object: %{user: @current_user}, class: "avatar--28px" - span.header__link-user__dropdown-arrow.hide-mobile data-click-preventdefault="true" - nav.dropdown__content.dropdown__content-right.hide-mobile.js-burger-links - a.header__link href=~p"/profiles/#{@current_user}" - = @current_user.name - a.header__link href="/search?q=my:watched" - i.fa.fa-fw.fa-eye> - | Watched - a.header__link href="/search?q=my:faves" - i.fa.fa-fw.fa-star> - | Faves - a.header__link href="/search?q=my:upvotes" - i.fa.fa-fw.fa-arrow-up> - | Upvotes - a.header__link href=~p"/galleries?#{[gallery: [creator: @current_user.name]]}" - i.fa.fa-fw.fa-image> - | Galleries - a.header__link href="/search?q=my:uploads" - i.fa.fa-fw.fa-upload> - | Uploads - a.header__link href="/comments?cq=my:comments" - i.fa.fa-fw.fa-comments> - | Comments - a.header__link href="/posts?pq=my:posts" - i.fas.fa-fw.fa-pen-square> - | Posts - a.header__link href=~p"/profiles/#{@current_user}/artist_links" - i.fa.fa-fw.fa-link> - | Links - a.header__link href="/settings/edit" - i.fa.fa-fw.fa-cogs> - | Settings - a.header__link href="/conversations" - i.fa.fa-fw.fa-envelope> - | Messages - a.header__link href=~p"/registrations/edit" - i.fa.fa-fw.fa-user> - | Account - a.header__link href=~p"/sessions" data-method="delete" - i.fa.fa-fw.fa-sign-out-alt> - | Logout - - else - a.header__link.hide-mobile href="/filters" - | Filters ( - = @current_filter.name - | ) - span.js-burger-links.hide-mobile - a.header__link href="/settings/edit" - i.fa.fa-fw.fa-cogs.hide-desktop> - | Settings - a.header__link href=~p"/registrations/new" - | Register - a.header__link href=~p"/sessions/new" - | Login - -nav.header.header--secondary - .flex.flex--centered.flex--spaced-out.flex--wrap - = render PhilomenaWeb.LayoutView, "_header_navigation.html", assigns - = if !is_nil(@current_user) and @current_user.role != "user" do - = render PhilomenaWeb.LayoutView, "_header_staff_links.html", assigns diff --git a/lib/philomena_web/templates/layout/_header_navigation.html.heex b/lib/philomena_web/templates/layout/_header_navigation.html.heex new file mode 100644 index 00000000..923ba3fe --- /dev/null +++ b/lib/philomena_web/templates/layout/_header_navigation.html.heex @@ -0,0 +1,62 @@ +
+ + + + + Tags + + + Live + + <%= @conn.assigns.live_channels %> + + + + Galleries + + + Commissions + +
diff --git a/lib/philomena_web/templates/layout/_header_navigation.html.slime b/lib/philomena_web/templates/layout/_header_navigation.html.slime deleted file mode 100644 index af53a163..00000000 --- a/lib/philomena_web/templates/layout/_header_navigation.html.slime +++ /dev/null @@ -1,41 +0,0 @@ -.hide-mobile.header__navigation - .dropdown.header__dropdown - a.header__link href="/images" - | Images - span data-click-preventdefault="true" - i.fa.fa-caret-down< - .dropdown__content - a.header__link href="/images/random" - | Random - .dropdown.header__dropdown - a.header__link href="/activity" - | Activity - span data-click-preventdefault="true" - i.fa.fa-caret-down< - .dropdown__content - a.header__link href="/comments" - | Comments - .dropdown.header__dropdown - a.header__link href="/forums" - | Forums - span data-click-preventdefault="true" - i.fa.fa-caret-down< - .dropdown__content - = for forum <- @conn.assigns.forums do - a.header__link href=~p"/forums/#{forum}" - = forum.name - - a.header__link href="/posts" - i.fa.fa-fw.fa-search> - | Post Search - a.header__link href="/tags" - | Tags - a.header__link href="/channels" - ' Live - span.header__counter - = @conn.assigns.live_channels - - a.header__link href="/galleries" - | Galleries - a.header__link href="/commissions" - | Commissions diff --git a/lib/philomena_web/templates/layout/_header_staff_links.html.heex b/lib/philomena_web/templates/layout/_header_staff_links.html.heex new file mode 100644 index 00000000..928d6477 --- /dev/null +++ b/lib/philomena_web/templates/layout/_header_staff_links.html.heex @@ -0,0 +1,122 @@ + diff --git a/lib/philomena_web/templates/layout/_header_staff_links.html.slime b/lib/philomena_web/templates/layout/_header_staff_links.html.slime deleted file mode 100644 index 59c6126b..00000000 --- a/lib/philomena_web/templates/layout/_header_staff_links.html.slime +++ /dev/null @@ -1,97 +0,0 @@ -.flex.flex--centered.header--secondary__admin-links.stretched-mobile-links.js-staff-action - = if manages_users?(@conn) do - .dropdown.hide-mobile - a.header__link title="Admin" - ' A - i.fa.fa-caret-down - - .dropdown__content.js-burger-links - = if manages_site_notices?(@conn) do - = link to: ~p"/admin/site_notices", class: "header__link" do - i.fa.fa-fw.fa-info-circle> - ' Site Notices - - = if manages_users?(@conn) do - = link to: ~p"/admin/users", class: "header__link" do - i.fa.fa-fw.fa-users> - ' Users - - = if manages_forums?(@conn) do - = link to: ~p"/admin/forums", class: "header__link" do - i.fa.fa-fw.fa-paragraph> - ' Forums - - = if manages_ads?(@conn) do - = link to: ~p"/admin/adverts", class: "header__link" do - i.fa.fa-fw.fa-shopping-bag> - ' Adverts - - = if manages_badges?(@conn) do - = link to: ~p"/admin/badges", class: "header__link" do - i.fa.fa-fw.fa-trophy> - ' Badges - - = if manages_static_pages?(@conn) do - = link to: ~p"/pages", class: "header__link" do - i.fa.fa-fw.fa-sticky-note> - ' Pages - - = if manages_mod_notes?(@conn) do - = link to: ~p"/admin/mod_notes", class: "header__link" do - i.fa.fa-fw.fa-clipboard> - ' Mod Notes - - = if can_see_moderation_log?(@conn) do - = link to: ~p"/moderation_logs", class: "header__link" do - i.fa.fa-fw.fa-list-alt> - ' Mod Logs - - = if @pending_approval_count do - = link to: ~p"/admin/approvals", class: "header__link", title: "Approval Queue" do - ' Q - span.header__counter__admin - = @pending_approval_count - - = if @duplicate_report_count do - = link to: ~p"/duplicate_reports", class: "header__link", title: "Duplicates" do - ' D - span.header__counter__admin - = @duplicate_report_count - - = if @report_count do - = link to: ~p"/admin/reports", class: "header__link", title: "Reports" do - ' R - span.header__counter__admin - = @report_count - - = if @artist_link_count do - = link to: ~p"/admin/artist_links", class: "header__link", title: "Artist Links" do - ' L - span.header__counter__admin - = @artist_link_count - - = if @dnp_entry_count do - = link to: ~p"/admin/dnp_entries", class: "header__link", title: "DNP Requests" do - ' S - span.header__counter__admin - = @dnp_entry_count - - = if manages_bans?(@conn) do - .dropdown.hide-mobile - a.header__link title="Bans" - ' B - i.fa.fa-caret-down - - .dropdown__content.dropdown__content-right.js-burger-links - - = link to: ~p"/admin/user_bans", class: "header__link" do - i.fa.fa-fw.fa-user> - ' User Bans - - = link to: ~p"/admin/subnet_bans", class: "header__link" do - i.fab.fa-fw.fa-internet-explorer> - ' IP Bans - - = link to: ~p"/admin/fingerprint_bans", class: "header__link" do - i.fa.fa-fw.fa-desktop> - ' FP Bans diff --git a/lib/philomena_web/templates/layout/_opengraph.html.heex b/lib/philomena_web/templates/layout/_opengraph.html.heex new file mode 100644 index 00000000..54eca01c --- /dev/null +++ b/lib/philomena_web/templates/layout/_opengraph.html.heex @@ -0,0 +1,38 @@ + + + +<%= if opengraph?(@conn) do %> + <% image = @conn.assigns.image %> + <% filtered = not image.thumbnails_generated %> + <% description = "##{image.id} - #{Philomena.Images.tag_list(image)} - Derpibooru" %> + <% thumb_large = ImageView.thumb_urls(image, false)[:large] %> + <% thumb_rendered = ImageView.thumb_url(image, false, :rendered) %> + + + + + <%= for tag <- artist_tags(image.tags) do %> + + <% end %> + <%= if image_has_sources(image) do %> + + <% end %> + + + <%= cond do %> + <% image.image_mime_type == "video/webm" and not filtered -> %> + + + + <% image.image_mime_type == "image/svg+xml" and not filtered -> %> + + + <% not filtered -> %> + + + <% true -> %> + + <% end %> +<% else %> + +<% end %> diff --git a/lib/philomena_web/templates/layout/_opengraph.html.slime b/lib/philomena_web/templates/layout/_opengraph.html.slime deleted file mode 100644 index 45585171..00000000 --- a/lib/philomena_web/templates/layout/_opengraph.html.slime +++ /dev/null @@ -1,45 +0,0 @@ -meta name="generator" content="philomena" -meta name="theme-color" content="#618fc3" -meta name="format-detection" content="telephone=no" - -= if opengraph?(@conn) do - - image = @conn.assigns.image - - filtered = not image.thumbnails_generated - - description = "##{image.id} - #{Philomena.Images.tag_list(image)} - Derpibooru" - - thumb_large = ImageView.thumb_urls(image, false)[:large] - - thumb_rendered = ImageView.thumb_url(image, false, :rendered) - - meta name="keywords" content=tag_list(image) - meta name="description" content=description - meta property="og:title" content=description - meta property="og:url" content=url(~p"/images/#{image}") - - = for tag <- artist_tags(image.tags) do - meta property="dc:creator" content=tag.name_in_namespace - - = if image_has_sources(image) do - meta property="foaf:primaryTopic" content=image_first_source(image) - - link rel="alternate" type="application/json+oembed" href=url(~p"/api/v1/json/oembed?#{[url: ~p"/images/#{image}"]}") title="oEmbed JSON Profile" - - link rel="canonical" href=url(~p"/images/#{image}") - - = cond do - - image.image_mime_type == "video/webm" and not filtered -> - meta property="og:type" content="video.other" - meta property="og:image" content=thumb_rendered - meta property="og:video" content=thumb_large - - - image.image_mime_type == "image/svg+xml" and not filtered -> - meta property="og:type" content="website" - meta property="og:image" content=thumb_rendered - - - not filtered -> - meta property="og:type" content="website" - meta property="og:image" content=thumb_large - - - true -> - meta property="og:type" content="website" - -- else - meta name="description" content="Derpibooru is a linear imagebooru which lets you share, find and discover new art and media surrounding the show My Little Pony: Friendship is Magic" diff --git a/lib/philomena_web/templates/layout/app.html.heex b/lib/philomena_web/templates/layout/app.html.heex new file mode 100644 index 00000000..24e681cb --- /dev/null +++ b/lib/philomena_web/templates/layout/app.html.heex @@ -0,0 +1,47 @@ + + + + + <%= viewport_meta_tag(@conn) %> + + <%= if assigns[:title] do %> + <%= assigns[:title] %> + - Derpibooru + <% else %> + Derpibooru + <% end %> + + + <%= if is_nil(@current_user) do %> + + <% end %> + + + + + + <%= csrf_meta_tag() %> + <%= vite_hmr? do %> + + + <% else %> + + <% end %> + <%= render(PhilomenaWeb.LayoutView, "_opengraph.html", assigns) %> + + + <%= render(PhilomenaWeb.LayoutView, "_burger.html", assigns) %> +
+ <%= render(PhilomenaWeb.LayoutView, "_header.html", assigns) %> + <%= render(PhilomenaWeb.LayoutView, "_flash_warnings.html", assigns) %> +
+ <%= @inner_content %> +
+ <%= render(PhilomenaWeb.LayoutView, "_footer.html", assigns) %> + + <%= clientside_data(@conn) %> +
+ + diff --git a/lib/philomena_web/templates/layout/app.html.slime b/lib/philomena_web/templates/layout/app.html.slime deleted file mode 100644 index 29013972..00000000 --- a/lib/philomena_web/templates/layout/app.html.slime +++ /dev/null @@ -1,38 +0,0 @@ -doctype html -html lang="en" - head - meta http-equiv="X-UA-Compatible" content="IE=edge" - = viewport_meta_tag(@conn) - - title - = if assigns[:title] do - => assigns[:title] - ' - Derpibooru - - else - ' Derpibooru - link rel="stylesheet" href=stylesheet_path(@current_user) - = if is_nil(@current_user) do - link rel="stylesheet" href=dark_stylesheet_path() media="(prefers-color-scheme: dark)" - link rel="icon" href=~p"/favicon.ico" type="image/x-icon" - link rel="icon" href=~p"/favicon.svg" type="image/svg+xml" - meta name="generator" content="philomena" - meta name="theme-color" content="#618fc3" - meta name="format-detection" content="telephone=no" - = csrf_meta_tag() - - = vite_hmr? do - script type="module" src="http://localhost:5173/@vite/client" - script type="module" src="http://localhost:5173/js/app.js" - - else - script type="text/javascript" src=~p"/js/app.js" async="async" - = render PhilomenaWeb.LayoutView, "_opengraph.html", assigns - body data-theme=theme_name(@current_user) data-vite-reload=to_string(vite_reload?()) - = render PhilomenaWeb.LayoutView, "_burger.html", assigns - #container class=container_class(@current_user) - = render PhilomenaWeb.LayoutView, "_header.html", assigns - = render PhilomenaWeb.LayoutView, "_flash_warnings.html", assigns - main#content class=layout_class(@conn) - = @inner_content - = render PhilomenaWeb.LayoutView, "_footer.html", assigns - form.hidden: input.js-interaction-cache type="hidden" value="{}" - = clientside_data(@conn) diff --git a/lib/philomena_web/templates/layout/two_factor.html.heex b/lib/philomena_web/templates/layout/two_factor.html.heex new file mode 100644 index 00000000..677da13f --- /dev/null +++ b/lib/philomena_web/templates/layout/two_factor.html.heex @@ -0,0 +1,20 @@ + + + + + + <%= viewport_meta_tag(@conn) %> + + Two Factor Authentication - Derpibooru + + + + + + + +
+ <%= @inner_content %> +
+ + diff --git a/lib/philomena_web/templates/layout/two_factor.html.slime b/lib/philomena_web/templates/layout/two_factor.html.slime deleted file mode 100644 index 416a8732..00000000 --- a/lib/philomena_web/templates/layout/two_factor.html.slime +++ /dev/null @@ -1,16 +0,0 @@ -doctype html -html lang="en" - head - meta charset="utf-8" - meta http-equiv="X-UA-Compatible" content="IE=edge" - = viewport_meta_tag(@conn) - - title Two Factor Authentication - Derpibooru - link rel="stylesheet" href=stylesheet_path(nil) - link rel="stylesheet" href=dark_stylesheet_path() media="(prefers-color-scheme: dark)" - link rel="icon" href="/favicon.ico" type="image/x-icon" - link rel="icon" href="/favicon.svg" type="image/svg+xml" - - body.minimal - .minimal__container - = @inner_content diff --git a/lib/philomena_web/templates/markdown/_anon_checkbox.html.heex b/lib/philomena_web/templates/markdown/_anon_checkbox.html.heex new file mode 100644 index 00000000..fa4be6b9 --- /dev/null +++ b/lib/philomena_web/templates/markdown/_anon_checkbox.html.heex @@ -0,0 +1,6 @@ +<% f = assigns[:f] %> +<% label_lext = assigns[:label] || "Anonymous" %> +<%= if @conn.assigns.current_user do %> + <%= checkbox(f, :anonymous, value: anonymous_by_default?(@conn), class: "js-preview-anonymous") %> + <%= label(f, :anonymous, label_lext) %> +<% end %> diff --git a/lib/philomena_web/templates/markdown/_anon_checkbox.html.slime b/lib/philomena_web/templates/markdown/_anon_checkbox.html.slime deleted file mode 100644 index bd5a6fe9..00000000 --- a/lib/philomena_web/templates/markdown/_anon_checkbox.html.slime +++ /dev/null @@ -1,5 +0,0 @@ -- f = assigns[:f] -- label_lext = assigns[:label] || "Anonymous" -= if @conn.assigns.current_user do - => checkbox f, :anonymous, value: anonymous_by_default?(@conn), class: "js-preview-anonymous" - = label f, :anonymous, label_lext diff --git a/lib/philomena_web/templates/markdown/_help.html.heex b/lib/philomena_web/templates/markdown/_help.html.heex new file mode 100644 index 00000000..e86ab6bc --- /dev/null +++ b/lib/philomena_web/templates/markdown/_help.html.heex @@ -0,0 +1,39 @@ +
+ + Syntax quick reference: + + + + **bold** + + + *italic* + + + ||hide text|| + + + `code` + + + __underline__ + + + ~~strike~~ + + + ^sup^ + + + %sub% + + +

+ + + + Detailed syntax guide + + +

+
diff --git a/lib/philomena_web/templates/markdown/_help.html.slime b/lib/philomena_web/templates/markdown/_help.html.slime deleted file mode 100644 index e2838ea3..00000000 --- a/lib/philomena_web/templates/markdown/_help.html.slime +++ /dev/null @@ -1,17 +0,0 @@ -.editor-syntax-reference - strong<> Syntax quick reference: - - span - strong> **bold** - em> *italic* - span.spoiler> ||hide text|| - code> `code` - ins> __underline__ - del> ~~strike~~ - sup> ^sup^ - sub %sub% - - p - a href="/pages/markdown" - i.fa.fa-question-circle> - strong Detailed syntax guide diff --git a/lib/philomena_web/templates/markdown/_input.html.heex b/lib/philomena_web/templates/markdown/_input.html.heex new file mode 100644 index 00000000..394a9856 --- /dev/null +++ b/lib/philomena_web/templates/markdown/_input.html.heex @@ -0,0 +1,27 @@ +<% form = assigns[:f] %> +<% action_text = assigns[:action_text] || ~c"Edit" %> +<% action_icon = assigns[:action_icon] || ~c"edit" %> +<% field_name = assigns[:name] || :body %> +<% field_placeholder = assigns[:placeholder] || "Your message" %> +<% is_required = assigns[:required] %> +<% input_classes = assigns[:class] %> +
+ + + <%= action_text %> + + + + + Preview + +
+
+ <%= render(PhilomenaWeb.MarkdownView, "_help.html", conn: @conn) %> + <%= render(PhilomenaWeb.MarkdownView, "_toolbar.html", conn: @conn) %> +
+ <%= textarea(form, field_name, class: add_classes("input input--wide input--text input--resize-vertical js-toolbar-input js-preview-input", input_classes), placeholder: field_placeholder, required: required?(is_required)) %> + <%= error_tag(form, field_name) %> +
+
+ diff --git a/lib/philomena_web/templates/markdown/_input.html.slime b/lib/philomena_web/templates/markdown/_input.html.slime deleted file mode 100644 index 8ec1ae19..00000000 --- a/lib/philomena_web/templates/markdown/_input.html.slime +++ /dev/null @@ -1,26 +0,0 @@ -- form = assigns[:f] -- action_text = assigns[:action_text] || 'Edit' -- action_icon = assigns[:action_icon] || 'edit' -- field_name = assigns[:name] || :body -- field_placeholder = assigns[:placeholder] || "Your message" -- is_required = assigns[:required] -- input_classes = assigns[:class] -.block__header.block__header--js-tabbed - a.selected href="#" data-click-tab="write" - i.fa> class="fa-#{action_icon}" - = action_text - - a href="#" data-click-tab="preview" - i.fa.fa-cog.fa-fw.fa-spin.js-preview-loading.hidden> title=raw('Loading preview…') - i.fa.fa-eye.fa-fw.js-preview-idle> - | Preview - -.block__tab.communication-edit__tab.selected.js-preview-input-wrapper data-tab="write" - = render PhilomenaWeb.MarkdownView, "_help.html", conn: @conn - = render PhilomenaWeb.MarkdownView, "_toolbar.html", conn: @conn - - .field - = textarea form, field_name, class: add_classes("input input--wide input--text input--resize-vertical js-toolbar-input js-preview-input", input_classes), placeholder: field_placeholder, required: required?(is_required) - = error_tag form, field_name - -.block__tab.communication-edit__tab.hidden.js-preview-content data-tab="preview" diff --git a/lib/philomena_web/templates/markdown/_toolbar.html.heex b/lib/philomena_web/templates/markdown/_toolbar.html.heex new file mode 100644 index 00000000..639822f1 --- /dev/null +++ b/lib/philomena_web/templates/markdown/_toolbar.html.heex @@ -0,0 +1,56 @@ +
+ + + + + + + + + + + + +
diff --git a/lib/philomena_web/templates/markdown/_toolbar.html.slime b/lib/philomena_web/templates/markdown/_toolbar.html.slime deleted file mode 100644 index 5d7ef785..00000000 --- a/lib/philomena_web/templates/markdown/_toolbar.html.slime +++ /dev/null @@ -1,34 +0,0 @@ -.communication__toolbar.flex.flex--wrap - button.communication__toolbar__button tabindex="-1" type="button" title="bold (ctrl+b)" data-syntax-id="bold" - strong - | B - button.communication__toolbar__button tabindex="-1" type="button" title="italics (ctrl+i)" data-syntax-id="italics" - em - | i - button.communication__toolbar__button tabindex="-1" type="button" title="underline (ctrl+u)" data-syntax-id="under" - ins - | U - button.communication__toolbar__button tabindex="-1" type="button" title="mark as spoiler (ctrl+s)" data-syntax-id="spoiler" - span.spoiler-revealed - | spoiler - button.communication__toolbar__button tabindex="-1" type="button" title="code formatting (ctrl+e)" data-syntax-id="code" - code - | code - button.communication__toolbar__button tabindex="-1" type="button" title="strikethrough" data-syntax-id="strike" - del - | strike - button.communication__toolbar__button tabindex="-1" type="button" title="superscript" data-syntax-id="superscript" - sup - | sup - button.communication__toolbar__button tabindex="-1" type="button" title="subscript" data-syntax-id="subscript" - sub - | sub - button.communication__toolbar__button tabindex="-1" type="button" title="insert blockquote" data-syntax-id="quote" - i.fa.fa-quote-right - button.communication__toolbar__button tabindex="-1" type="button" title="insert hyperlink (ctrl+l)" data-syntax-id="link" - i.fa.fa-link - button.communication__toolbar__button tabindex="-1" type="button" title="insert image (ctrl+k)" data-syntax-id="image" - i.fa.fa-image - button.communication__toolbar__button tabindex="-1" type="button" title="Text you want the parser to ignore" data-syntax-id="escape" - span - | escape diff --git a/lib/philomena_web/templates/message/_message.html.heex b/lib/philomena_web/templates/message/_message.html.heex new file mode 100644 index 00000000..ef96f7d2 --- /dev/null +++ b/lib/philomena_web/templates/message/_message.html.heex @@ -0,0 +1,47 @@ +
+ <%= if not @message.approved and (can?(@conn, :approve, @message) or @message.from_id == @conn.assigns.current_user.id) do %> +
+
+

+ + This private message is pending approval from a staff member. +

+ <%= if can?(@conn, :approve, @message) do %> +

+

    +
  • + <%= link(to: ~p"/conversations/#{@message.conversation_id}/messages/#{@message}/approve", data: [confirm: "Are you sure?"], method: "post", class: "button") do %> + + Approve + <% end %> +
  • +
+

+ <% end %> +
+
+ <% end %> +
+
+ <%= render(PhilomenaWeb.UserAttributionView, "_user_avatar.html", object: %{user: @message.from}, conn: @conn, class: "avatar--100px") %> +
+
+ + <%= render(PhilomenaWeb.UserAttributionView, "_user.html", object: %{user: @message.from}, badges: true, conn: @conn) %> + +
+ <%= render(PhilomenaWeb.UserAttributionView, "_user_title.html", object: %{user: @message.from}, conn: @conn) %> +
+ <%= @body %> +
+
+
+
+
+
+ Posted + <%= pretty_time(@message.created_at) %> +
+
+
+
diff --git a/lib/philomena_web/templates/message/_message.html.slime b/lib/philomena_web/templates/message/_message.html.slime deleted file mode 100644 index 9f750121..00000000 --- a/lib/philomena_web/templates/message/_message.html.slime +++ /dev/null @@ -1,34 +0,0 @@ -article.block.communication - = if not @message.approved and (can?(@conn, :approve, @message) or @message.from_id == @conn.assigns.current_user.id) do - .block__content - .block.block--fixed.block--danger - p - i.fas.fa-exclamation-triangle> - ' This private message is pending approval from a staff member. - = if can?(@conn, :approve, @message) do - p - ul.horizontal-list - li - = link(to: ~p"/conversations/#{@message.conversation_id}/messages/#{@message}/approve", data: [confirm: "Are you sure?"], method: "post", class: "button") do - i.fas.fa-check> - ' Approve - - .block__content.flex.flex--no-wrap - .flex__fixed.spacing-right - = render PhilomenaWeb.UserAttributionView, "_user_avatar.html", object: %{user: @message.from}, conn: @conn, class: "avatar--100px" - - .flex__grow.communication__body - - span.communication__body__sender-name = render PhilomenaWeb.UserAttributionView, "_user.html", object: %{user: @message.from}, badges: true, conn: @conn - br - - = render PhilomenaWeb.UserAttributionView, "_user_title.html", object: %{user: @message.from}, conn: @conn - - .communication__body__text - = @body - - .block__content.communication__options - .flex.flex--wrap.flex--spaced-out - div - ' Posted - = pretty_time(@message.created_at) diff --git a/lib/philomena_web/templates/moderation_log/index.html.heex b/lib/philomena_web/templates/moderation_log/index.html.heex new file mode 100644 index 00000000..1a646f8c --- /dev/null +++ b/lib/philomena_web/templates/moderation_log/index.html.heex @@ -0,0 +1,66 @@ +<% + route = fn p -> ~p"/moderation_logs?#{p}" end + pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @moderation_logs, route: route, conn: @conn) +%> +

+ Listing Moderation Logs +

+ +
+
+ <%= pagination %> +
+
+
+ + + + + + + + + + + + <%= for log <- @moderation_logs do %> + + + + + + + + <% end %> + +
+ Moderator + + Type + + Body + + Creation time + + Actions +
+ <%= render(PhilomenaWeb.UserAttributionView, "_user.html", object: %{user: log.user}, conn: @conn) %> + + <%= log.type %> + + <%= log.body %> + + <%= pretty_time(log.created_at) %> + + <%= link to: log.subject_path do %> + + View subject + <% end %> +
+ +
+
+ <%= pagination %> +
+
+
diff --git a/lib/philomena_web/templates/moderation_log/index.html.slime b/lib/philomena_web/templates/moderation_log/index.html.slime deleted file mode 100644 index e2c81eef..00000000 --- a/lib/philomena_web/templates/moderation_log/index.html.slime +++ /dev/null @@ -1,33 +0,0 @@ -elixir: - route = fn p -> ~p"/moderation_logs?#{p}" end - pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @moderation_logs, route: route, conn: @conn - -h1 Listing Moderation Logs - -block - .block__header - .page__pagination = pagination - -table - thead - tr - th Moderator - th Type - th Body - th Creation time - th Actions - tbody - = for log <- @moderation_logs do - tr - td = render PhilomenaWeb.UserAttributionView, "_user.html", object: %{user: log.user}, conn: @conn - td = log.type - td = log.body - td = pretty_time(log.created_at) - td - = link to: log.subject_path do - i.fa.fa-eye> - ' View subject - -block - .block__header - .page__pagination = pagination diff --git a/lib/philomena_web/templates/notification/_channel.html.heex b/lib/philomena_web/templates/notification/_channel.html.heex new file mode 100644 index 00000000..8345f31a --- /dev/null +++ b/lib/philomena_web/templates/notification/_channel.html.heex @@ -0,0 +1,17 @@ +
+
+ + <%= link(@notification.actor.title, to: ~p"/channels/#{@notification.actor}") %> + + <%= @notification.action %> + <%= pretty_time(@notification.updated_at) %> +
+
+
+ + + + + + +
diff --git a/lib/philomena_web/templates/notification/_channel.html.slime b/lib/philomena_web/templates/notification/_channel.html.slime deleted file mode 100644 index 1fc57157..00000000 --- a/lib/philomena_web/templates/notification/_channel.html.slime +++ /dev/null @@ -1,14 +0,0 @@ -.flex.flex--centered.flex__grow - div - strong> - = link @notification.actor.title, to: ~p"/channels/#{@notification.actor}" - =<> @notification.action - - => pretty_time @notification.updated_at - -.flex.flex--centered.flex--no-wrap - a.button.button--separate-right title="Delete" href=~p"/channels/#{@notification.actor}/read" data-method="post" data-remote="true" data-fetchcomplete-hide="#notification-#{@notification.id}" - i.fa.fa-trash - - a.button title="Unsubscribe" href=~p"/channels/#{@notification.actor}/subscription" data-method="delete" data-remote="true" data-fetchcomplete-hide="#notification-#{@notification.id}" - i.fa.fa-bell-slash \ No newline at end of file diff --git a/lib/philomena_web/templates/notification/_forum.html.heex b/lib/philomena_web/templates/notification/_forum.html.heex new file mode 100644 index 00000000..fb004750 --- /dev/null +++ b/lib/philomena_web/templates/notification/_forum.html.heex @@ -0,0 +1,23 @@ +<% forum = @notification.actor %> +<% topic = @notification.actor_child %> +
+
+ <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: topic, conn: @conn) %> + <%= @notification.action %> + titled + + <%= link(topic.title, to: ~p"/forums/#{forum}/topics/#{topic}") %> + + in + <%= link(forum.name, to: ~p"/forums/#{forum}") %> + <%= pretty_time(@notification.updated_at) %> +
+
+
+ + + + + + +
diff --git a/lib/philomena_web/templates/notification/_forum.html.slime b/lib/philomena_web/templates/notification/_forum.html.slime deleted file mode 100644 index f7edb198..00000000 --- a/lib/philomena_web/templates/notification/_forum.html.slime +++ /dev/null @@ -1,25 +0,0 @@ -- forum = @notification.actor -- topic = @notification.actor_child - -.flex.flex--centered.flex__grow - div - => render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: topic, conn: @conn - => @notification.action - - ' titled - - strong> - = link topic.title, to: ~p"/forums/#{forum}/topics/#{topic}" - - ' in - - => link forum.name, to: ~p"/forums/#{forum}" - - => pretty_time @notification.updated_at - -.flex.flex--centered.flex--no-wrap - a.button.button--separate-right title="Delete" href=~p"/forums/#{forum}/read" data-method="post" data-remote="true" data-fetchcomplete-hide="#notification-#{@notification.id}" - i.fa.fa-trash - - a.button title="Unsubscribe" href=~p"/forums/#{forum}/subscription" data-method="delete" data-remote="true" data-fetchcomplete-hide="#notification-#{@notification.id}" - i.fa.fa-bell-slash \ No newline at end of file diff --git a/lib/philomena_web/templates/notification/_gallery.html.heex b/lib/philomena_web/templates/notification/_gallery.html.heex new file mode 100644 index 00000000..c2b494b4 --- /dev/null +++ b/lib/philomena_web/templates/notification/_gallery.html.heex @@ -0,0 +1,18 @@ +
+
+ <%= render(PhilomenaWeb.UserAttributionView, "_user.html", object: %{user: @notification.actor.creator}, conn: @conn) %> + <%= @notification.action %> + + <%= link(@notification.actor.title, to: ~p"/galleries/#{@notification.actor}") %> + + <%= pretty_time(@notification.updated_at) %> +
+
+
+ + + + + + +
diff --git a/lib/philomena_web/templates/notification/_gallery.html.slime b/lib/philomena_web/templates/notification/_gallery.html.slime deleted file mode 100644 index 09e3eccc..00000000 --- a/lib/philomena_web/templates/notification/_gallery.html.slime +++ /dev/null @@ -1,16 +0,0 @@ -.flex.flex--centered.flex__grow - div - => render PhilomenaWeb.UserAttributionView, "_user.html", object: %{user: @notification.actor.creator}, conn: @conn - => @notification.action - - strong> - = link @notification.actor.title, to: ~p"/galleries/#{@notification.actor}" - - => pretty_time @notification.updated_at - -.flex.flex--centered.flex--no-wrap - a.button.button--separate-right title="Delete" href=~p"/galleries/#{@notification.actor}/read" data-method="post" data-remote="true" data-fetchcomplete-hide="#notification-#{@notification.id}" - i.fa.fa-trash - - a.button title="Unsubscribe" href=~p"/galleries/#{@notification.actor}/subscription" data-method="delete" data-remote="true" data-fetchcomplete-hide="#notification-#{@notification.id}" - i.fa.fa-bell-slash \ No newline at end of file diff --git a/lib/philomena_web/templates/notification/_image.html.heex b/lib/philomena_web/templates/notification/_image.html.heex new file mode 100644 index 00000000..9693dbb1 --- /dev/null +++ b/lib/philomena_web/templates/notification/_image.html.heex @@ -0,0 +1,22 @@ +
+
+ <%= if @notification.actor_child do %> + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @notification.actor_child, conn: @conn) %> + <% else %> + Someone + <% end %> + <%= @notification.action %> + + <%= link("##{@notification.actor_id}", to: ~p"/images/#{@notification.actor}" <> "#comments") %> + + <%= pretty_time(@notification.updated_at) %> +
+
+
+ + + + + + +
diff --git a/lib/philomena_web/templates/notification/_image.html.slime b/lib/philomena_web/templates/notification/_image.html.slime deleted file mode 100644 index 89814c39..00000000 --- a/lib/philomena_web/templates/notification/_image.html.slime +++ /dev/null @@ -1,19 +0,0 @@ -.flex.flex--centered.flex__grow - div - = if @notification.actor_child do - => render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @notification.actor_child, conn: @conn - - else - ' Someone - => @notification.action - - strong> - = link "##{@notification.actor_id}", to: ~p"/images/#{@notification.actor}" <> "#comments" - - => pretty_time @notification.updated_at - -.flex.flex--centered.flex--no-wrap - a.button.button--separate-right title="Delete" href=~p"/images/#{@notification.actor}/read" data-method="post" data-remote="true" data-fetchcomplete-hide="#notification-#{@notification.id}" - i.fa.fa-trash - - a.button title="Unsubscribe" href=~p"/images/#{@notification.actor}/subscription" data-method="delete" data-remote="true" data-fetchcomplete-hide="#notification-#{@notification.id}" - i.fa.fa-bell-slash \ No newline at end of file diff --git a/lib/philomena_web/templates/notification/_notification.html.heex b/lib/philomena_web/templates/notification/_notification.html.heex new file mode 100644 index 00000000..bf26cd6a --- /dev/null +++ b/lib/philomena_web/templates/notification/_notification.html.heex @@ -0,0 +1,10 @@ +<%= if @notification.actor do %> +
+ <%= if @notification.actor_type == "Image" and @notification.actor do %> +
+ <%= render(PhilomenaWeb.ImageView, "_image_container.html", image: @notification.actor, size: :thumb_tiny, conn: @conn) %> +
+ <% end %> + <%= render(PhilomenaWeb.NotificationView, notification_template_path(@notification.actor_type), notification: @notification, conn: @conn) %> +
+<% end %> diff --git a/lib/philomena_web/templates/notification/_notification.html.slime b/lib/philomena_web/templates/notification/_notification.html.slime deleted file mode 100644 index 688df590..00000000 --- a/lib/philomena_web/templates/notification/_notification.html.slime +++ /dev/null @@ -1,7 +0,0 @@ -= if @notification.actor do - .block.block--fixed.flex id="notification-#{@notification.id}" - = if @notification.actor_type == "Image" and @notification.actor do - .flex.flex--centered.flex__fixed.thumb-tiny-container.spacing-right - = render PhilomenaWeb.ImageView, "_image_container.html", image: @notification.actor, size: :thumb_tiny, conn: @conn - - => render PhilomenaWeb.NotificationView, notification_template_path(@notification.actor_type), notification: @notification, conn: @conn diff --git a/lib/philomena_web/templates/notification/_topic.html.heex b/lib/philomena_web/templates/notification/_topic.html.heex new file mode 100644 index 00000000..c0b11840 --- /dev/null +++ b/lib/philomena_web/templates/notification/_topic.html.heex @@ -0,0 +1,20 @@ +<% topic = @notification.actor %> +<% post = @notification.actor_child %> +
+
+ <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: post, conn: @conn) %> + <%= @notification.action %> + + <%= link(topic.title, to: ~p"/forums/#{topic.forum}/topics/#{topic}?#{[post_id: post.id]}" <> "#post_#{post.id}") %> + + <%= pretty_time(@notification.updated_at) %> +
+
+
+ + + + + + +
diff --git a/lib/philomena_web/templates/notification/_topic.html.slime b/lib/philomena_web/templates/notification/_topic.html.slime deleted file mode 100644 index 5ecefcfd..00000000 --- a/lib/philomena_web/templates/notification/_topic.html.slime +++ /dev/null @@ -1,19 +0,0 @@ -- topic = @notification.actor -- post = @notification.actor_child - -.flex.flex--centered.flex__grow - div - => render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: post, conn: @conn - => @notification.action - - strong> - = link topic.title, to: ~p"/forums/#{topic.forum}/topics/#{topic}?#{[post_id: post.id]}" <> "#post_#{post.id}" - - => pretty_time @notification.updated_at - -.flex.flex--centered.flex--no-wrap - a.button.button--separate-right title="Delete" href=~p"/forums/#{topic.forum}/topics/#{topic}/read" data-method="post" data-remote="true" data-fetchcomplete-hide="#notification-#{@notification.id}" - i.fa.fa-trash - - a.button title="Unsubscribe" href=~p"/forums/#{topic.forum}/topics/#{topic}/subscription" data-method="delete" data-remote="true" data-fetchcomplete-hide="#notification-#{@notification.id}" - i.fa.fa-bell-slash \ No newline at end of file diff --git a/lib/philomena_web/templates/notification/index.html.heex b/lib/philomena_web/templates/notification/index.html.heex new file mode 100644 index 00000000..3edb5426 --- /dev/null +++ b/lib/philomena_web/templates/notification/index.html.heex @@ -0,0 +1,21 @@ +<% route = fn p -> ~p"/notifications?#{p}" end %> +

+ Notification Area +

+
+
+ <%= render(PhilomenaWeb.PaginationView, "_pagination.html", page: @notifications, route: route, conn: @conn) %> +
+ <%= cond do %> + <% Enum.any?(@notifications) -> %> + <%= for notification <- @notifications do %> + <%= render(PhilomenaWeb.NotificationView, "_notification.html", notification: notification, conn: @conn) %> + <% end %> + <% true -> %> +

+ To get notifications on new comments and forum posts, click the + 'Subscribe' button in the bar at the top of an image or forum topic. + You'll get notifications here for any new posts or comments. +

+ <% end %> +
diff --git a/lib/philomena_web/templates/notification/index.html.slime b/lib/philomena_web/templates/notification/index.html.slime deleted file mode 100644 index 9cec1086..00000000 --- a/lib/philomena_web/templates/notification/index.html.slime +++ /dev/null @@ -1,17 +0,0 @@ -- route = fn p -> ~p"/notifications?#{p}" end - -h1 Notification Area -.walloftext - .block__header - = render PhilomenaWeb.PaginationView, "_pagination.html", page: @notifications, route: route, conn: @conn - - = cond do - - Enum.any?(@notifications) -> - = for notification <- @notifications do - = render PhilomenaWeb.NotificationView, "_notification.html", notification: notification, conn: @conn - - - true -> - p - ' To get notifications on new comments and forum posts, click the - ' 'Subscribe' button in the bar at the top of an image or forum topic. - ' You'll get notifications here for any new posts or comments. diff --git a/lib/philomena_web/templates/page/_form.html.heex b/lib/philomena_web/templates/page/_form.html.heex new file mode 100644 index 00000000..321ffe9e --- /dev/null +++ b/lib/philomena_web/templates/page/_form.html.heex @@ -0,0 +1,24 @@ +<%= form_for @changeset, @action, fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+ <%= label(f, :title) %> + <%= text_input(f, :title, class: "input input--wide") %> +
+
+ <%= label(f, :slug) %> + <%= text_input(f, :slug, class: "input input--wide") %> +
+
+ <%= label(f, :body) %> + <%= textarea(f, :body, class: "input input--wide") %> +
+
+ <%= submit("Save", class: "button") %> +
+<% end %> diff --git a/lib/philomena_web/templates/page/_form.html.slime b/lib/philomena_web/templates/page/_form.html.slime deleted file mode 100644 index 94b4e012..00000000 --- a/lib/philomena_web/templates/page/_form.html.slime +++ /dev/null @@ -1,19 +0,0 @@ -= form_for @changeset, @action, fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .field - => label f, :title - = text_input f, :title, class: "input input--wide" - - .field - => label f, :slug - = text_input f, :slug, class: "input input--wide" - - .field - => label f, :body - = textarea f, :body, class: "input input--wide" - - .actions - = submit "Save", class: "button" diff --git a/lib/philomena_web/templates/page/edit.html.heex b/lib/philomena_web/templates/page/edit.html.heex new file mode 100644 index 00000000..a73cc4e3 --- /dev/null +++ b/lib/philomena_web/templates/page/edit.html.heex @@ -0,0 +1,4 @@ +

+ Editing static page +

+<%= render(PhilomenaWeb.PageView, "_form.html", changeset: @changeset, action: ~p"/pages/#{@static_page}", conn: @conn) %> diff --git a/lib/philomena_web/templates/page/edit.html.slime b/lib/philomena_web/templates/page/edit.html.slime deleted file mode 100644 index f141d06b..00000000 --- a/lib/philomena_web/templates/page/edit.html.slime +++ /dev/null @@ -1,3 +0,0 @@ -h1 Editing static page - -= render PhilomenaWeb.PageView, "_form.html", changeset: @changeset, action: ~p"/pages/#{@static_page}", conn: @conn diff --git a/lib/philomena_web/templates/page/history/index.html.heex b/lib/philomena_web/templates/page/history/index.html.heex new file mode 100644 index 00000000..59765c3d --- /dev/null +++ b/lib/philomena_web/templates/page/history/index.html.heex @@ -0,0 +1,56 @@ +

+ Revision history for + <%= link(@static_page.title, to: ~p"/pages/#{@static_page}") %> +

+ + + + + + + + + + <%= for version <- @versions do %> + + + + + + <% end %> + +
+ User + + Date + + Body +
+ <%= link(version.user.name, to: ~p"/profiles/#{version.user}") %> + + <%= pretty_time(version.created_at) %> + + <%= for diff <- version.difference do %> + <%= case diff do %> + <% {:eq, lines} -> %> + <%= for line <- lines do %> + <%= line %> + <%= "\n" %> + <% end %> + <% {:ins, lines} -> %> + + <%= for line <- lines do %> + <%= line %> + <%= "\n" %> + <% end %> + + <% {:del, lines} -> %> + + <%= for line <- lines do %> + <%= line %> + <%= "\n" %> + <% end %> + + <% end %> + <% end %> +
diff --git a/lib/philomena_web/templates/page/history/index.html.slime b/lib/philomena_web/templates/page/history/index.html.slime deleted file mode 100644 index 805492eb..00000000 --- a/lib/philomena_web/templates/page/history/index.html.slime +++ /dev/null @@ -1,35 +0,0 @@ -h1 - ' Revision history for - = link @static_page.title, to: ~p"/pages/#{@static_page}" - -table.table - thead - tr - th User - th Date - th Body - - tbody - = for version <- @versions do - tr - td = link version.user.name, to: ~p"/profiles/#{version.user}" - td = pretty_time(version.created_at) - td.static-page__diff - = for diff <- version.difference do - = case diff do - - {:eq, lines} -> - = for line <- lines do - = line - = "\n" - - - {:ins, lines} -> - ins.differ - = for line <- lines do - = line - = "\n" - - - {:del, lines} -> - del.differ - = for line <- lines do - = line - = "\n" diff --git a/lib/philomena_web/templates/page/index.html.heex b/lib/philomena_web/templates/page/index.html.heex new file mode 100644 index 00000000..2d18e174 --- /dev/null +++ b/lib/philomena_web/templates/page/index.html.heex @@ -0,0 +1,23 @@ +

+ Pages +

+ + + + + + + + <%= for static_page <- @static_pages do %> + + + + <% end %> + +
+ Title +
+ <%= link(static_page.title, to: ~p"/pages/#{static_page}") %> +
+
+<%= link("New static page", to: ~p"/pages/new") %> diff --git a/lib/philomena_web/templates/page/index.html.slime b/lib/philomena_web/templates/page/index.html.slime deleted file mode 100644 index 5e535faa..00000000 --- a/lib/philomena_web/templates/page/index.html.slime +++ /dev/null @@ -1,14 +0,0 @@ -h1 Pages - -table.table - thead - tr - th Title - - tbody - = for static_page <- @static_pages do - tr - td = link static_page.title, to: ~p"/pages/#{static_page}" - -br -= link "New static page", to: ~p"/pages/new" diff --git a/lib/philomena_web/templates/page/new.html.heex b/lib/philomena_web/templates/page/new.html.heex new file mode 100644 index 00000000..bf481f24 --- /dev/null +++ b/lib/philomena_web/templates/page/new.html.heex @@ -0,0 +1,4 @@ +

+ New static page +

+<%= render(PhilomenaWeb.PageView, "_form.html", changeset: @changeset, action: ~p"/pages", conn: @conn) %> diff --git a/lib/philomena_web/templates/page/new.html.slime b/lib/philomena_web/templates/page/new.html.slime deleted file mode 100644 index c2b7b208..00000000 --- a/lib/philomena_web/templates/page/new.html.slime +++ /dev/null @@ -1,3 +0,0 @@ -h1 New static page - -= render PhilomenaWeb.PageView, "_form.html", changeset: @changeset, action: ~p"/pages", conn: @conn diff --git a/lib/philomena_web/templates/page/show.html.heex b/lib/philomena_web/templates/page/show.html.heex new file mode 100644 index 00000000..7ccab2d9 --- /dev/null +++ b/lib/philomena_web/templates/page/show.html.heex @@ -0,0 +1,20 @@ +

+ <%= @static_page.title %> +

+

+ Last updated + <%= pretty_time(@static_page.updated_at) %> +

+

+ <%= link to: ~p"/pages/#{@static_page}/history" do %> + + Revision history + <% end %> + <%= if can?(@conn, :edit, Philomena.StaticPages.StaticPage) do %> + <%= link to: ~p"/pages/#{@static_page}/edit" do %> + + Edit + <% end %> + <% end %> +

+<%= @rendered %> diff --git a/lib/philomena_web/templates/page/show.html.slime b/lib/philomena_web/templates/page/show.html.slime deleted file mode 100644 index f5bc82cc..00000000 --- a/lib/philomena_web/templates/page/show.html.slime +++ /dev/null @@ -1,15 +0,0 @@ -h1 = @static_page.title -p - ' Last updated - => pretty_time(@static_page.updated_at) - -p - => link to: ~p"/pages/#{@static_page}/history" do - i.fa.fa-history> - ' Revision history - = if can?(@conn, :edit, Philomena.StaticPages.StaticPage) do - =< link to: ~p"/pages/#{@static_page}/edit" do - i.fa.fa-edit> - ' Edit - -= @rendered diff --git a/lib/philomena_web/templates/pagination/_pagination.html.heex b/lib/philomena_web/templates/pagination/_pagination.html.heex new file mode 100644 index 00000000..a273a2b7 --- /dev/null +++ b/lib/philomena_web/templates/pagination/_pagination.html.heex @@ -0,0 +1,83 @@ +<% params = assigns[:params] || [] %> +<%= if @page.total_pages > 1 do %> + + +<% end %> diff --git a/lib/philomena_web/templates/pagination/_pagination.html.slime b/lib/philomena_web/templates/pagination/_pagination.html.slime deleted file mode 100644 index f2f26382..00000000 --- a/lib/philomena_web/templates/pagination/_pagination.html.slime +++ /dev/null @@ -1,64 +0,0 @@ -- params = assigns[:params] || [] - -= if @page.total_pages > 1 do - nav.pagination.hide-mobile-t - = if not first_page?(@page) do - = link("« First", to: first_page_path(@page, @route, params)) - = link("‹ Prev", to: prev_page_path(@page, @route, params), class: "js-prev") - - = if left_gap?(@page) do - span.page.gap - ' … - - = for number <- left_page_numbers(@page) do - = link(number, to: page_path(@route, params, number)) - - span.page-current = @page.page_number - - = for number <- right_page_numbers(@page) do - = link(number, to: page_path(@route, params, number)) - - = if right_gap?(@page) do - span.page.gap - ' … - - = if not last_page?(@page) do - = link("Next ›", to: next_page_path(@page, @route, params), class: "js-next") - = link("Last »", to: last_page_path(@page, @route, params)) - - nav.pagination.hide-desktop-t - = if first_page?(@page) do - span « First - span ‹ Prev - - else - = link("« First", to: first_page_path(@page, @route, params)) - = link("‹ Prev", to: prev_page_path(@page, @route, params), class: "js-prev") - - .dropdown - a.page-current.pagination__dropdown - => @page.page_number - i.fa.fa-caret-down - - .dropdown__content - = if left_gap?(@page) do - span.page.gap.header__span - ' … - - = for number <- left_page_numbers(@page) do - = link(number, to: page_path(@route, params, number)) - - span.page-current.header__span = @page.page_number - - = for number <- right_page_numbers(@page) do - = link(number, to: page_path(@route, params, number)) - - = if right_gap?(@page) do - span.page.gap.header__span - ' … - - = if last_page?(@page) do - span Next › - span Last » - - else - = link("Next ›", to: next_page_path(@page, @route, params), class: "js-next") - = link("Last »", to: last_page_path(@page, @route, params)) diff --git a/lib/philomena_web/templates/pagination/_pagination_info.html.heex b/lib/philomena_web/templates/pagination/_pagination_info.html.heex new file mode 100644 index 00000000..b6e94122 --- /dev/null +++ b/lib/philomena_web/templates/pagination/_pagination_info.html.heex @@ -0,0 +1,16 @@ +<%= if @page.total_entries > 0 do %> + Showing + <%= pluralize("result", "results", @page.total_entries) %> + + <%= max((@page.page_number - 1) * @page.page_size, 0) + 1 %> + - + <%= min(@page.page_number * @page.page_size, @page.total_entries) %> + + of + + <%= @page.total_entries %> + + total +<% else %> + No results found +<% end %> diff --git a/lib/philomena_web/templates/pagination/_pagination_info.html.slime b/lib/philomena_web/templates/pagination/_pagination_info.html.slime deleted file mode 100644 index 2cde8fb9..00000000 --- a/lib/philomena_web/templates/pagination/_pagination_info.html.slime +++ /dev/null @@ -1,16 +0,0 @@ -= if @page.total_entries > 0 do - ' Showing - => pluralize("result", "results", @page.total_entries) - - strong - => max(((@page.page_number - 1) * @page.page_size), 0) + 1 - ' - - => min(@page.page_number * @page.page_size, @page.total_entries) - ' of - - strong - => @page.total_entries - ' total - -- else - ' No results found diff --git a/lib/philomena_web/templates/password/edit.html.heex b/lib/philomena_web/templates/password/edit.html.heex new file mode 100644 index 00000000..bef57316 --- /dev/null +++ b/lib/philomena_web/templates/password/edit.html.heex @@ -0,0 +1,23 @@ +

+ Reset password +

+<%= form_for @changeset, ~p"/passwords/#{@token}", fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+ <%= password_input(f, :password, class: "input", placeholder: "New password", minlength: 12) %> + <%= error_tag(f, :password) %> +
+
+ <%= password_input(f, :password_confirmation, class: "input", placeholder: "Confirm new password", minlength: 12) %> + <%= error_tag(f, :password_confirmation) %> +
+
+ <%= submit("Submit", class: "button") %> +
+<% end %> diff --git a/lib/philomena_web/templates/password/edit.html.slime b/lib/philomena_web/templates/password/edit.html.slime deleted file mode 100644 index 00cf1f71..00000000 --- a/lib/philomena_web/templates/password/edit.html.slime +++ /dev/null @@ -1,17 +0,0 @@ -h1 Reset password - -= form_for @changeset, ~p"/passwords/#{@token}", fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .field - = password_input f, :password, class: "input", placeholder: "New password", minlength: 12 - = error_tag f, :password - - .field - = password_input f, :password_confirmation, class: "input", placeholder: "Confirm new password", minlength: 12 - = error_tag f, :password_confirmation - - div - = submit "Submit", class: "button" diff --git a/lib/philomena_web/templates/password/new.html.heex b/lib/philomena_web/templates/password/new.html.heex new file mode 100644 index 00000000..88c39b4c --- /dev/null +++ b/lib/philomena_web/templates/password/new.html.heex @@ -0,0 +1,14 @@ +

+ Forgot your password? +

+

+ Provide the email address you signed up with and we will email you + password reset instructions. +

+<%= form_for :user, ~p"/passwords", fn f -> %> +
+ <%= email_input(f, :email, class: "input", placeholder: "Email", required: true) %> +
+ <%= render(PhilomenaWeb.CaptchaView, "_captcha.html", name: "password", conn: @conn) %> + <%= submit("Send instructions to reset password", class: "button") %> +<% end %> diff --git a/lib/philomena_web/templates/password/new.html.slime b/lib/philomena_web/templates/password/new.html.slime deleted file mode 100644 index 3aac61b5..00000000 --- a/lib/philomena_web/templates/password/new.html.slime +++ /dev/null @@ -1,12 +0,0 @@ -h1 Forgot your password? -p - ' Provide the email address you signed up with and we will email you - ' password reset instructions. - -= form_for :user, ~p"/passwords", fn f -> - .field - = email_input f, :email, class: "input", placeholder: "Email", required: true - - = render PhilomenaWeb.CaptchaView, "_captcha.html", name: "password", conn: @conn - - = submit "Send instructions to reset password", class: "button" diff --git a/lib/philomena_web/templates/post/_post.html.heex b/lib/philomena_web/templates/post/_post.html.heex new file mode 100644 index 00000000..4a8a4b33 --- /dev/null +++ b/lib/philomena_web/templates/post/_post.html.heex @@ -0,0 +1,110 @@ +
+ <%= if not @post.approved and not @post.hidden_from_users and (can?(@conn, :hide, @post) or @post.user_id == @conn.assigns.current_user.id) do %> +
+
+

+ + This post is pending approval from a staff member. +

+ <%= if can?(@conn, :approve, @post) do %> +

+

    +
  • + <%= link(to: ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/approve", data: [confirm: "Are you sure?"], method: "post", class: "button") do %> + + Approve + <% end %> +
  • +
  • + + + Reject + +
  • +
+ <%= form_for :post, ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/hide", [class: "togglable-delete-form hidden flex", id: "inline-reject-form-post-#{@post.id}"], fn f -> %> + <%= text_input(f, :deletion_reason, class: "input input--wide", placeholder: "Deletion Reason", id: "inline-reject-reason-post-#{@post.id}", required: true) %> + <%= submit("Delete", class: "button") %> + <% end %> +

+ <% end %> +
+
+ <% end %> +
+
+ <%= render(PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @post, conn: @conn) %> +
+
+ + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @post, awards: true, conn: @conn) %> + +
+ <%= render(PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @post, conn: @conn) %> +
+ <%= if @post.hidden_from_users do %> + + Deletion reason: + <%= @post.deletion_reason %> + <%= if can?(@conn, :hide, @post) and not is_nil(@post.deleted_by) do %> + ( + <%= @post.deleted_by.name %> + ) + <% end %> + + <%= if can?(@conn, :hide, @post) do %> + <%= if @post.destroyed_content do %> +
+ + This post's contents have been destroyed. + + <% else %> +
+ <%= @body %> + <% end %> + <% end %> + <% else %> + <%= @body %> + <% end %> +
+
+
+
+
+ <%= render(PhilomenaWeb.PostView, "_post_options.html", conn: @conn, post: @post) %> +
+ <%= if can?(@conn, :hide, @post) and not hide_staff_tools?(@conn) do %> + <%= cond do %> + <% @post.hidden_from_users and not @post.destroyed_content -> %> + <%= link(to: ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/hide", data: [confirm: "Are you sure?"], method: "delete", class: "communication__interaction") do %> + + Restore + <%= if can?(@conn, :delete, @post) do %> + <%= link(to: ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/delete", data: [confirm: "Are you sure?"], method: "post", class: "communication__interaction") do %> + + Delete Contents + <% end %> + <% end %> + <% end %> + <% not @post.hidden_from_users and not @post.destroyed_content -> %> + + + Delete + + <% true -> %> + <% end %> + <%= if can?(@conn, :show, :ip_address) do %> +
+ <%= link_to_ip(@conn, @post.ip) %> +
+
+ <%= link_to_fingerprint(@conn, @post.fingerprint) %> +
+ <% end %> + <%= form_for :post, ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/hide", [class: "togglable-delete-form hidden flex", id: "inline-del-form-post-#{@post.id}"], fn f -> %> + <%= text_input(f, :deletion_reason, class: "input input--wide", placeholder: "Deletion Reason", id: "inline-del-reason-post-#{@post.id}", required: true) %> + <%= submit("Delete", class: "button") %> + <% end %> + <% end %> +
+
diff --git a/lib/philomena_web/templates/post/_post.html.slime b/lib/philomena_web/templates/post/_post.html.slime deleted file mode 100644 index fc41fa73..00000000 --- a/lib/philomena_web/templates/post/_post.html.slime +++ /dev/null @@ -1,83 +0,0 @@ -article.block.communication id="post_#{@post.id}" - = if not @post.approved and not @post.hidden_from_users and (can?(@conn, :hide, @post) or @post.user_id == @conn.assigns.current_user.id) do - .block__content - .block.block--fixed.block--danger - p - i.fas.fa-exclamation-triangle> - ' This post is pending approval from a staff member. - = if can?(@conn, :approve, @post) do - p - ul.horizontal-list - li - = link(to: ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/approve", data: [confirm: "Are you sure?"], method: "post", class: "button") do - i.fas.fa-check> - ' Approve - li - a.button.togglable-delete-form-link href="#" data-click-toggle="#inline-reject-form-post-#{@post.id}" - i.fa.fa-times> - ' Reject - - = form_for :post, ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/hide", [class: "togglable-delete-form hidden flex", id: "inline-reject-form-post-#{@post.id}"], fn f -> - = text_input f, :deletion_reason, class: "input input--wide", placeholder: "Deletion Reason", id: "inline-reject-reason-post-#{@post.id}", required: true - = submit "Delete", class: "button" - - .block__content.flex.flex--no-wrap class=communication_body_class(@post) - .flex__fixed.spacing-right - = render PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @post, conn: @conn - .flex__grow.communication__body - span.communication__body__sender-name = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @post, awards: true, conn: @conn - br - = render PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @post, conn: @conn - .communication__body__text - = if @post.hidden_from_users do - strong.comment_deleted - ' Deletion reason: - => @post.deletion_reason - = if can?(@conn, :hide, @post) and not is_nil(@post.deleted_by) do - | ( - = @post.deleted_by.name - | ) - - = if can?(@conn, :hide, @post) do - = if @post.destroyed_content do - br - strong.comment_deleted> - | This post's contents have been destroyed. - - else - br - =<> @body - - - else - =<> @body - - .block__content.communication__options - .flex.flex--wrap.flex--spaced-out - = render PhilomenaWeb.PostView, "_post_options.html", conn: @conn, post: @post - - = if can?(@conn, :hide, @post) and not hide_staff_tools?(@conn) do - = cond do - - @post.hidden_from_users and not @post.destroyed_content -> - = link(to: ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/hide", data: [confirm: "Are you sure?"], method: "delete", class: "communication__interaction") do - i.fas.fa-check> - ' Restore - = if can?(@conn, :delete, @post) do - = link(to: ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/delete", data: [confirm: "Are you sure?"], method: "post", class: "communication__interaction") do - i.fas.fa-times> - ' Delete Contents - - - not @post.hidden_from_users and not @post.destroyed_content -> - a.communication__interaction.togglable-delete-form-link href="#" data-click-toggle="#inline-del-form-post-#{@post.id}" - i.fa.fa-times> - ' Delete - - - true -> - - = if can?(@conn, :show, :ip_address) do - .communication__info - =<> link_to_ip(@conn, @post.ip) - .communication__info - =<> link_to_fingerprint(@conn, @post.fingerprint) - - = form_for :post, ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/hide", [class: "togglable-delete-form hidden flex", id: "inline-del-form-post-#{@post.id}"], fn f -> - = text_input f, :deletion_reason, class: "input input--wide", placeholder: "Deletion Reason", id: "inline-del-reason-post-#{@post.id}", required: true - = submit "Delete", class: "button" diff --git a/lib/philomena_web/templates/post/_post_options.html.heex b/lib/philomena_web/templates/post/_post_options.html.heex new file mode 100644 index 00000000..74e58758 --- /dev/null +++ b/lib/philomena_web/templates/post/_post_options.html.heex @@ -0,0 +1,53 @@ +
+ Posted + <%= pretty_time(@post.created_at) %> + + + Report + + <%= if not is_nil(@post.edited_at) and can?(@conn, :show, @post) do %> +
+ + Edited + <%= pretty_time(@post.edited_at) %> + <%= if @post.edit_reason not in [nil, ""] do %> + because: + <%= @post.edit_reason %> + <% end %> + + <% end %> +
+
+ <% link_path = ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}?#{[post_id: @post.id]}" <> "#post_#{@post.id}" %> + <% safe_author = markdown_safe_author(@post) %> + <% + quote_body = + if @post.hidden_from_users do + "" + else + @post.body + end + %> + + + Link + + + + Quote + + + + Reply + + <%= if can?(@conn, :edit, @post) do %> + + + + + Edit + + + + <% end %> +
diff --git a/lib/philomena_web/templates/post/_post_options.html.slime b/lib/philomena_web/templates/post/_post_options.html.slime deleted file mode 100644 index 214cf1d3..00000000 --- a/lib/philomena_web/templates/post/_post_options.html.slime +++ /dev/null @@ -1,41 +0,0 @@ -div - ' Posted - => pretty_time(@post.created_at) - - a.communication__interaction href=~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/reports/new" - i.fa.fa-flag> - ' Report - - = if not is_nil(@post.edited_at) and can?(@conn, :show, @post) do - br - a href=~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/history" - ' Edited - => pretty_time(@post.edited_at) - - = if @post.edit_reason not in [nil, ""] do - ' because: - => @post.edit_reason - -div - - link_path = ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}?#{[post_id: @post.id]}" <> "#post_#{@post.id}" - - safe_author = markdown_safe_author(@post) - - quote_body = if @post.hidden_from_users, do: "", else: @post.body - - a.communication__interaction title="Link to post" href=link_path - i.fa.fa-link> - ' Link - - a.communication__interaction.post-reply.post-reply-quote href=link_path data-reply-url=link_path data-author=safe_author data-post=quote_body - i.fa.fa-quote-right> - ' Quote - - a.communication__interaction.post-reply href=link_path data-reply-url=link_path data-author=safe_author - i.fa.fa-reply> - ' Reply - - = if can?(@conn, :edit, @post) do - span.owner-options - strong - a.communication__interaction href=~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/edit" - i.fas.fa-edit> - ' Edit diff --git a/lib/philomena_web/templates/post/index.html.heex b/lib/philomena_web/templates/post/index.html.heex new file mode 100644 index 00000000..1468e42f --- /dev/null +++ b/lib/philomena_web/templates/post/index.html.heex @@ -0,0 +1,319 @@ +

+ Posts +

+<%= form_for :posts, ~p"/posts", [method: "get", class: "hform", enforce_utf8: false], fn f -> %> +
+ <%= text_input(f, :pq, name: :pq, value: @conn.params["pq"], class: "input hform__text", placeholder: "Search posts", autocapitalize: "none") %> + <%= submit("Search", class: "hform__button button") %> +
+
+ For more information, see the + + search syntax documentation + + . Search results are sorted by creation date. +
+<% end %> +

+ Search Results +

+<%= cond do %> + <% Enum.any?(@posts) -> %> + <% route = fn p -> ~p"/posts?#{p}" end %> + <% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @posts, route: route, params: [pq: @conn.params["pq"]], conn: @conn) %> + <%= for {body, post} <- @posts, post.topic.hidden_from_users == false do %> +
+

+ <%= link(post.topic.forum.name, to: ~p"/forums/#{post.topic.forum}") %> + » + <%= link(post.topic.title, to: ~p"/forums/#{post.topic.forum}/topics/#{post.topic}") %> + » + <% post_link = ~p"/forums/#{post.topic.forum}/topics/#{post.topic}?#{[post_id: post.id]}" <> "#post_#{post.id}" %> + <%= if post.topic_position == 0 do %> + <%= link("Topic Opener", to: post_link) %> + <% else %> + <%= link("Post #{post.topic_position}", to: post_link) %> + <% end %> +

+ <%= render(PhilomenaWeb.PostView, "_post.html", body: body, post: post, conn: @conn) %> +
+ <% end %> +
+ +
+ <% assigns[:error] -> %> +

+ Oops, there was an error evaluating your query: +

+
+      <%= assigns[:error] %>
+    
+ <% true -> %> +

+ No posts found! +

+<% end %> +

+ Default search +

+

+ If you do not specify a field to search over, the search engine will + search for posts with a body that is similar to the query's + + word stems + + . For example, posts containing the words + + winged humanization + + , + + wings + + , and + + spread wings + + would all be found by a search for + + wing + + , but + + sewing + + would not be. +

+

+ Allowed fields +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Field Selector + + Type + + Description + + Example +
+ + author + + + Literal + + Matches the author of this post. Anonymous authors will never match this term. + + + <%= link("author:Joey", to: ~p"/posts?#{[pq: "author:Joey"]}") %> + +
+ + body + + + Full Text + + Matches the body of this post. This is the default field. + + + <%= link("body:test", to: ~p"/posts?#{[pq: "body:test"]}") %> + +
+ + created_at + + + Date/Time Range + + Matches the creation time of this post. + + + <%= link("created_at:2015", to: ~p"/posts?#{[pq: "created_at:2015"]}") %> + +
+ + id + + + Numeric Range + + Matches the numeric surrogate key for this post. + + + <%= link("id:1000000", to: ~p"/posts?#{[pq: "id:1000000"]}") %> + +
+ + my + + + Meta + + + my:posts + + matches posts you have posted if you are signed in. + + + <%= link("my:posts", to: ~p"/posts?#{[pq: "my:posts"]}") %> + +
+ + subject + + + Full Text + + Matches the title of the topic. + + + <%= link("subject:time wasting thread", to: ~p"/posts?#{[pq: "subject:time wasting thread"]}") %> + +
+ + topic_id + + + Literal + + Matches the numeric surrogate key for the topic this post belongs to. + + + <%= link("topic_id:7000", to: ~p"/posts?#{[pq: "topic_id:7000"]}") %> + +
+ + topic_position + + + Numeric Range + + Matches the offset from the beginning of the topic of this post. Positions begin at 0. + + + <%= link("topic_position:0", to: ~p"/posts?#{[pq: "topic_position:0"]}") %> + +
+ + updated_at + + + Date/Time Range + + Matches the creation or last edit time of this post. + + + <%= link("updated_at.gte:2 weeks ago", to: ~p"/posts?#{[pq: "updated_at.gte:2 weeks ago"]}") %> + +
+ + user_id + + + Literal + + Matches posts with the specified user_id. Anonymous users will never match this term. + + + <%= link("user_id:211190", to: ~p"/posts?#{[pq: "user_id:211190"]}") %> + +
+ + forum + + + Literal + + Matches the short name for the forum this post belongs to. + + + <%= link("forum:meta", to: ~p"/posts?#{[pq: "forum:meta"]}") %> + +
diff --git a/lib/philomena_web/templates/post/index.html.slime b/lib/philomena_web/templates/post/index.html.slime deleted file mode 100644 index 6313a9dc..00000000 --- a/lib/philomena_web/templates/post/index.html.slime +++ /dev/null @@ -1,154 +0,0 @@ -h1 Posts - -= form_for :posts, ~p"/posts", [method: "get", class: "hform", enforce_utf8: false], fn f -> - .field - = text_input f, :pq, name: :pq, value: @conn.params["pq"], class: "input hform__text", placeholder: "Search posts", autocapitalize: "none" - = submit "Search", class: "hform__button button" - - .fieldlabel - ' For more information, see the - a href="/pages/search_syntax" search syntax documentation - ' . Search results are sorted by creation date. - -h2 Search Results - -= cond do - - Enum.any?(@posts) -> - - route = fn p -> ~p"/posts?#{p}" end - - pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @posts, route: route, params: [pq: @conn.params["pq"]], conn: @conn - - = for {body, post} <- @posts, post.topic.hidden_from_users == false do - div - h3 - =<> link post.topic.forum.name, to: ~p"/forums/#{post.topic.forum}" - | » - =<> link post.topic.title, to: ~p"/forums/#{post.topic.forum}/topics/#{post.topic}" - | » - - post_link = ~p"/forums/#{post.topic.forum}/topics/#{post.topic}?#{[post_id: post.id]}" <> "#post_#{post.id}" - = if post.topic_position == 0 do - =<> link "Topic Opener", to: post_link - - else - =<> link "Post #{post.topic_position}", to: post_link - = render PhilomenaWeb.PostView, "_post.html", body: body, post: post, conn: @conn - - .block - .block__header.block__header--light.page__header - .page__pagination = pagination - .page__info - span.block__header__title - = render PhilomenaWeb.PaginationView, "_pagination_info.html", page: @posts, conn: @conn - - - assigns[:error] -> - p - ' Oops, there was an error evaluating your query: - pre = assigns[:error] - - - true -> - p - ' No posts found! - -h3 Default search -p - ' If you do not specify a field to search over, the search engine will - ' search for posts with a body that is similar to the query's - em word stems - ' . For example, posts containing the words - code winged humanization - ' , - code wings - ' , and - code> spread wings - ' would all be found by a search for - code wing - ' , but - code> sewing - ' would not be. - -h3 Allowed fields -table.table - thead - tr - th Field Selector - th Type - th Description - th Example - tbody - tr - td - code author - td Literal - td Matches the author of this post. Anonymous authors will never match this term. - td - code = link "author:Joey", to: ~p"/posts?#{[pq: "author:Joey"]}" - tr - td - code body - td Full Text - td Matches the body of this post. This is the default field. - td - code = link "body:test", to: ~p"/posts?#{[pq: "body:test"]}" - tr - td - code created_at - td Date/Time Range - td Matches the creation time of this post. - td - code = link "created_at:2015", to: ~p"/posts?#{[pq: "created_at:2015"]}" - tr - td - code id - td Numeric Range - td Matches the numeric surrogate key for this post. - td - code = link "id:1000000", to: ~p"/posts?#{[pq: "id:1000000"]}" - tr - td - code my - td Meta - td - code> my:posts - ' matches posts you have posted if you are signed in. - td - code = link "my:posts", to: ~p"/posts?#{[pq: "my:posts"]}" - tr - td - code subject - td Full Text - td Matches the title of the topic. - td - code = link "subject:time wasting thread", to: ~p"/posts?#{[pq: "subject:time wasting thread"]}" - tr - td - code topic_id - td Literal - td Matches the numeric surrogate key for the topic this post belongs to. - td - code = link "topic_id:7000", to: ~p"/posts?#{[pq: "topic_id:7000"]}" - tr - td - code topic_position - td Numeric Range - td Matches the offset from the beginning of the topic of this post. Positions begin at 0. - td - code = link "topic_position:0", to: ~p"/posts?#{[pq: "topic_position:0"]}" - tr - td - code updated_at - td Date/Time Range - td Matches the creation or last edit time of this post. - td - code = link "updated_at.gte:2 weeks ago", to: ~p"/posts?#{[pq: "updated_at.gte:2 weeks ago"]}" - tr - td - code user_id - td Literal - td Matches posts with the specified user_id. Anonymous users will never match this term. - td - code = link "user_id:211190", to: ~p"/posts?#{[pq: "user_id:211190"]}" - tr - td - code forum - td Literal - td Matches the short name for the forum this post belongs to. - td - code = link "forum:meta", to: ~p"/posts?#{[pq: "forum:meta"]}" diff --git a/lib/philomena_web/templates/post/preview/create.html.heex b/lib/philomena_web/templates/post/preview/create.html.heex new file mode 100644 index 00000000..7520d906 --- /dev/null +++ b/lib/philomena_web/templates/post/preview/create.html.heex @@ -0,0 +1,13 @@ +
+
+ <%= render(PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @post, conn: @conn) %> +
+
+ + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @post, conn: @conn, awards: true) %> + +
+ <%= @body %> +
+
+
diff --git a/lib/philomena_web/templates/post/preview/create.html.slime b/lib/philomena_web/templates/post/preview/create.html.slime deleted file mode 100644 index 469efc80..00000000 --- a/lib/philomena_web/templates/post/preview/create.html.slime +++ /dev/null @@ -1,10 +0,0 @@ -.block.flex - .flex__fixed.spacing-right - = render PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @post, conn: @conn - - .flex__grow.communication__body - span.communication__body__sender-name - = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @post, conn: @conn, awards: true - - .communication__body__text - = @body diff --git a/lib/philomena_web/templates/profile/_about_me.html.heex b/lib/philomena_web/templates/profile/_about_me.html.heex new file mode 100644 index 00000000..e845090d --- /dev/null +++ b/lib/philomena_web/templates/profile/_about_me.html.heex @@ -0,0 +1,12 @@ +
+ <%= cond do %> + <% @user.description not in [nil, ""] -> %> + <%= @about_me %> + <% current?(@user, @conn.assigns.current_user) -> %> + + Want to + <%= link("add some info about yourself?", to: ~p"/profiles/#{@user}/description/edit") %> + + <% true -> %> + <% end %> +
diff --git a/lib/philomena_web/templates/profile/_about_me.html.slime b/lib/philomena_web/templates/profile/_about_me.html.slime deleted file mode 100644 index 5bad35b2..00000000 --- a/lib/philomena_web/templates/profile/_about_me.html.slime +++ /dev/null @@ -1,11 +0,0 @@ -.block__content.profile-about - = cond do - - @user.description not in [nil, ""] -> - = @about_me - - - current?(@user, @conn.assigns.current_user) -> - em - ' Want to - => link "add some info about yourself?", to: ~p"/profiles/#{@user}/description/edit" - - - true -> diff --git a/lib/philomena_web/templates/profile/_admin_block.html.heex b/lib/philomena_web/templates/profile/_admin_block.html.heex new file mode 100644 index 00000000..9c7fc278 --- /dev/null +++ b/lib/philomena_web/templates/profile/_admin_block.html.heex @@ -0,0 +1,279 @@ +
+ + Account created + <%= @user.created_at %> +
+ + Current Filter: + <%= if @filter do %> + <%= link(@filter.name, to: ~p"/filters/#{@filter}") %> + <% else %> + + (none) + + <% end %> +
+ + Last seen + <%= if @last_ip do %> + <%= pretty_time(@last_ip.updated_at) %> + from + <%= link_to_ip(@conn, @last_ip.ip) %> + <%= if @last_fp do %> + <%= link_to_fingerprint(@conn, @last_fp.fingerprint) %> + <% end %> + <% else %> + + (never) + + <% end %> +
+ + Two factor auth: + + <%= enabled_text(@user.otp_required_for_login) %> + +
+ <%= if @user.locked_at do %> + + + Account locked, + <%= @user.failed_attempts %> + failed login attempts + + <% else %> + + Not currently locked + <% end %> +
+
+ + + + Toggle Controls + + + diff --git a/lib/philomena_web/templates/profile/_admin_block.html.slime b/lib/philomena_web/templates/profile/_admin_block.html.slime deleted file mode 100644 index ca2462ab..00000000 --- a/lib/philomena_web/templates/profile/_admin_block.html.slime +++ /dev/null @@ -1,178 +0,0 @@ -.block--fixed - i.fa.fa-fw.fa-calendar> - ' Account created - = @user.created_at - - br - i.fa.fa-fw.fa-filter> - ' Current Filter: - = if @filter do - = link @filter.name, to: ~p"/filters/#{@filter}" - - else - em - ' (none) - - br - i.far.fa-fw.fa-clock> - ' Last seen - = if @last_ip do - => pretty_time(@last_ip.updated_at) - ' from - => link_to_ip(@conn, @last_ip.ip) - - = if @last_fp do - => link_to_fingerprint(@conn, @last_fp.fingerprint) - - else - em - ' (never) - - br - i.fas.fa-fw.fa-key> - ' Two factor auth: - strong = enabled_text(@user.otp_required_for_login) - - br - - = if @user.locked_at do - i.fas.fa-fw.fa-lock> - strong.comment_deleted> - ' Account locked, - => @user.failed_attempts - ' failed login attempts - - else - i.fas.fa-fw.fa-unlock> - ' Not currently locked - -br - -a.label.label--primary.label--block href="#" data-click-toggle=".js-admin__options__toggle" title="Toggle Controls" - i.fa.fa-fw.fa-bars - span Toggle Controls - -.profile-top__options.js-admin__options__toggle.hidden - ul.profile-admin__options__column - li - = link to: ~p"/profiles/#{@user}/details" do - i.fa.fa-fw.fa-eye - span.admin__button View Details - li - = link to: ~p"/search?#{[q: "upvoted_by_id:#{@user.id}"]}" do - i.fa.fa-fw.fa-arrow-up - span.admin__button Upvotes - li - = link to: ~p"/search?#{[q: "downvoted_by_id:#{@user.id}"]}" do - i.fa.fa-fw.fa-arrow-down - span.admin__button Downvotes - li - = link to: ~p"/search?#{[q: "hidden_by_id:#{@user.id}"]}" do - i.fa.fa-fw.fa-eye-slash - span.admin__button Hidden Images - li - = link to: ~p"/admin/reports?#{[rq: "user_id:#{@user.id}"]}" do - i.fa.fa-fw.fa-exclamation - span.admin__button Reports - li - = link to: ~p"/profiles/#{@user}/ip_history" do - i.fab.fa-fw.fa-internet-explorer - span.admin__button IP History - li - = link to: ~p"/profiles/#{@user}/fp_history" do - i.fa.fa-fw.fa-desktop - span.admin__button FP History - li - = link to: ~p"/profiles/#{@user}/aliases" do - i.fa.fa-fw.fa-users - span.admin__button Potential Aliases - - = if can?(@conn, :index, %Philomena.Donations.Donation{}) do - li - = link to: ~p"/admin/donations/user/#{@user}" do - i.fas.fa-fw.fa-dollar-sign - span.admin__button Donations - - ul.profile-admin__options__column - = if can?(@conn, :edit, @user) do - li - = link to: ~p"/admin/users/#{@user}/edit" do - i.fas.fa-fw.fa-edit - span.admin__button Edit User - - li - = link to: ~p"/admin/users/#{@user}/force_filter/new" do - i.fas.faw-fw.fa-filter - span.admin__button Force Filter - - = if @forced do - li - = link to: ~p"/admin/users/#{@user}/force_filter", data: [confirm: "Are you really, really sure?", method: "delete"] do - i.fas.fa-fw.fa-filter - span.admin__button Remove Force Filter - - = if @user.deleted_at do - li - = link to: ~p"/admin/users/#{@user}/activation", data: [confirm: "Are you really, really sure?", method: "post"] do - i.fa.fa-fw.fa-check - span.admin__button Reactivate Account - - else - li - = link to: ~p"/admin/users/#{@user}/activation", data: [confirm: "Are you really, really sure?", method: "delete"] do - i.fa.fa-fw.fa-times - span.admin__button Deactivate Account - - = if @user.locked_at do - li - = link to: ~p"/admin/users/#{@user}/unlock", data: [method: "post"] do - i.fas.fa-fw.fa-unlock - span.admin__button Unlock Account - - li - = link to: ~p"/admin/users/#{@user}/wipe", data: [confirm: "This is irreversible, destroying all identifying information including email. Are you sure?", method: "post"] do - i.fas.fa-fw.fa-eraser - span.admin__button Wipe PII - - = if can?(@conn, :edit, %Philomena.ArtistLinks.ArtistLink{}) do - li - = link to: ~p"/profiles/#{@user}/artist_links/new" do - i.fa.fa-fw.fa-link - span.admin__button Add Artist Link - - = if can?(@conn, :create, Philomena.Bans.User) do - li - = link to: ~p"/admin/user_bans/new?#{[username: @user.name]}" do - i.fa.fa-fw.fa-ban - span.admin__button Ban this sucker - - ul.profile-admin__options__column - = if can?(@conn, :index, Philomena.Users.User) do - li - = link to: ~p"/admin/users/#{@user}/api_key", data: [confirm: "Are you really, really sure?", method: "delete"] do - i.fas.fa-fw.fa-key - span.admin__button Reset API key - - li - = if @user.verified do - = link to: ~p"/admin/users/#{@user}/verification", data: [confirm: "Are you really, really sure?", method: "delete"] do - i.fas.fa-fw.fa-user-times - span.admin__button Revoke Verification - - else - = link to: ~p"/admin/users/#{@user}/verification", data: [confirm: "Are you really, really sure?", method: "create"] do - i.fas.fa-fw.fa-user-check - span.admin__button Grant Verification - - ul.profile-admin__options__column - = if can?(@conn, :index, Philomena.Users.User) do - li - = link to: ~p"/admin/users/#{@user}/votes", data: [confirm: "Are you really, really sure?", method: "delete"] do - i.far.fa-fw.fa-file-excel - span.admin__button Remove All Votes/Faves - - li - = link to: ~p"/admin/users/#{@user}/downvotes", data: [confirm: "Are you really, really sure?", method: "delete"] do - i.fa.fa-fw.fa-arrow-down - span.admin__button Remove All Downvotes - - = if @user.role == "user" and can?(@conn, :revert, Philomena.TagChanges.TagChange) do - li - = link to: ~p"/tag_changes/full_revert?#{[user_id: @user.id]}", data: [confirm: "Are you really, really sure?", method: "create"] do - i.fa.fa-fw.fa-tag - span.admin__button Revert All Tag Changes diff --git a/lib/philomena_web/templates/profile/_awards.html.heex b/lib/philomena_web/templates/profile/_awards.html.heex new file mode 100644 index 00000000..228d036f --- /dev/null +++ b/lib/philomena_web/templates/profile/_awards.html.heex @@ -0,0 +1,25 @@ +
+ <% awards = award_order(@awards) %> + <% {awards, overflow} = Enum.split(awards, 10) %> + <%= for award <- awards do %> + <% title = [award_title(award), award.label] |> Enum.join(" - ") %> +
+ <%= badge_image(award.badge, alt: title, title: title, width: "18", height: "18") %> +
+ <% end %> + <%= if Enum.any?(overflow) do %> + + <% end %> +
diff --git a/lib/philomena_web/templates/profile/_awards.html.slime b/lib/philomena_web/templates/profile/_awards.html.slime deleted file mode 100644 index be7834ec..00000000 --- a/lib/philomena_web/templates/profile/_awards.html.slime +++ /dev/null @@ -1,18 +0,0 @@ -.badges - - awards = award_order(@awards) - - {awards, overflow} = Enum.split(awards, 10) - - = for award <- awards do - - title = [award_title(award), award.label] |> Enum.join(" - ") - .badge - = badge_image(award.badge, alt: title, title: title, width: "18", height: "18") - - = if Enum.any?(overflow) do - .dropdown - i.fa.fa-caret-down - .dropdown__content.block__header - .badges.flex--column - = for award <- overflow do - - title = [award_title(award), award.label] |> Enum.join(" - ") - .badge - = badge_image(award.badge, alt: title, title: title, width: "18", height: "18") diff --git a/lib/philomena_web/templates/profile/_commission.html.heex b/lib/philomena_web/templates/profile/_commission.html.heex new file mode 100644 index 00000000..5829ff09 --- /dev/null +++ b/lib/philomena_web/templates/profile/_commission.html.heex @@ -0,0 +1,43 @@ +
+ <%= cond do %> + <% @user.commission -> %> + + Status: + + <%= commission_status(@user.commission) %> +
+ <%= if Enum.any?(@user.commission.items) do %> + + Price Range: + + <% {min, max} = Enum.min_max_by(@user.commission.items, &Decimal.to_float(&1.base_price)) %> + $ + <%= Decimal.round(min.base_price || 0, 2) |> Decimal.to_string() %> + - $ + <%= Decimal.round(max.base_price || 0, 2) |> Decimal.to_string() %> + USD +
+ <% end %> + <% # Lotta space here %> +
+ <%= @commission_information %> +
+
+ <%= link("More information", to: ~p"/profiles/#{@user}/commission") %> + <% current?(@user, @conn.assigns.current_user) -> %> + <%= if Enum.any?(@conn.assigns.user.verified_links) do %> + + You don't have any commission information listed yet. + <%= link("Click here", to: ~p"/profiles/#{@user}/commission/new") %> + to set it up. + + <% else %> + + You must have a verified Artist Link to create a commission page. + <%= link("Click here", to: ~p"/profiles/#{@user}/artist_links/new") %> + to set one up. + + <% end %> + <% true -> %> + <% end %> +
diff --git a/lib/philomena_web/templates/profile/_commission.html.slime b/lib/philomena_web/templates/profile/_commission.html.slime deleted file mode 100644 index be102740..00000000 --- a/lib/philomena_web/templates/profile/_commission.html.slime +++ /dev/null @@ -1,38 +0,0 @@ -.block__content.profile - = cond do - - @user.commission -> - strong> Status: - = commission_status(@user.commission) - br - - = if Enum.any?(@user.commission.items) do - strong> Price Range: - - {min, max} = Enum.min_max_by(@user.commission.items, &Decimal.to_float(&1.base_price)) - | $ - => Decimal.round(min.base_price || 0, 2) |> Decimal.to_string() - | - $ - => Decimal.round(max.base_price || 0, 2) |> Decimal.to_string() - ' USD - br - - / Lotta space here - br - = @commission_information - br - br - - = link "More information", to: ~p"/profiles/#{@user}/commission" - - - current?(@user, @conn.assigns.current_user) -> - = if Enum.any?(@conn.assigns.user.verified_links) do - em - ' You don't have any commission information listed yet. - => link "Click here", to: ~p"/profiles/#{@user}/commission/new" - ' to set it up. - - else - em - ' You must have a verified Artist Link to create a commission page. - => link "Click here", to: ~p"/profiles/#{@user}/artist_links/new" - ' to set one up. - - - true -> diff --git a/lib/philomena_web/templates/profile/_recent_comments.html.heex b/lib/philomena_web/templates/profile/_recent_comments.html.heex new file mode 100644 index 00000000..48ebb679 --- /dev/null +++ b/lib/philomena_web/templates/profile/_recent_comments.html.heex @@ -0,0 +1,15 @@ +<%= if Enum.any?(@comments) do %> +
+
+ + Recent Comments + + <%= link("View all", to: ~p"/comments?#{[cq: "user_id:#{@user.id}"]}") %> +
+
+ <%= for {body, comment} <- @comments, can?(@conn, :show, comment.image) do %> + <%= render(PhilomenaWeb.CommentView, "_comment_with_image.html", comment: comment, body: body, conn: @conn) %> + <% end %> +
+
+<% end %> diff --git a/lib/philomena_web/templates/profile/_recent_comments.html.slime b/lib/philomena_web/templates/profile/_recent_comments.html.slime deleted file mode 100644 index 2752b333..00000000 --- a/lib/philomena_web/templates/profile/_recent_comments.html.slime +++ /dev/null @@ -1,9 +0,0 @@ -= if Enum.any?(@comments) do - .block - .block__header - span.block__header__title Recent Comments - = link "View all", to: ~p"/comments?#{[cq: "user_id:#{@user.id}"]}" - - .block__content - = for {body, comment} <- @comments, can?(@conn, :show, comment.image) do - = render PhilomenaWeb.CommentView, "_comment_with_image.html", comment: comment, body: body, conn: @conn diff --git a/lib/philomena_web/templates/profile/_recent_galleries.html.heex b/lib/philomena_web/templates/profile/_recent_galleries.html.heex new file mode 100644 index 00000000..d92c02ba --- /dev/null +++ b/lib/philomena_web/templates/profile/_recent_galleries.html.heex @@ -0,0 +1,15 @@ +<%= if Enum.any?(@galleries) do %> +
+
+ + Recent Galleries + + <%= link("View all", to: ~p"/galleries?#{[gallery: [creator: @user.name]]}") %> +
+
+ <%= for gallery <- @galleries do %> + <%= render(PhilomenaWeb.GalleryView, "_gallery.html", gallery: gallery, conn: @conn) %> + <% end %> +
+
+<% end %> diff --git a/lib/philomena_web/templates/profile/_recent_galleries.html.slime b/lib/philomena_web/templates/profile/_recent_galleries.html.slime deleted file mode 100644 index 8aee5f98..00000000 --- a/lib/philomena_web/templates/profile/_recent_galleries.html.slime +++ /dev/null @@ -1,9 +0,0 @@ -= if Enum.any?(@galleries) do - .block - .block__header - span.block__header__title Recent Galleries - = link "View all", to: ~p"/galleries?#{[gallery: [creator: @user.name]]}" - - .block__content.js-resizable-media-container - = for gallery <- @galleries do - = render PhilomenaWeb.GalleryView, "_gallery.html", gallery: gallery, conn: @conn \ No newline at end of file diff --git a/lib/philomena_web/templates/profile/_recent_images.html.heex b/lib/philomena_web/templates/profile/_recent_images.html.heex new file mode 100644 index 00000000..9abfda42 --- /dev/null +++ b/lib/philomena_web/templates/profile/_recent_images.html.heex @@ -0,0 +1,17 @@ +<%= if Enum.any?(@images) do %> +
+
+ + <%= @title %> + + <%= if assigns[:view_all_path] do %> + <%= link("View all", to: assigns[:view_all_path]) %> + <% end %> +
+
+ <%= for image <- @images do %> + <%= render(PhilomenaWeb.ImageView, "_image_box.html", image: image, size: :thumb, conn: @conn) %> + <% end %> +
+
+<% end %> diff --git a/lib/philomena_web/templates/profile/_recent_images.html.slime b/lib/philomena_web/templates/profile/_recent_images.html.slime deleted file mode 100644 index d3db5ced..00000000 --- a/lib/philomena_web/templates/profile/_recent_images.html.slime +++ /dev/null @@ -1,10 +0,0 @@ -= if Enum.any?(@images) do - .block - .block__header - span.block__header__title = @title - = if assigns[:view_all_path] do - = link("View all", to: assigns[:view_all_path]) - - .block__content.js-resizable-media-container - = for image <- @images do - = render PhilomenaWeb.ImageView, "_image_box.html", image: image, size: :thumb, conn: @conn \ No newline at end of file diff --git a/lib/philomena_web/templates/profile/_recent_posts.html.heex b/lib/philomena_web/templates/profile/_recent_posts.html.heex new file mode 100644 index 00000000..eb65eab9 --- /dev/null +++ b/lib/philomena_web/templates/profile/_recent_posts.html.heex @@ -0,0 +1,22 @@ +<%= if Enum.any?(@posts) do %> +
+
+ + Recent Forum Posts + + <%= link("View all", to: ~p"/posts?#{[pq: "user_id:#{@user.id}"]}") %> +
+
+
+ <%= for post <- @posts do %> +
+ Post + <%= link(pretty_time(post.created_at), to: ~p"/forums/#{post.topic.forum}/topics/#{post.topic}?#{[post_id: post]}" <> "#post_#{post.id}") %> + in topic + <%= link(post.topic.title, to: ~p"/forums/#{post.topic.forum}/topics/#{post.topic}") %> +
+ <% end %> +
+
+
+<% end %> diff --git a/lib/philomena_web/templates/profile/_recent_posts.html.slime b/lib/philomena_web/templates/profile/_recent_posts.html.slime deleted file mode 100644 index 3b4b4814..00000000 --- a/lib/philomena_web/templates/profile/_recent_posts.html.slime +++ /dev/null @@ -1,14 +0,0 @@ -= if Enum.any?(@posts) do - .block - .block__header - span.block__header__title Recent Forum Posts - = link "View all", to: ~p"/posts?#{[pq: "user_id:#{@user.id}"]}" - - .block__content - .block - = for post <- @posts do - .block__content.alternating-color - ' Post - => link pretty_time(post.created_at), to: ~p"/forums/#{post.topic.forum}/topics/#{post.topic}?#{[post_id: post]}" <> "#post_#{post.id}" - ' in topic - => link post.topic.title, to: ~p"/forums/#{post.topic.forum}/topics/#{post.topic}" diff --git a/lib/philomena_web/templates/profile/_statistics.html.heex b/lib/philomena_web/templates/profile/_statistics.html.heex new file mode 100644 index 00000000..d6222579 --- /dev/null +++ b/lib/philomena_web/templates/profile/_statistics.html.heex @@ -0,0 +1,89 @@ +
+
+ + Statistics (Last 90 Days) + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Uploads + + <%= number_with_delimiter(@user.uploads_count) %> + +
+ <%= sparkline_data(@statistics.uploads) %> +
+
+ Favorites + + <%= number_with_delimiter(@user.images_favourited_count) %> + +
+ <%= sparkline_data(@statistics.images_favourited) %> +
+
+ Comments + + <%= number_with_delimiter(@user.comments_posted_count) %> + +
+ <%= sparkline_data(@statistics.comments_posted) %> +
+
+ Votes + + <%= number_with_delimiter(@user.votes_cast_count) %> + +
+ <%= sparkline_data(@statistics.votes_cast) %> +
+
+ Metadata Updates + + <%= number_with_delimiter(@user.metadata_updates_count) %> + +
+ <%= sparkline_data(@statistics.metadata_updates) %> +
+
+ Forum Posts + + <%= number_with_delimiter(@user.forum_posts_count) %> + +
+ <%= sparkline_data(@statistics.forum_posts) %> +
+
+
+
diff --git a/lib/philomena_web/templates/profile/_statistics.html.slime b/lib/philomena_web/templates/profile/_statistics.html.slime deleted file mode 100644 index 043b3e47..00000000 --- a/lib/philomena_web/templates/profile/_statistics.html.slime +++ /dev/null @@ -1,28 +0,0 @@ -.block - .block__header: span.block__header__title Statistics (Last 90 Days) - .block__content - table.table.table--stats.center - tr - td.table--stats__parameter Uploads - td.table--stats__value = number_with_delimiter(@user.uploads_count) - td.table--stats__sparkline: .sparkline = sparkline_data(@statistics.uploads) - tr - td.table--stats__parameter Favorites - td.table--stats__value = number_with_delimiter(@user.images_favourited_count) - td.table--stats__sparkline: .sparkline = sparkline_data(@statistics.images_favourited) - tr - td.table--stats__parameter Comments - td.table--stats__value = number_with_delimiter(@user.comments_posted_count) - td.table--stats__sparkline: .sparkline = sparkline_data(@statistics.comments_posted) - tr - td.table--stats__parameter Votes - td.table--stats__value = number_with_delimiter(@user.votes_cast_count) - td.table--stats__sparkline: .sparkline = sparkline_data(@statistics.votes_cast) - tr - td.table--stats__parameter Metadata Updates - td.table--stats__value = number_with_delimiter(@user.metadata_updates_count) - td.table--stats__sparkline: .sparkline = sparkline_data(@statistics.metadata_updates) - tr - td.table--stats__parameter Forum Posts - td.table--stats__value = number_with_delimiter(@user.forum_posts_count) - td.table--stats__sparkline: .sparkline = sparkline_data(@statistics.forum_posts) diff --git a/lib/philomena_web/templates/profile/alias/_aliases.html.heex b/lib/philomena_web/templates/profile/alias/_aliases.html.heex new file mode 100644 index 00000000..65f82508 --- /dev/null +++ b/lib/philomena_web/templates/profile/alias/_aliases.html.heex @@ -0,0 +1,42 @@ +<%= for u <- @aliases do %> + + + <%= link(u.name, to: ~p"/profiles/#{u}") %> + + + <%= @type %> + + <%= cond do %> + <% younger_than_7_days?(u) -> %> + + <%= pretty_time(u.created_at) %> + + <% younger_than_14_days?(u) -> %> + + <%= pretty_time(u.created_at) %> + + <% true -> %> + + <%= pretty_time(u.created_at) %> + + <% end %> + <%= cond do %> + <% not is_nil(u.deleted_at) -> %> + + Account Disabled + + <% currently_banned?(u) -> %> + + Currently Banned + + <% previously_banned?(u) -> %> + + Previously banned + + <% true -> %> + + Never banned + + <% end %> + +<% end %> diff --git a/lib/philomena_web/templates/profile/alias/_aliases.html.slime b/lib/philomena_web/templates/profile/alias/_aliases.html.slime deleted file mode 100644 index 38030e40..00000000 --- a/lib/philomena_web/templates/profile/alias/_aliases.html.slime +++ /dev/null @@ -1,37 +0,0 @@ -= for u <- @aliases do - tr - td - = link u.name, to: ~p"/profiles/#{u}" - - td - = @type - - = cond do - - younger_than_7_days?(u) -> - td.danger - = pretty_time u.created_at - - - younger_than_14_days?(u) -> - td.warning - = pretty_time u.created_at - - - true -> - td.success - = pretty_time u.created_at - - = cond do - - not is_nil(u.deleted_at) -> - td.danger - ' Account Disabled - - - currently_banned?(u) -> - td.danger - ' Currently Banned - - - previously_banned?(u) -> - td.danger - ' Previously banned - - - true -> - td.success - ' Never banned diff --git a/lib/philomena_web/templates/profile/alias/index.html.heex b/lib/philomena_web/templates/profile/alias/index.html.heex new file mode 100644 index 00000000..d342bd2d --- /dev/null +++ b/lib/philomena_web/templates/profile/alias/index.html.heex @@ -0,0 +1,35 @@ +

+ Potential Aliases +

+

+ Remember that aliases, especially fingerprints, aren't infallible by a + + long + + margin. Use this data only in supplement to other evidence when considering bans. +

+
+
+ + + + + + + + + + + <%= render(PhilomenaWeb.Profile.AliasView, "_aliases.html", aliases: @both_matches, type: "IP + FP", conn: @conn) %> + <%= render(PhilomenaWeb.Profile.AliasView, "_aliases.html", aliases: @ip_matches, type: "IP", conn: @conn) %> + <%= render(PhilomenaWeb.Profile.AliasView, "_aliases.html", aliases: @fp_matches, type: "FP", conn: @conn) %> + +
+ User + + Method + + Creation Date + + Ban Status +
diff --git a/lib/philomena_web/templates/profile/alias/index.html.slime b/lib/philomena_web/templates/profile/alias/index.html.slime deleted file mode 100644 index 64c6ee59..00000000 --- a/lib/philomena_web/templates/profile/alias/index.html.slime +++ /dev/null @@ -1,20 +0,0 @@ -h2 Potential Aliases -p - ' Remember that aliases, especially fingerprints, aren't infallible by a - em> long - ' margin. Use this data only in supplement to other evidence when considering bans. - -br -br - -table.table - thead - tr - td User - td Method - td Creation Date - td Ban Status - tbody - = render PhilomenaWeb.Profile.AliasView, "_aliases.html", aliases: @both_matches, type: "IP + FP", conn: @conn - = render PhilomenaWeb.Profile.AliasView, "_aliases.html", aliases: @ip_matches, type: "IP", conn: @conn - = render PhilomenaWeb.Profile.AliasView, "_aliases.html", aliases: @fp_matches, type: "FP", conn: @conn diff --git a/lib/philomena_web/templates/profile/artist_link/_form.html.heex b/lib/philomena_web/templates/profile/artist_link/_form.html.heex new file mode 100644 index 00000000..aad87126 --- /dev/null +++ b/lib/philomena_web/templates/profile/artist_link/_form.html.heex @@ -0,0 +1,52 @@ +<%= form_for @changeset, @action, fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+
+

+ +

+ <%= text_input(f, :tag_name, value: assigns[:tag_name], class: "input", autocomplete: "off", placeholder: "artist:your-name", data: [ac: "true", ac_min_length: "3", ac_source: "/autocomplete/tags?term="]) %> + <%= error_tag(f, :tag) %> +
+
+
+ + <%= url_input(f, :uri, class: "input input--wide", placeholder: "https://www.deviantart.com/your-name", required: true) %> + <%= error_tag(f, :uri) %> +
+ <% options = [{"Visible to everyone", true}, {"Visible only to site staff", false}] %> +
+ <%= select(f, :public, options, class: "input", autocomplete: "off") %> +
+

+ Instructions +

+

+ + Review details carefully as only site staff can edit later. + +

+

+ + For quick results, put the LINKVALIDATION code on your linked webpage after submission. + + We'll message you there otherwise. +

+
+ <%= submit("Submit", class: "button") %> +
+<% end %> diff --git a/lib/philomena_web/templates/profile/artist_link/_form.html.slime b/lib/philomena_web/templates/profile/artist_link/_form.html.slime deleted file mode 100644 index cfe75981..00000000 --- a/lib/philomena_web/templates/profile/artist_link/_form.html.slime +++ /dev/null @@ -1,38 +0,0 @@ -= form_for @changeset, @action, fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .field - .field - p - label for="tag_name" - ' Artist Link validation is intended for artists. Validating your link will give you control over your content on the site, allowing you to create a - a> href="/commissions" commissions - ' listing and request takedowns or DNPs. Do not request a link if the source contains no artwork which you have created. - = text_input f, :tag_name, value: assigns[:tag_name], class: "input", autocomplete: "off", placeholder: "artist:your-name", data: [ac: "true", ac_min_length: "3", ac_source: "/autocomplete/tags?term="] - = error_tag f, :tag - - .field - label for="uri" - ' URL of your art webpage (may be your Derpibooru profile page if you have no other sources) - = url_input f, :uri, class: "input input--wide", placeholder: "https://www.deviantart.com/your-name", required: true - = error_tag f, :uri - - elixir: - options = [ - {"Visible to everyone", true}, - {"Visible only to site staff", false} - ] - - .field - => select f, :public, options, class: "input", autocomplete: "off" - - h4 Instructions - p - strong Review details carefully as only site staff can edit later. - p - strong> For quick results, put the LINKVALIDATION code on your linked webpage after submission. - | We'll message you there otherwise. - .actions - = submit "Submit", class: "button" diff --git a/lib/philomena_web/templates/profile/artist_link/edit.html.heex b/lib/philomena_web/templates/profile/artist_link/edit.html.heex new file mode 100644 index 00000000..9d744142 --- /dev/null +++ b/lib/philomena_web/templates/profile/artist_link/edit.html.heex @@ -0,0 +1,4 @@ +

+ Edit Link +

+<%= render(PhilomenaWeb.Profile.ArtistLinkView, "_form.html", conn: @conn, changeset: @changeset, tag_name: tag_name(@artist_link), action: ~p"/profiles/#{@artist_link.user}/artist_links/#{@artist_link}") %> diff --git a/lib/philomena_web/templates/profile/artist_link/edit.html.slime b/lib/philomena_web/templates/profile/artist_link/edit.html.slime deleted file mode 100644 index c03ff454..00000000 --- a/lib/philomena_web/templates/profile/artist_link/edit.html.slime +++ /dev/null @@ -1,2 +0,0 @@ -h1 Edit Link -= render PhilomenaWeb.Profile.ArtistLinkView, "_form.html", conn: @conn, changeset: @changeset, tag_name: tag_name(@artist_link), action: ~p"/profiles/#{@artist_link.user}/artist_links/#{@artist_link}" diff --git a/lib/philomena_web/templates/profile/artist_link/index.html.heex b/lib/philomena_web/templates/profile/artist_link/index.html.heex new file mode 100644 index 00000000..d0793751 --- /dev/null +++ b/lib/philomena_web/templates/profile/artist_link/index.html.heex @@ -0,0 +1,53 @@ +

+ Artist Links +

+

+ + Request a link + +

+

+ Artist links associate your account on Derpibooru with tags about content you create and with accounts on sites elsewhere. This allows users to easily identify artists and staff to act more rapidly on takedown requests. +

+ + + + + + + + + + + + <%= for link <- @artist_links do %> + + + + + + + + <% end %> + +
+ URI + + Options + + Verification Code + + Verified? + + Public +
+ <%= link(link.uri, to: link.uri) %> + + <%= link("View Details", to: ~p"/profiles/#{@user}/artist_links/#{link}") %> + + <%= link.verification_code %> + + <%= verified_as_string(link) %> + + <%= public_as_string(link) %> +
diff --git a/lib/philomena_web/templates/profile/artist_link/index.html.slime b/lib/philomena_web/templates/profile/artist_link/index.html.slime deleted file mode 100644 index 7cb3be11..00000000 --- a/lib/philomena_web/templates/profile/artist_link/index.html.slime +++ /dev/null @@ -1,23 +0,0 @@ -h1 Artist Links -p - a.button href=~p"/profiles/#{@user}/artist_links/new" - ' Request a link -p - ' Artist links associate your account on Derpibooru with tags about content you create and with accounts on sites elsewhere. This allows users to easily identify artists and staff to act more rapidly on takedown requests. - -table.table - thead - tr - th URI - th Options - th Verification Code - th Verified? - th Public - tbody - = for link <- @artist_links do - tr - td = link link.uri, to: link.uri - td = link "View Details", to: ~p"/profiles/#{@user}/artist_links/#{link}" - td = link.verification_code - th = verified_as_string(link) - th = public_as_string(link) diff --git a/lib/philomena_web/templates/profile/artist_link/new.html.heex b/lib/philomena_web/templates/profile/artist_link/new.html.heex new file mode 100644 index 00000000..60722820 --- /dev/null +++ b/lib/philomena_web/templates/profile/artist_link/new.html.heex @@ -0,0 +1,4 @@ +

+ Request Artist Link +

+<%= render(PhilomenaWeb.Profile.ArtistLinkView, "_form.html", changeset: @changeset, action: ~p"/profiles/#{@user}/artist_links", conn: @conn) %> diff --git a/lib/philomena_web/templates/profile/artist_link/new.html.slime b/lib/philomena_web/templates/profile/artist_link/new.html.slime deleted file mode 100644 index a2566378..00000000 --- a/lib/philomena_web/templates/profile/artist_link/new.html.slime +++ /dev/null @@ -1,2 +0,0 @@ -h1 Request Artist Link -= render PhilomenaWeb.Profile.ArtistLinkView, "_form.html", changeset: @changeset, action: ~p"/profiles/#{@user}/artist_links", conn: @conn diff --git a/lib/philomena_web/templates/profile/artist_link/show.html.heex b/lib/philomena_web/templates/profile/artist_link/show.html.heex new file mode 100644 index 00000000..9fae25a7 --- /dev/null +++ b/lib/philomena_web/templates/profile/artist_link/show.html.heex @@ -0,0 +1,118 @@ +

+ Link to + <%= link(@artist_link.uri, to: @artist_link.uri) %> +

+

+ Status +

+<%= cond do %> + <% verified?(@artist_link) -> %> +

+ This link has been verified by a member of the administration team. +

+

+ You can now remove the verification text from your website if you have not done so already. +

+ <% contacted?(@artist_link) -> %> +

+ + This link is awaiting your reply on the linked website in order to be verified. + +

+

+ An administrator + <%= "(#{@artist_link.contacted_by_user.name})" %> + has manually contacted you at the address above, as your verification code was not found on the website. Please respond to the message from the administrator to confirm your link. +

+

+ The verification code is: +

+

+

+ <%= @artist_link.verification_code %> +

+

+ <% link_verified?(@artist_link) -> %> +

+ + This link is pending verification by a member of the administration team. + +

+

+ We've now found the verification code on your website. An administrator still needs to check the tag list before verifying the link. Please leave the code on your website until verification is complete. +

+

+ If you need it again, your verification code is: +

+

+

+ <%= @artist_link.verification_code %> +

+

+ <% unverified?(@artist_link) -> %> +

+ + This link is pending verification by a member of the administration team. + +

+

+ To have your link verified as fast as possible, please place this text somewhere on the page you are linking. +

+

+ <%= @artist_link.verification_code %> +

+
+

+

+ Otherwise, an administrator will have to contact you to verify your identity. +

+

+ Once the link has been verified you can remove the text; the text simply allows the team to directly check with your website rather than messaging you and waiting for a reply. +

+ <% rejected?(@artist_link) -> %> +

+ This link has been rejected by a member of the administration team; this is probably because you were not reachable in a timely manner (~1 week) to verify the link. +

+<% end %> +

+ Visibility +

+<%= if public?(@artist_link) do %> +

+ This link is public, and will be shown around the site. +

+<% else %> +

+ This link is not public, and will only be shown to administrators. +

+<% end %> +

+ Associated tag +

+<%= if @artist_link.tag do %> +
+ <%= render(PhilomenaWeb.TagView, "_tag.html", tag: @artist_link.tag, conn: @conn) %> +
+<% else %> +

+ There is no tag associated with this link. +

+<% end %> +<%= if can?(@conn, :index, Philomena.ArtistLinks.ArtistLink) do %> +

+ <%= link("Edit", to: ~p"/profiles/#{@user}/artist_links/#{@artist_link}/edit") %> + • + <%= link("Verify", to: ~p"/admin/artist_links/#{@artist_link}/verification", method: :post) %> + • + <%= link("Reject", to: ~p"/admin/artist_links/#{@artist_link}/reject", method: :post) %> + <%= if not verified?(@artist_link) do %> + • + <%= if contacted?(@artist_link) do %> + Artist contacted + <% else %> + <%= link("Artist contacted", to: ~p"/admin/artist_links/#{@artist_link}/contact", method: :post) %> + <% end %> + <% end %> +

+<% end %> +<%= link("Back", to: ~p"/profiles/#{@user}/artist_links") %> diff --git a/lib/philomena_web/templates/profile/artist_link/show.html.slime b/lib/philomena_web/templates/profile/artist_link/show.html.slime deleted file mode 100644 index 73aedd3f..00000000 --- a/lib/philomena_web/templates/profile/artist_link/show.html.slime +++ /dev/null @@ -1,69 +0,0 @@ -h1 - ' Link to - = link @artist_link.uri, to: @artist_link.uri - -h3 Status -= cond do - - verified?(@artist_link) -> - p This link has been verified by a member of the administration team. - p You can now remove the verification text from your website if you have not done so already. - - - contacted?(@artist_link) -> - p - strong This link is awaiting your reply on the linked website in order to be verified. - p - ' An administrator - => "(#{@artist_link.contacted_by_user.name})" - ' has manually contacted you at the address above, as your verification code was not found on the website. Please respond to the message from the administrator to confirm your link. - p The verification code is: - p - h1 = @artist_link.verification_code - - - link_verified?(@artist_link) -> - p - strong This link is pending verification by a member of the administration team. - p We've now found the verification code on your website. An administrator still needs to check the tag list before verifying the link. Please leave the code on your website until verification is complete. - p If you need it again, your verification code is: - p - h1 = @artist_link.verification_code - - - unverified?(@artist_link) -> - p - strong This link is pending verification by a member of the administration team. - .dnp-warning - h3 To have your link verified as fast as possible, please place this text somewhere on the page you are linking. - h1 = @artist_link.verification_code - p Otherwise, an administrator will have to contact you to verify your identity. - p Once the link has been verified you can remove the text; the text simply allows the team to directly check with your website rather than messaging you and waiting for a reply. - - - rejected?(@artist_link) -> - p This link has been rejected by a member of the administration team; this is probably because you were not reachable in a timely manner (~1 week) to verify the link. - -h3 Visibility -= if public?(@artist_link) do - p This link is public, and will be shown around the site. -- else - p This link is not public, and will only be shown to administrators. - -h3 Associated tag -= if @artist_link.tag do - .tag-list - = render PhilomenaWeb.TagView, "_tag.html", tag: @artist_link.tag, conn: @conn -- else - p There is no tag associated with this link. - -= if can?(@conn, :index, Philomena.ArtistLinks.ArtistLink) do - p - => link "Edit", to: ~p"/profiles/#{@user}/artist_links/#{@artist_link}/edit" - ' • - => link "Verify", to: ~p"/admin/artist_links/#{@artist_link}/verification", method: :post - ' • - => link "Reject", to: ~p"/admin/artist_links/#{@artist_link}/reject", method: :post - = if not verified?(@artist_link) do - ' • - = if contacted?(@artist_link) do - ' Artist contacted - - else - = link "Artist contacted", to: ~p"/admin/artist_links/#{@artist_link}/contact", method: :post - -= link "Back", to: ~p"/profiles/#{@user}/artist_links" diff --git a/lib/philomena_web/templates/profile/award/_form.html.heex b/lib/philomena_web/templates/profile/award/_form.html.heex new file mode 100644 index 00000000..53939e5f --- /dev/null +++ b/lib/philomena_web/templates/profile/award/_form.html.heex @@ -0,0 +1,33 @@ +<%= form_for @changeset, @action, fn f -> %> + <% badge_options = badge_options(@badges) %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+ <%= label(f, :badge_id, "Badge type") %> + <%= select(f, :badge_id, badge_options, class: "input", data: [change_selectvalue: "#award_label"]) %> + <%= error_tag(f, :badge_id) %> +
+
+ <%= label(f, :label, "Label (Public)") %> + <%= text_input(f, :label, class: "input input--wide", value: first_badge_label(badge_options)) %> + <%= error_tag(f, :label) %> +
+
+ <%= label(f, :reason, "Reason (Private)") %> + <%= text_input(f, :reason, class: "input input--wide") %> + <%= error_tag(f, :reason) %> +
+
+ <%= label(f, :badge_name, "Badge name (overrides default name if set, leave blank for default badge name)") %> + <%= text_input(f, :badge_name, class: "input input--wide") %> + <%= error_tag(f, :badge_name) %> +
+
+ <%= submit("Save", class: "button", data: [disable_with: raw("Saving…")]) %> +
+<% end %> diff --git a/lib/philomena_web/templates/profile/award/_form.html.slime b/lib/philomena_web/templates/profile/award/_form.html.slime deleted file mode 100644 index cdaf2627..00000000 --- a/lib/philomena_web/templates/profile/award/_form.html.slime +++ /dev/null @@ -1,29 +0,0 @@ -= form_for @changeset, @action, fn f -> - - badge_options = badge_options(@badges) - - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .field - => label f, :badge_id, "Badge type" - = select f, :badge_id, badge_options, class: "input", data: [change_selectvalue: "#award_label"] - = error_tag f, :badge_id - - .field - => label f, :label, "Label (Public)" - = text_input f, :label, class: "input input--wide", value: first_badge_label(badge_options) - = error_tag f, :label - - .field - => label f, :reason, "Reason (Private)" - = text_input f, :reason, class: "input input--wide" - = error_tag f, :reason - - .field - => label f, :badge_name, "Badge name (overrides default name if set, leave blank for default badge name)" - = text_input f, :badge_name, class: "input input--wide" - = error_tag f, :badge_name - - .field - = submit "Save", class: "button", data: [disable_with: raw("Saving…")] diff --git a/lib/philomena_web/templates/profile/award/edit.html.heex b/lib/philomena_web/templates/profile/award/edit.html.heex new file mode 100644 index 00000000..583b8e1f --- /dev/null +++ b/lib/philomena_web/templates/profile/award/edit.html.heex @@ -0,0 +1,4 @@ +

+ Editing award +

+<%= render(PhilomenaWeb.Profile.AwardView, "_form.html", changeset: @changeset, badges: @badges, action: ~p"/profiles/#{@user}/awards/#{@award}", conn: @conn) %> diff --git a/lib/philomena_web/templates/profile/award/edit.html.slime b/lib/philomena_web/templates/profile/award/edit.html.slime deleted file mode 100644 index 94a5f3b6..00000000 --- a/lib/philomena_web/templates/profile/award/edit.html.slime +++ /dev/null @@ -1,3 +0,0 @@ -h1 Editing award - -= render PhilomenaWeb.Profile.AwardView, "_form.html", changeset: @changeset, badges: @badges, action: ~p"/profiles/#{@user}/awards/#{@award}", conn: @conn diff --git a/lib/philomena_web/templates/profile/award/new.html.heex b/lib/philomena_web/templates/profile/award/new.html.heex new file mode 100644 index 00000000..d80ce7d2 --- /dev/null +++ b/lib/philomena_web/templates/profile/award/new.html.heex @@ -0,0 +1,4 @@ +

+ New award +

+<%= render(PhilomenaWeb.Profile.AwardView, "_form.html", changeset: @changeset, badges: @badges, action: ~p"/profiles/#{@user}/awards", conn: @conn) %> diff --git a/lib/philomena_web/templates/profile/award/new.html.slime b/lib/philomena_web/templates/profile/award/new.html.slime deleted file mode 100644 index 525e06cf..00000000 --- a/lib/philomena_web/templates/profile/award/new.html.slime +++ /dev/null @@ -1,3 +0,0 @@ -h1 New award - -= render PhilomenaWeb.Profile.AwardView, "_form.html", changeset: @changeset, badges: @badges, action: ~p"/profiles/#{@user}/awards", conn: @conn diff --git a/lib/philomena_web/templates/profile/commission/_form.html.heex b/lib/philomena_web/templates/profile/commission/_form.html.heex new file mode 100644 index 00000000..b10af0a4 --- /dev/null +++ b/lib/philomena_web/templates/profile/commission/_form.html.heex @@ -0,0 +1,49 @@ +<%= form_for @changeset, @action, fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+ <%= label(f, :information, "General Information:") %> + <%= textarea(f, :information, class: "input input--wide input--text", placeholder: "A general overview about your commissions.", required: true) %> + <%= error_tag(f, :information) %> +
+
+ <%= label(f, :contact, "Contact Information:") %> + <%= textarea(f, :contact, class: "input input--wide input--text", placeholder: "How you would like potential customers to contact you (PM, Discord, Email, etc). Remember that this information will be publicly visible.", required: true) %> + <%= error_tag(f, :contact) %> +
+
+ <%= label(f, :will_create, "Content you are particularly interested in drawing or creating (optional):") %> + <%= textarea(f, :will_create, class: "input input--wide input--text", placeholder: "List specific content you are willing to accept commissions for.") %> + <%= error_tag(f, :will_create) %> +
+
+ <%= label(f, :will_not_create, "Content you will not draw or create (optional):") %> + <%= textarea(f, :will_not_create, class: "input input--wide input--text", placeholder: "List specific content you are not willing to accept commissions for.") %> + <%= error_tag(f, :will_not_create) %> +
+
+ <%= label(f, :categories, "Art Categories:") %> +
+ <%= collection_checkboxes(f, :categories, categories(), selected: f.data.categories, input_opts: [class: ~c"checkbox spacing-right"], wrapper: &Phoenix.HTML.Tag.content_tag(:span, &1, class: "commission__category")) %> + <%= error_tag(f, :categories) %> +
+
+ <%= label(f, :sheet_image_id, "Image ID of your commissions sheet (optional but recommended):") %> +
+ <%= number_input(f, :sheet_image_id, class: "input", placeholder: "1227409") %> + <%= error_tag(f, :sheet_image_id) %> +
+
+ <%= label f, :open, "Currently accepting commissions." do %> + <% end %> + <%= checkbox(f, :open, class: "checkbox") %> + <%= error_tag(f, :open) %> +
+
+ <%= submit("Save", class: "button") %> +<% end %> diff --git a/lib/philomena_web/templates/profile/commission/_form.html.slime b/lib/philomena_web/templates/profile/commission/_form.html.slime deleted file mode 100644 index ac2e286b..00000000 --- a/lib/philomena_web/templates/profile/commission/_form.html.slime +++ /dev/null @@ -1,38 +0,0 @@ -= form_for @changeset, @action, fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .field - => label f, :information, "General Information:" - = textarea f, :information, class: "input input--wide input--text", placeholder: "A general overview about your commissions.", required: true - = error_tag f, :information - - .field - => label f, :contact, "Contact Information:" - = textarea f, :contact, class: "input input--wide input--text", placeholder: "How you would like potential customers to contact you (PM, Discord, Email, etc). Remember that this information will be publicly visible.", required: true - = error_tag f, :contact - .field - => label f, :will_create, "Content you are particularly interested in drawing or creating (optional):" - = textarea f, :will_create, class: "input input--wide input--text", placeholder: "List specific content you are willing to accept commissions for." - = error_tag f, :will_create - .field - => label f, :will_not_create, "Content you will not draw or create (optional):" - = textarea f, :will_not_create, class: "input input--wide input--text", placeholder: "List specific content you are not willing to accept commissions for." - = error_tag f, :will_not_create - .field - => label f, :categories, "Art Categories:" - br - = collection_checkboxes f, :categories, categories(), selected: f.data.categories, input_opts: [ class: 'checkbox spacing-right' ], wrapper: &Phoenix.HTML.Tag.content_tag(:span, &1, class: "commission__category") - = error_tag f, :categories - .field - => label f, :sheet_image_id, "Image ID of your commissions sheet (optional but recommended):" - br - = number_input f, :sheet_image_id, class: "input", placeholder: "1227409" - = error_tag f, :sheet_image_id - .field - = label f, :open, "Currently accepting commissions." do - => checkbox f, :open, class: "checkbox" - = error_tag f, :open - br - = submit "Save", class: "button" diff --git a/lib/philomena_web/templates/profile/commission/_listing_items.html.heex b/lib/philomena_web/templates/profile/commission/_listing_items.html.heex new file mode 100644 index 00000000..8e31613e --- /dev/null +++ b/lib/philomena_web/templates/profile/commission/_listing_items.html.heex @@ -0,0 +1,87 @@ +
+
+ + Available Items and Prices + + <%= if current?(@user, @conn.assigns.current_user) do %> + <%= link("Add an item", to: ~p"/profiles/#{@user}/commission/items/new") %> + <% end %> +
+
+ <%= if not Enum.any?(@commission.items) do %> + <%= if current?(@user, @conn.assigns.current_user) do %> +

+ You have not added any items to your commissions sheet yet. +

+

+ Your listing will not appear in search results until you + <%= link("list at least one item", to: ~p"/profiles/#{@user}/commission/items/new") %> + . +

+ <% else %> +

+ This artist has not added any items yet. Please check back later. +

+ <% end %> + <% end %> + + + + + + + + <%= if can?(@conn, :edit, @commission) do %> + + <% end %> + + + + <%= for {description, add_ons, item} <- @items do %> + + + + + + <%= if can?(@conn, :edit, @commission) do %> + + <% end %> + + <% end %> + +
+ Example + + Description + + Base Price + + Add-Ons + + Options +
+ <%= if item.example_image do %> + <%= render(PhilomenaWeb.ImageView, "_image_container.html", image: item.example_image, size: :thumb_small, conn: @conn) %> + <% else %> + (No example) + <% end %> + + + <%= item.item_type %> + +
+
+ <%= description %> +
+ $ + <%= Decimal.round(item.base_price, 2) %> + + <%= add_ons %> + + <%= link("Edit item", to: ~p"/profiles/#{@user}/commission/items/#{item}/edit") %> +
+
+ <%= link("Delete item", to: ~p"/profiles/#{@user}/commission/items/#{item}", data: [confirm: "Are you really, really sure?", method: "delete"]) %> +
+
+
diff --git a/lib/philomena_web/templates/profile/commission/_listing_items.html.slime b/lib/philomena_web/templates/profile/commission/_listing_items.html.slime deleted file mode 100644 index 49ead871..00000000 --- a/lib/philomena_web/templates/profile/commission/_listing_items.html.slime +++ /dev/null @@ -1,58 +0,0 @@ -.block - .block__header - span.block__header__title Available Items and Prices - - = if current?(@user, @conn.assigns.current_user) do - = link "Add an item", to: ~p"/profiles/#{@user}/commission/items/new" - - .block__content - - = if not Enum.any?(@commission.items) do - = if current?(@user, @conn.assigns.current_user) do - p You have not added any items to your commissions sheet yet. - p - ' Your listing will not appear in search results until you - = link "list at least one item", to: ~p"/profiles/#{@user}/commission/items/new" - ' . - - else - p This artist has not added any items yet. Please check back later. - - table.table - thead - tr - th Example - th Description - th Base Price - th Add-Ons - = if can?(@conn, :edit, @commission) do - th Options - tbody - = for {description, add_ons, item} <- @items do - tr - td - = if item.example_image do - = render PhilomenaWeb.ImageView, "_image_container.html", image: item.example_image, size: :thumb_small, conn: @conn - - else - | (No example) - - td - strong - = item.item_type - - br - br - - = description - td - | $ - = Decimal.round(item.base_price, 2) - - td - = add_ons - - = if can?(@conn, :edit, @commission) do - td - = link "Edit item", to: ~p"/profiles/#{@user}/commission/items/#{item}/edit" - br - br - = link "Delete item", to: ~p"/profiles/#{@user}/commission/items/#{item}", data: [confirm: "Are you really, really sure?", method: "delete"] diff --git a/lib/philomena_web/templates/profile/commission/_listing_sheet.html.heex b/lib/philomena_web/templates/profile/commission/_listing_sheet.html.heex new file mode 100644 index 00000000..e2974265 --- /dev/null +++ b/lib/philomena_web/templates/profile/commission/_listing_sheet.html.heex @@ -0,0 +1,12 @@ +<%= if @commission.sheet_image do %> +
+
+ + Commissions Sheet + +
+
+ <%= render(PhilomenaWeb.ImageView, "_image_container.html", image: @commission.sheet_image, size: :tall, conn: @conn) %> +
+
+<% end %> diff --git a/lib/philomena_web/templates/profile/commission/_listing_sheet.html.slime b/lib/philomena_web/templates/profile/commission/_listing_sheet.html.slime deleted file mode 100644 index ce980cf6..00000000 --- a/lib/philomena_web/templates/profile/commission/_listing_sheet.html.slime +++ /dev/null @@ -1,6 +0,0 @@ -= if @commission.sheet_image do - .block - .block__header - span.block__header__title Commissions Sheet - .block__content.center - = render PhilomenaWeb.ImageView, "_image_container.html", image: @commission.sheet_image, size: :tall, conn: @conn diff --git a/lib/philomena_web/templates/profile/commission/_listing_sidebar.html.heex b/lib/philomena_web/templates/profile/commission/_listing_sidebar.html.heex new file mode 100644 index 00000000..9cb16411 --- /dev/null +++ b/lib/philomena_web/templates/profile/commission/_listing_sidebar.html.heex @@ -0,0 +1,137 @@ +<% # General information block %> +
+
+ + General information + +
+
+ + Profile: + + <%= render(PhilomenaWeb.UserAttributionView, "_user.html", object: @commission, conn: @conn) %> +
+ + Status: + + <%= + if @commission.open do + "Open" + else + "Closed" + end + %> +
+ <%= if Enum.any?(@commission.items) do %> + + Price Range: + + <% {min, max} = Enum.min_max_by(@commission.items, &Decimal.to_float(&1.base_price)) %> + $ + <%= Decimal.round(min.base_price, 2) |> Decimal.to_string() %> + - $ + <%= Decimal.round(max.base_price, 2) |> Decimal.to_string() %> + USD + <% end %> +
+
+ <%= @rendered.information %> +
+
+<% # Contact information block %> +
+
+ + Contact information + +
+
+ <%= @rendered.contact %> +
+
+<% # Categories block %> +
+
+ + Art Categories + +
+
+ <%= for cat <- @commission.categories do %> + + <%= cat %> + + <% end %> +
+
+<% # Will create block %> +<%= if @commission.will_create not in [nil, ""] do %> +
+
+ + Will draw/create + +
+
+ <%= @rendered.will_create %> +
+
+<% end %> +<% # Will not create block %> +<%= if @commission.will_not_create not in [nil, ""] do %> +
+
+ + Will not draw/create + +
+
+ <%= @rendered.will_not_create %> +
+
+<% end %> +<% # Artist link block %> +<% # .block %> +<% # .block__header: span.block__header__title Artist Links %> +<% # - is_current = (current_user && current_user.id == @user.id) %> +<% # - if @links.present? || is_current %> +<% # = render partial: 'profiles/artist_link_area' %> +<% # %> +<% # Options block %> +
+
+ + Options + +
+
+ <%= if can?(@conn, :edit, @commission) do %> + <%= link("Edit this listing", to: ~p"/profiles/#{@user}/commission/edit") %> +
+ <%= link("Delete this listing", to: ~p"/profiles/#{@user}/commission", data: [confirm: "Are you really, really sure about that?", method: "delete"]) %> +
+ <% end %> + <%= link("Report this listing", to: ~p"/profiles/#{@user}/commission/reports/new") %> +
+
+<% # Share block %> +
+
+ + Share this listing + +
+
+ <% url = url(~p"/profiles/#{@user}/commission") %> +
+ + + + Copy + + <%= text_input(:commission, :commission_url, value: url, class: "input input--wide input--separate-top", readonly: true) %> +
+
+
diff --git a/lib/philomena_web/templates/profile/commission/_listing_sidebar.html.slime b/lib/philomena_web/templates/profile/commission/_listing_sidebar.html.slime deleted file mode 100644 index 93db5128..00000000 --- a/lib/philomena_web/templates/profile/commission/_listing_sidebar.html.slime +++ /dev/null @@ -1,92 +0,0 @@ -/ General information block -.block - .block__header - span.block__header__title General information - .block__content.commission__block_body - strong> Profile: - = render PhilomenaWeb.UserAttributionView, "_user.html", object: @commission, conn: @conn - br - - strong> Status: - = if @commission.open, do: "Open", else: "Closed" - - br - - = if Enum.any?(@commission.items) do - strong> Price Range: - - {min, max} = Enum.min_max_by(@commission.items, &Decimal.to_float(&1.base_price)) - | $ - => Decimal.round(min.base_price, 2) |> Decimal.to_string() - | - $ - => Decimal.round(max.base_price, 2) |> Decimal.to_string() - ' USD - - br - br - - = @rendered.information - -/ Contact information block -.block - .block__header - span.block__header__title Contact information - .block__content.commission__block_body - = @rendered.contact - -/ Categories block -.block - .block__header - span.block__header__title Art Categories - .block__content - = for cat <- @commission.categories do - span.commission__category - = cat - -/ Will create block -= if @commission.will_create not in [nil, ""] do - .block - .block__header - span.block__header__title Will draw/create - .block__content.commission__block_body - = @rendered.will_create - -/ Will not create block -= if @commission.will_not_create not in [nil, ""] do - .block - .block__header - span.block__header__title Will not draw/create - .block__content.commission__block_body - = @rendered.will_not_create - -/ Artist link block -/.block - .block__header: span.block__header__title Artist Links - - is_current = (current_user && current_user.id == @user.id) - - if @links.present? || is_current - = render partial: 'profiles/artist_link_area' - -/ Options block -.block - .block__header - span.block__header__title Options - .block__content - = if can?(@conn, :edit, @commission) do - = link "Edit this listing", to: ~p"/profiles/#{@user}/commission/edit" - br - = link "Delete this listing", to: ~p"/profiles/#{@user}/commission", data: [confirm: "Are you really, really sure about that?", method: "delete"] - br - = link "Report this listing", to: ~p"/profiles/#{@user}/commission/reports/new" - -/ Share block -.block - .block__header - span.block__header__title Share this listing - .block__content - - url = url(~p"/profiles/#{@user}/commission") - - .field - label> for="commission_url" URL - a href="#" data-click-copy="#commission_url" - i.fa.fa-clipboard> - ' Copy - = text_input :commission, :commission_url, value: url, class: "input input--wide input--separate-top", readonly: true diff --git a/lib/philomena_web/templates/profile/commission/edit.html.heex b/lib/philomena_web/templates/profile/commission/edit.html.heex new file mode 100644 index 00000000..3f51f5cb --- /dev/null +++ b/lib/philomena_web/templates/profile/commission/edit.html.heex @@ -0,0 +1,7 @@ +

+ Edit Commission Listing +

+

+ <%= link("Back to commission", to: ~p"/profiles/#{@user}/commission") %> +

+<%= render(PhilomenaWeb.Profile.CommissionView, "_form.html", changeset: @changeset, action: ~p"/profiles/#{@user}/commission", conn: @conn) %> diff --git a/lib/philomena_web/templates/profile/commission/edit.html.slime b/lib/philomena_web/templates/profile/commission/edit.html.slime deleted file mode 100644 index 514d03f0..00000000 --- a/lib/philomena_web/templates/profile/commission/edit.html.slime +++ /dev/null @@ -1,5 +0,0 @@ -h1 Edit Commission Listing -p - = link "Back to commission", to: ~p"/profiles/#{@user}/commission" - -= render PhilomenaWeb.Profile.CommissionView, "_form.html", changeset: @changeset, action: ~p"/profiles/#{@user}/commission", conn: @conn \ No newline at end of file diff --git a/lib/philomena_web/templates/profile/commission/item/_form.html.heex b/lib/philomena_web/templates/profile/commission/item/_form.html.heex new file mode 100644 index 00000000..53c823f8 --- /dev/null +++ b/lib/philomena_web/templates/profile/commission/item/_form.html.heex @@ -0,0 +1,40 @@ +<%= form_for @changeset, @action, fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+ <%= label(f, :item_type, "Type of item:") %> + <%= select(f, :item_type, types(), class: "input") %> + <%= error_tag(f, :item_type) %> +
+
+
+ <%= label(f, :base_price, "Base Price:") %> + <%= number_input(f, :base_price, class: "input", placeholder: "20.00", step: "any", min: 0) %> + <%= error_tag(f, :base_price) %> +
+
+
+ <%= label(f, :example_image_id, "ID of example image:") %> + <%= number_input(f, :example_image_id, class: "input", placeholder: "1345604") %> + <%= error_tag(f, :example_image_id) %> +
+
+
+ <%= label(f, :description, "Short description:") %> + <%= text_input(f, :description, class: "input input--wide", placeholder: "Description") %> + <%= error_tag(f, :description) %> +
+
+
+ <%= label(f, :add_ons, "Add-ons (optional):") %> + <%= textarea(f, :add_ons, class: "input input--wide input--text", placeholder: "Additional character: $10.00") %> + <%= error_tag(f, :add_ons) %> +
+
+ <%= submit("Submit", class: "button") %> +<% end %> diff --git a/lib/philomena_web/templates/profile/commission/item/_form.html.slime b/lib/philomena_web/templates/profile/commission/item/_form.html.slime deleted file mode 100644 index 9883e7c8..00000000 --- a/lib/philomena_web/templates/profile/commission/item/_form.html.slime +++ /dev/null @@ -1,31 +0,0 @@ -= form_for @changeset, @action, fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .field - => label f, :item_type, "Type of item:" - = select f, :item_type, types(), class: "input" - = error_tag f, :item_type - br - .field - => label f, :base_price, "Base Price:" - = number_input f, :base_price, class: "input", placeholder: "20.00", step: "any", min: 0 - = error_tag f, :base_price - br - .field - => label f, :example_image_id, "ID of example image:" - = number_input f, :example_image_id, class: "input", placeholder: "1345604" - = error_tag f, :example_image_id - br - .field - => label f, :description, "Short description:" - = text_input f, :description, class: "input input--wide", placeholder: "Description" - = error_tag f, :description - br - .field - => label f, :add_ons, "Add-ons (optional):" - = textarea f, :add_ons, class: "input input--wide input--text", placeholder: "Additional character: $10.00" - = error_tag f, :add_ons - br - = submit "Submit", class: "button" diff --git a/lib/philomena_web/templates/profile/commission/item/edit.html.heex b/lib/philomena_web/templates/profile/commission/item/edit.html.heex new file mode 100644 index 00000000..db501163 --- /dev/null +++ b/lib/philomena_web/templates/profile/commission/item/edit.html.heex @@ -0,0 +1,7 @@ +

+ Edit Item on Listing +

+

+ <%= link("Back to listing", to: ~p"/profiles/#{@user}/commission") %> +

+<%= render(PhilomenaWeb.Profile.Commission.ItemView, "_form.html", conn: @conn, changeset: @changeset, action: ~p"/profiles/#{@user}/commission/items/#{@item}") %> diff --git a/lib/philomena_web/templates/profile/commission/item/edit.html.slime b/lib/philomena_web/templates/profile/commission/item/edit.html.slime deleted file mode 100644 index 46d4e28b..00000000 --- a/lib/philomena_web/templates/profile/commission/item/edit.html.slime +++ /dev/null @@ -1,5 +0,0 @@ -h1 Edit Item on Listing -p - = link "Back to listing", to: ~p"/profiles/#{@user}/commission" - -= render PhilomenaWeb.Profile.Commission.ItemView, "_form.html", conn: @conn, changeset: @changeset, action: ~p"/profiles/#{@user}/commission/items/#{@item}" diff --git a/lib/philomena_web/templates/profile/commission/item/new.html.heex b/lib/philomena_web/templates/profile/commission/item/new.html.heex new file mode 100644 index 00000000..dad0cf43 --- /dev/null +++ b/lib/philomena_web/templates/profile/commission/item/new.html.heex @@ -0,0 +1,7 @@ +

+ New Item on Listing +

+

+ <%= link("Back to listing", to: ~p"/profiles/#{@user}/commission") %> +

+<%= render(PhilomenaWeb.Profile.Commission.ItemView, "_form.html", conn: @conn, changeset: @changeset, action: ~p"/profiles/#{@user}/commission/items") %> diff --git a/lib/philomena_web/templates/profile/commission/item/new.html.slime b/lib/philomena_web/templates/profile/commission/item/new.html.slime deleted file mode 100644 index 6897a066..00000000 --- a/lib/philomena_web/templates/profile/commission/item/new.html.slime +++ /dev/null @@ -1,5 +0,0 @@ -h1 New Item on Listing -p - = link "Back to listing", to: ~p"/profiles/#{@user}/commission" - -= render PhilomenaWeb.Profile.Commission.ItemView, "_form.html", conn: @conn, changeset: @changeset, action: ~p"/profiles/#{@user}/commission/items" diff --git a/lib/philomena_web/templates/profile/commission/new.html.heex b/lib/philomena_web/templates/profile/commission/new.html.heex new file mode 100644 index 00000000..4c827bce --- /dev/null +++ b/lib/philomena_web/templates/profile/commission/new.html.heex @@ -0,0 +1,7 @@ +

+ New Commission Listing +

+

+ <%= link("Back to index", to: ~p"/commissions") %> +

+<%= render(PhilomenaWeb.Profile.CommissionView, "_form.html", changeset: @changeset, action: ~p"/profiles/#{@user}/commission", conn: @conn) %> diff --git a/lib/philomena_web/templates/profile/commission/new.html.slime b/lib/philomena_web/templates/profile/commission/new.html.slime deleted file mode 100644 index 0e08e263..00000000 --- a/lib/philomena_web/templates/profile/commission/new.html.slime +++ /dev/null @@ -1,5 +0,0 @@ -h1 New Commission Listing -p - = link "Back to index", to: ~p"/commissions" - -= render PhilomenaWeb.Profile.CommissionView, "_form.html", changeset: @changeset, action: ~p"/profiles/#{@user}/commission", conn: @conn \ No newline at end of file diff --git a/lib/philomena_web/templates/profile/commission/show.html.heex b/lib/philomena_web/templates/profile/commission/show.html.heex new file mode 100644 index 00000000..8945c2b4 --- /dev/null +++ b/lib/philomena_web/templates/profile/commission/show.html.heex @@ -0,0 +1,17 @@ +

+ <%= @commission.user.name %> + 's Commissions +

+
+ <% # Side column %> +
+ <%= render(PhilomenaWeb.Profile.CommissionView, "_listing_sidebar.html", commission: @commission, user: @user, rendered: @rendered, conn: @conn) %> +
+ <% # Main column %> +
+ <% # Commission sheet block %> + <%= render(PhilomenaWeb.Profile.CommissionView, "_listing_sheet.html", commission: @commission, user: @user, conn: @conn) %> + <% # Types and prices block %> + <%= render(PhilomenaWeb.Profile.CommissionView, "_listing_items.html", commission: @commission, user: @user, items: @items, conn: @conn) %> +
+
diff --git a/lib/philomena_web/templates/profile/commission/show.html.slime b/lib/philomena_web/templates/profile/commission/show.html.slime deleted file mode 100644 index c5d45474..00000000 --- a/lib/philomena_web/templates/profile/commission/show.html.slime +++ /dev/null @@ -1,18 +0,0 @@ -h1 - = @commission.user.name - | 's Commissions - -.column-layout - - / Side column - .column-layout__left - = render PhilomenaWeb.Profile.CommissionView, "_listing_sidebar.html", commission: @commission, user: @user, rendered: @rendered, conn: @conn - - / Main column - .column-layout__main - - / Commission sheet block - = render PhilomenaWeb.Profile.CommissionView, "_listing_sheet.html", commission: @commission, user: @user, conn: @conn - - / Types and prices block - = render PhilomenaWeb.Profile.CommissionView, "_listing_items.html", commission: @commission, user: @user, items: @items, conn: @conn \ No newline at end of file diff --git a/lib/philomena_web/templates/profile/description/edit.html.heex b/lib/philomena_web/templates/profile/description/edit.html.heex new file mode 100644 index 00000000..335f723b --- /dev/null +++ b/lib/philomena_web/templates/profile/description/edit.html.heex @@ -0,0 +1,33 @@ +

+ Updating Profile Description +

+<%= form_for @changeset, ~p"/profiles/#{@user}/description", [method: "put"], fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+
+ + Personal Title + +
+
+
+ <%= text_input(f, :personal_title, class: "input input--short", placeholder: "Title") %> + <%= error_tag(f, :personal_title) %> +
+
+
+
+
+ <%= render(PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, action_text: "About Me", placeholder: "Description (up to 10000 characters)", name: :description, required: false) %> +
+
+ <%= submit("Update", class: "button") %> +
+
+<% end %> diff --git a/lib/philomena_web/templates/profile/description/edit.html.slime b/lib/philomena_web/templates/profile/description/edit.html.slime deleted file mode 100644 index a59ced13..00000000 --- a/lib/philomena_web/templates/profile/description/edit.html.slime +++ /dev/null @@ -1,21 +0,0 @@ -h1 Updating Profile Description - -= form_for @changeset, ~p"/profiles/#{@user}/description", [method: "put"], fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .block - .block__header - span.block__header__title Personal Title - .block__content - .field - = text_input f, :personal_title, class: "input input--short", placeholder: "Title" - = error_tag f, :personal_title - - .block - div - = render PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, action_text: "About Me", placeholder: "Description (up to 10000 characters)", name: :description, required: false - - .block__content.communication-edit__actions - => submit "Update", class: "button" diff --git a/lib/philomena_web/templates/profile/detail/index.html.heex b/lib/philomena_web/templates/profile/detail/index.html.heex new file mode 100644 index 00000000..07f0716c --- /dev/null +++ b/lib/philomena_web/templates/profile/detail/index.html.heex @@ -0,0 +1,50 @@ +

+ <%= link(@user.name, to: ~p"/profiles/#{@user}") %> + 's User Details +

+

+ Mod Notes +

+<%= render(PhilomenaWeb.Admin.ModNoteView, "_table.html", mod_notes: @mod_notes, conn: @conn) %> +<%= link("Add New Note", to: ~p"/admin/mod_notes/new?#{[notable_id: @user.id, notable_type: "User"]}") %> +

+ Name History +

+ + + + + + + + + <%= for nc <- @name_changes do %> + + + + + <% end %> + +
+ Name + + Changed +
+ <%= nc.name %> + + <%= pretty_time(nc.created_at) %> +
+

+ More Details +

+ diff --git a/lib/philomena_web/templates/profile/detail/index.html.slime b/lib/philomena_web/templates/profile/detail/index.html.slime deleted file mode 100644 index 7d51cdfc..00000000 --- a/lib/philomena_web/templates/profile/detail/index.html.slime +++ /dev/null @@ -1,25 +0,0 @@ -h2 - = link @user.name, to: ~p"/profiles/#{@user}" - | 's User Details - -h4 Mod Notes -= render PhilomenaWeb.Admin.ModNoteView, "_table.html", mod_notes: @mod_notes, conn: @conn -= link "Add New Note", to: ~p"/admin/mod_notes/new?#{[notable_id: @user.id, notable_type: "User"]}" - -h4 Name History -table.table - thead - tr - th Name - th Changed - tbody - = for nc <- @name_changes do - tr - td = nc.name - td = pretty_time nc.created_at - -h4 More Details -ul - li = link "IP Address Usage History", to: ~p"/profiles/#{@user}/ip_history" - li = link "Fingerprint Usage History", to: ~p"/profiles/#{@user}/fp_history" - li = link "Potential Aliases", to: ~p"/profiles/#{@user}/aliases" diff --git a/lib/philomena_web/templates/profile/fp_history/index.html.heex b/lib/philomena_web/templates/profile/fp_history/index.html.heex new file mode 100644 index 00000000..04c62c76 --- /dev/null +++ b/lib/philomena_web/templates/profile/fp_history/index.html.heex @@ -0,0 +1,23 @@ +

+ FP History for + <%= @user.name %> +

+ diff --git a/lib/philomena_web/templates/profile/fp_history/index.html.slime b/lib/philomena_web/templates/profile/fp_history/index.html.slime deleted file mode 100644 index 182c30c5..00000000 --- a/lib/philomena_web/templates/profile/fp_history/index.html.slime +++ /dev/null @@ -1,18 +0,0 @@ -h2 - ' FP History for - = @user.name - -ul - = for ufp <- @user_fps do - li - = link_to_fingerprint @conn, ufp.fingerprint - - ul - = for u <- @other_users[ufp.fingerprint] do - li - => link u.user.name, to: ~p"/profiles/#{u.user}" - | ( - => u.uses - ' uses, last used - = pretty_time(u.updated_at) - ' ) diff --git a/lib/philomena_web/templates/profile/ip_history/index.html.heex b/lib/philomena_web/templates/profile/ip_history/index.html.heex new file mode 100644 index 00000000..c29c20e6 --- /dev/null +++ b/lib/philomena_web/templates/profile/ip_history/index.html.heex @@ -0,0 +1,23 @@ +

+ IP History for + <%= @user.name %> +

+ diff --git a/lib/philomena_web/templates/profile/ip_history/index.html.slime b/lib/philomena_web/templates/profile/ip_history/index.html.slime deleted file mode 100644 index d5ffc0ff..00000000 --- a/lib/philomena_web/templates/profile/ip_history/index.html.slime +++ /dev/null @@ -1,18 +0,0 @@ -h2 - ' IP History for - = @user.name - -ul - = for uip <- @user_ips do - li - = link_to_ip @conn, uip.ip - - ul - = for u <- @other_users[uip.ip] do - li - => link u.user.name, to: ~p"/profiles/#{u.user}" - | ( - => u.uses - ' uses, last used - = pretty_time(u.updated_at) - ' ) diff --git a/lib/philomena_web/templates/profile/scratchpad/edit.html.heex b/lib/philomena_web/templates/profile/scratchpad/edit.html.heex new file mode 100644 index 00000000..b01584ce --- /dev/null +++ b/lib/philomena_web/templates/profile/scratchpad/edit.html.heex @@ -0,0 +1,20 @@ +

+ Updating Moderation Scratchpad +

+<%= form_for @changeset, ~p"/profiles/#{@user}/scratchpad", [method: "put"], fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+
+ <%= render(PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, action_text: "Scratchpad", placeholder: "Scratchpad Contents", name: :scratchpad, required: false) %> +
+
+ <%= submit("Update", class: "button") %> +
+
+<% end %> diff --git a/lib/philomena_web/templates/profile/scratchpad/edit.html.slime b/lib/philomena_web/templates/profile/scratchpad/edit.html.slime deleted file mode 100644 index 9632e445..00000000 --- a/lib/philomena_web/templates/profile/scratchpad/edit.html.slime +++ /dev/null @@ -1,12 +0,0 @@ -h1 Updating Moderation Scratchpad - -= form_for @changeset, ~p"/profiles/#{@user}/scratchpad", [method: "put"], fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - .block - div - = render PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, action_text: "Scratchpad", placeholder: "Scratchpad Contents", name: :scratchpad, required: false - - .block__content.communication-edit__actions - => submit "Update", class: "button" diff --git a/lib/philomena_web/templates/profile/show.html.heex b/lib/philomena_web/templates/profile/show.html.heex new file mode 100644 index 00000000..2d767e06 --- /dev/null +++ b/lib/philomena_web/templates/profile/show.html.heex @@ -0,0 +1,269 @@ +
+
+ <% avatar = render(PhilomenaWeb.UserAttributionView, "_user_avatar.html", object: %{user: @user}, class: "avatar--125px") %> + <%= if current?(@user, @conn.assigns.current_user) do %> + <%= link(avatar, to: ~p"/avatar/edit?#{[profile: true]}", title: "Change avatar") %> + <% else %> + <%= avatar %> + <% end %> +
+ +
+<%= if can_index_user?(@conn) do %> +
+ <%= render(PhilomenaWeb.ProfileView, "_admin_block.html", assigns) %> +
+<% end %> +<%= if @forced && (current?(@user, @conn.assigns.current_user) or can_index_user?(@conn)) do %> +
+ + + Forced Filter: + + <%= link(@forced.name, to: ~p"/filters/#{@forced}") %> +
+<% end %> +<%= if (current?(@user, @conn.assigns.current_user) or can?(@conn, :index, Philomena.Bans.User)) and Enum.any?(@bans) do %> +
+
+ Ban History +
+
+ <%= render(PhilomenaWeb.BanView, "_bans.html", bans: @bans, conn: @conn) %> +
+
+<% end %> +
+
+
+
+ + Commissions + +
+ <%= render(PhilomenaWeb.ProfileView, "_commission.html", user: @user, commission_information: @commission_information, conn: @conn) %> +
+
+ <%= if current?(@user, @conn.assigns.current_user) or manages_links?(@conn, @user) do %> + + Artist Links + + <% else %> +
+ + Artist Links + +
+ <% end %> + <%= for link <- @user.verified_links, should_see_link?(@conn, @user, link) do %> + <% + watchers = + if link.tag do + @watcher_counts[link.tag.id] || 0 + else + 0 + end + %> +
+
+ <%= if link.tag do %> +
+ <%= render(PhilomenaWeb.TagView, "_tag.html", tag: link.tag, conn: @conn) %> +
+ <% end %> + <%= link(link.uri, to: link.uri) %> + <%= if current?(@user, @conn.assigns.current_user) or manages_links?(@conn, @user) do %> +
+ Watched by + <%= watchers %> + <%= pluralize("user", "users", watchers) %> + <% end %> + <%= if manages_links?(@conn, @user) do %> +
+ <%= if link.public do %> + Public + <% else %> + Hidden + <% end %> + • + + Edit + + • + + Reject + + <% else %> + <%= unless link.public do %> +
+ Hidden + <% end %> + <% end %> +
+
+ <% end %> +
+
+ <%= if manages_awards?(@conn) and not hide_staff_tools?(@conn) do %> + + Badges + + <% else %> +
+ + Badges + +
+ <% end %> + <%= for award <- award_order(@user.awards) do %> +
+
+
+ <%= badge_image(award.badge, alt: award.label, width: "32", height: "32") %> +
+
+ <%= award_title(award) %> +
+
+ <%= pretty_time(award.awarded_on) %> + <%= if manages_awards?(@conn) do %> + <%= user_abbrv(award.awarded_by) %> + <% end %> +
+ <%= if manages_awards?(@conn) do %> + + <% end %> +
+ <% end %> +
+
+
+ <%= if can?(@conn, :edit_description, @user) do %> + + About Me + + <% else %> + + About Me + + <% end %> +
+ <%= render(PhilomenaWeb.ProfileView, "_about_me.html", user: @user, about_me: @about_me, conn: @conn) %> +
+ <%= if can_read_mod_notes?(@conn) and not hide_staff_tools?(@conn) do %> +
+ + Mod Notes + + + + + + + + + + <%= for {body, mod_note} <- @mod_notes do %> + + + + + <% end %> + +
+ Note + + Created +
+ <%= body %> + + <%= pretty_time(mod_note.created_at) %> +
+
+ <% end %> + <%= if can_index_user?(@conn) do %> +
+ + Moderation Scratchpad + +
+ <%= @scratchpad %> +
+
+ <% end %> +
+
+ <%= render(PhilomenaWeb.ProfileView, "_statistics.html", user: @user, statistics: @statistics, conn: @conn) %> + <%= render(PhilomenaWeb.ProfileView, "_recent_images.html", title: "Recent Artwork", images: @recent_artwork, view_all_path: ~p"/search?#{[q: tag_disjunction(@tags)]}", conn: @conn) %> + <%= render(PhilomenaWeb.ProfileView, "_recent_images.html", title: "Recent Uploads", images: @recent_uploads, view_all_path: ~p"/search?#{[q: "uploader_id:#{@user.id}"]}", conn: @conn) %> + <%= render(PhilomenaWeb.ProfileView, "_recent_images.html", title: "Recent Favorites", images: @recent_faves, view_all_path: ~p"/search?#{[q: "faved_by_id:#{@user.id}"]}", conn: @conn) %> + <%= render(PhilomenaWeb.ProfileView, "_recent_galleries.html", galleries: @recent_galleries, user: @user, conn: @conn) %> + <%= render(PhilomenaWeb.ProfileView, "_recent_comments.html", comments: @recent_comments, user: @user, conn: @conn) %> + <%= render(PhilomenaWeb.ProfileView, "_recent_posts.html", posts: @recent_posts, user: @user, conn: @conn) %> +
+
diff --git a/lib/philomena_web/templates/profile/show.html.slime b/lib/philomena_web/templates/profile/show.html.slime deleted file mode 100644 index 6039a48d..00000000 --- a/lib/philomena_web/templates/profile/show.html.slime +++ /dev/null @@ -1,164 +0,0 @@ -.profile-top - .profile-top__avatar - - avatar = render PhilomenaWeb.UserAttributionView, "_user_avatar.html", object: %{user: @user}, class: "avatar--125px" - = if current?(@user, @conn.assigns.current_user) do - = link avatar, to: ~p"/avatar/edit?#{[profile: true]}", title: "Change avatar" - - else - = avatar - .profile-top__name-and-links - div - h1.profile-top__name-header - = @user.name - | 's profile - = render PhilomenaWeb.UserAttributionView, "_user_title.html", object: %{user: @user}, large: true - br - - = if can?(@conn, :edit_description, @user) do - = link "Edit Personal Title", to: ~p"/profiles/#{@user}/description/edit" - br - - span - ' Member since - = pretty_time(@user.created_at) - - .profile-top__options - ul.profile-top__options__column - li = link("Send message", to: ~p"/conversations/new?#{[recipient: @user.name]}") - li = link("Our conversations", to: ~p"/conversations?#{[with: @user.id]}") - li = link("Report this user", to: ~p"/profiles/#{@user}/reports/new") - - ul.profile-top__options__column - li = link("Uploads", to: ~p"/search?#{[q: "uploader_id:#{@user.id}"]}") - li = link("Comments", to: ~p"/comments?#{[cq: "user_id:#{@user.id}"]}") - li = link("Posts", to: ~p"/posts?#{[pq: "user_id:#{@user.id}"]}") - = if current?(@user, @conn.assigns.current_user) do - li = link "My reports", to: ~p"/reports" - - ul.profile-top__options__column - li = link("Favorites", to: ~p"/search?#{[q: "faved_by_id:#{@user.id}"]}") - li = link("Tag changes", to: ~p"/profiles/#{@user}/tag_changes") - li = link("Source changes", to: ~p"/profiles/#{@user}/source_changes") - -= if can_index_user?(@conn) do - .js-staff-action - = render PhilomenaWeb.ProfileView, "_admin_block.html", assigns - -= if @forced && (current?(@user, @conn.assigns.current_user) or can_index_user?(@conn)) do - .block - i.fa.fa-fw.fa-filter> - strong.comment_deleted> Forced Filter: - = link @forced.name, to: ~p"/filters/#{@forced}" - -= if (current?(@user, @conn.assigns.current_user) or can?(@conn, :index, Philomena.Bans.User)) and Enum.any?(@bans) do - .block - .block__header--single-item - ' Ban History - .block__content - = render PhilomenaWeb.BanView, "_bans.html", bans: @bans, conn: @conn - -.column-layout - .column-layout__left - .block - .block__header - span.block__header__title Commissions - = render PhilomenaWeb.ProfileView, "_commission.html", user: @user, commission_information: @commission_information, conn: @conn - - .block - = if current?(@user, @conn.assigns.current_user) or manages_links?(@conn, @user) do - a.block__header--single-item href=~p"/profiles/#{@user}/artist_links/new" Artist Links - - else - .block__header - span.block__header__title Artist Links - = for link <- @user.verified_links, should_see_link?(@conn, @user, link) do - - watchers = if link.tag, do: @watcher_counts[link.tag.id] || 0, else: 0 - - .block__content.alternating-color.break-word class=link_block_class(link) - .center - = if link.tag do - .tag_list = render PhilomenaWeb.TagView, "_tag.html", tag: link.tag, conn: @conn - = link(link.uri, to: link.uri) - - = if current?(@user, @conn.assigns.current_user) or manages_links?(@conn, @user) do - br - ' Watched by - => watchers - = pluralize("user", "users", watchers) - - = if manages_links?(@conn, @user) do - br - => if link.public do - ' Public - - else - ' Hidden - ' • - a href=~p"/profiles/#{@user}/artist_links/#{link}/edit" - ' Edit - ' • - a href=~p"/admin/artist_links/#{link}/reject" data-method="post" - ' Reject - - else - => unless link.public do - br - ' Hidden - - .block - = if manages_awards?(@conn) and not hide_staff_tools?(@conn) do - a.block__header--single-item href=~p"/profiles/#{@user}/awards/new" Badges - - else - .block__header - span.block__header__title Badges - = for award <- award_order(@user.awards) do - .block__content.flex.flex--centered.flex--center-distributed.alternating-color.no-overflow title=award.label - .flex__grow.center - .badge = badge_image(award.badge, alt: award.label, width: "32", height: "32") - br - = award_title(award) - .flex__grow.center - => pretty_time(award.awarded_on) - = if manages_awards?(@conn) do - = user_abbrv(award.awarded_by) - - = if manages_awards?(@conn) do - .flex__grow.center - a href=~p"/profiles/#{@user}/awards/#{award}" data-method="delete" data-confirm="Are you really, really sure?" - ' Remove - br - a href=~p"/profiles/#{@user}/awards/#{award}/edit" - ' Edit - - .block - .block__header - = if can?(@conn, :edit_description, @user) do - a.block__header--single-item href=~p"/profiles/#{@user}/description/edit" About Me - - else - span.block__header__title About Me - - = render PhilomenaWeb.ProfileView, "_about_me.html", user: @user, about_me: @about_me, conn: @conn - - = if can_read_mod_notes?(@conn) and not hide_staff_tools?(@conn) do - .block - a.block__header--single-item href=~p"/profiles/#{@user}/details" Mod Notes - table.table - thead - tr - th Note - th Created - tbody - = for {body, mod_note} <- @mod_notes do - tr - td = body - td = pretty_time(mod_note.created_at) - = if can_index_user?(@conn) do - .block - a.block__header--single-item href=~p"/profiles/#{@user}/scratchpad/edit" Moderation Scratchpad - .block__content.profile-about - = @scratchpad - - .column-layout__main - = render PhilomenaWeb.ProfileView, "_statistics.html", user: @user, statistics: @statistics, conn: @conn - = render PhilomenaWeb.ProfileView, "_recent_images.html", title: "Recent Artwork", images: @recent_artwork, view_all_path: ~p"/search?#{[q: tag_disjunction(@tags)]}", conn: @conn - = render PhilomenaWeb.ProfileView, "_recent_images.html", title: "Recent Uploads", images: @recent_uploads, view_all_path: ~p"/search?#{[q: "uploader_id:#{@user.id}"]}", conn: @conn - = render PhilomenaWeb.ProfileView, "_recent_images.html", title: "Recent Favorites", images: @recent_faves, view_all_path: ~p"/search?#{[q: "faved_by_id:#{@user.id}"]}", conn: @conn - = render PhilomenaWeb.ProfileView, "_recent_galleries.html", galleries: @recent_galleries, user: @user, conn: @conn - = render PhilomenaWeb.ProfileView, "_recent_comments.html", comments: @recent_comments, user: @user, conn: @conn - = render PhilomenaWeb.ProfileView, "_recent_posts.html", posts: @recent_posts, user: @user, conn: @conn diff --git a/lib/philomena_web/templates/profile/source_change/index.html.heex b/lib/philomena_web/templates/profile/source_change/index.html.heex new file mode 100644 index 00000000..fb37c456 --- /dev/null +++ b/lib/philomena_web/templates/profile/source_change/index.html.heex @@ -0,0 +1,9 @@ +

+ Source changes by + + <%= @user.name %> + +

+<% route = fn p -> ~p"/profiles/#{@user}/source_changes?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @source_changes, route: route, conn: @conn) %> +<%= render(PhilomenaWeb.SourceChangeView, "index.html", conn: @conn, source_changes: @source_changes, pagination: pagination) %> diff --git a/lib/philomena_web/templates/profile/source_change/index.html.slime b/lib/philomena_web/templates/profile/source_change/index.html.slime deleted file mode 100644 index d03fb4f5..00000000 --- a/lib/philomena_web/templates/profile/source_change/index.html.slime +++ /dev/null @@ -1,9 +0,0 @@ -h1 - ' Source changes by - a href=~p"/profiles/#{@user}" - = @user.name - -- route = fn p -> ~p"/profiles/#{@user}/source_changes?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @source_changes, route: route, conn: @conn - -= render PhilomenaWeb.SourceChangeView, "index.html", conn: @conn, source_changes: @source_changes, pagination: pagination \ No newline at end of file diff --git a/lib/philomena_web/templates/profile/tag_change/index.html.heex b/lib/philomena_web/templates/profile/tag_change/index.html.heex new file mode 100644 index 00000000..b556856b --- /dev/null +++ b/lib/philomena_web/templates/profile/tag_change/index.html.heex @@ -0,0 +1,20 @@ +

+ Tag changes by + + <%= @user.name %> + +

+<% route = fn p -> ~p"/profiles/#{@user}/tag_changes?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @tag_changes, route: route, conn: @conn, params: @pagination_params) %> +
+
+ <%= form_for @conn, ~p"/profiles/#{@user}/tag_changes", [method: "get", enforce_utf8: false], fn f -> %> + <%= text_input(f, :only_tag, class: "input", placeholder: "Tag", title: "Only show this tag", autocapitalize: "none") %> + <%= submit("Search", class: "button", title: "Search") %> + <%= link("Removed", to: ~p"/profiles/#{@user}/tag_changes?#{Keyword.merge(@pagination_params, added: 0)}") %> + <%= link("Added", to: ~p"/profiles/#{@user}/tag_changes?#{Keyword.merge(@pagination_params, added: 1)}") %> + <%= link("All", to: ~p"/profiles/#{@user}/tag_changes?#{Keyword.delete(@pagination_params, :added)}") %> + <% end %> +
+ <%= render(PhilomenaWeb.TagChangeView, "index.html", conn: @conn, tag_changes: @tag_changes, pagination: pagination) %> +
diff --git a/lib/philomena_web/templates/profile/tag_change/index.html.slime b/lib/philomena_web/templates/profile/tag_change/index.html.slime deleted file mode 100644 index f2a2f83f..00000000 --- a/lib/philomena_web/templates/profile/tag_change/index.html.slime +++ /dev/null @@ -1,19 +0,0 @@ -h1 - ' Tag changes by - a href=~p"/profiles/#{@user}" - = @user.name - -- route = fn p -> ~p"/profiles/#{@user}/tag_changes?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @tag_changes, route: route, conn: @conn, params: @pagination_params - -.block - .block__header - = form_for @conn, ~p"/profiles/#{@user}/tag_changes", [method: "get", enforce_utf8: false], fn f -> - = text_input f, :only_tag, class: "input", placeholder: "Tag", title: "Only show this tag", autocapitalize: "none" - = submit "Search", class: "button", title: "Search" - - = link "Removed", to: ~p"/profiles/#{@user}/tag_changes?#{Keyword.merge(@pagination_params, added: 0)}" - = link "Added", to: ~p"/profiles/#{@user}/tag_changes?#{Keyword.merge(@pagination_params, added: 1)}" - = link "All", to: ~p"/profiles/#{@user}/tag_changes?#{Keyword.delete(@pagination_params, :added)}" - - = render PhilomenaWeb.TagChangeView, "index.html", conn: @conn, tag_changes: @tag_changes, pagination: pagination diff --git a/lib/philomena_web/templates/registration/edit.html.heex b/lib/philomena_web/templates/registration/edit.html.heex new file mode 100644 index 00000000..bf1c0640 --- /dev/null +++ b/lib/philomena_web/templates/registration/edit.html.heex @@ -0,0 +1,94 @@ +

+ Account Settings +

+

+ Looking for your content settings? + + Click here! + +

+

+ Looking for two factor authentication? + <%= link("Click here!", to: ~p"/registrations/totp/edit") %> +

+

+ Looking to change your avatar? + <%= link("Click here!", to: ~p"/avatar/edit") %> +

+<%= if can?(@conn, :change_username, @current_user) do %> +

+ Looking to change your username? + <%= link("Click here!", to: ~p"/registrations/name/edit") %> +

+<% end %> +

+ API Key +

+

+ Your API key is +

+ + <%= link("Click to show", to: "#", data: [click_show: "#api-key", click_hide: "#api-key-button"]) %> + +
+ +

+ You can use this to allow API consumers to access your account. +

+

+

+ Avoid sharing this key with others, as it could be used to compromise + your account. +

+

+ Change email +

+<%= form_for @email_changeset, ~p"/registrations/email", [method: :post], fn f -> %> + <%= if @email_changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+ <%= email_input(f, :email, class: "input", placeholder: "Email", required: true, pattern: ~S/[^\s]+@[^\s]+\.[^\s]+/) %> + <%= error_tag(f, :email) %> +
+
+ <%= password_input(f, :current_password, class: "input", required: true, name: "current_password", placeholder: "Current password") %> + <%= error_tag(f, :current_password) %> +
+
+ <%= submit("Change email", class: "button") %> +
+<% end %> +

+ Change password +

+<%= form_for @password_changeset, ~p"/registrations/password", fn f -> %> + <%= if @password_changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+ <%= password_input(f, :password, class: "input", placeholder: "New password", minlength: 12) %> + <%= error_tag(f, :password) %> +
+
+ <%= password_input(f, :password_confirmation, class: "input", placeholder: "Confirm new password", minlength: 12) %> + <%= error_tag(f, :password_confirmation) %> +
+
+ <%= password_input(f, :current_password, name: "current_password", class: "input", placeholder: "Current password") %> + <%= error_tag(f, :current_password) %> +
+ <%= submit("Change password", class: "button") %> +<% end %> diff --git a/lib/philomena_web/templates/registration/edit.html.slime b/lib/philomena_web/templates/registration/edit.html.slime deleted file mode 100644 index a0134b6e..00000000 --- a/lib/philomena_web/templates/registration/edit.html.slime +++ /dev/null @@ -1,71 +0,0 @@ -h1 Account Settings - -p - ' Looking for your content settings? - a<> href="/settings/edit" Click here! - -p - ' Looking for two factor authentication? - = link "Click here!", to: ~p"/registrations/totp/edit" - -p - ' Looking to change your avatar? - = link "Click here!", to: ~p"/avatar/edit" - -= if can?(@conn, :change_username, @current_user) do - p - ' Looking to change your username? - = link "Click here!", to: ~p"/registrations/name/edit" - -h3 API Key -p - ' Your API key is - #api-key-button> - code> - = link("Click to show", to: "#", data: [click_show: "#api-key", click_hide: "#api-key-button"]) - #api-key.hidden> - code> - = @current_user.authentication_token - p You can use this to allow API consumers to access your account. -p - ' Avoid sharing this key with others, as it could be used to compromise - ' your account. - -h3 Change email - -= form_for @email_changeset, ~p"/registrations/email", [method: :post], fn f -> - = if @email_changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .field - = email_input f, :email, class: "input", placeholder: "Email", required: true, pattern: ~S/[^\s]+@[^\s]+\.[^\s]+/ - = error_tag f, :email - - .field - = password_input f, :current_password, class: "input", required: true, name: "current_password", placeholder: "Current password" - = error_tag f, :current_password - - div - = submit "Change email", class: "button" - -h3 Change password - -= form_for @password_changeset, ~p"/registrations/password", fn f -> - = if @password_changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .field - = password_input f, :password, class: "input", placeholder: "New password", minlength: 12 - = error_tag f, :password - - .field - = password_input f, :password_confirmation, class: "input", placeholder: "Confirm new password", minlength: 12 - = error_tag f, :password_confirmation - - .field - = password_input f, :current_password, name: "current_password", class: "input", placeholder: "Current password" - = error_tag f, :current_password - - = submit "Change password", class: "button" diff --git a/lib/philomena_web/templates/registration/name/edit.html.heex b/lib/philomena_web/templates/registration/name/edit.html.heex new file mode 100644 index 00000000..0c772be7 --- /dev/null +++ b/lib/philomena_web/templates/registration/name/edit.html.heex @@ -0,0 +1,25 @@ +

+ Editing Name +

+<%= form_for @changeset, ~p"/registrations/name", [as: :user], fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +

+ Enter your new name here. Usernames may only be changed once every 90 days. Please be aware that once you change your name, your previous name will be available for reuse, and someone else may claim it. +

+
+ <%= text_input(f, :name, class: "input", placeholder: "Name", required: true) %> + <%= error_tag(f, :name) %> +
+
+ <%= submit("Save", class: "button") %> +
+<% end %> +

+ <%= link("Back", to: ~p"/registrations/edit") %> +

diff --git a/lib/philomena_web/templates/registration/name/edit.html.slime b/lib/philomena_web/templates/registration/name/edit.html.slime deleted file mode 100644 index 1f9bce28..00000000 --- a/lib/philomena_web/templates/registration/name/edit.html.slime +++ /dev/null @@ -1,17 +0,0 @@ -h1 Editing Name - -= form_for @changeset, ~p"/registrations/name", [as: :user], fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - p Enter your new name here. Usernames may only be changed once every 90 days. Please be aware that once you change your name, your previous name will be available for reuse, and someone else may claim it. - - .field - = text_input f, :name, class: "input", placeholder: "Name", required: true - = error_tag f, :name - - .action - = submit "Save", class: "button" - -p = link "Back", to: ~p"/registrations/edit" diff --git a/lib/philomena_web/templates/registration/new.html.heex b/lib/philomena_web/templates/registration/new.html.heex new file mode 100644 index 00000000..01522f20 --- /dev/null +++ b/lib/philomena_web/templates/registration/new.html.heex @@ -0,0 +1,59 @@ +

+ Register +

+<%= form_for @changeset, ~p"/registrations", fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+ Non-anonymous posts permanently show your username as of posting time, + and may appear on search engines; choose wisely. +
+
+ <%= text_input(f, :name, class: "input", placeholder: "Username", required: true) %> + <%= error_tag(f, :name) %> +
+
+ You'll use your email address to log in, and we'll use this to get in + touch if we need to. Don't worry, we won't share this or spam you. +
+
+ <%= email_input(f, :email, class: "input", placeholder: "Email", required: true, pattern: ~S/[^\s]+@[^\s]+\.[^\s]+/) %> + <%= error_tag(f, :email) %> +
+
+ Pick a good strong password - longer is better! Minimum of 12 characters. +
+
+ <%= password_input(f, :password, class: "input", placeholder: "Password", required: true, minlength: 12) %> + <%= error_tag(f, :password) %> +
+
+ <%= password_input(f, :password_confirmation, class: "input", placeholder: "Confirm password", required: true, minlength: 12) %> + <%= error_tag(f, :password_confirmation) %> +
+ <%= render(PhilomenaWeb.CaptchaView, "_captcha.html", name: "registration", conn: @conn) %> +
+
+

+ We won't share your personal information, won't send you spam emails, + and take your security and privacy seriously. +

+

+ + Don't forget to read the + + site rules + + before you dive in - they contain a quick introduction on how to + use the site. + +

+
+
+ <%= submit("Sign Up", class: "button") %> +<% end %> diff --git a/lib/philomena_web/templates/registration/new.html.slime b/lib/philomena_web/templates/registration/new.html.slime deleted file mode 100644 index 82d8b8d5..00000000 --- a/lib/philomena_web/templates/registration/new.html.slime +++ /dev/null @@ -1,48 +0,0 @@ -h1 Register - -= form_for @changeset, ~p"/registrations", fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .fieldlabel - ' Non-anonymous posts permanently show your username as of posting time, - ' and may appear on search engines; choose wisely. - .field - = text_input f, :name, class: "input", placeholder: "Username", required: true - = error_tag f, :name - - .fieldlabel - ' You'll use your email address to log in, and we'll use this to get in - ' touch if we need to. Don't worry, we won't share this or spam you. - .field - = email_input f, :email, class: "input", placeholder: "Email", required: true, pattern: ~S/[^\s]+@[^\s]+\.[^\s]+/ - = error_tag f, :email - - .fieldlabel - ' Pick a good strong password - longer is better! Minimum of 12 characters. - .field - = password_input f, :password, class: "input", placeholder: "Password", required: true, minlength: 12 - = error_tag f, :password - .field - = password_input f, :password_confirmation, class: "input", placeholder: "Confirm password", required: true, minlength: 12 - = error_tag f, :password_confirmation - - = render PhilomenaWeb.CaptchaView, "_captcha.html", name: "registration", conn: @conn - - br - - .block.block--fixed.block--warning - p - ' We won't share your personal information, won't send you spam emails, - ' and take your security and privacy seriously. - p - strong - ' Don't forget to read the - a<> href="/pages/rules" site rules - ' before you dive in - they contain a quick introduction on how to - ' use the site. - - br - - = submit "Sign Up", class: "button" diff --git a/lib/philomena_web/templates/registration/totp/edit.html.heex b/lib/philomena_web/templates/registration/totp/edit.html.heex new file mode 100644 index 00000000..a63c9978 --- /dev/null +++ b/lib/philomena_web/templates/registration/totp/edit.html.heex @@ -0,0 +1,197 @@ +

+ Two Factor Authentication +

+<%= form_for @changeset, ~p"/registrations/totp", [as: :user], fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> + <%= if @current_user.otp_required_for_login do %> + <%= if !@changeset.action and get_flash(@conn, :totp_backup_codes) do %> +
+

+ Important - Save The Below Codes +

+

+ The backup codes shown in the green box below are necessary to + regain access to your account in the event of you losing access + to your authenticator app (such as loss, theft, or damage to your + phone). It is extremely important that you write them down and + store them in a safe, secure place. If you lose access to you + authenticator app and do not have one or more of the above codes, + we will be unable to help you regain access to your account. +

+
+
+
+

+ Two Factor Authentication Enabled +

+

+ You've successfully enabled two factor authentication on your + account. From now on you'll be asked for the 6 digit code each + time you log in. +

+

+ In case you lose your device or uninstall the application, you + will need one of the following backup codes to access to your + account: +

+ +
+

+ Make sure to write these down (preferably on paper) and store them + in a safe location, otherwise you may + + permanently lose access + + to your account. +

+
+ <% end %> +

+ Two factor authentication is currently + + enabled + + for your account. +

+

+ Enter the generated 6-digit code or one of your backup codes to disable. +

+

+ Note that the 6-digit codes are limited to a single use within their + lifespan of 30 seconds, so if you just logged in with a code, entering + it again here will cause an error. If that's the case, just wait for a + new code to be generated. +

+
+ <%= text_input(f, :twofactor_token, class: "input", placeholder: "6-digit code") %> + <%= error_tag(f, :twofactor_token) %> +
+ <% else %> +

+ Two factor authentication is currently + + disabled + + for your account. +

+
+
+

+ Enabling 2FA will make it harder for an attacker to get into your account, but it may also make it harder for + + you + + to get into your account. Make sure you'll have access to your authenticator if you enable it. +

+
+

+ Download application +

+

+ You will need an application on your phone that'll generate TOTP codes for you, such as: +

+

+

+ Pair application +

+

+ Using the application of your choice, scan the QR code below or enter the following secret key: + + <%= @totp_secret %> + +

+

+ + + + +

+

+ Confirm pairing +

+

+ Enter the code generated by your authenticator app into the field below for verification. +

+ <%= text_input(f, :twofactor_token, class: "input", placeholder: "6-digit code", autocomplete: "off") %> +

+ Note that the 6-digit codes are limited to a single use within their lifespan of 30 seconds, so if you use a code to enable the feature here, you won't be able to immediately use the same code to log in or to disable the feature. You have to wait for a new code to be generated. +

+
+

+ Warning - Authenticator Backup Codes +

+

+ Once you enable 2FA on your account, you will be provided with a list of backup codes that can be used to access your account in the event of you losing access to your authenticator app. You will only be provided with these codes once, so please ensure that you have a way to safely and securely record them before enabling 2FA on your account. If you lose access to your authenticator app and do not have your backup codes, you will be locked out of your account permanently, and we will be unable to assist you. +

+
+ <% end %> +
+
+
+ <%= password_input(f, :current_password, class: "input", placeholder: "Current password") %> + <%= error_tag(f, :current_password) %> +
+
+ We need your current password to confirm these changes +
+
+ <%= submit("Save Account", class: "button") %> +
+<% end %> +

+ <%= link("Back", to: ~p"/registrations/edit") %> +

diff --git a/lib/philomena_web/templates/registration/totp/edit.html.slime b/lib/philomena_web/templates/registration/totp/edit.html.slime deleted file mode 100644 index 8fd3028b..00000000 --- a/lib/philomena_web/templates/registration/totp/edit.html.slime +++ /dev/null @@ -1,136 +0,0 @@ -h1 Two Factor Authentication - -= form_for @changeset, ~p"/registrations/totp", [as: :user], fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - = if @current_user.otp_required_for_login do - = if !@changeset.action and get_flash(@conn, :totp_backup_codes) do - .dnp-warning - h4 Important - Save The Below Codes - p - ' The backup codes shown in the green box below are necessary to - ' regain access to your account in the event of you losing access - ' to your authenticator app (such as loss, theft, or damage to your - ' phone). It is extremely important that you write them down and - ' store them in a safe, secure place. If you lose access to you - ' authenticator app and do not have one or more of the above codes, - ' we will be unable to help you regain access to your account. - br - .block.block--fixed.block--success.layout--narrow - h2 Two Factor Authentication Enabled - p - ' You've successfully enabled two factor authentication on your - ' account. From now on you'll be asked for the 6 digit code each - ' time you log in. - p - ' In case you lose your device or uninstall the application, you - ' will need one of the following backup codes to access to your - ' account: - ul - = for code <- get_flash(@conn, :totp_backup_codes) do - li = code - br - p - ' Make sure to write these down (preferably on paper) and store them - ' in a safe location, otherwise you may - strong<> permanently lose access - ' to your account. - - p - ' Two factor authentication is currently - strong> enabled - ' for your account. - - h4 Enter the generated 6-digit code or one of your backup codes to disable. - p - ' Note that the 6-digit codes are limited to a single use within their - ' lifespan of 30 seconds, so if you just logged in with a code, entering - ' it again here will cause an error. If that's the case, just wait for a - ' new code to be generated. - - .field - = text_input f, :twofactor_token, class: "input", placeholder: "6-digit code" - = error_tag f, :twofactor_token - - - else - p - ' Two factor authentication is currently - strong> disabled - ' for your account. - - br - - .block.block--fixed.block--warning - p - | Enabling 2FA will make it harder for an attacker to get into your account, but it may also make it harder for - strong<> you - | to get into your account. Make sure you'll have access to your authenticator if you enable it. - h4 Download application - p - | You will need an application on your phone that'll generate TOTP codes for you, such as: - ul - li - | Authy ( - a href="https://play.google.com/store/apps/details?id=com.authy.authy" target="_blank" rel="noreferrer" - | Android - | / - a href="https://itunes.apple.com/us/app/authy/id494168017" target="_blank" rel="noreferrer" - | iOS - | ) - li - | LastPass Authenticator ( - a href="https://play.google.com/store/apps/details?id=com.lastpass.authenticator" target="_blank" rel="noreferrer" - | Android - | / - a href="https://itunes.apple.com/us/app/lastpass-authenticator/id1079110004" target="_blank" rel="noreferrer" - | iOS - | / - a href="https://www.microsoft.com/en-us/store/apps/lastpass-authenticator/9nblggh5l9d7" target="_blank" rel="noreferrer" - | Windows Mobile - | ) - li - | Microsoft Authenticator ( - a href="https://play.google.com/store/apps/details?id=com.azure.authenticator" target="_blank" rel="noreferrer" - | Android - | / - a href="https://itunes.apple.com/us/app/microsoft-authenticator/id983156458" target="_blank" rel="noreferrer" - | iOS - | / - a href="https://www.microsoft.com/en-us/store/p/microsoft-authenticator/9nblgggzmcj6" target="_blank" rel="noreferrer" - | Windows Mobile - | ) - - h4 Pair application - p - ' Using the application of your choice, scan the QR code below or enter the following secret key: - strong - = @totp_secret - p - svg xmlns="http://www.w3.org/2000/svg" width="392" height="392" - rect fill="#fff" width="392" height="392" - image xlink:href=@totp_qrcode alt="QR Code" x="32" y="32" - - h4 Confirm pairing - p Enter the code generated by your authenticator app into the field below for verification. - = text_input f, :twofactor_token, class: "input", placeholder: "6-digit code", autocomplete: "off" - p Note that the 6-digit codes are limited to a single use within their lifespan of 30 seconds, so if you use a code to enable the feature here, you won't be able to immediately use the same code to log in or to disable the feature. You have to wait for a new code to be generated. - .dnp-warning - h4 Warning - Authenticator Backup Codes - p Once you enable 2FA on your account, you will be provided with a list of backup codes that can be used to access your account in the event of you losing access to your authenticator app. You will only be provided with these codes once, so please ensure that you have a way to safely and securely record them before enabling 2FA on your account. If you lose access to your authenticator app and do not have your backup codes, you will be locked out of your account permanently, and we will be unable to assist you. - - br - - .block.block--fixed.block--warning - .field - = password_input f, :current_password, class: "input", placeholder: "Current password" - = error_tag f, :current_password - .fieldlabel - ' We need your current password to confirm these changes - - br - - = submit "Save Account", class: "button" - -p = link "Back", to: ~p"/registrations/edit" diff --git a/lib/philomena_web/templates/report/index.html.heex b/lib/philomena_web/templates/report/index.html.heex new file mode 100644 index 00000000..50cd2142 --- /dev/null +++ b/lib/philomena_web/templates/report/index.html.heex @@ -0,0 +1,50 @@ +

+ Your Reports +

+
+
+ + Reports + + <% route = fn p -> ~p"/reports?#{p}" end %> + <%= render(PhilomenaWeb.PaginationView, "_pagination.html", page: @reports, route: route, conn: @conn) %> +
+
+ + + + + + + + + + + <%= for r <- @reports do %> + + + + + + + <% end %> + +
+ State + + Reported Thing + + Reason + + Opened +
+ <%= pretty_state(r) %> + + <%= link_to_reported_thing(r.reportable) %> + + <%= r.reason %> + + <%= pretty_time(r.created_at) %> +
+
+
diff --git a/lib/philomena_web/templates/report/index.html.slime b/lib/philomena_web/templates/report/index.html.slime deleted file mode 100644 index 2d7d6563..00000000 --- a/lib/philomena_web/templates/report/index.html.slime +++ /dev/null @@ -1,23 +0,0 @@ -h1 Your Reports -.block - .block__header - span.block__header__title Reports - - route = fn p -> ~p"/reports?#{p}" end - = render PhilomenaWeb.PaginationView, "_pagination.html", page: @reports, route: route, conn: @conn - - .block__content - table.table - thead - tr - th State - th Reported Thing - th Reason - th Opened - tbody - = for r <- @reports do - tr - td class=report_row_class(r) - = pretty_state(r) - td = link_to_reported_thing(r.reportable) - td = r.reason - td = pretty_time(r.created_at) diff --git a/lib/philomena_web/templates/report/new.html.heex b/lib/philomena_web/templates/report/new.html.heex new file mode 100644 index 00000000..2850d671 --- /dev/null +++ b/lib/philomena_web/templates/report/new.html.heex @@ -0,0 +1,82 @@ +

+ Submit a report +

+

+ + <%= link_to_reported_thing(@reportable) %> + +

+
+
+

+ Reporting Tips +

+ +

+ You may only open up to + + 3 reports + + at a time. Please be mindful of what you report. +

+
+
+ <%= if image?(@changeset) do %> +
+

+ Takedown Policy +

+

+ + Only an owner of an image's rights (normally the artist) can request a takedown. + + If you're the artist, you'll + + need + + a verified artist link. +

+

+ For more information, please read the + <%= link("takedown policy", to: "/pages/takedowns") %> + . +

+
+
+ <% end %> + <%= if conversation?(@changeset) do %> +
+

+ Privacy note +

+

+ The whole conversation will be readable by site staff. +

+
+
+ <% end %> + <%= form_for @changeset, @action, fn f -> %> +
+ <%= select(f, :category, report_categories(), class: "input") %> +
+
+ <%= render(PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, placeholder: "Provide anything else we should know here.", name: :reason, required: false) %> +
+ <%= render(PhilomenaWeb.CaptchaView, "_captcha.html", name: "report", conn: @conn) %> + <%= submit("Send Report", class: "button") %> + <% end %> +
diff --git a/lib/philomena_web/templates/report/new.html.slime b/lib/philomena_web/templates/report/new.html.slime deleted file mode 100644 index f7839783..00000000 --- a/lib/philomena_web/templates/report/new.html.slime +++ /dev/null @@ -1,52 +0,0 @@ -h2 Submit a report -p - strong - = link_to_reported_thing(@reportable) - -.image-other - .dnp-warning - h3 Reporting Tips - ul - li - ' Make sure to report for the correct - = link "rule", to: "/pages/rules" - ' . - li One report per problem. If it involves multiple things (images, comments, etc), list all of their IDs in the description of a single report. - li - strong Do not report someone just because they disagree with you. Abusing the report system is a bannable offense. - p - ' You may only open up to - strong> 3 reports - ' at a time. Please be mindful of what you report. - br - - = if image?(@changeset) do - .dnp-warning - h3 Takedown Policy - p - strong> Only an owner of an image's rights (normally the artist) can request a takedown. - ' If you're the artist, you'll - strong> need - ' a verified artist link. - p - ' For more information, please read the - = link "takedown policy", to: "/pages/takedowns" - ' . - br - - = if conversation?(@changeset) do - .dnp-warning - h3 Privacy note - p - ' The whole conversation will be readable by site staff. - br - - = form_for @changeset, @action, fn f -> - .field - = select f, :category, report_categories(), class: "input" - .block - = render PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, placeholder: "Provide anything else we should know here.", name: :reason, required: false - - = render PhilomenaWeb.CaptchaView, "_captcha.html", name: "report", conn: @conn - - = submit "Send Report", class: "button" diff --git a/lib/philomena_web/templates/search/_form.html.heex b/lib/philomena_web/templates/search/_form.html.heex new file mode 100644 index 00000000..edccf4ac --- /dev/null +++ b/lib/philomena_web/templates/search/_form.html.heex @@ -0,0 +1,273 @@ +

+ Search +

+<%= form_for :search, ~p"/search", [id: "searchform", method: "get", class: "js-search-form", enforce_utf8: false], fn f -> %> + <%= text_input(f, :q, class: "input input--wide js-search-field", placeholder: "Search terms are chained with commas", autocapitalize: "none", name: "q", value: @conn.params["q"]) %> +
+
+ + NOT + + + <%= if @conn.assigns.current_user do %> + + <% end %> + +
+
+ + + + +
+
+ +
+ <%= submit("Search", class: "button button--state-primary") %> + <% # = submit_tag "I'm Feeling Poni", class: 'button button--separate-left spacing-right', name: 'random_image' %> + <% + random_is_selected = to_string(@conn.params["sf"]) =~ ~r/\Arandom(:\d+)?\z/ + + random_seed = + if random_is_selected do + @conn.params["sf"] + else + "random:#{:rand.uniform(4_294_967_296)}" + end + + sort_fields = [ + "Sort by initial post date": :first_seen_at, + "Sort by image ID": :id, + "Sort by last modification date": :updated_at, + "Sort by aspect ratio": :aspect_ratio, + "Sort by fave count": :faves, + "Sort by upvotes": :upvotes, + "Sort by downvotes": :downvotes, + "Sort by score": :score, + "Sort by Wilson score": :wilson_score, + "Sort by relevance": :_score, + "Sort by width": :width, + "Sort by height": :height, + "Sort by comments": :comment_count, + "Sort by tag count": :tag_count, + "Sort by pixels": :pixels, + "Sort by file size": :size, + "Sort by duration": :duration, + Random!: random_seed + ] + + sort_directions = [Descending: :desc, Ascending: :asc] + sort_hidden = ["Exclude Deleted": "", "Include Deleted/Merged": "1", "Deleted Only": "deleted", "Deleted/Merged Only": "only"] + %> + <%= select(f, :sf, sort_fields, class: "input input--separate-left", name: "sf", autocomplete: "off", selected: @conn.params["sf"]) %> + <%= select(f, :sd, sort_directions, class: "input input--separate-left", name: "sd", autocomplete: "off", selected: @conn.params["sd"]) %> + <%= if present?(@conn.params["hidden"]) do %> + <%= hidden_input(f, :hidden, name: "hidden", value: @conn.params["hidden"]) %> + <% end %> + <%= if hides_images?(@conn) do %> + <%= select(f, :del, sort_hidden, class: "input input--separate-left", name: "del", autocomplete: "off", selected: @conn.params["del"]) %> + <% end %> +
+<% end %> diff --git a/lib/philomena_web/templates/search/_form.html.slime b/lib/philomena_web/templates/search/_form.html.slime deleted file mode 100644 index efc065af..00000000 --- a/lib/philomena_web/templates/search/_form.html.slime +++ /dev/null @@ -1,176 +0,0 @@ -h1 Search - -= form_for :search, ~p"/search", [id: "searchform", method: "get", class: "js-search-form", enforce_utf8: false], fn f -> - = text_input f, :q, class: "input input--wide js-search-field", placeholder: "Search terms are chained with commas", autocapitalize: "none", name: "q", value: @conn.params["q"] - - .block - .block__header.flex - a data-search-prepend="-" NOT - .dropdown.block__header__dropdown-tab - a - ' Search terms - span data-click-preventdefault="true" - i.fa.fa-caret-down< - .dropdown__content - a data-search-add="score.gte:100" data-search-select-last="3" data-search-show-help="numeric" Score - a data-search-add="created_at.lte:3 years ago" data-search-select-last="11" data-search-show-help="date" Created at - a data-search-add="id.lte:10" data-search-select-last="2" data-search-show-help="numeric" Numeric ID - a data-search-add="faves.gte:100" data-search-select-last="3" data-search-show-help="numeric" Number of faves - a data-search-add="upvotes.gte:100" data-search-select-last="3" data-search-show-help="numeric" Number of upvotes - a data-search-add="downvotes.gte:100" data-search-select-last="3" data-search-show-help="numeric" Number of downvotes - a data-search-add="comment_count.gt:20" data-search-select-last="2" data-search-show-help="numeric" Number of comments - a data-search-add="uploader:k_a" data-search-select-last="3" data-search-show-help="literal" Uploader - a data-search-add="original_format:gif" data-search-select-last="3" data-search-show-help="literal" File extension - a data-search-add="file_name:tumblr_*" data-search-select-last="8" data-search-show-help="literal" Original file name - a data-search-add="mime_type:image/jpeg" data-search-select-last="10" data-search-show-help="literal" MIME type - a data-search-add="source_url:*deviantart.com*" data-search-select-last="16" data-search-show-help="literal" Image source URL - a data-search-add="width:1920" data-search-select-last="4" data-search-show-help="numeric" Image width - a data-search-add="height:1080" data-search-select-last="4" data-search-show-help="numeric" Image height - a data-search-add="aspect_ratio:1" data-search-select-last="1" data-search-show-help="numeric" Aspect ratio - a data-search-add="animated:false" data-search-select-last="5" data-search-show-help="boolean" Animated - a data-search-add="duration:10" data-search-select-last="2" data-search-show-help="numeric" Duration (seconds) - a data-search-add="pixels.gte:5000000" data-search-select-last="7" data-search-show-help="numeric" Pixels - a data-search-add="size.lt:1048576" data-search-select-last="7" data-search-show-help="numeric" File size (bytes) - - = if @conn.assigns.current_user do - .dropdown.block__header__dropdown-tab - a - ' Belonging to… - span data-click-preventdefault="true" - i.fa.fa-caret-down< - .dropdown__content - a data-search-add="my:faves" data-search-show-help=" " My favorites - a data-search-add="my:upvotes" data-search-show-help=" " My upvotes - a data-search-add="my:uploads" data-search-show-help=" " My uploads - a data-search-add="my:watched" data-search-show-help=" " My watched tags - .flex__right - a href="#" data-click-toggle="#js-search-tags" Quick tags - a href="/pages/search_syntax" Help - - .block__content - .hidden.walloftext data-search-help="boolean" - strong.js-search-help-subject> - ' is a Boolean-valued field. It only accepts the values - code> true - ' and - code false - |. - br - br - em<> Example: - ' to find images which are not animated, you would use - code animated:false - | . - - .hidden.walloftext data-search-help="numeric" - strong.js-search-help-subject> - | is a numerical range field. Four qualifiers, - code<> gte - | (greater than or equal), - code<> lte - | (less than or equal), - code<> gt - | (greater than), and - code<> lt - | (less than), can be applied to the desired value. - br - br - em<> Example: - | to find images with a score greater than 100, you would use - code<> score.gt:100 - | . - - .hidden.walloftext data-search-help="date" - strong.js-search-help-subject> - ' is a date/time field. It accepts a - a href="/pages/search_syntax#date-range" tweaked subset of the ISO 8601 standard - | , as well as relative dates - code< - | (X minutes/hours/days/months/years ago) - | . Four qualifiers, - code<> gte - | (greater than or equal), - code<> lte - | (less than or equal), - code<> gt - | (greater than), and - code<> lt - | (less than), can be applied to the desired value. - br - br - em<> Example: - | to find images created before 2013, you would use - code<> created_at.lt:2013 - | . - - .hidden.walloftext data-search-help="literal" - strong.js-search-help-subject> - ' is a literal field. You can apply apply a wildcard - code<> * - | as a substitute for zero or more characters. - br - br - em<> Example: - | to find images from DeviantArt, you would use - code<> source_url:*deviantart.com* - | . - - #js-search-tags.hidden - .block.js-tagtable data-target=".js-search-field" - = PhilomenaWeb.TagView.quick_tags(@conn) - - .field.field--inline.flex-wrap - = submit "Search", class: "button button--state-primary" - /= submit_tag "I'm Feeling Poni", class: 'button button--separate-left spacing-right', name: 'random_image' - - elixir: - random_is_selected = to_string(@conn.params["sf"]) =~ ~r/\Arandom(:\d+)?\z/ - - random_seed = - if random_is_selected do - @conn.params["sf"] - else - "random:#{:rand.uniform(4_294_967_296)}" - end - - sort_fields = [ - "Sort by initial post date": :first_seen_at, - "Sort by image ID": :id, - "Sort by last modification date": :updated_at, - "Sort by aspect ratio": :aspect_ratio, - "Sort by fave count": :faves, - "Sort by upvotes": :upvotes, - "Sort by downvotes": :downvotes, - "Sort by score": :score, - "Sort by Wilson score": :wilson_score, - "Sort by relevance": :_score, - "Sort by width": :width, - "Sort by height": :height, - "Sort by comments": :comment_count, - "Sort by tag count": :tag_count, - "Sort by pixels": :pixels, - "Sort by file size": :size, - "Sort by duration": :duration, - "Random!": random_seed - ] - - sort_directions = [ - "Descending": :desc, - "Ascending": :asc - ] - - sort_hidden = [ - "Exclude Deleted": "", - "Include Deleted/Merged": "1", - "Deleted Only": "deleted", - "Deleted/Merged Only": "only" - ] - - = select f, :sf, sort_fields, class: "input input--separate-left", name: "sf", autocomplete: "off", selected: @conn.params["sf"] - = select f, :sd, sort_directions, class: "input input--separate-left", name: "sd", autocomplete: "off", selected: @conn.params["sd"] - - = if present?(@conn.params["hidden"]) do - = hidden_input f, :hidden, name: "hidden", value: @conn.params["hidden"] - - = if hides_images?(@conn) do - = select f, :del, sort_hidden, class: "input input--separate-left", name: "del", autocomplete: "off", selected: @conn.params["del"] diff --git a/lib/philomena_web/templates/search/index.html.heex b/lib/philomena_web/templates/search/index.html.heex new file mode 100644 index 00000000..820d787a --- /dev/null +++ b/lib/philomena_web/templates/search/index.html.heex @@ -0,0 +1,18 @@ +<%= cond do %> + <% Enum.any?(@images) or override_display(@tags) -> %> + <%= render(PhilomenaWeb.ImageView, "index.html", conn: @conn, tags: @tags, images: @images, header: "Searching for #{@conn.params["q"]}", route: fn p -> ~p"/search?#{p}" end, scope: scope(@conn)) %> + <% assigns[:error] -> %> +
+ Oops, there was an error parsing your query! Check for mistakes like mismatched parentheses. The error was: +
+
+      <%= assigns[:error] %>
+    
+ <% blank?(@conn.params["q"]) -> %> + <% # Don't render anything. %> + <% true -> %> +

+ No images found! +

+<% end %> +<%= render(PhilomenaWeb.SearchView, "_form.html", conn: @conn) %> diff --git a/lib/philomena_web/templates/search/index.html.slime b/lib/philomena_web/templates/search/index.html.slime deleted file mode 100644 index 130d7dd4..00000000 --- a/lib/philomena_web/templates/search/index.html.slime +++ /dev/null @@ -1,17 +0,0 @@ -= cond do - - Enum.any?(@images) or override_display(@tags) -> - = render PhilomenaWeb.ImageView, "index.html", conn: @conn, tags: @tags, images: @images, header: "Searching for #{@conn.params["q"]}", route: fn p -> ~p"/search?#{p}" end, scope: scope(@conn) - - - assigns[:error] -> - .block.block--fixed.block--danger - ' Oops, there was an error parsing your query! Check for mistakes like mismatched parentheses. The error was: - pre = assigns[:error] - - - blank?(@conn.params["q"]) -> - / Don't render anything. - - - true -> - p - ' No images found! - -= render PhilomenaWeb.SearchView, "_form.html", conn: @conn diff --git a/lib/philomena_web/templates/search/reverse/index.html.heex b/lib/philomena_web/templates/search/reverse/index.html.heex new file mode 100644 index 00000000..6932c527 --- /dev/null +++ b/lib/philomena_web/templates/search/reverse/index.html.heex @@ -0,0 +1,98 @@ +

+ Reverse Search +

+<%= form_for :image, ~p"/search/reverse", [multipart: true], fn f -> %> +

+ Basic image similarity search. Finds uploaded images similar to the one + provided based on simple intensities and uses the median frame of + animations; very low contrast images (such as sketches) will produce + poor results and, regardless of contrast, results may include seemingly + random images that look very different. +

+
+
+

+ Upload a file from your computer, or provide a link to the page containing the image and click Fetch. +

+
+ <%= file_input(f, :image, class: "input js-scraper") %> +
+
+ <%= url_input(f, :url, name: "url", class: "input input--wide js-scraper", placeholder: "Link a deviantART page, a Tumblr post, or the image directly") %> + +
+ +
+

+ Optional settings +

+
+ <%= label(f, :distance, "Match distance (suggested values: between 0.2 and 0.5)") %> +
+ <%= number_input(f, :distance, value: 0.25, min: 0, max: 1, step: 0.01, class: "input") %> +
+
+ <%= submit("Reverse Search", class: "button") %> +
+<% end %> +<%= cond do %> + <% is_nil(@images) -> %> + <% Enum.any?(@images) -> %> +

+ Results +

+ + + + + + + <%= for match <- @images do %> + + + + + + <% end %> +
+   + + Image + +   +
+

+ <%= link("##{match.id}", to: ~p"/images/#{match}") %> +

+

+ <%= if image_has_sources(match) do %> + + <%= link("Source", to: image_first_source(match)) %> + + <% else %> + Unknown source + <% end %> +

+
+ <%= render(PhilomenaWeb.ImageView, "_image_container.html", image: match, size: :thumb, conn: @conn) %> + +

+ <%= match.image_width %> + x + <%= match.image_height %> + - + <%= round(match.image_size / 1024) %> + KiB +

+ <%= render(PhilomenaWeb.TagView, "_tag_list.html", tags: Tag.display_order(match.tags), conn: @conn) %> +
+ <% true -> %> +

+ Results +

+

+ We couldn't find any images matching this in our image database. +

+<% end %> diff --git a/lib/philomena_web/templates/search/reverse/index.html.slime b/lib/philomena_web/templates/search/reverse/index.html.slime deleted file mode 100644 index 876be913..00000000 --- a/lib/philomena_web/templates/search/reverse/index.html.slime +++ /dev/null @@ -1,74 +0,0 @@ -h1 Reverse Search - -= form_for :image, ~p"/search/reverse", [multipart: true], fn f -> - p - ' Basic image similarity search. Finds uploaded images similar to the one - ' provided based on simple intensities and uses the median frame of - ' animations; very low contrast images (such as sketches) will produce - ' poor results and, regardless of contrast, results may include seemingly - ' random images that look very different. - - .image-other - #js-image-upload-previews - p Upload a file from your computer, or provide a link to the page containing the image and click Fetch. - .field - = file_input f, :image, class: "input js-scraper" - - .field.field--inline - = url_input f, :url, name: "url", class: "input input--wide js-scraper", placeholder: "Link a deviantART page, a Tumblr post, or the image directly" - button.button.button--separate-left#js-scraper-preview(type="button" title="Fetch the image at the specified URL" data-disable-with="Fetch" disabled) - ' Fetch - - .field-error-js.hidden.js-scraper - - h4 Optional settings - - .field - = label f, :distance, "Match distance (suggested values: between 0.2 and 0.5)" - br - = number_input f, :distance, value: 0.25, min: 0, max: 1, step: 0.01, class: "input" - - .field - = submit "Reverse Search", class: "button" - -= cond do - - is_nil(@images) -> - - - Enum.any?(@images) -> - h2 Results - - table - tr - th   - th Image - th   - - = for match <- @images do - tr - th - h3 = link "##{match.id}", to: ~p"/images/#{match}" - p - = if image_has_sources(match) do - span.source_url - = link "Source", to: image_first_source(match) - - else - ' Unknown source - - th - = render PhilomenaWeb.ImageView, "_image_container.html", image: match, size: :thumb, conn: @conn - - th - h3 - = match.image_width - | x - => match.image_height - ' - - => round(match.image_size / 1024) - ' KiB - - = render PhilomenaWeb.TagView, "_tag_list.html", tags: Tag.display_order(match.tags), conn: @conn - - - true -> - h2 Results - p - ' We couldn't find any images matching this in our image database. diff --git a/lib/philomena_web/templates/session/new.html.heex b/lib/philomena_web/templates/session/new.html.heex new file mode 100644 index 00000000..4b00bb1f --- /dev/null +++ b/lib/philomena_web/templates/session/new.html.heex @@ -0,0 +1,45 @@ +

+ Sign in +

+<%= form_for @conn, ~p"/sessions", [as: :user], fn f -> %> + <%= if @error_message do %> +
+

+ <%= @error_message %> +

+
+

+ <%= link("Resend unlock instructions", to: ~p"/unlocks/new") %> +

+

+ <%= link("Resend confirmation email", to: ~p"/confirmations/new") %> +

+ <% end %> +

+ <%= link("Forgot your password?", to: ~p"/passwords/new") %> +

+
+ <%= email_input(f, :email, class: "input", required: true, placeholder: "Email", autofocus: true, pattern: ~S/[^\s]+@[^\s]+\.[^\s]+/) %> + <%= error_tag(f, :email) %> +
+
+ <%= password_input(f, :password, class: "input", required: true, placeholder: "Password") %> + <%= error_tag(f, :password) %> +
+
+ <%= checkbox(f, :remember_me) %> + <%= label(f, :remember_me, "Remember me") %> +
+
+ <%= submit("Sign in", class: "button") %> +
+<% end %> +

+ + Haven't read the + + site rules + + lately? Make sure you read them before posting or editing metadata! + +

diff --git a/lib/philomena_web/templates/session/new.html.slime b/lib/philomena_web/templates/session/new.html.slime deleted file mode 100644 index 3d856c2d..00000000 --- a/lib/philomena_web/templates/session/new.html.slime +++ /dev/null @@ -1,31 +0,0 @@ -h1 Sign in - -= form_for @conn, ~p"/sessions", [as: :user], fn f -> - = if @error_message do - .alert.alert-danger - p = @error_message - p = link "Resend unlock instructions", to: ~p"/unlocks/new" - p = link "Resend confirmation email", to: ~p"/confirmations/new" - - p = link "Forgot your password?", to: ~p"/passwords/new" - - .field - = email_input f, :email, class: "input", required: true, placeholder: "Email", autofocus: true, pattern: ~S/[^\s]+@[^\s]+\.[^\s]+/ - = error_tag f, :email - - .field - = password_input f, :password, class: "input", required: true, placeholder: "Password" - = error_tag f, :password - - .field - => checkbox f, :remember_me - = label f, :remember_me, "Remember me" - - .actions - = submit "Sign in", class: "button" - -p - strong - ' Haven't read the - a<> href="/pages/rules" site rules - ' lately? Make sure you read them before posting or editing metadata! diff --git a/lib/philomena_web/templates/session/totp/new.html.heex b/lib/philomena_web/templates/session/totp/new.html.heex new file mode 100644 index 00000000..98444f80 --- /dev/null +++ b/lib/philomena_web/templates/session/totp/new.html.heex @@ -0,0 +1,16 @@ +

+ Two Factor Authentication +

+<%= form_for @changeset, ~p"/sessions/totp", [as: :user, method: "post"], fn f -> %> +
+

+ Please enter your 2FA code +

+ <%= text_input(f, :twofactor_token, class: "input", placeholder: "6-digit code", required: true, autofocus: true, autocomplete: "off") %> +
+
+ <%= checkbox(f, :remember_me, class: "input", checked: true) %> + <%= label(f, :remember_me, "Remember this device") %> +
+ <%= submit("Sign in", class: "button") %> +<% end %> diff --git a/lib/philomena_web/templates/session/totp/new.html.slime b/lib/philomena_web/templates/session/totp/new.html.slime deleted file mode 100644 index 0a632f9f..00000000 --- a/lib/philomena_web/templates/session/totp/new.html.slime +++ /dev/null @@ -1,12 +0,0 @@ -h1 Two Factor Authentication - -= form_for @changeset, ~p"/sessions/totp", [as: :user, method: "post"], fn f -> - .field - h4 Please enter your 2FA code - = text_input f, :twofactor_token, class: "input", placeholder: "6-digit code", required: true, autofocus: true, autocomplete: "off" - - .field - => checkbox f, :remember_me, class: "input", checked: true - = label f, :remember_me, "Remember this device" - - = submit "Sign in", class: "button" diff --git a/lib/philomena_web/templates/setting/edit.html.heex b/lib/philomena_web/templates/setting/edit.html.heex new file mode 100644 index 00000000..4a561c04 --- /dev/null +++ b/lib/philomena_web/templates/setting/edit.html.heex @@ -0,0 +1,327 @@ +

+ Content Settings +

+<%= form_for @changeset, ~p"/settings", [method: "put"], fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+
+ <%= if @conn.assigns.current_user do %> + <%= link("Watch List", to: "#", class: "selected", data: [click_tab: "watched"]) %> + <%= link("Display", to: "#", data: [click_tab: "display"]) %> + <%= link("Comments", to: "#", data: [click_tab: "comments"]) %> + <%= link("Notifications", to: "#", data: [click_tab: "notifications"]) %> + <%= link("Metadata", to: "#", data: [click_tab: "metadata"]) %> + <%= link("Local", to: "#", data: [click_tab: "local"]) %> + <% else %> + <%= link("Local", to: "#", class: "selected", data: [click_tab: "local"]) %> + <%= link("More settings", to: "#", data: [click_tab: "join-the-herd"]) %> + <% end %> +
+ <%= if @conn.assigns.current_user do %> +
+

+ Tags +

+
+ <%= label(f, :watched_tag_list, "Tags to watch") %> + <%= render(PhilomenaWeb.TagView, "_tag_editor.html", f: f, name: :watched_tag_list, type: :edit, conn: @conn) %> + <%= error_tag(f, :watched_tag_list) %> +
+

+ Watchlist queries and filtering +

+

+ The following two areas are for search queries to control what other images show up in your watch list. Lines are ORed together. See + <%= link("the syntax guide", to: "/pages/search_syntax") %> + for how to write queries. +

+
+ <%= label(f, :watched_images_query_str, "Watch list search string (images found by this search are added to your watched images list)") %> + <%= textarea(f, :watched_images_query_str, class: "input input--wide", autocapitalize: "none") %> + <%= error_tag(f, :watched_images_query_str) %> +
+
+ <%= label(f, :watched_images_exclude_str, "Watch list filter string (any images found by this search are removed from your watched images list)") %> + <%= textarea(f, :watched_images_exclude_str, class: "input input--wide", autocapitalize: "none") %> + <%= error_tag(f, :watched_images_exclude_str) %> +
+
+ <%= checkbox(f, :no_spoilered_in_watched, class: "checkbox") %> + <%= label(f, :no_spoilered_in_watched, "Hide images spoilered by filter in watchlist") %> +
+

+ Other +

+

+ RSS feed link (for Newsblur, RSSOwl, Thunderbird, etc.): +
+

+ + <%= link("Click to show", to: "#", data: [click_show: "#rss-link", click_hide: "#rss-feed-button"]) %> + +
+ +
+ Do not share this URL with anyone, it may allow an attacker to compromise your account. +

+
+ + + + + <% end %> +
+
+ Settings on this tab are saved in the current browser. They are independent of your login. +
+
+ <%= label(f, :hidpi, "Serve HiDPI thumbnails") %> + <%= checkbox(f, :hidpi, checked: @conn.cookies["hidpi"] == "true") %> +
+ + Use high quality thumbnails on displays with a high pixel density. Requires more data than regular thumbnails. + +
+
+
+ <%= label(f, :serve_webm, "Serve WebM") %> + <%= checkbox(f, :serve_webm, checked: @conn.cookies["serve_webm"] == "true") %> +
+ + Serve WebM/MP4 versions of GIF images when available. Good for lower-bandwidth connections, but the video versions may have missing start/end frames, and do not support transparency. + +
+
+
+ <%= label(f, :webm, "Use video thumbnails") %> + <%= checkbox(f, :webm, checked: @conn.cookies["webm"] == "true") %> +
+ + Use video thumbnails for WebM videos. Does not apply to GIF images. + +
+
+
+ <%= label(f, :hide_uploader) %> + <%= checkbox(f, :hide_uploader, checked: @conn.cookies["hide_uploader"] == "true") %> +
+ + Hide the uploader and date posted information on image pages. + +
+
+
+ <%= label(f, :unfilter_tag_suggestions) %> + <%= checkbox(f, :unfilter_tag_suggestions, checked: @conn.cookies["unfilter_tag_suggestions"] == "true") %> +
+ + Don't attempt to filter tag suggestions using your current filter. + +
+
+
+ <%= label(f, :hide_score) %> + <%= checkbox(f, :hide_score, checked: @conn.cookies["hide_score"] == "true") %> +
+ + Hide score information for images. + +
+
+
+ <%= label(f, :chan_nsfw, "Show NSFW channels") %> + <%= checkbox(f, :chan_nsfw, checked: @conn.cookies["chan_nsfw"] == "true") %> +
+ + Show streams marked as NSFW on the channels page. + +
+
+ <%= if staff?(@conn.assigns.current_user) do %> +
+ <%= label(f, :hide_staff_tools) %> + <%= checkbox(f, :hide_staff_tools, checked: @conn.cookies["hide_staff_tools"] == "true") %> +
+ + Hide most of the staff tools (e.g. IPs, anon names) making your site appear as if you weren't staff, this is useful when browsing in public. + +
+
+ <% end %> +
+ <%= if !@conn.assigns.current_user do %> + + <% end %> +
+
+ <%= submit("Save My Settings", class: "button") %> +
+<% end %> diff --git a/lib/philomena_web/templates/setting/edit.html.slime b/lib/philomena_web/templates/setting/edit.html.slime deleted file mode 100644 index cff5dd42..00000000 --- a/lib/philomena_web/templates/setting/edit.html.slime +++ /dev/null @@ -1,189 +0,0 @@ -h1 Content Settings -= form_for @changeset, ~p"/settings", [method: "put"], fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - #js-setting-table.block - .block__header.block__header--js-tabbed - = if @conn.assigns.current_user do - = link "Watch List", to: "#", class: "selected", data: [click_tab: "watched"] - = link "Display", to: "#", data: [click_tab: "display"] - = link "Comments", to: "#", data: [click_tab: "comments"] - = link "Notifications", to: "#", data: [click_tab: "notifications"] - = link "Metadata", to: "#", data: [click_tab: "metadata"] - = link "Local", to: "#", data: [click_tab: "local"] - - else - = link "Local", to: "#", class: "selected", data: [click_tab: "local"] - = link "More settings", to: "#", data: [click_tab: "join-the-herd"] - - = if @conn.assigns.current_user do - .block__tab data-tab="watched" - h4 Tags - .field - = label f, :watched_tag_list, "Tags to watch" - = render PhilomenaWeb.TagView, "_tag_editor.html", f: f, name: :watched_tag_list, type: :edit, conn: @conn - = error_tag f, :watched_tag_list - - h4 Watchlist queries and filtering - p - ' The following two areas are for search queries to control what other images show up in your watch list. Lines are ORed together. See - => link "the syntax guide", to: "/pages/search_syntax" - ' for how to write queries. - - .field - = label f, :watched_images_query_str, "Watch list search string (images found by this search are added to your watched images list)" - = textarea f, :watched_images_query_str, class: "input input--wide", autocapitalize: "none" - = error_tag f, :watched_images_query_str - .field - = label f, :watched_images_exclude_str, "Watch list filter string (any images found by this search are removed from your watched images list)" - = textarea f, :watched_images_exclude_str, class: "input input--wide", autocapitalize: "none" - = error_tag f, :watched_images_exclude_str - .field - => checkbox f, :no_spoilered_in_watched, class: "checkbox" - => label f, :no_spoilered_in_watched, "Hide images spoilered by filter in watchlist" - - h4 Other - p - ' RSS feed link (for Newsblur, RSSOwl, Thunderbird, etc.): - br - #rss-feed-button> - code> - = link("Click to show", to: "#", data: [click_show: "#rss-link", click_hide: "#rss-feed-button"]) - #rss-link.hidden - = url_input f, :subscribe_url, value: url(~p"/api/v1/rss/watched?#{[key: @conn.assigns.current_user.authentication_token]}"), class: "input input--wide" - br - ' Do not share this URL with anyone, it may allow an attacker to compromise your account. - - .block__tab.hidden.flex.flex--maybe-wrap data-tab="display" - div - .field - => label f, :use_centered_layout - => checkbox f, :use_centered_layout, class: "checkbox" - .fieldlabel: i Align content to the center of the page - try this option out if you browse the site on a tablet or a fairly wide screen. - .field - => label f, :show_sidebar_and_watched_images - => checkbox f, :show_sidebar_and_watched_images, class: "checkbox" - .fieldlabel: i Show the sidebar and new watched images on the homepage (the default) or hide it. - .field - => label f, :hide_vote_counts - => checkbox f, :hide_vote_counts, class: "checkbox" - .fieldlabel: i Hide upvote and downvote counts on images, showing only the overall score - .field - => label f, :images_per_page - => number_input f, :images_per_page, min: 1, max: 50, step: 1, class: "input" - = error_tag f, :images_per_page - .fieldlabel - i - ' This is the number of images per page that are displayed on image listings and searches, up to a maximum of 50. - ' For 1080p monitors, try 24. - .field - => label f, :theme - => select f, :theme, theme_options(), class: "input" - = error_tag f, :theme - .fieldlabel: i Preview themes by selecting one from the dropdown. Saving sets the currently selected theme. - .field - => label f, :scale_large_images - => select f, :scale_large_images, scale_options(), class: "input" - = error_tag f, :scale_large_images - - .block__tab.hidden.flex.flex--maybe-wrap data-tab="comments" - div - .field - => label f, :comments_newest_first, "Newest comments first" - => checkbox f, :comments_newest_first - .fieldlabel: i Display the newest comments at the top of the page. - .field - => label f, :comments_always_jump_to_last, "Show latest comment page" - => checkbox f, :comments_always_jump_to_last - .fieldlabel - i - ' This setting takes effect when the previous is disabled. Always jump to the latest page (enabled) or show the first page if the oldest comments are shown at the top of the page. - br - ' Posting will always direct you to the latest page so that you can see your comment in context. - .field - => label f, :comments_per_page - => number_input f, :comments_per_page, min: 1, max: 100, step: 1, class: "input" - = error_tag f, :comments_per_page - .fieldlabel: i This is the number of comments per page that are displayed on image pages. - .field - => label f, :messages_newest_first, "Newest messages first" - => checkbox f, :messages_newest_first - .fieldlabel: i Show the newest messages first (enabled) or show the oldest messages at the top of a conversation. Enabling this makes it feel more like a top-posted email quote chain. - - .block__tab.hidden.flex.flex--maybe-wrap data-tab="notifications" - div - .field - => label f, :watch_on_reply, "Subscribe on Reply" - => checkbox f, :watch_on_reply, class: "checkbox" - .fieldlabel: i Subscribe on Reply means you'll be subscribed things (images or topics) automatically as soon as you post a comment or reply, keeping you in the conversation. - .field - => label f, :watch_on_upload, "Subscribe on Upload" - => checkbox f, :watch_on_upload, class: "checkbox" - .fieldlabel: i Subscribe on Upload means you'll be subscribed to images automatically as soon as you upload, to help you keep track of comments. - .field - => label f, :watch_on_new_topic, "Subscribe on New Threads" - => checkbox f, :watch_on_new_topic, class: "checkbox" - .fieldlabel: i Subscribe on New Threads means you'll be subscribed to threads automatically as soon as you post, to help you keep track of replies. - - .block__tab.hidden.flex.flex--maybe-wrap data-tab="metadata" - div - .field - => label f, :fancy_tag_field_on_upload, "Fancy tags - uploads" - => checkbox f, :fancy_tag_field_on_upload, class: "checkbox" - .field - => label f, :fancy_tag_field_on_edit, "Fancy tags - edits" - => checkbox f, :fancy_tag_field_on_edit, class: "checkbox" - .fieldlabel: i The fancy tag editor gives you autosuggestions and visual representations of the tags, but is sometimes not desired - for instance when dealing with batch uploads where you might want to copy-paste tags. You can choose which type of editor to use by default here. - .field - => label f, :anonymous_by_default - => checkbox f, :anonymous_by_default, class: "checkbox" - .fieldlabel: i Check this box to post images and comments as anonymous by default, even if logged in. - - .block__tab class=local_tab_class(@conn) data-tab="local" - .block.block--fixed.block--warning Settings on this tab are saved in the current browser. They are independent of your login. - .field - => label f, :hidpi, "Serve HiDPI thumbnails" - => checkbox f, :hidpi, checked: @conn.cookies["hidpi"] == "true" - .fieldlabel: i Use high quality thumbnails on displays with a high pixel density. Requires more data than regular thumbnails. - .field - => label f, :serve_webm, "Serve WebM" - => checkbox f, :serve_webm, checked: @conn.cookies["serve_webm"] == "true" - .fieldlabel: i Serve WebM/MP4 versions of GIF images when available. Good for lower-bandwidth connections, but the video versions may have missing start/end frames, and do not support transparency. - .field - => label f, :webm, "Use video thumbnails" - => checkbox f, :webm, checked: @conn.cookies["webm"] == "true" - .fieldlabel: i Use video thumbnails for WebM videos. Does not apply to GIF images. - .field - => label f, :hide_uploader - => checkbox f, :hide_uploader, checked: @conn.cookies["hide_uploader"] == "true" - .fieldlabel: i Hide the uploader and date posted information on image pages. - .field - => label f, :unfilter_tag_suggestions - => checkbox f, :unfilter_tag_suggestions, checked: @conn.cookies["unfilter_tag_suggestions"] == "true" - .fieldlabel: i Don't attempt to filter tag suggestions using your current filter. - .field - => label f, :hide_score - => checkbox f, :hide_score, checked: @conn.cookies["hide_score"] == "true" - .fieldlabel: i Hide score information for images. - .field - => label f, :chan_nsfw, "Show NSFW channels" - => checkbox f, :chan_nsfw, checked: @conn.cookies["chan_nsfw"] == "true" - .fieldlabel: i Show streams marked as NSFW on the channels page. - = if staff?(@conn.assigns.current_user) do - .field - => label f, :hide_staff_tools - => checkbox f, :hide_staff_tools, checked: @conn.cookies["hide_staff_tools"] == "true" - .fieldlabel: i Hide most of the staff tools (e.g. IPs, anon names) making your site appear as if you weren't staff, this is useful when browsing in public. - - = if !@conn.assigns.current_user do - .block__tab.hidden data-tab="join-the-herd" - p - ' Consider - => link "creating an account!", to: ~p"/registrations/new" - br - ' You will be able to customize the number of images and comments you get on a single page, as well as change the appearance of the site with custom themes. - - br - = submit "Save My Settings", class: "button" - br diff --git a/lib/philomena_web/templates/source_change/index.html.heex b/lib/philomena_web/templates/source_change/index.html.heex new file mode 100644 index 00000000..834c0926 --- /dev/null +++ b/lib/philomena_web/templates/source_change/index.html.heex @@ -0,0 +1,76 @@ +
+
+ <%= @pagination %> +
+
+ + + + + + + + + + + + <%= for source_change <- @source_changes do %> + + + + + <%= if source_change.added do %> + + <% else %> + + <% end %> + + + + <% end %> + +
+ Image + + Source + + Action + + Timestamp + + User +
+ <%= link(source_change.image_id, to: ~p"/images/#{source_change.image}") %> + + <%= render(PhilomenaWeb.ImageView, "_image_container.html", image: source_change.image, size: :thumb_tiny, conn: @conn) %> + + <%= source_change.source_url %> + + Added + + Removed + + <%= pretty_time(source_change.created_at) %> + + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: source_change, conn: @conn) %> + <%= if can?(@conn, :show, :ip_address) do %> + <%= link_to_ip(@conn, source_change.ip) %> + <%= link_to_fingerprint(@conn, source_change.fingerprint) %> + <% end %> + <%= if staff?(source_change) do %> +
+ + + Stop! + + This user is a staff member. +
+ Ask them before reverting their changes. +
+ <% end %> +
+
+
+ <%= @pagination %> +
+
diff --git a/lib/philomena_web/templates/source_change/index.html.slime b/lib/philomena_web/templates/source_change/index.html.slime deleted file mode 100644 index fe4b37b2..00000000 --- a/lib/philomena_web/templates/source_change/index.html.slime +++ /dev/null @@ -1,50 +0,0 @@ -.block - .block__header - = @pagination - - .block__content - table.table - thead - tr - th colspan=2 Image - th Source - th Action - th Timestamp - th User - - tbody - = for source_change <- @source_changes do - tr - td.center - = link source_change.image_id, to: ~p"/images/#{source_change.image}" - td.center - = render PhilomenaWeb.ImageView, "_image_container.html", image: source_change.image, size: :thumb_tiny, conn: @conn - - td - = source_change.source_url - - = if source_change.added do - td.success Added - - else - td.danger Removed - - td - = pretty_time(source_change.created_at) - - td class=user_column_class(source_change) - => render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: source_change, conn: @conn - - = if can?(@conn, :show, :ip_address) do - => link_to_ip @conn, source_change.ip - => link_to_fingerprint @conn,source_change.fingerprint - - = if staff?(source_change) do - br - small - strong> Stop! - ' This user is a staff member. - br - ' Ask them before reverting their changes. - - .block__header - = @pagination diff --git a/lib/philomena_web/templates/staff/index.html.heex b/lib/philomena_web/templates/staff/index.html.heex new file mode 100644 index 00000000..f3c33218 --- /dev/null +++ b/lib/philomena_web/templates/staff/index.html.heex @@ -0,0 +1,83 @@ +

+ Staff +

+
+

+ Do you wish to submit a report? +

+

+ + Do + + not + + + PM staff members with your reports. Instead, if you think something breaks + <%= link to: "/pages/rules" do %> + the rules + <% end %> + , use the "Report" button, which is included next to all user-created content on the site. This will ensure swift handling of your issue, since most staff members don't check their PMs nearly as vigilantly as the reports queue. +

+

+ Staff PMs are only for general questions or for getting help with using the site. +

+
+
+

+ Before contacting any of the staff members, you should try to ask your question in our + <%= link to: "/pages/discord" do %> + Discord + <% end %> + or + <%= link to: "/pages/irc" do %> + IRC channels. + <% end %> +

+

+ Keep in mind that all staff are unpaid volunteers who donate their time and effort into making sure this site remains organized and operational. Please do not harass them, and try to keep your PMs constructive. We will happily answer your questions, however receiving plenty of PMs for no reason gets tiring and impacts our ability to tend to more important matters, so please make sure you actually have a need to contact a staff member before doing so. +

+
+
+ <%= for {header, users} <- @categories do %> + <% header = to_string(header) %> + <%= if Enum.any?(users) do %> +
+ <%= header %> +
+

+ + <%= category_description(header) %> +

+
+ <%= for user <- users do %> +
+
+
+ +
+ <%= link to: ~p"/conversations/new?#{[recipient: user.name]}", class: "button" do %> + + Send PM + <% end %> +
+
+
+

+ <%= staff_description(user) %> +

+
+
+ <% end %> +
+ <% end %> + <% end %> +
diff --git a/lib/philomena_web/templates/staff/index.html.slime b/lib/philomena_web/templates/staff/index.html.slime deleted file mode 100644 index c8373b59..00000000 --- a/lib/philomena_web/templates/staff/index.html.slime +++ /dev/null @@ -1,49 +0,0 @@ -h1 Staff -.block.block--fixed.block--warning - h3 Do you wish to submit a report? - p - strong> - ' Do - em not - ' PM staff members with your reports. Instead, if you think something breaks - = link to: "/pages/rules" do - | the rules - ' , use the "Report" button, which is included next to all user-created content on the site. This will ensure swift handling of your issue, since most staff members don't check their PMs nearly as vigilantly as the reports queue. - p Staff PMs are only for general questions or for getting help with using the site. - -.block.block--fixed - p - ' Before contacting any of the staff members, you should try to ask your question in our - = link to: "/pages/discord" do - ' Discord - ' or - = link to: "/pages/irc" do - ' IRC channels. - p Keep in mind that all staff are unpaid volunteers who donate their time and effort into making sure this site remains organized and operational. Please do not harass them, and try to keep your PMs constructive. We will happily answer your questions, however receiving plenty of PMs for no reason gets tiring and impacts our ability to tend to more important matters, so please make sure you actually have a need to contact a staff member before doing so. - -.staff-block - = for {header, users} <- @categories do - - header = to_string(header) - - = if Enum.any?(users) do - div class="block block--fixed staff-block__category #{category_class(header)}" = header - p.staff-block__description - i.fa.fa-fw.fa-info-circle> - = category_description(header) - - .staff-block__grid - = for user <- users do - .block.flex.flex--column - .block__content.staff-block__user - .staff-block__user-card - .staff-block__avatar - a.profile-block href=~p"/profiles/#{user}" - = render PhilomenaWeb.UserAttributionView, "_user_avatar.html", object: %{user: user}, class: "avatar--125px" - p - b = user.name - .staff-block__info - = link to: ~p"/conversations/new?#{[recipient: user.name]}", class: "button" do - i.fa.fa-envelope> - ' Send PM - hr.staff-block__separator - p.staff-block__user-description = staff_description(user) diff --git a/lib/philomena_web/templates/stat/index.html.heex b/lib/philomena_web/templates/stat/index.html.heex new file mode 100644 index 00000000..9fb4edca --- /dev/null +++ b/lib/philomena_web/templates/stat/index.html.heex @@ -0,0 +1,163 @@ +<% + img_bucket = @image_aggs["aggregations"] + cmt_bucket = @comment_aggs["aggregations"] +%> +
+

+ Images +

+

+ There are + + <%= number_with_delimiter(img_bucket["non_deleted"]["doc_count"]) %> + + non-deleted images total in our database. Of these, + + <%= number_with_delimiter(img_bucket["non_deleted"]["last_24h"]["doc_count"]) %> + + images were uploaded in the last 24 hours. +

+

+ This net total excludes the + <%= number_with_delimiter(img_bucket["deleted"]["doc_count"]) %> + images that have been deleted or marked as duplicates. +

+

+ Comments +

+

+ There are + + <%= number_with_delimiter(@comment_aggs["hits"]["total"]["value"]) %> + + comments on the site. Of these, + <%= number_with_delimiter(cmt_bucket["deleted"]["doc_count"]) %> + have been deleted. +

+

+ In the last 24 hours, + + <%= number_with_delimiter(cmt_bucket["last_24h"]["doc_count"]) %> + + comments have been posted. +

+

+ There are, on average, + + <%= number_with_delimiter(trunc(img_bucket["non_deleted"]["avg_comments"]["value"] || 0)) %> + + comments on each image on the site. +

+

+ Votes +

+

+ Out of + <%= number_with_delimiter(img_bucket["non_deleted"]["doc_count"]) %> + images, + + <%= number_with_delimiter(img_bucket["non_deleted"]["score_gt_0"]["doc_count"]) %> + + images have a score above 0, and + + <%= number_with_delimiter(img_bucket["non_deleted"]["score_lt_0"]["doc_count"]) %> + + images have a score below 0. + + <%= number_with_delimiter(img_bucket["non_deleted"]["faves_gt_0"]["doc_count"]) %> + + images have been faved by at least one user. +

+

+ Forums +

+

+ In our + <%= @forums_count %> + forums there have been + + <%= number_with_delimiter(@topics_count) %> + + topics started. There have been + + <%= number_with_delimiter(@posts_count) %> + + replies to topics in total. +

+

+ Users +

+

+ There are + + <%= number_with_delimiter(@users_count) %> + + users on the site. Of these, + + <%= number_with_delimiter(@users_24h) %> + + have joined in the last 24 hours. +

+

+ Galleries +

+

+ There are + + <%= number_with_delimiter(@gallery_count) %> + + existing image galleries on the site, created by + + <%= number_with_delimiter(@distinct_creators) %> + + distinct creators. There are, on average, + + <%= number_with_delimiter(@gallery_size) %> + + images in each gallery. +

+

+ In total, images have been added to galleries + + <%= number_with_delimiter(@images_in_galleries) %> + + times. +

+

+ Commissions +

+

+ There are + + <%= number_with_delimiter(@open_commissions) %> + + open commission listings on the site, offering a total of + + <%= number_with_delimiter(@commission_items) %> + + items. +

+

+ Moderation +

+

+ We have received + + <%= number_with_delimiter(@report_stat_count) %> + + reports. Out of these reports, + <%= number_with_delimiter(@open_reports) %> + reports are outstanding and awaiting action. +

+

+ On the last 250 reports we've received, it's taken us on average + + <%= @response_time %> + + hour(s) between a report being made and the report being resolved. +

+

+ Upload History +

+ <%= upload_graph(img_bucket["non_deleted"]["all_time"]["buckets"]) %> +
diff --git a/lib/philomena_web/templates/stat/index.html.slime b/lib/philomena_web/templates/stat/index.html.slime deleted file mode 100644 index 944c4063..00000000 --- a/lib/philomena_web/templates/stat/index.html.slime +++ /dev/null @@ -1,119 +0,0 @@ -elixir: - img_bucket = @image_aggs["aggregations"] - cmt_bucket = @comment_aggs["aggregations"] - -.walloftext - h3 Images - p - ' There are - span.stat> - = number_with_delimiter(img_bucket["non_deleted"]["doc_count"]) - ' non-deleted images total in our database. Of these, - span.stat> - = number_with_delimiter(img_bucket["non_deleted"]["last_24h"]["doc_count"]) - ' images were uploaded in the last 24 hours. - p - ' This net total excludes the - => number_with_delimiter(img_bucket["deleted"]["doc_count"]) - ' images that have been deleted or marked as duplicates. - - h3 Comments - p - ' There are - span.stat> - = number_with_delimiter(@comment_aggs["hits"]["total"]["value"]) - ' comments on the site. Of these, - => number_with_delimiter(cmt_bucket["deleted"]["doc_count"]) - ' have been deleted. - p - ' In the last 24 hours, - span.stat> - = number_with_delimiter(cmt_bucket["last_24h"]["doc_count"]) - ' comments have been posted. - p - ' There are, on average, - span.stat> - = number_with_delimiter(trunc(img_bucket["non_deleted"]["avg_comments"]["value"] || 0)) - ' comments on each image on the site. - - h3 Votes - p - ' Out of - => number_with_delimiter(img_bucket["non_deleted"]["doc_count"]) - ' images, - span.stat> - = number_with_delimiter(img_bucket["non_deleted"]["score_gt_0"]["doc_count"]) - ' images have a score above 0, and - span.stat> - = number_with_delimiter(img_bucket["non_deleted"]["score_lt_0"]["doc_count"]) - ' images have a score below 0. - span.stat> - = number_with_delimiter(img_bucket["non_deleted"]["faves_gt_0"]["doc_count"]) - ' images have been faved by at least one user. - - h3 Forums - p - ' In our - => @forums_count - ' forums there have been - span.stat> - = number_with_delimiter(@topics_count) - ' topics started. There have been - span.stat> - = number_with_delimiter(@posts_count) - ' replies to topics in total. - - h3 Users - p - ' There are - span.stat> - = number_with_delimiter(@users_count) - ' users on the site. Of these, - span.stat> - = number_with_delimiter(@users_24h) - ' have joined in the last 24 hours. - - h3 Galleries - p - ' There are - span.stat> - = number_with_delimiter(@gallery_count) - ' existing image galleries on the site, created by - span.stat> - = number_with_delimiter(@distinct_creators) - ' distinct creators. There are, on average, - span.stat> - = number_with_delimiter(@gallery_size) - ' images in each gallery. - p - ' In total, images have been added to galleries - span.stat> - = number_with_delimiter(@images_in_galleries) - ' times. - - h3 Commissions - p - ' There are - span.stat> - = number_with_delimiter(@open_commissions) - ' open commission listings on the site, offering a total of - span.stat> - = number_with_delimiter(@commission_items) - ' items. - - h3 Moderation - p - ' We have received - span.stat> - = number_with_delimiter(@report_stat_count) - ' reports. Out of these reports, - => number_with_delimiter(@open_reports) - ' reports are outstanding and awaiting action. - p - ' On the last 250 reports we've received, it's taken us on average - span.stat> - = @response_time - ' hour(s) between a report being made and the report being resolved. - - h3 Upload History - = upload_graph(img_bucket["non_deleted"]["all_time"]["buckets"]) diff --git a/lib/philomena_web/templates/tag/_quick_tag_table.html.heex b/lib/philomena_web/templates/tag/_quick_tag_table.html.heex new file mode 100644 index 00000000..b94ba6ce --- /dev/null +++ b/lib/philomena_web/templates/tag/_quick_tag_table.html.heex @@ -0,0 +1,16 @@ +<% + tabs = Enum.with_index(@data["tabs"]) + tab_modes = @data["tab_modes"] +%> +
+ <%= for {name, i} <- tabs do %> + <%= link(name, to: "#", class: tab_class(i), data: [click_tab: name]) %> + <% end %> +
+<%= for {name, i} <- tabs do %> + <% tab_data = @data[name] %> + <% tab_mode = tab_modes[name] %> +
+ <%= render(PhilomenaWeb.TagView, "_quick_tag_table_#{tab_mode}.html", tab: name, data: tab_data, shipping: @shipping, tags: @tags, conn: @conn) %> +
+<% end %> diff --git a/lib/philomena_web/templates/tag/_quick_tag_table.html.slime b/lib/philomena_web/templates/tag/_quick_tag_table.html.slime deleted file mode 100644 index ec3688e1..00000000 --- a/lib/philomena_web/templates/tag/_quick_tag_table.html.slime +++ /dev/null @@ -1,14 +0,0 @@ -elixir: - tabs = Enum.with_index(@data["tabs"]) - tab_modes = @data["tab_modes"] - -.block__header--sub.block__header--js-tabbed - = for {name, i} <- tabs do - = link name, to: "#", class: tab_class(i), data: [click_tab: name] - -= for {name, i} <- tabs do - - tab_data = @data[name] - - tab_mode = tab_modes[name] - - .block__tab.quick-tag-table__tab class=tab_body_class(i) data-tab=name - = render PhilomenaWeb.TagView, "_quick_tag_table_#{tab_mode}.html", tab: name, data: tab_data, shipping: @shipping, tags: @tags, conn: @conn \ No newline at end of file diff --git a/lib/philomena_web/templates/tag/_quick_tag_table_default.html.heex b/lib/philomena_web/templates/tag/_quick_tag_table_default.html.heex new file mode 100644 index 00000000..07ed62dc --- /dev/null +++ b/lib/philomena_web/templates/tag/_quick_tag_table_default.html.heex @@ -0,0 +1,12 @@ +<%= for {heading, tag_names} <- @data do %> +
+ + <%= heading %> + +
+ <%= for tag_name <- tag_names do %> + <%= tag_link(@tags[tag_name], tag_name) %> +
+ <% end %> +
+<% end %> diff --git a/lib/philomena_web/templates/tag/_quick_tag_table_default.html.slime b/lib/philomena_web/templates/tag/_quick_tag_table_default.html.slime deleted file mode 100644 index 8dcac0c2..00000000 --- a/lib/philomena_web/templates/tag/_quick_tag_table_default.html.slime +++ /dev/null @@ -1,8 +0,0 @@ -= for {heading, tag_names} <- @data do - div - strong = heading - br - - = for tag_name <- tag_names do - = tag_link @tags[tag_name], tag_name - br \ No newline at end of file diff --git a/lib/philomena_web/templates/tag/_quick_tag_table_season.html.heex b/lib/philomena_web/templates/tag/_quick_tag_table_season.html.heex new file mode 100644 index 00000000..2f760734 --- /dev/null +++ b/lib/philomena_web/templates/tag/_quick_tag_table_season.html.heex @@ -0,0 +1,11 @@ +<%= for slice <- Enum.chunk_every(@data, 10) do %> +
+ <%= for map <- slice do %> + <% [header, tag_name] = Enum.to_list(map) %> + <%= header %> + . + <%= tag_link(@tags[tag_name], tag_name) %> +
+ <% end %> +
+<% end %> diff --git a/lib/philomena_web/templates/tag/_quick_tag_table_season.html.slime b/lib/philomena_web/templates/tag/_quick_tag_table_season.html.slime deleted file mode 100644 index 1f451a67..00000000 --- a/lib/philomena_web/templates/tag/_quick_tag_table_season.html.slime +++ /dev/null @@ -1,9 +0,0 @@ -= for slice <- Enum.chunk_every(@data, 10) do - div - = for map <- slice do - - [header, tag_name] = Enum.to_list(map) - - = header - ' . - = tag_link @tags[tag_name], tag_name - br diff --git a/lib/philomena_web/templates/tag/_quick_tag_table_shipping.html.heex b/lib/philomena_web/templates/tag/_quick_tag_table_shipping.html.heex new file mode 100644 index 00000000..ec20f9d2 --- /dev/null +++ b/lib/philomena_web/templates/tag/_quick_tag_table_shipping.html.heex @@ -0,0 +1,8 @@ +<%= for slice <- Enum.chunk_every(@shipping[@tab], 10) do %> +
+ <%= for tag <- slice do %> + <%= tag_link(tag, tag.name) %> +
+ <% end %> +
+<% end %> diff --git a/lib/philomena_web/templates/tag/_quick_tag_table_shipping.html.slime b/lib/philomena_web/templates/tag/_quick_tag_table_shipping.html.slime deleted file mode 100644 index 85cc34a2..00000000 --- a/lib/philomena_web/templates/tag/_quick_tag_table_shipping.html.slime +++ /dev/null @@ -1,5 +0,0 @@ -= for slice <- Enum.chunk_every(@shipping[@tab], 10) do - div - = for tag <- slice do - = tag_link tag, tag.name - br \ No newline at end of file diff --git a/lib/philomena_web/templates/tag/_quick_tag_table_shorthand.html.heex b/lib/philomena_web/templates/tag/_quick_tag_table_shorthand.html.heex new file mode 100644 index 00000000..238946e5 --- /dev/null +++ b/lib/philomena_web/templates/tag/_quick_tag_table_shorthand.html.heex @@ -0,0 +1,14 @@ +<%= for [heading, maps] <- @data do %> +
+ + <%= heading %> + +
+ <%= for [name, alias_name] <- maps do %> + <%= name %> + - + <%= tag_link(@tags[alias_name], alias_name) %> +
+ <% end %> +
+<% end %> diff --git a/lib/philomena_web/templates/tag/_quick_tag_table_shorthand.html.slime b/lib/philomena_web/templates/tag/_quick_tag_table_shorthand.html.slime deleted file mode 100644 index ad34a181..00000000 --- a/lib/philomena_web/templates/tag/_quick_tag_table_shorthand.html.slime +++ /dev/null @@ -1,10 +0,0 @@ -= for [heading, maps] <- @data do - div - strong = heading - br - - = for [name, alias_name] <- maps do - => name - ' - - = tag_link @tags[alias_name], alias_name - br diff --git a/lib/philomena_web/templates/tag/_tag.html.heex b/lib/philomena_web/templates/tag/_tag.html.heex new file mode 100644 index 00000000..38f9f46f --- /dev/null +++ b/lib/philomena_web/templates/tag/_tag.html.heex @@ -0,0 +1,49 @@ + + <% # The order of tag states and dropdown links is important for tags.js %> + + + + + + + <%= @tag.name %> + + + + + <%= @tag.images_count %> + + diff --git a/lib/philomena_web/templates/tag/_tag.html.slime b/lib/philomena_web/templates/tag/_tag.html.slime deleted file mode 100644 index 0de59b7e..00000000 --- a/lib/philomena_web/templates/tag/_tag.html.slime +++ /dev/null @@ -1,29 +0,0 @@ -span.tag.dropdown data-tag-category="#{@tag.category}" data-tag-id="#{@tag.id}" data-tag-name="#{@tag.name}" data-tag-slug="#{@tag.slug}" - / The order of tag states and dropdown links is important for tags.js - span - span.tag__state.hidden title="Unwatched" - | + - span.tag__state.hidden title="Watched" - | - - span.tag__state.hidden title="Spoilered" - | S - span.tag__state.hidden title="Hidden" - | H - - a.tag__name< href=pretty_tag_path(@tag) title="#{@tag.short_description}" = @tag.name - - div.dropdown__content - a.tag__dropdown__link.hidden data-method="delete" data-remote="true" data-tag-action="unwatch" href=~p"/tags/#{@tag}/watch" Unwatch - a.tag__dropdown__link.hidden data-method="post" data-remote="true" data-tag-action="watch" href=~p"/tags/#{@tag}/watch" Watch - - a.tag__dropdown__link.hidden data-method="delete" data-remote="true" data-tag-action="unspoiler" href=~p"/filters/spoiler?#{[tag: @tag]}" Unspoiler - a.tag__dropdown__link.hidden data-method="post" data-remote="true" data-tag-action="spoiler" href=~p"/filters/spoiler?#{[tag: @tag]}" Spoiler - - a.tag__dropdown__link.hidden data-method="delete" data-remote="true" data-tag-action="unhide" href=~p"/filters/hide?#{[tag: @tag]}" Unhide - a.tag__dropdown__link.hidden data-method="post" data-remote="true" data-tag-action="hide" href=~p"/filters/hide?#{[tag: @tag]}" Hide - - a.tag__dropdown__link.hidden href="/sessions/new" Sign in to Watch - a.tag__dropdown__link.hidden href="/filters" Filter - - span.tag__count - = @tag.images_count diff --git a/lib/philomena_web/templates/tag/_tag_editor.html.heex b/lib/philomena_web/templates/tag/_tag_editor.html.heex new file mode 100644 index 00000000..0ad4be8b --- /dev/null +++ b/lib/philomena_web/templates/tag/_tag_editor.html.heex @@ -0,0 +1,17 @@ +<% + textarea_options = [class: "input input--wide tagsinput js-image-tags-input js-taginput js-taginput-plain js-taginput-#{@name}", placeholder: "Add tags separated with commas", autocomplete: "off"] + html_options = Keyword.merge(textarea_options, assigns[:extra] || []) +%> +
+ <%= textarea(@f, @name, html_options) %> + +
+ + diff --git a/lib/philomena_web/templates/tag/_tag_editor.html.slime b/lib/philomena_web/templates/tag/_tag_editor.html.slime deleted file mode 100644 index 0bb692fe..00000000 --- a/lib/philomena_web/templates/tag/_tag_editor.html.slime +++ /dev/null @@ -1,17 +0,0 @@ -elixir: - textarea_options = [ - class: "input input--wide tagsinput js-image-tags-input js-taginput js-taginput-plain js-taginput-#{@name}", - placeholder: "Add tags separated with commas", - autocomplete: "off" - ] - html_options = Keyword.merge(textarea_options, assigns[:extra] || []) - -.js-tag-block class="fancy-tag-#{@type}" - = textarea @f, @name, html_options - .js-taginput.input.input--wide.tagsinput.hidden class="js-taginput-fancy" data-click-focus=".js-taginput-input.js-taginput-#{@name}" - input.input class="js-taginput-input js-taginput-#{@name}" id="taginput-fancy-#{@name}" type="text" placeholder="add a tag" autocomplete="off" autocapitalize="none" data-ac="true" data-ac-min-length="3" data-ac-source="/autocomplete/tags?term=" -button.button.button--state-primary.button--bold class="js-taginput-show" data-click-show=".js-taginput-fancy,.js-taginput-hide" data-click-hide=".js-taginput-plain,.js-taginput-show" data-click-focus=".js-taginput-input.js-taginput-#{@name}" - = hidden_input :fuck_ie, :fuck_ie, value: "fuck_ie" - ' Fancy Editor -button.hidden.button.button--state-primary.button--bold class="js-taginput-hide" data-click-show=".js-taginput-plain,.js-taginput-show" data-click-hide=".js-taginput-fancy,.js-taginput-hide" data-click-focus=".js-taginput-plain.js-taginput-#{@name}" - ' Plain Editor diff --git a/lib/philomena_web/templates/tag/_tag_info_row.html.heex b/lib/philomena_web/templates/tag/_tag_info_row.html.heex new file mode 100644 index 00000000..190f872f --- /dev/null +++ b/lib/philomena_web/templates/tag/_tag_info_row.html.heex @@ -0,0 +1,145 @@ +
+
+ <%= if @tag.image do %> + spoiler image + <% else %> + no spoiler image + <% end %> +
+
+ <%= render(PhilomenaWeb.TagView, "_tag.html", tag: @tag, conn: @conn) %> + <%= link("Tag changes", to: ~p"/tags/#{@tag}/tag_changes", class: "detail-link") %> + <%= if manages_tags?(@conn) do %> + <%= link("Edit details", to: ~p"/tags/#{@tag}/edit", class: "detail-link") %> + <%= link("Usage", to: ~p"/tags/#{@tag}/details", class: "detail-link") %> + <% end %> + <%= if manages_dnp?(@conn) do %> + <%= link("Create new DNP entry", to: ~p"/dnp/new?#{[tag_id: @tag.id]}", class: "detail-link") %> + <% end %> +
+ <%= if @tag.short_description not in [nil, ""] do %> + + Short description: + + <%= @tag.short_description %> +
+ <% end %> + <%= if manages_tags?(@conn) and present?(@tag.mod_notes) do %> + + Mod notes: + + <%= @tag.mod_notes %> +
+ <% end %> + <%= if Enum.any?(@tag.aliases) do %> + + Aliases: + + <%= if aliases_tags?(@conn) do %> + <%= map_join(@tag.aliases, ", ", &link(&1.name, to: ~p"/tags/#{&1}/alias/edit")) %> + <% else %> + <%= map_join(@tag.aliases, ", ", & &1.name) %> + <% end %> +
+ <% end %> + <%= if Enum.any?(@tag.implied_tags) do %> + + Implies: + + <%= map_join(@tag.implied_tags, ", ", &link(&1.name, to: ~p"/tags/#{&1}")) %> +
+ <% end %> + <%= if Enum.any?(@tag.hidden_links) and manages_links?(@conn) do %> + + Hidden links: + +
+ <%= for artist_link <- @tag.hidden_links do %> + <%= link(artist_link.user.name, to: ~p"/profiles/#{artist_link.user}") %> + → + <%= link(artist_link.uri, to: artist_link.uri) %> +
+ <% end %> + <% end %> + <%= if present?(@tag.public_links) or present?(@tag.channels) or present?(@tag.implied_by_tags) or present?(@tag.description) do %> +
+ <%= link("Toggle detailed information", to: "#", data: [click_toggle: ".tag-info__more"]) %> +
+
+ <%= if Enum.any?(@tag.public_links) do %> + + Associated links: + + <%= for link <- @tag.public_links do %> + + <%= link.uri %> + + <% end %> +
+ <% end %> + <%= if Enum.any?(@tag.public_links) do %> + + Associated users: + + <% users = Enum.map(@tag.public_links, & &1.user) |> Enum.uniq_by(& &1.id) %> + <%= for user <- users do %> + <%= link(user.name, to: ~p"/profiles/#{user}") %> + <% end %> +
+ <% end %> + <%= if Enum.any?(@tag.channels) do %> + + Associated streams: + + <%= for channel <- @tag.channels do %> + <%= link(channel.title, to: ~p"/channels/#{channel}") %> + <%= if can?(@conn, :edit, channel) do %> + ( + <%= link("Edit", to: ~p"/channels/#{channel}/edit") %> + ) + <% end %> + <% end %> +
+ <% end %> + <%= if Enum.any?(@tag.implied_by_tags) do %> + + +
+
+ <%= map_join @tag.implied_by_tags, ", ", fn tag -> %> + <%= link(tag.name, to: ~p"/tags/#{tag}") %> + <% end %> +
+
+
+ <% end %> + <%= if @tag.description not in [nil, ""] do %> + + Detailed description: + +
+ <%= @body %> + <% end %> +
+ <% end %> + <%= if Enum.any?(@dnp_entries) do %> +
+ + This artist is on the Do-Not-Post List with the following restrictions: + + <%= for {body, entry} <- @dnp_entries do %> +
+ • + + <%= entry.dnp_type %> + + <%= body %> + ( + <%= link("more info", to: ~p"/dnp/#{entry}") %> + ) + <% end %> + <% end %> +
+
diff --git a/lib/philomena_web/templates/tag/_tag_info_row.html.slime b/lib/philomena_web/templates/tag/_tag_info_row.html.slime deleted file mode 100644 index 2bd36b42..00000000 --- a/lib/philomena_web/templates/tag/_tag_info_row.html.slime +++ /dev/null @@ -1,121 +0,0 @@ -.block__content.js-imagelist-info.flex class=tags_row_class(@conn) - .flex__fixed.tag-info__image.thumb-tiny-container.spacing-right - = if @tag.image do - img src=tag_image(@tag) alt="spoiler image" - - else - | no spoiler image - - .flex__grow - = render PhilomenaWeb.TagView, "_tag.html", tag: @tag, conn: @conn - = link "Tag changes", to: ~p"/tags/#{@tag}/tag_changes", class: "detail-link" - = if manages_tags?(@conn) do - = link "Edit details", to: ~p"/tags/#{@tag}/edit", class: "detail-link" - = link "Usage", to: ~p"/tags/#{@tag}/details", class: "detail-link" - = if manages_dnp?(@conn) do - = link "Create new DNP entry", to: ~p"/dnp/new?#{[tag_id: @tag.id]}", class: "detail-link" - - br - - = if @tag.short_description not in [nil, ""] do - strong> Short description: - = @tag.short_description - br - - = if manages_tags?(@conn) and present?(@tag.mod_notes) do - strong.comment_deleted> Mod notes: - = @tag.mod_notes - br - - = if Enum.any?(@tag.aliases) do - strong> Aliases: - = if aliases_tags?(@conn) do - = map_join(@tag.aliases, ", ", &link(&1.name, to: ~p"/tags/#{&1}/alias/edit")) - - else - = map_join(@tag.aliases, ", ", & &1.name) - br - - = if Enum.any?(@tag.implied_tags) do - strong> Implies: - = map_join(@tag.implied_tags, ", ", &link(&1.name, to: ~p"/tags/#{&1}")) - br - - = if Enum.any?(@tag.hidden_links) and manages_links?(@conn) do - strong.comment_deleted> Hidden links: - br - - = for artist_link <- @tag.hidden_links do - => link artist_link.user.name, to: ~p"/profiles/#{artist_link.user}" - ' → - => link artist_link.uri, to: artist_link.uri - br - - - = if present?(@tag.public_links) or present?(@tag.channels) or present?(@tag.implied_by_tags) or present?(@tag.description) do - br - = link "Toggle detailed information", to: "#", data: [click_toggle: ".tag-info__more"] - - .tag-info__more - hr - - = if Enum.any?(@tag.public_links) do - strong> Associated links: - - = for link <- @tag.public_links do - a> href=link.uri = link.uri - - br - - = if Enum.any?(@tag.public_links) do - strong> Associated users: - - users = Enum.map(@tag.public_links, & &1.user) |> Enum.uniq_by(& &1.id) - - = for user <- users do - => link user.name, to: ~p"/profiles/#{user}" - - br - - = if Enum.any?(@tag.channels) do - strong> Associated streams: - = for channel <- @tag.channels do - => link channel.title, to: ~p"/channels/#{channel}" - - = if can?(@conn, :edit, channel) do - | ( - = link "Edit", to: ~p"/channels/#{channel}/edit" - ' ) - - br - - = if Enum.any?(@tag.implied_by_tags) do - input.toggle-box id="implied_by" type="checkbox" - label for="implied_by" - ' Implied by (warning: unfiltered) - - .toggle-box-container - .toggle-box-container__content - = map_join @tag.implied_by_tags, ", ", fn tag -> - = link tag.name, to: ~p"/tags/#{tag}" - - br - - = if @tag.description not in [nil, ""] do - strong> Detailed description: - br - = @body - - = if Enum.any?(@dnp_entries) do - hr - strong.comment_deleted This artist is on the Do-Not-Post List with the following restrictions: - - = for {body, entry} <- @dnp_entries do - br - ' • - - strong - => entry.dnp_type - - => body - - | ( - = link "more info", to: ~p"/dnp/#{entry}" - | ) diff --git a/lib/philomena_web/templates/tag/_tag_list.html.heex b/lib/philomena_web/templates/tag/_tag_list.html.heex new file mode 100644 index 00000000..52f7433c --- /dev/null +++ b/lib/philomena_web/templates/tag/_tag_list.html.heex @@ -0,0 +1,5 @@ +
+ <%= for tag <- @tags do %> + <%= render(PhilomenaWeb.TagView, "_tag.html", tag: tag, conn: @conn) %> + <% end %> +
diff --git a/lib/philomena_web/templates/tag/_tag_list.html.slime b/lib/philomena_web/templates/tag/_tag_list.html.slime deleted file mode 100644 index ea9562cc..00000000 --- a/lib/philomena_web/templates/tag/_tag_list.html.slime +++ /dev/null @@ -1,3 +0,0 @@ -.tag-list - = for tag <- @tags do - = render PhilomenaWeb.TagView, "_tag.html", tag: tag, conn: @conn \ No newline at end of file diff --git a/lib/philomena_web/templates/tag/_tags_row.html.heex b/lib/philomena_web/templates/tag/_tags_row.html.heex new file mode 100644 index 00000000..57bf91be --- /dev/null +++ b/lib/philomena_web/templates/tag/_tags_row.html.heex @@ -0,0 +1,5 @@ +
+
+ <%= render(PhilomenaWeb.TagView, "_tag_list.html", tags: @tags, conn: @conn) %> +
+
diff --git a/lib/philomena_web/templates/tag/_tags_row.html.slime b/lib/philomena_web/templates/tag/_tags_row.html.slime deleted file mode 100644 index 1d32520a..00000000 --- a/lib/philomena_web/templates/tag/_tags_row.html.slime +++ /dev/null @@ -1,3 +0,0 @@ -.block__content.js-imagelist-info.flex class=tags_row_class(@conn) - .flex__grow - = render PhilomenaWeb.TagView, "_tag_list.html", tags: @tags, conn: @conn \ No newline at end of file diff --git a/lib/philomena_web/templates/tag/alias/edit.html.heex b/lib/philomena_web/templates/tag/alias/edit.html.heex new file mode 100644 index 00000000..998983d2 --- /dev/null +++ b/lib/philomena_web/templates/tag/alias/edit.html.heex @@ -0,0 +1,26 @@ +

+ Aliasing tag + <%= @tag.name %> +

+<%= form_for @changeset, ~p"/tags/#{@tag}/alias", [method: "put"], fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+ <%= label(f, "Alias target:") %> + <%= text_input(f, :target_tag, value: alias_target(@tag), class: "input") %> + <%= error_tag(f, :tag) %> + <%= error_tag(f, :aliased_tag) %> +
+
+ <%= submit("Alias tag", class: "button") %> +
+<% end %> +
+<%= button_to("Remove tag alias", ~p"/tags/#{@tag}/alias", method: "delete", class: "button", data: [confirm: "Are you really, really sure?", disable_with: raw("Saving…")]) %> +
+<%= link("Back", to: ~p"/tags/#{@tag}") %> diff --git a/lib/philomena_web/templates/tag/alias/edit.html.slime b/lib/philomena_web/templates/tag/alias/edit.html.slime deleted file mode 100644 index 346aae09..00000000 --- a/lib/philomena_web/templates/tag/alias/edit.html.slime +++ /dev/null @@ -1,23 +0,0 @@ -h1 - ' Aliasing tag - = @tag.name - -= form_for @changeset, ~p"/tags/#{@tag}/alias", [method: "put"], fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .field - => label f, "Alias target:" - = text_input f, :target_tag, value: alias_target(@tag), class: "input" - = error_tag f, :tag - = error_tag f, :aliased_tag - - .field - => submit "Alias tag", class: "button" - -br -= button_to "Remove tag alias", ~p"/tags/#{@tag}/alias", method: "delete", class: "button", data: [confirm: "Are you really, really sure?", disable_with: raw("Saving…")] - -br -= link "Back", to: ~p"/tags/#{@tag}" diff --git a/lib/philomena_web/templates/tag/detail/_filters.html.heex b/lib/philomena_web/templates/tag/detail/_filters.html.heex new file mode 100644 index 00000000..bd361e0c --- /dev/null +++ b/lib/philomena_web/templates/tag/detail/_filters.html.heex @@ -0,0 +1,53 @@ + + + + + + + + + + + + <%= for filter <- @filters do %> + + + + + + + + <% end %> + +
+ Filter + + Type + + Owner + + Spoilers + + Hides +
+ <%= link(filter.name, to: ~p"/filters/#{filter}") %> + + <%= cond do %> + <% filter.system -> %> + System + <% filter.public -> %> + Public + <% true -> %> + Private + <% end %> + + <%= if filter.user do %> + <%= link(filter.user.name, to: ~p"/profiles/#{filter.user}") %> + <% else %> + No user associated + <% end %> + + <%= length(filter.spoilered_tag_ids) %> + + <%= length(filter.hidden_tag_ids) %> +
diff --git a/lib/philomena_web/templates/tag/detail/_filters.html.slime b/lib/philomena_web/templates/tag/detail/_filters.html.slime deleted file mode 100644 index 8dfdb621..00000000 --- a/lib/philomena_web/templates/tag/detail/_filters.html.slime +++ /dev/null @@ -1,31 +0,0 @@ -table.table - thead - tr - th Filter - th Type - th Owner - th Spoilers - th Hides - tbody - = for filter <- @filters do - tr - td = link filter.name, to: ~p"/filters/#{filter}" - td - = cond do - - filter.system -> - ' System - - - filter.public -> - ' Public - - - true -> - ' Private - - td - = if filter.user do - = link filter.user.name, to: ~p"/profiles/#{filter.user}" - - else - ' No user associated - - td = length(filter.spoilered_tag_ids) - td = length(filter.hidden_tag_ids) diff --git a/lib/philomena_web/templates/tag/detail/index.html.heex b/lib/philomena_web/templates/tag/detail/index.html.heex new file mode 100644 index 00000000..81e20b5c --- /dev/null +++ b/lib/philomena_web/templates/tag/detail/index.html.heex @@ -0,0 +1,20 @@ +

+ Tag Usage for + <%= link(@tag.name, to: ~p"/tags/#{@tag}") %> +

+

+ Filters that spoiler this tag: +

+<%= render(PhilomenaWeb.Tag.DetailView, "_filters.html", filters: @filters_spoilering, conn: @conn) %> +

+ Filters that hide this tag: +

+<%= render(PhilomenaWeb.Tag.DetailView, "_filters.html", filters: @filters_hiding, conn: @conn) %> +

+ Users that watch this tag ( + <%= length(@users_watching) %> + ) +

+<%= for u <- @users_watching do %> + <%= link(u.name, to: ~p"/profiles/#{u}", class: "interaction-user-list-item") %> +<% end %> diff --git a/lib/philomena_web/templates/tag/detail/index.html.slime b/lib/philomena_web/templates/tag/detail/index.html.slime deleted file mode 100644 index 5271cab2..00000000 --- a/lib/philomena_web/templates/tag/detail/index.html.slime +++ /dev/null @@ -1,17 +0,0 @@ -h1 - ' Tag Usage for - = link @tag.name, to: ~p"/tags/#{@tag}" - -h3 Filters that spoiler this tag: -= render PhilomenaWeb.Tag.DetailView, "_filters.html", filters: @filters_spoilering, conn: @conn - -h3 Filters that hide this tag: -= render PhilomenaWeb.Tag.DetailView, "_filters.html", filters: @filters_hiding, conn: @conn - -h3 - | Users that watch this tag ( - = length(@users_watching) - | ) - -= for u <- @users_watching do - = link u.name, to: ~p"/profiles/#{u}", class: "interaction-user-list-item" diff --git a/lib/philomena_web/templates/tag/edit.html.heex b/lib/philomena_web/templates/tag/edit.html.heex new file mode 100644 index 00000000..2e1d9b91 --- /dev/null +++ b/lib/philomena_web/templates/tag/edit.html.heex @@ -0,0 +1,86 @@ +

+ Editing Tag +

+

+ <%= link("Edit image", to: ~p"/tags/#{@tag}/image/edit") %> +

+<%= if can?(@conn, :alias, @tag) do %> +

+ <%= link("Edit aliases", to: ~p"/tags/#{@tag}/alias/edit") %> +

+<% end %> +<%= form_for @changeset, ~p"/tags/#{@tag}", [class: "form"], fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +

+ <%= @tag.name %> +

+
+ Category: + <%= select(f, :category, tag_categories(), class: "input") %> +
+

+ Description +

+
+ <%= label(f, :short_description, "Short description:") %> + <%= text_input(f, :short_description, class: "input input--wide") %> +
+
+ <%= label(f, :description, "Long description:") %> + <%= textarea(f, :description, class: "input input--wide") %> +
+
+ <%= label(f, :mod_notes, "Mod notes:") %> + <%= textarea(f, :mod_notes, class: "input input--wide") %> +
+

+ Implied Tags +

+
+ Tags in this list will be added when this tag is added to an image. +
+
+ <%= render(PhilomenaWeb.TagView, "_tag_editor.html", f: f, name: :implied_tag_list, type: :edit, conn: @conn) %> +
+
+ <%= submit("Save Tag", class: "button button--state-primary") %> +<% end %> +
+
+<%= if can?(@conn, :alias, @tag) do %> + + +
+
+ <%= button_to("Rebuild index", ~p"/tags/#{@tag}/reindex", method: "post", class: "button", data: [confirm: "Are you really, really sure?", disable_with: raw("Reindexing…")]) %> +

+ Use this if the tag displays the wrong number of images or returns the wrong search results. +

+ <%= button_to("Destroy tag", ~p"/tags/#{@tag}", method: "delete", class: "button button--state-danger", data: [confirm: "Are you really, really sure?", disable_with: raw("Deleting…")]) %> +

+ + Irreversible. Use with extreme caution! + +

+ +
+
+<% end %> diff --git a/lib/philomena_web/templates/tag/edit.html.slime b/lib/philomena_web/templates/tag/edit.html.slime deleted file mode 100644 index f5faedb7..00000000 --- a/lib/philomena_web/templates/tag/edit.html.slime +++ /dev/null @@ -1,56 +0,0 @@ -h1 Editing Tag - -p = link "Edit image", to: ~p"/tags/#{@tag}/image/edit" -= if can?(@conn, :alias, @tag) do - p = link "Edit aliases", to: ~p"/tags/#{@tag}/alias/edit" - -= form_for @changeset, ~p"/tags/#{@tag}", [class: "form"], fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - h2 - = @tag.name - - .field - ' Category: - = select f, :category, tag_categories(), class: "input" - - h4 Description - .field - => label f, :short_description, "Short description:" - = text_input f, :short_description, class: "input input--wide" - - .field - => label f, :description, "Long description:" - = textarea f, :description, class: "input input--wide" - - .field - => label f, :mod_notes, "Mod notes:" - = textarea f, :mod_notes, class: "input input--wide" - - h4 Implied Tags - .fieldlabel Tags in this list will be added when this tag is added to an image. - .field - = render PhilomenaWeb.TagView, "_tag_editor.html", f: f, name: :implied_tag_list, type: :edit, conn: @conn - - br - = submit "Save Tag", class: "button button--state-primary" - -br -br -= if can?(@conn, :alias, @tag) do - input.toggle-box#tag-management checked="false" type="checkbox" - label for="tag-management" Tag Processing - .toggle-box-container - .toggle-box-container__content - = button_to "Rebuild index", ~p"/tags/#{@tag}/reindex", method: "post", class: "button", data: [confirm: "Are you really, really sure?", disable_with: raw("Reindexing…")] - p Use this if the tag displays the wrong number of images or returns the wrong search results. - - = button_to "Destroy tag", ~p"/tags/#{@tag}", method: "delete", class: "button button--state-danger", data: [confirm: "Are you really, really sure?", disable_with: raw("Deleting…")] - p - strong Irreversible. Use with extreme caution! - ul - li Intended use is removing garbage tags. - li Will remove tag changes on the tag, but not on images or profiles. - li Will unset the alias if this tag is an alias target, and will automatically remove any implications that exist to it. diff --git a/lib/philomena_web/templates/tag/image/edit.html.heex b/lib/philomena_web/templates/tag/image/edit.html.heex new file mode 100644 index 00000000..4920d7f9 --- /dev/null +++ b/lib/philomena_web/templates/tag/image/edit.html.heex @@ -0,0 +1,53 @@ +
+
+
+ <%= if @tag.image do %> + spoiler image + <% else %> + no spoiler image + <% end %> +
+
+ +
diff --git a/lib/philomena_web/templates/tag/image/edit.html.slime b/lib/philomena_web/templates/tag/image/edit.html.slime deleted file mode 100644 index 778a9b87..00000000 --- a/lib/philomena_web/templates/tag/image/edit.html.slime +++ /dev/null @@ -1,41 +0,0 @@ - - -.profile-top - .profile-top__avatar - .tag-info__image.thumb-tiny-container - = if @tag.image do - img src=tag_image(@tag) alt="spoiler image" width=50 height=50 - - else - | no spoiler image - - .profile-top__name-and-links - div - h1 Tag image - - p Add a new image or remove the existing one here. - p SVG is preferred. - - = form_for @changeset, ~p"/tags/#{@tag}/image", [method: "put", multipart: true], fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - h4 Select an image - .image-other - #js-image-upload-previews - p Upload a file from your computer - .field - = file_input f, :image, class: "input js-scraper" - = error_tag f, :image_mime_type - - .field-error-js.hidden.js-scraper - - br - - => submit "Update tag image", class: "button" - - br - = button_to "Remove tag image", ~p"/tags/#{@tag}/image", method: "delete", class: "button", data: [confirm: "Are you really, really sure?"] - - br - = link "Back", to: ~p"/tags/#{@tag}" diff --git a/lib/philomena_web/templates/tag/index.html.heex b/lib/philomena_web/templates/tag/index.html.heex new file mode 100644 index 00000000..345dba5b --- /dev/null +++ b/lib/philomena_web/templates/tag/index.html.heex @@ -0,0 +1,349 @@ +

+ Tags +

+<%= form_for :tags, ~p"/tags", [method: "get", class: "hform", enforce_utf8: false], fn f -> %> +
+ <%= text_input(f, :tq, name: :tq, value: @conn.params["tq"] || "*", class: "input hform__text", placeholder: "Search tags", autocapitalize: "none") %> + <%= submit("Search", class: "hform__button button") %> +
+
+ For more information, see the + + search syntax documentation + + . Wildcards are supported in all literal fields. + Search results are sorted by image count, then by name alphabetically. +
+<% end %> +

+ Search Results +

+<%= cond do %> + <% Enum.any?(@tags) -> %> + <% route = fn p -> ~p"/tags?#{p}" end %> + <% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @tags, route: route, params: [tq: @conn.params["tq"] || "*"]) %> + <%= render(PhilomenaWeb.TagView, "_tag_list.html", tags: @tags, conn: @conn) %> +
+ +
+ <% assigns[:error] -> %> +
+ Oops, there was an error parsing your query! Check for mistakes like mismatched parentheses. The error was: +
+
+      <%= assigns[:error] %>
+    
+ <% true -> %> +

+ No tags found! +

+<% end %> +

+ Default search +

+

+ If you do not specify a field to search over, the search engine will + search for tags with a name that is equal to the query string. +

+

+ Allowed fields +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Field Selector + + Type + + Description + + Example +
+ + alias_of + + + Literal + + Matches the name of the target tag, if this tag is aliased. + + + <%= link("alias_of:twilight sparkle", to: ~p"/tags?#{[tq: "alias_of:twilight sparkle"]}") %> + +
+ + aliased + + + Boolean + + Matches when this tag is aliased. + + + <%= link("aliased:true", to: ~p"/tags?#{[tq: "aliased:true"]}") %> + +
+ + aliases + + + Literal + + Matches the name of any of this tag's aliases. + + + <%= link("aliases:ts", to: ~p"/tags?#{[tq: "aliases:ts"]}") %> + +
+ + analyzed_name + + + Full Text + + Matches the name of this tag. This is the default field. + + + <%= link("analyzed_name:wing", to: ~p"/tags?#{[tq: "analyzed_name:wing"]}") %> + +
+ + category + + + Literal + + Matches the category this tag belongs to. + + + <%= link("category:origin", to: ~p"/tags?#{[tq: "category:origin"]}") %> + +
+ + description + + + Full Text + + Matches the text of the full description for this tag. + + + <%= link("description:species", to: ~p"/tags?#{[tq: "description:species"]}") %> + +
+ + id + + + Numeric Range + + Matches the numeric surrogate key for this tag. + + + <%= link("id:40482", to: ~p"/tags?#{[tq: "id:40482"]}") %> + +
+ + images + + + Numeric Range + + Matches tags with the specified image count. + + + <%= link("images.lte:1000", to: ~p"/tags?#{[tq: "images.lte:1000"]}") %> + +
+ + implied_by + + + Literal + + Matches this tag if it is implied by the given tag. + + + <%= link("implied_by:transparent background", to: ~p"/tags?#{[tq: "implied_by:transparent background"]}") %> + +
+ + implies + + + Literal + + Matches this tag if it implies the given tag. + + + <%= link("implies:shipping", to: ~p"/tags?#{[tq: "implies:shipping"]}") %> + +
+ + name + + + Literal + + Matches the exact name of this tag. + + + <%= link("name:safe", to: ~p"/tags?#{[tq: "name:safe"]}") %> + +
+ + name_in_namespace + + + Literal + + Matches the name of this tag with any namespace component removed. + + + <%= link("name_in_namespace:johnjoseco", to: ~p"/tags?#{[tq: "name_in_namespace:johnjoseco"]}") %> + +
+ + namespace + + + Literal + + Matches tags with the given namespace. + + + <%= link("namespace:artist", to: ~p"/tags?#{[tq: "namespace:artist"]}") %> + +
+ + short_description + + + Full Text + + Matches the text of the short description for this tag. + + + <%= link("short_description:gender", to: ~p"/tags?#{[tq: "short_description:gender"]}") %> + +
+ + slug + + + Literal + + Matches the slug of this tag. + + + <%= link("slug:-fwslash-mlp-fwslash-", to: ~p"/tags?#{[tq: "slug:-fwslash-mlp-fwslash-"]}") %> + +
diff --git a/lib/philomena_web/templates/tag/index.html.slime b/lib/philomena_web/templates/tag/index.html.slime deleted file mode 100644 index 89931cea..00000000 --- a/lib/philomena_web/templates/tag/index.html.slime +++ /dev/null @@ -1,157 +0,0 @@ -h1 Tags - -= form_for :tags, ~p"/tags", [method: "get", class: "hform", enforce_utf8: false], fn f -> - .field - = text_input f, :tq, name: :tq, value: @conn.params["tq"] || "*", class: "input hform__text", placeholder: "Search tags", autocapitalize: "none" - = submit "Search", class: "hform__button button" - - .fieldlabel - ' For more information, see the - a href="/pages/search_syntax" search syntax documentation - ' . Wildcards are supported in all literal fields. - ' Search results are sorted by image count, then by name alphabetically. - -h2 Search Results - -= cond do - - Enum.any?(@tags) -> - - route = fn p -> ~p"/tags?#{p}" end - - pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @tags, route: route, params: [tq: @conn.params["tq"] || "*"] - - = render PhilomenaWeb.TagView, "_tag_list.html", tags: @tags, conn: @conn - - .block - .block__header.block__header--light.page__header - .page__pagination = pagination - .page__info - span.block__header__title - = render PhilomenaWeb.PaginationView, "_pagination_info.html", page: @tags - - - assigns[:error] -> - .block.block--fixed.block--danger - ' Oops, there was an error parsing your query! Check for mistakes like mismatched parentheses. The error was: - pre = assigns[:error] - - - true -> - p - ' No tags found! - -h3 Default search -p - ' If you do not specify a field to search over, the search engine will - ' search for tags with a name that is equal to the query string. - -h3 Allowed fields -table.table - thead - tr - th Field Selector - th Type - th Description - th Example - tbody - tr - td - code alias_of - td Literal - td Matches the name of the target tag, if this tag is aliased. - td - code = link "alias_of:twilight sparkle", to: ~p"/tags?#{[tq: "alias_of:twilight sparkle"]}" - tr - td - code aliased - td Boolean - td Matches when this tag is aliased. - td - code = link "aliased:true", to: ~p"/tags?#{[tq: "aliased:true"]}" - tr - td - code aliases - td Literal - td Matches the name of any of this tag's aliases. - td - code = link "aliases:ts", to: ~p"/tags?#{[tq: "aliases:ts"]}" - tr - td - code analyzed_name - td Full Text - td Matches the name of this tag. This is the default field. - td - code = link "analyzed_name:wing", to: ~p"/tags?#{[tq: "analyzed_name:wing"]}" - tr - td - code category - td Literal - td Matches the category this tag belongs to. - td - code = link "category:origin", to: ~p"/tags?#{[tq: "category:origin"]}" - tr - td - code description - td Full Text - td Matches the text of the full description for this tag. - td - code = link "description:species", to: ~p"/tags?#{[tq: "description:species"]}" - tr - td - code id - td Numeric Range - td Matches the numeric surrogate key for this tag. - td - code = link "id:40482", to: ~p"/tags?#{[tq: "id:40482"]}" - tr - td - code images - td Numeric Range - td Matches tags with the specified image count. - td - code = link "images.lte:1000", to: ~p"/tags?#{[tq: "images.lte:1000"]}" - tr - td - code implied_by - td Literal - td Matches this tag if it is implied by the given tag. - td - code = link "implied_by:transparent background", to: ~p"/tags?#{[tq: "implied_by:transparent background"]}" - tr - td - code implies - td Literal - td Matches this tag if it implies the given tag. - td - code = link "implies:shipping", to: ~p"/tags?#{[tq: "implies:shipping"]}" - tr - td - code name - td Literal - td Matches the exact name of this tag. - td - code = link "name:safe", to: ~p"/tags?#{[tq: "name:safe"]}" - tr - td - code name_in_namespace - td Literal - td Matches the name of this tag with any namespace component removed. - td - code = link "name_in_namespace:johnjoseco", to: ~p"/tags?#{[tq: "name_in_namespace:johnjoseco"]}" - tr - td - code namespace - td Literal - td Matches tags with the given namespace. - td - code = link "namespace:artist", to: ~p"/tags?#{[tq: "namespace:artist"]}" - tr - td - code short_description - td Full Text - td Matches the text of the short description for this tag. - td - code = link "short_description:gender", to: ~p"/tags?#{[tq: "short_description:gender"]}" - tr - td - code slug - td Literal - td Matches the slug of this tag. - td - code = link "slug:-fwslash-mlp-fwslash-", to: ~p"/tags?#{[tq: "slug:-fwslash-mlp-fwslash-"]}" diff --git a/lib/philomena_web/templates/tag/show.html.heex b/lib/philomena_web/templates/tag/show.html.heex new file mode 100644 index 00000000..a3f86f23 --- /dev/null +++ b/lib/philomena_web/templates/tag/show.html.heex @@ -0,0 +1,2 @@ +<%= render(PhilomenaWeb.ImageView, "index.html", conn: @conn, tags: @tags, images: @images, header: "Images tagged #{@tag.name}", scope: scope(@conn), route: fn p -> ~p"/tags/#{@tag}?#{p}" end) %> +<%= render(PhilomenaWeb.SearchView, "_form.html", conn: @conn) %> diff --git a/lib/philomena_web/templates/tag/show.html.slime b/lib/philomena_web/templates/tag/show.html.slime deleted file mode 100644 index ad85fbed..00000000 --- a/lib/philomena_web/templates/tag/show.html.slime +++ /dev/null @@ -1,3 +0,0 @@ -= render PhilomenaWeb.ImageView, "index.html", conn: @conn, tags: @tags, images: @images, header: "Images tagged #{@tag.name}", scope: scope(@conn), route: fn p -> ~p"/tags/#{@tag}?#{p}" end - -= render PhilomenaWeb.SearchView, "_form.html", conn: @conn diff --git a/lib/philomena_web/templates/tag/tag_change/index.html.heex b/lib/philomena_web/templates/tag/tag_change/index.html.heex new file mode 100644 index 00000000..8f21f7a5 --- /dev/null +++ b/lib/philomena_web/templates/tag/tag_change/index.html.heex @@ -0,0 +1,25 @@ +

+ Tag changes on tag + + <%= @tag.name %> + +

+<% route = fn p -> ~p"/tags/#{@tag}/tag_changes?#{p}" end %> +<% + params = + if @conn.params["added"] do + [added: @conn.params["added"]] + end +%> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @tag_changes, route: route, conn: @conn, params: params) %> +
+
+ + Display only: + + <%= link("Removed", to: ~p"/tags/#{@tag}/tag_changes?#{[added: 0]}") %> + <%= link("Added", to: ~p"/tags/#{@tag}/tag_changes?#{[added: 1]}") %> + <%= link("All", to: ~p"/tags/#{@tag}/tag_changes") %> +
+ <%= render(PhilomenaWeb.TagChangeView, "index.html", conn: @conn, tag_changes: @tag_changes, pagination: pagination) %> +
diff --git a/lib/philomena_web/templates/tag/tag_change/index.html.slime b/lib/philomena_web/templates/tag/tag_change/index.html.slime deleted file mode 100644 index a91d1ede..00000000 --- a/lib/philomena_web/templates/tag/tag_change/index.html.slime +++ /dev/null @@ -1,19 +0,0 @@ -h1 - ' Tag changes on tag - a href=~p"/tags/#{@tag}" - = @tag.name - -- route = fn p -> ~p"/tags/#{@tag}/tag_changes?#{p}" end -- params = if @conn.params["added"], do: [added: @conn.params["added"]] -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @tag_changes, route: route, conn: @conn, params: params - -.block - .block__header - span.block__header__title - | Display only: - - = link "Removed", to: ~p"/tags/#{@tag}/tag_changes?#{[added: 0]}" - = link "Added", to: ~p"/tags/#{@tag}/tag_changes?#{[added: 1]}" - = link "All", to: ~p"/tags/#{@tag}/tag_changes" - - = render PhilomenaWeb.TagChangeView, "index.html", conn: @conn, tag_changes: @tag_changes, pagination: pagination diff --git a/lib/philomena_web/templates/tag_change/index.html.heex b/lib/philomena_web/templates/tag_change/index.html.heex new file mode 100644 index 00000000..d4ef83a9 --- /dev/null +++ b/lib/philomena_web/templates/tag_change/index.html.heex @@ -0,0 +1,125 @@ +
+ <%= @pagination %> +
+<%= if reverts_tag_changes?(@conn) do %> +
+ + + Toggle all + +
+<% end %> +<%= form_for :tag_changes, ~p"/tag_changes/revert", [class: "tag-changes-form"], fn _f -> %> +
+ + + + <%= if reverts_tag_changes?(@conn) do %> + + <% end %> + + + + + + + <%= if reverts_tag_changes?(@conn) do %> + + <% end %> + + + + <%= for tag_change <- @tag_changes do %> + + <%= if reverts_tag_changes?(@conn) do %> + + <% end %> + + + + <%= if tag_change.added do %> + + <% else %> + + <% end %> + + + <%= if tag_change_retained(tag_change) do %> + + <% else %> + + <% end %> + <%= if reverts_tag_changes?(@conn) do %> + + <% end %> + + <% end %> + +
+ Revert? + + Image + + Tag + + Action + + Timestamp + + User + + Retained? + + Moderation +
+ + + <%= link(tag_change.image_id, to: ~p"/images/#{tag_change.image}") %> + + <%= render(PhilomenaWeb.ImageView, "_image_container.html", image: tag_change.image, size: :thumb_tiny, conn: @conn) %> + + <%= if tag_change.tag do %> + <%= render(PhilomenaWeb.TagView, "_tag.html", tag: tag_change.tag, conn: @conn) %> + <% else %> + <%= tag_change.tag_name_cache || "Unknown tag" %> + <% end %> + + Added + + Removed + + <%= pretty_time(tag_change.created_at) %> + + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: tag_change, conn: @conn) %> + <%= if can?(@conn, :show, :ip_address) do %> + <%= link_to_ip(@conn, tag_change.ip) %> + <%= link_to_fingerprint(@conn, tag_change.fingerprint) %> + <% end %> + <%= if staff?(tag_change) do %> +
+ + + Stop! + + This user is a staff member. +
+ Ask them before reverting their changes. +
+ <% end %> +
+ Yes + + No + + + Delete from history + +
+
+
+ <%= @pagination %> +
+ <%= if reverts_tag_changes?(@conn) do %> + <%= submit("Revert selected", class: "button", data: [confirm: "Are you really, really sure?"]) %> + <% end %> +<% end %> diff --git a/lib/philomena_web/templates/tag_change/index.html.slime b/lib/philomena_web/templates/tag_change/index.html.slime deleted file mode 100644 index cfffd345..00000000 --- a/lib/philomena_web/templates/tag_change/index.html.slime +++ /dev/null @@ -1,79 +0,0 @@ -.block__header - = @pagination - -= if reverts_tag_changes?(@conn) do - .block__header.block__header--light.block__header--sub - a data-click-checkall=".tag-changes-form" - i.fa.fa-check> - ' Toggle all - -= form_for :tag_changes, ~p"/tag_changes/revert", [class: "tag-changes-form"], fn _f -> - .block__content - table.table - thead - tr - = if reverts_tag_changes?(@conn) do - th Revert? - th colspan=2 Image - th Tag - th Action - th Timestamp - th User - th Retained? - = if reverts_tag_changes?(@conn) do - th Moderation - - tbody - = for tag_change <- @tag_changes do - tr - = if reverts_tag_changes?(@conn) do - td.center - input type="checkbox" name="ids[]" value=tag_change.id - - td.center - = link tag_change.image_id, to: ~p"/images/#{tag_change.image}" - td.center - = render PhilomenaWeb.ImageView, "_image_container.html", image: tag_change.image, size: :thumb_tiny, conn: @conn - - td - = if tag_change.tag do - = render PhilomenaWeb.TagView, "_tag.html", tag: tag_change.tag, conn: @conn - - else - = tag_change.tag_name_cache || "Unknown tag" - - = if tag_change.added do - td.success Added - - else - td.danger Removed - - td - = pretty_time(tag_change.created_at) - - td class=user_column_class(tag_change) - => render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: tag_change, conn: @conn - - = if can?(@conn, :show, :ip_address) do - => link_to_ip @conn, tag_change.ip - => link_to_fingerprint @conn, tag_change.fingerprint - - = if staff?(tag_change) do - br - small - strong> Stop! - ' This user is a staff member. - br - ' Ask them before reverting their changes. - = if tag_change_retained(tag_change) do - td.success Yes - - else - td.danger No - = if reverts_tag_changes?(@conn) do - td - a href=~p"/images/#{tag_change.image}/tag_changes/#{tag_change}" data-method="delete" data-confirm="Are you really, really sure?" - ' Delete from history - - .block__header - = @pagination - - = if reverts_tag_changes?(@conn) do - = submit "Revert selected", class: "button", data: [confirm: "Are you really, really sure?"] diff --git a/lib/philomena_web/templates/topic/new.html.heex b/lib/philomena_web/templates/topic/new.html.heex new file mode 100644 index 00000000..31efb87b --- /dev/null +++ b/lib/philomena_web/templates/topic/new.html.heex @@ -0,0 +1,39 @@ +<%= form_for @changeset, ~p"/forums/#{@forum}/topics", fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +

+ Create a Topic +

+
+ <%= text_input(f, :title, class: "input input--wide", placeholder: "Title") %> + <%= error_tag(f, :title) %> + <%= error_tag(f, :slug) %> +
+
+ <%= inputs_for f, :posts, fn fp -> %> + <%= render(PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: fp, action_icon: "pencil-alt", action_text: "First Post", placeholder: "Please read the site rules before posting and use ||spoilers|| for NSFW stuff in SFW forums.") %> + <% end %> +
+ <%= render(PhilomenaWeb.MarkdownView, "_anon_checkbox.html", conn: @conn, f: f, label: "Post anonymously") %> + <%= inputs_for f, :poll, fn fp -> %> +
+ + +
+ <%= render(PhilomenaWeb.Topic.PollView, "_form.html", Map.put(assigns, :f, fp)) %> +
+
+ <% end %> +
+
+ <%= submit("Post", class: "button", data: [disable_with: raw("Posting…")]) %> +
+
+<% end %> diff --git a/lib/philomena_web/templates/topic/new.html.slime b/lib/philomena_web/templates/topic/new.html.slime deleted file mode 100644 index 05236f7a..00000000 --- a/lib/philomena_web/templates/topic/new.html.slime +++ /dev/null @@ -1,28 +0,0 @@ -= form_for @changeset, ~p"/forums/#{@forum}/topics", fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - h1 Create a Topic - - .field - = text_input f, :title, class: "input input--wide", placeholder: "Title" - = error_tag f, :title - = error_tag f, :slug - - .block - = inputs_for f, :posts, fn fp -> - = render PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: fp, action_icon: "pencil-alt", action_text: "First Post", placeholder: "Please read the site rules before posting and use ||spoilers|| for NSFW stuff in SFW forums." - - .block__content.communication-edit__wrap - = render PhilomenaWeb.MarkdownView, "_anon_checkbox.html", conn: @conn, f: f, label: "Post anonymously" - - = inputs_for f, :poll, fn fp -> - #add-poll.field - input.toggle-box id="add_poll" name="add_poll" type="checkbox" - label for="add_poll" Add a poll - .toggle-box-container - = render PhilomenaWeb.Topic.PollView, "_form.html", Map.put(assigns, :f, fp) - - .block__content.communication-edit__actions - = submit "Post", class: "button", data: [disable_with: raw("Posting…")] diff --git a/lib/philomena_web/templates/topic/poll/_display.html.heex b/lib/philomena_web/templates/topic/poll/_display.html.heex new file mode 100644 index 00000000..7d30a65b --- /dev/null +++ b/lib/philomena_web/templates/topic/poll/_display.html.heex @@ -0,0 +1,49 @@ +
+ <%= link("Voting", to: "#", class: "selected", data: [click_tab: "voting"]) %> + <%= if can?(@conn, :hide, @topic) do %> + <%= link("Voters", to: "#", data: [click_tab: "voters", load_tab: ~p"/forums/#{@forum}/topics/#{@topic}/poll/votes"]) %> + <%= link("Administrate", to: "#", data: [click_tab: "administration"]) %> + <% end %> +
+
+ <%= cond do %> + <% @poll.hidden_from_users -> %> +
+
+

+ This poll has been deleted +

+

+ Reason: + + <%= @poll.deletion_reason || "Unknown (likely deleted in error). Please contact a moderator." %> + +

+
+ <% @poll_active and not @voted and not is_nil(@conn.assigns.current_user) -> %> +
+
+ <%= render(PhilomenaWeb.Topic.PollView, "_vote_form.html", assigns) %> +
+
+ <% true -> %> +
+
+ <%= render(PhilomenaWeb.Topic.PollView, "_results.html", assigns) %> +
+
+ <% end %> +
+<%= if can?(@conn, :hide, @topic) do %> + + +<% end %> diff --git a/lib/philomena_web/templates/topic/poll/_display.html.slime b/lib/philomena_web/templates/topic/poll/_display.html.slime deleted file mode 100644 index 780b6336..00000000 --- a/lib/philomena_web/templates/topic/poll/_display.html.slime +++ /dev/null @@ -1,36 +0,0 @@ -.block__header.block__header--js-tabbed - = link "Voting", to: "#", class: "selected", data: [click_tab: "voting"] - - = if can?(@conn, :hide, @topic) do - = link "Voters", to: "#", data: [click_tab: "voters", load_tab: ~p"/forums/#{@forum}/topics/#{@topic}/poll/votes"] - = link "Administrate", to: "#", data: [click_tab: "administration"] - -.block__tab data-tab="voting" - = cond do - - @poll.hidden_from_users -> - .walloftext - .block.block--fixed.block--warning - h1 This poll has been deleted - p - ' Reason: - strong - = @poll.deletion_reason || "Unknown (likely deleted in error). Please contact a moderator." - - - @poll_active and not @voted and not is_nil(@conn.assigns.current_user) -> - .poll - .poll-area - = render PhilomenaWeb.Topic.PollView, "_vote_form.html", assigns - - - true -> - .poll - .poll-area - = render PhilomenaWeb.Topic.PollView, "_results.html", assigns - - -= if can?(@conn, :hide, @topic) do - .block__tab.hidden data-tab="voters" - p Loading… - .block__tab.hidden data-tab="administration" - a.button.button--state-warning.js-staff-action> href=~p"/forums/#{@forum}/topics/#{@topic}/poll/edit" - i.fa.fa-edit> - | Edit diff --git a/lib/philomena_web/templates/topic/poll/_form.html.heex b/lib/philomena_web/templates/topic/poll/_form.html.heex new file mode 100644 index 00000000..29dbafe0 --- /dev/null +++ b/lib/philomena_web/templates/topic/poll/_form.html.heex @@ -0,0 +1,49 @@ +

+ Polls may have a maximum of + + 20 + + options. Leave any options you don't want to use blank. + Only registered users will be able to vote. +

+
+ <%= text_input(@f, :title, class: "input input--wide", placeholder: "Poll title", maxlength: 140) %> + <%= error_tag(@f, :title) %> +
+

+ End date +

+
+ <%= text_input(@f, :until, class: "input input--wide", placeholder: "2 weeks from now", maxlength: 255) %> + <%= error_tag(@f, :until) %> + <%= error_tag(@f, :active_until) %> +
+

+ Specify when the poll should end. Once the poll ends, no more + votes can be cast and the final results will be displayed. Good + values to try are "1 week from now" and "24 hours from now". Polls + must last for at least 24 hours. +

+

+ Voting method: +

+
+ <%= select(@f, :vote_method, [-: "", "Single option": :single, "Multiple options": :multiple], class: "input") %> + <%= error_tag(@f, :vote_method) %> +
+<%= inputs_for @f, :options, fn fo -> %> +
+ <%= text_input(fo, :label, class: "input flex__grow js-option-label", placeholder: "Option") %> + <%= error_tag(fo, :label) %> + +
+<% end %> + diff --git a/lib/philomena_web/templates/topic/poll/_form.html.slime b/lib/philomena_web/templates/topic/poll/_form.html.slime deleted file mode 100644 index c1ba66cf..00000000 --- a/lib/philomena_web/templates/topic/poll/_form.html.slime +++ /dev/null @@ -1,44 +0,0 @@ -p - ' Polls may have a maximum of - span.js-max-option-count> 20 - ' options. Leave any options you don't want to use blank. - ' Only registered users will be able to vote. - -.field.field--block - = text_input @f, :title, class: "input input--wide", placeholder: "Poll title", maxlength: 140 - = error_tag @f, :title - -p.fieldlabel - ' End date - -.field.field--block - = text_input @f, :until, class: "input input--wide", placeholder: "2 weeks from now", maxlength: 255 - = error_tag @f, :until - = error_tag @f, :active_until - -p.fieldlabel - ' Specify when the poll should end. Once the poll ends, no more - ' votes can be cast and the final results will be displayed. Good - ' values to try are "1 week from now" and "24 hours from now". Polls - ' must last for at least 24 hours. - -p.fieldlabel - ' Voting method: - -.field.field--block - = select @f, :vote_method, ["-": "", "Single option": :single, "Multiple options": :multiple], class: "input" - = error_tag @f, :vote_method - -= inputs_for @f, :options, fn fo -> - .field.js-poll-option.field--inline.flex--no-wrap.flex--centered - = text_input fo, :label, class: "input flex__grow js-option-label", placeholder: "Option" - = error_tag fo, :label - - label.input--separate-left.flex__fixed.flex--centered - a.js-option-remove href="#" - i.fa.fa-trash> - ' Delete - -button.button.js-poll-add-option type="button" - i.fa.fa-plus> - ' Add option diff --git a/lib/philomena_web/templates/topic/poll/_results.html.heex b/lib/philomena_web/templates/topic/poll/_results.html.heex new file mode 100644 index 00000000..d3bd3ba8 --- /dev/null +++ b/lib/philomena_web/templates/topic/poll/_results.html.heex @@ -0,0 +1,54 @@ +
+

+ Poll results: + <%= @poll.title %> +

+
+ <% + winning = winning_option(@poll) + winners? = @poll.total_votes > 0 + %> + <%= for option <- ranked_options(@poll) do %> +
+
+ + <%= option.label %> + +
+ + <%= percent_of_total(option, @poll) %> + <%= option.vote_count %> + <%= pluralize("vote", "votes", option.vote_count) %> + +
+
+
+ + + +
+
+ <% end %> +

+ <%= if active?(@poll) do %> + Poll ends + <%= pretty_time(@poll.active_until) %> + . + <%= if @poll.total_votes > 0 do %> + <%= @poll.total_votes %> + <%= pluralize("vote", "votes", @poll.total_votes) %> + <% else %> + No votes have been + <% end %> + cast so far. + <% else %> + Poll ended + <%= pretty_time(@poll.active_until) %> + with + <%= @poll.total_votes %> + <%= pluralize("vote", "votes", @poll.total_votes) %> + . + <% end %> +

+
+
diff --git a/lib/philomena_web/templates/topic/poll/_results.html.slime b/lib/philomena_web/templates/topic/poll/_results.html.slime deleted file mode 100644 index 9690c607..00000000 --- a/lib/philomena_web/templates/topic/poll/_results.html.slime +++ /dev/null @@ -1,45 +0,0 @@ -.poll-results - h4.poll__header - ' Poll results: - = @poll.title - - .poll-option-list - elixir: - winning = winning_option(@poll) - winners? = @poll.total_votes > 0 - - = for option <- ranked_options(@poll) do - div class=option_class(option, winning, winners?) - .poll-option__text - span.poll-option__label = option.label - - .poll-option__counts - span - => percent_of_total(option, @poll) - => option.vote_count - => pluralize("vote", "votes", option.vote_count) - - .poll-bar - svg.poll-bar__image width=percent_of_total(option, @poll) height="100%" viewBox="0 0 1 1" preserveAspectRatio="none" - rect class=poll_bar_class(option, winning, winners?) width="1" height="1" - - p - = if active?(@poll) do - ' Poll ends - = pretty_time(@poll.active_until) - ' . - - = if @poll.total_votes > 0 do - => @poll.total_votes - => pluralize("vote", "votes", @poll.total_votes) - - else - ' No votes have been - ' cast so far. - - - else - ' Poll ended - => pretty_time(@poll.active_until) - ' with - => @poll.total_votes - = pluralize("vote", "votes", @poll.total_votes) - ' . \ No newline at end of file diff --git a/lib/philomena_web/templates/topic/poll/_vote_form.html.heex b/lib/philomena_web/templates/topic/poll/_vote_form.html.heex new file mode 100644 index 00000000..babf3e68 --- /dev/null +++ b/lib/philomena_web/templates/topic/poll/_vote_form.html.heex @@ -0,0 +1,31 @@ +<%= form_for :poll_vote, ~p"/forums/#{@forum}/topics/#{@topic}/poll/votes", [class: "poll-vote-form"], fn _f -> %> +

+ Poll: + <%= @poll.title %> +

+
+ <% + input_type = input_type(@poll) + input_name = input_name(@poll) + require_answer? = require_answer?(@poll) + %> + <%= for option <- @poll.options do %> + + <% end %> +
+
+

+ Voting ends + <%= pretty_time(@poll.active_until) %> +

+
+ +<% end %> diff --git a/lib/philomena_web/templates/topic/poll/_vote_form.html.slime b/lib/philomena_web/templates/topic/poll/_vote_form.html.slime deleted file mode 100644 index 08f209ff..00000000 --- a/lib/philomena_web/templates/topic/poll/_vote_form.html.slime +++ /dev/null @@ -1,24 +0,0 @@ -= form_for :poll_vote, ~p"/forums/#{@forum}/topics/#{@topic}/poll/votes", [class: "poll-vote-form"], fn _f -> - h4.poll__header - ' Poll: - = @poll.title - - .poll-form__options - elixir: - input_type = input_type(@poll) - input_name = input_name(@poll) - require_answer? = require_answer?(@poll) - - = for option <- @poll.options do - label.poll-form__options__label - input.button--separate-right> type=input_type name=input_name value=option.id required=require_answer? - span = option.label - - .poll-form__status - p - ' Voting ends - = pretty_time(@poll.active_until) - - button.button.button--state-success> - i.fa.fa-check> - ' Vote diff --git a/lib/philomena_web/templates/topic/poll/edit.html.heex b/lib/philomena_web/templates/topic/poll/edit.html.heex new file mode 100644 index 00000000..30847e2d --- /dev/null +++ b/lib/philomena_web/templates/topic/poll/edit.html.heex @@ -0,0 +1,11 @@ +

+ Editing Poll +

+<%= form_for @changeset, ~p"/forums/#{@forum}/topics/#{@topic}/poll", fn f -> %> + <%= render(PhilomenaWeb.Topic.PollView, "_form.html", f: f) %> +
+
+
+ <%= submit("Save", class: "button", data: [disable_with: raw("Saving…")]) %> +
+<% end %> diff --git a/lib/philomena_web/templates/topic/poll/edit.html.slime b/lib/philomena_web/templates/topic/poll/edit.html.slime deleted file mode 100644 index 03cf0640..00000000 --- a/lib/philomena_web/templates/topic/poll/edit.html.slime +++ /dev/null @@ -1,10 +0,0 @@ -h1 Editing Poll - -= form_for @changeset, ~p"/forums/#{@forum}/topics/#{@topic}/poll", fn f -> - = render PhilomenaWeb.Topic.PollView, "_form.html", f: f - - br - br - - .action - = submit "Save", class: "button", data: [disable_with: raw("Saving…")] diff --git a/lib/philomena_web/templates/topic/poll/vote/index.html.heex b/lib/philomena_web/templates/topic/poll/vote/index.html.heex new file mode 100644 index 00000000..a83570fa --- /dev/null +++ b/lib/philomena_web/templates/topic/poll/vote/index.html.heex @@ -0,0 +1,19 @@ +<%= if Enum.any?(@options) do %> + <%= for option <- @options do %> +
+ <%= option.label %> +
+ <%= for vote <- option.poll_votes do %> + + <%= link(vote.user.name, to: ~p"/profiles/#{vote.user}") %> + <% # = link "(x)", to: ~p"/forums/#{@forum}/topics/#{@topic}/poll/votes/#{vote}" %> + + <% end %> + <% end %> +<% else %> +

+ + No votes to display + +

+<% end %> diff --git a/lib/philomena_web/templates/topic/poll/vote/index.html.slime b/lib/philomena_web/templates/topic/poll/vote/index.html.slime deleted file mode 100644 index 749d9cb3..00000000 --- a/lib/philomena_web/templates/topic/poll/vote/index.html.slime +++ /dev/null @@ -1,12 +0,0 @@ -= if Enum.any?(@options) do - = for option <- @options do - h5 = option.label - - = for vote <- option.poll_votes do - span.interaction-user-list-item - => link vote.user.name, to: ~p"/profiles/#{vote.user}" - /= link "(x)", to: ~p"/forums/#{@forum}/topics/#{@topic}/poll/votes/#{vote}" - -- else - p - em No votes to display diff --git a/lib/philomena_web/templates/topic/post/_form.html.heex b/lib/philomena_web/templates/topic/post/_form.html.heex new file mode 100644 index 00000000..c2cd645f --- /dev/null +++ b/lib/philomena_web/templates/topic/post/_form.html.heex @@ -0,0 +1,18 @@ +<%= form_for @changeset, ~p"/forums/#{@forum}/topics/#{@topic}/posts", fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+
+ <%= render(PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, placeholder: "Please read the site rules before posting and use ||spoilers|| for NSFW stuff in SFW forums.") %> +
+
+ <%= submit("Post", class: "button", data: [disable_with: raw("Posting…")]) %> + <%= render(PhilomenaWeb.MarkdownView, "_anon_checkbox.html", conn: @conn, f: f) %> +
+
+<% end %> diff --git a/lib/philomena_web/templates/topic/post/_form.html.slime b/lib/philomena_web/templates/topic/post/_form.html.slime deleted file mode 100644 index dcb15f40..00000000 --- a/lib/philomena_web/templates/topic/post/_form.html.slime +++ /dev/null @@ -1,13 +0,0 @@ -= form_for @changeset, ~p"/forums/#{@forum}/topics/#{@topic}/posts", fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .block - div - = render PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, placeholder: "Please read the site rules before posting and use ||spoilers|| for NSFW stuff in SFW forums." - - .block__content.communication-edit__actions - => submit "Post", class: "button", data: [disable_with: raw("Posting…")] - - = render PhilomenaWeb.MarkdownView, "_anon_checkbox.html", conn: @conn, f: f diff --git a/lib/philomena_web/templates/topic/post/edit.html.heex b/lib/philomena_web/templates/topic/post/edit.html.heex new file mode 100644 index 00000000..b0cd3936 --- /dev/null +++ b/lib/philomena_web/templates/topic/post/edit.html.heex @@ -0,0 +1,23 @@ +<%= form_for @changeset, ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}", fn f -> %> + <%= if @changeset.action do %> +
+

+ Oops, something went wrong! Please check the errors below. +

+
+ <% end %> +
+
+
+ <%= render(PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, placeholder: "Please read the site rules before posting and use ||spoilers|| for NSFW stuff in SFW forums.") %> +
+
+ <%= text_input(f, :edit_reason, class: "input input--wide", placeholder: "Reason for edit") %> + <%= error_tag(f, :edit_reason) %> +
+
+
+ <%= submit("Edit", class: "button", data: [disable_with: raw("Posting…")]) %> +
+
+<% end %> diff --git a/lib/philomena_web/templates/topic/post/edit.html.slime b/lib/philomena_web/templates/topic/post/edit.html.slime deleted file mode 100644 index b7544121..00000000 --- a/lib/philomena_web/templates/topic/post/edit.html.slime +++ /dev/null @@ -1,16 +0,0 @@ -= form_for @changeset, ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}", fn f -> - = if @changeset.action do - .alert.alert-danger - p Oops, something went wrong! Please check the errors below. - - .block - .communication-edit__wrap - .field - = render PhilomenaWeb.MarkdownView, "_input.html", conn: @conn, f: f, placeholder: "Please read the site rules before posting and use ||spoilers|| for NSFW stuff in SFW forums." - - .block__content.field - = text_input f, :edit_reason, class: "input input--wide", placeholder: "Reason for edit" - = error_tag f, :edit_reason - - .block__content.communication-edit__actions - => submit "Edit", class: "button", data: [disable_with: raw("Posting…")] diff --git a/lib/philomena_web/templates/topic/post/history/index.html.heex b/lib/philomena_web/templates/topic/post/history/index.html.heex new file mode 100644 index 00000000..5b1ec361 --- /dev/null +++ b/lib/philomena_web/templates/topic/post/history/index.html.heex @@ -0,0 +1,58 @@ +

+ Viewing last 25 versions of post by + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @post, conn: @conn) %> + in topic + "#post_#{@post.id}")}> + <%= @post.topic.title %> + +

+<%= for version <- @versions do %> +
+
+
+ <%= render(PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @post, conn: @conn) %> +
+
+ + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @post, awards: true, conn: @conn) %> + +
+ <%= render(PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @post, conn: @conn) %> +
+ <%= for edit <- version.difference do %> + <%= case edit do %> + <% {:eq, value} -> %> + <%= escape_nl2br(value) %> + <% {:ins, value} -> %> + + <%= escape_nl2br(value) %> + + <% {:del, value} -> %> + + <%= escape_nl2br(value) %> + + <% end %> + <% end %> +
+
+
+
+
+
+ <%= if version.edit_reason not in [nil, ""] do %> + Reason: + <%= version.edit_reason %> + <% else %> + No reason given + <% end %> +
+
+ Edited + <%= pretty_time(version.created_at) %> + by + <%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: version, conn: @conn) %> +
+
+
+
+<% end %> diff --git a/lib/philomena_web/templates/topic/post/history/index.html.slime b/lib/philomena_web/templates/topic/post/history/index.html.slime deleted file mode 100644 index e455ff57..00000000 --- a/lib/philomena_web/templates/topic/post/history/index.html.slime +++ /dev/null @@ -1,45 +0,0 @@ -h1 - ' Viewing last 25 versions of post by - = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @post, conn: @conn - ' in topic - a href=(~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}?#{[post_id: @post.id]}" <> "#post_#{@post.id}") - = @post.topic.title - -= for version <- @versions do - article.block.communication - .block__content.flex.flex--no-wrap - .flex__fixed.spacing-right - = render PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @post, conn: @conn - - .flex__grow.communication__body - span.communication__body__sender-name = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @post, awards: true, conn: @conn - br - - = render PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @post, conn: @conn - - .communication__body__text - = for edit <- version.difference do - = case edit do - - {:eq, value} -> - = escape_nl2br(value) - - - {:ins, value} -> - ins.differ = escape_nl2br(value) - - - {:del, value} -> - del.differ = escape_nl2br(value) - - .block__content.communication__options - .flex.flex--wrap.flex--spaced-out - div - = if version.edit_reason not in [nil, ""] do - ' Reason: - = version.edit_reason - - else - ' No reason given - - .flex__right - ' Edited - => pretty_time(version.created_at) - ' by - => render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: version, conn: @conn diff --git a/lib/philomena_web/templates/topic/show.html.heex b/lib/philomena_web/templates/topic/show.html.heex new file mode 100644 index 00000000..58af2a83 --- /dev/null +++ b/lib/philomena_web/templates/topic/show.html.heex @@ -0,0 +1,224 @@ +<% route = fn p -> ~p"/forums/#{@forum}/topics/#{@topic}?#{p}" end %> +<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @posts, route: route, last: true) %> +

+ <%= @topic.title %> +

+<%= if @topic.hidden_from_users do %> +
+

+ This topic has been deleted by a moderator +

+

+ + Reason: + + + <%= @topic.deletion_reason %> + +

+ <%= if can?(@conn, :hide, @topic) do %> +

+ + Deleted by: + + + + <%= link(@topic.deleted_by.name, to: ~p"/profiles/#{@topic.deleted_by}") %> + + +

+

+ <%= link(to: ~p"/forums/#{@forum}/topics/#{@topic}/hide", method: :delete, class: "button") do %> + + Restore + <% end %> +

+ <% end %> +
+<% end %> +<% # Header section %> +
+
+ <%= link(@forum.name, to: ~p"/forums/#{@forum}") %> + » + <%= link(@topic.title, to: ~p"/forums/#{@forum}/topics/#{@topic}") %> + <%= if not @topic.hidden_from_users or can?(@conn, :hide, @topic) do %> + + + Search Posts + + + <% end %> +
+
+<%= if not @topic.hidden_from_users or can?(@conn, :hide, @topic) do %> + <% # Display the poll, if any %> + <%= if @topic.poll do %> + <%= render(PhilomenaWeb.Topic.PollView, "_display.html", Map.put(assigns, :poll, @topic.poll)) %> + <% end %> + <% # The actual posts %> +
+
+ <%= for {post, body} <- @posts, can_view_communication?(@conn, post) do %> + <%= render(PhilomenaWeb.PostView, "_post.html", conn: @conn, post: post, body: body) %> + <% end %> + <%= if @conn.assigns.advert do %> + <%= render(PhilomenaWeb.AdvertView, "_box.html", advert: @conn.assigns.advert, conn: @conn) %> + <% end %> + <% # Footer section %> +
+ +
+ <%= if @topic.locked_at do %> +
+

+ This topic has been locked to new posts from non-moderators. +

+

+ Locked + <%= pretty_time(@topic.locked_at) %> +

+

+ Lock reason: + + <%= @topic.lock_reason %> + +

+ <%= if can?(@conn, :hide, @topic) and not is_nil(@topic.locked_by) do %> +

+ Locked by: + + + <%= link(@topic.locked_by.name, to: ~p"/profiles/#{@topic.locked_by}") %> + + +

+ <% end %> +
+ <% end %> +
+
+ <% # Post form %> + <%= cond do %> + <% @conn.assigns.current_ban -> %> + <%= render(PhilomenaWeb.BanView, "_ban_reason.html", conn: @conn) %> + <% @topic.hidden_from_users -> %> +
+

+ Cannot reply to a deleted topic. +

+
+ <% @topic.post_count < 200_000 and can?(@conn, :create_post, @topic) -> %> + <%= render(PhilomenaWeb.Topic.PostView, "_form.html", conn: @conn, forum: @forum, topic: @topic, changeset: @changeset) %> + <% @topic.post_count >= 200_000 -> %> +

+ Okay, we're impressed +

+

+ You're looking at a thread with over 200,000 posts in it! +

+

+ For various reasons, we'd like to ask you to start a new topic. +

+ <% true -> %> + <% end %> + <%= if can?(@conn, :hide, @topic) do %> +
+ + +
+
+

+ <%= if not @topic.hidden_from_users do %> + <%= if @topic.sticky do %> + <%= link(to: ~p"/forums/#{@forum}/topics/#{@topic}/stick", method: :delete, class: "button") do %> + + Unstick + <% end %> + <% else %> + <%= link(to: ~p"/forums/#{@forum}/topics/#{@topic}/stick", method: :post, class: "button") do %> + + Stick + <% end %> + <% end %> + <%= if @topic.locked_at do %> + <%= link(to: ~p"/forums/#{@forum}/topics/#{@topic}/lock", method: :delete, class: "button") do %> + + Unlock + <% end %> + <% else %> + <%= form_for :topic, ~p"/forums/#{@forum}/topics/#{@topic}/lock", [method: :post, class: "hform"], fn f -> %> +

+ <%= text_input(f, :lock_reason, class: "input hform__text", placeholder: "Lock reason", required: true) %> + <%= submit class: "hform__button button" do %> + + Lock + <% end %> +
+ <% end %> + <% end %> + <%= form_for @topic_changeset, ~p"/forums/#{@forum}/topics/#{@topic}", [method: :put, class: "hform"], fn f -> %> +
+ <%= text_input(f, :title, class: "input hform__text", placeholder: "New Title") %> + <%= submit class: "hform__button button" do %> + + Set Title + <% end %> +
+ <% end %> + <%= form_for :topic, ~p"/forums/#{@forum}/topics/#{@topic}/move", [method: :post, class: "hform"], fn f -> %> +
+ <%= select(f, :target_forum_id, Enum.map(@conn.assigns.forums, &{&1.name, &1.id}), class: "input hform__text") %> + <%= submit class: "hform__button button" do %> + + Move + <% end %> +
+ <% end %> + <%= form_for :topic, ~p"/forums/#{@forum}/topics/#{@topic}/hide", [method: :post, class: "hform"], fn f -> %> +
+ <%= text_input(f, :deletion_reason, class: "input hform__text", placeholder: "Deletion reason", required: true) %> + <%= submit class: "hform__button button" do %> + + Delete + <% end %> +
+ <% end %> + <% else %> + Moderation tools unavailable for deleted topics. + <% end %> +

+
+
+
+ <% end %> +<% end %> diff --git a/lib/philomena_web/templates/topic/show.html.slime b/lib/philomena_web/templates/topic/show.html.slime deleted file mode 100644 index 613db6d7..00000000 --- a/lib/philomena_web/templates/topic/show.html.slime +++ /dev/null @@ -1,163 +0,0 @@ -- route = fn p -> ~p"/forums/#{@forum}/topics/#{@topic}?#{p}" end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @posts, route: route, last: true - -h1 = @topic.title - -= if @topic.hidden_from_users do - .block.block--fixed.block--danger - h4 This topic has been deleted by a moderator - p - strong> Reason: - em - = @topic.deletion_reason - - = if can?(@conn, :hide, @topic) do - p - strong> Deleted by: - em - strong - = link(@topic.deleted_by.name, to: ~p"/profiles/#{@topic.deleted_by}") - - p - = link(to: ~p"/forums/#{@forum}/topics/#{@topic}/hide", method: :delete, class: "button") do - i.fas.fa-check> - ' Restore - -/ Header section -.block - .block__header - => link(@forum.name, to: ~p"/forums/#{@forum}") - ' » - => link(@topic.title, to: ~p"/forums/#{@forum}/topics/#{@topic}") - - = if not @topic.hidden_from_users or can?(@conn, :hide, @topic) do - a href=~p"/posts?#{[pq: "topic_id:#{@topic.id}"]}" - i.fa.fa-fw.fa-search> - ' Search Posts - .flex.flex--wrap.block__header.block__header--light.page__header - .flex--fixed.page__pagination - = pagination - .flex--fixed.block__header__item.page__options - ' Started by - => render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @topic, conn: @conn - .page__info - .flex.flex--center-distributed - .flex--fixed.block__header__item - ' Posted - =< pretty_time(@topic.created_at) - .flex--fixed.block__header__item - => @topic.post_count - 1 - ' replies - = if not @topic.hidden_from_users do - = render PhilomenaWeb.Topic.SubscriptionView, "_subscription.html", forum: @forum, topic: @topic, watching: @watching, conn: @conn - -= if not @topic.hidden_from_users or can?(@conn, :hide, @topic) do - / Display the poll, if any - = if @topic.poll do - = render PhilomenaWeb.Topic.PollView, "_display.html", Map.put(assigns, :poll, @topic.poll) - - / The actual posts - .posts-area - .post-list - = for {post, body} <- @posts, can_view_communication?(@conn, post) do - = render PhilomenaWeb.PostView, "_post.html", conn: @conn, post: post, body: body - - = if @conn.assigns.advert do - = render PhilomenaWeb.AdvertView, "_box.html", advert: @conn.assigns.advert, conn: @conn - - / Footer section - .block - .block__header.block__header--light.page__header - .page__pagination = pagination - - = if @topic.locked_at do - .block.block--fixed.block--warning - h4 This topic has been locked to new posts from non-moderators. - p - ' Locked - => pretty_time(@topic.locked_at) - - p - ' Lock reason: - em = @topic.lock_reason - - = if can?(@conn, :hide, @topic) and not is_nil(@topic.locked_by) do - p - ' Locked by: - em - strong - = link(@topic.locked_by.name, to: ~p"/profiles/#{@topic.locked_by}") - - / Post form - = cond do - - @conn.assigns.current_ban -> - = render PhilomenaWeb.BanView, "_ban_reason.html", conn: @conn - - - @topic.hidden_from_users -> - .block.block--fixed.block--danger - h4 Cannot reply to a deleted topic. - - - @topic.post_count < 200_000 and can?(@conn, :create_post, @topic) -> - = render PhilomenaWeb.Topic.PostView, "_form.html", conn: @conn, forum: @forum, topic: @topic, changeset: @changeset - - - @topic.post_count >= 200_000 -> - h3 Okay, we're impressed - p You're looking at a thread with over 200,000 posts in it! - p For various reasons, we'd like to ask you to start a new topic. - - - true -> - - = if can?(@conn, :hide, @topic) do - .block__content.block__content--top-border - input.toggle-box id="administrator_tools" type="checkbox" checked=false - label for="administrator_tools" Manage Topic - .toggle-box-container - .toggle-box-container__content - p - = if not @topic.hidden_from_users do - = if @topic.sticky do - = link(to: ~p"/forums/#{@forum}/topics/#{@topic}/stick", method: :delete, class: "button") do - i.fas.fa-thumbtack> - ' Unstick - - - else - = link(to: ~p"/forums/#{@forum}/topics/#{@topic}/stick", method: :post, class: "button") do - i.fas.fa-thumbtack> - ' Stick - - = if @topic.locked_at do - = link(to: ~p"/forums/#{@forum}/topics/#{@topic}/lock", method: :delete, class: "button") do - i.fas.fa-unlock> - ' Unlock - - - else - = form_for :topic, ~p"/forums/#{@forum}/topics/#{@topic}/lock", [method: :post, class: "hform"], fn f -> - .field - = text_input f, :lock_reason, class: "input hform__text", placeholder: "Lock reason", required: true - = submit class: "hform__button button" do - i.fas.fa-lock> - ' Lock - - = form_for @topic_changeset, ~p"/forums/#{@forum}/topics/#{@topic}", [method: :put, class: "hform"], fn f -> - .field - = text_input f, :title, class: "input hform__text", placeholder: "New Title" - = submit class: "hform__button button" do - i.fas.fa-pen> - ' Set Title - - = form_for :topic, ~p"/forums/#{@forum}/topics/#{@topic}/move", [method: :post, class: "hform"], fn f -> - .field - = select f, :target_forum_id, Enum.map(@conn.assigns.forums, &{&1.name, &1.id}), class: "input hform__text" - = submit class: "hform__button button" do - i.fas.fa-truck> - ' Move - - = form_for :topic, ~p"/forums/#{@forum}/topics/#{@topic}/hide", [method: :post, class: "hform"], fn f -> - .field - = text_input f, :deletion_reason, class: "input hform__text", placeholder: "Deletion reason", required: true - = submit class: "hform__button button" do - i.fas.fa-trash> - ' Delete - - - else - | Moderation tools unavailable for deleted topics. diff --git a/lib/philomena_web/templates/topic/subscription/_subscription.html.heex b/lib/philomena_web/templates/topic/subscription/_subscription.html.heex new file mode 100644 index 00000000..a3f3c03a --- /dev/null +++ b/lib/philomena_web/templates/topic/subscription/_subscription.html.heex @@ -0,0 +1,42 @@ +<% + watch_path = ~p"/forums/#{@forum}/topics/#{@topic}/subscription" + + watch_class = + if @watching do + "hidden" + else + "" + end + + unwatch_path = ~p"/forums/#{@forum}/topics/#{@topic}/subscription" + + unwatch_class = + if @watching do + "" + else + "hidden" + end +%> +<%= if @conn.assigns.current_user do %> + + + + + Subscribe + + + + + + Unsubscribe + + + +<% else %> + + + + Subscribe + + +<% end %> diff --git a/lib/philomena_web/templates/topic/subscription/_subscription.html.slime b/lib/philomena_web/templates/topic/subscription/_subscription.html.slime deleted file mode 100644 index 0772283e..00000000 --- a/lib/philomena_web/templates/topic/subscription/_subscription.html.slime +++ /dev/null @@ -1,23 +0,0 @@ -elixir: - watch_path = ~p"/forums/#{@forum}/topics/#{@topic}/subscription" - watch_class = if @watching, do: "hidden", else: "" - - unwatch_path = ~p"/forums/#{@forum}/topics/#{@topic}/subscription" - unwatch_class = if @watching, do: "", else: "hidden" - -= if @conn.assigns.current_user do - span.js-subscription-target - a.js-subscription-link href=watch_path class=watch_class data-remote="true" data-method="post" - i.fa.fa-bell> - span.hide-mobile - ' Subscribe - - a.js-subscription-link href=unwatch_path class=unwatch_class data-remote="true" data-method="delete" - i.fa.fa-bell-slash> - span.hide-mobile - ' Unsubscribe -- else - a href=~p"/sessions/new" - i.fa.fa-bell> - span.hide-mobile - ' Subscribe diff --git a/lib/philomena_web/templates/unlock/new.html.heex b/lib/philomena_web/templates/unlock/new.html.heex new file mode 100644 index 00000000..0fa30494 --- /dev/null +++ b/lib/philomena_web/templates/unlock/new.html.heex @@ -0,0 +1,12 @@ +

+ Resend unlock instructions +

+<%= form_for :user, ~p"/unlocks", fn f -> %> +
+ <%= email_input(f, :email, placeholder: "Email", class: "input", required: true) %> +
+ <%= render(PhilomenaWeb.CaptchaView, "_captcha.html", name: "unlock", conn: @conn) %> +
+ <%= submit("Resend unlock instructions", class: "button") %> +
+<% end %> diff --git a/lib/philomena_web/templates/unlock/new.html.slime b/lib/philomena_web/templates/unlock/new.html.slime deleted file mode 100644 index 9c8e05cc..00000000 --- a/lib/philomena_web/templates/unlock/new.html.slime +++ /dev/null @@ -1,10 +0,0 @@ -h1 Resend unlock instructions - -= form_for :user, ~p"/unlocks", fn f -> - .field - = email_input f, :email, placeholder: "Email", class: "input", required: true - - = render PhilomenaWeb.CaptchaView, "_captcha.html", name: "unlock", conn: @conn - - div - = submit "Resend unlock instructions", class: "button" diff --git a/lib/philomena_web/templates/user_attribution/_anon_user.html.heex b/lib/philomena_web/templates/user_attribution/_anon_user.html.heex new file mode 100644 index 00000000..7f34d3f8 --- /dev/null +++ b/lib/philomena_web/templates/user_attribution/_anon_user.html.heex @@ -0,0 +1,17 @@ +<%= cond do %> + <% not is_nil(@object.user) and not anonymous?(@object) -> %> + + <%= link(@object.user.name, to: ~p"/profiles/#{@object.user}") %> + + <%= if assigns[:awards] do %> + <%= render(PhilomenaWeb.ProfileView, "_awards.html", awards: @object.user.awards) %> + <% end %> + <% not is_nil(@object.user) and (can?(@conn, :reveal_anon, @object) and not hide_staff_tools?(@conn)) -> %> + + <%= link(anonymous_name(@object, true), to: ~p"/profiles/#{@object.user}") %> + + <% true -> %> + + <%= anonymous_name(@object) %> + +<% end %> diff --git a/lib/philomena_web/templates/user_attribution/_anon_user.html.slime b/lib/philomena_web/templates/user_attribution/_anon_user.html.slime deleted file mode 100644 index f5914b85..00000000 --- a/lib/philomena_web/templates/user_attribution/_anon_user.html.slime +++ /dev/null @@ -1,14 +0,0 @@ -= cond do - - not is_nil(@object.user) and not anonymous?(@object) -> - strong<> - = link(@object.user.name, to: ~p"/profiles/#{@object.user}") - = if assigns[:awards] do - = render PhilomenaWeb.ProfileView, "_awards.html", awards: @object.user.awards - - - not is_nil(@object.user) and (can?(@conn, :reveal_anon, @object) and not hide_staff_tools?(@conn)) -> - strong<> - = link(anonymous_name(@object, true), to: ~p"/profiles/#{@object.user}") - - - true -> - strong<> - = anonymous_name(@object) diff --git a/lib/philomena_web/templates/user_attribution/_anon_user_avatar.html.heex b/lib/philomena_web/templates/user_attribution/_anon_user_avatar.html.heex new file mode 100644 index 00000000..0f670a7d --- /dev/null +++ b/lib/philomena_web/templates/user_attribution/_anon_user_avatar.html.heex @@ -0,0 +1,5 @@ +<%= if !!@object.user and !anonymous?(@object) do %> + <%= user_avatar(@object, assigns[:class] || "avatar--100px") %> +<% else %> + <%= anonymous_avatar(anonymous_name(@object), assigns[:class] || "avatar--100px") %> +<% end %> diff --git a/lib/philomena_web/templates/user_attribution/_anon_user_avatar.html.slime b/lib/philomena_web/templates/user_attribution/_anon_user_avatar.html.slime deleted file mode 100644 index 8e31711f..00000000 --- a/lib/philomena_web/templates/user_attribution/_anon_user_avatar.html.slime +++ /dev/null @@ -1,4 +0,0 @@ -= if !!@object.user and !anonymous?(@object) do - = user_avatar(@object, assigns[:class] || "avatar--100px") -- else - = anonymous_avatar(anonymous_name(@object), assigns[:class] || "avatar--100px") diff --git a/lib/philomena_web/templates/user_attribution/_anon_user_title.html.heex b/lib/philomena_web/templates/user_attribution/_anon_user_title.html.heex new file mode 100644 index 00000000..bdea7d5b --- /dev/null +++ b/lib/philomena_web/templates/user_attribution/_anon_user_title.html.heex @@ -0,0 +1,13 @@ +<%= if !!@object.user and !anonymous?(@object) do %> + <%= for {class, label} <- user_labels(@object) do %> + <%= if assigns[:large] do %> +
+ <%= label %> +
+ <% else %> +
+ <%= label %> +
+ <% end %> + <% end %> +<% end %> diff --git a/lib/philomena_web/templates/user_attribution/_anon_user_title.html.slime b/lib/philomena_web/templates/user_attribution/_anon_user_title.html.slime deleted file mode 100644 index 2d0a6d45..00000000 --- a/lib/philomena_web/templates/user_attribution/_anon_user_title.html.slime +++ /dev/null @@ -1,6 +0,0 @@ -= if !!@object.user and !anonymous?(@object) do - = for {class, label} <- user_labels(@object) do - = if assigns[:large] do - .label.label--block class=class = label - - else - .label.label--block.label--small class=class = label \ No newline at end of file diff --git a/lib/philomena_web/templates/user_attribution/_user.html.heex b/lib/philomena_web/templates/user_attribution/_user.html.heex new file mode 100644 index 00000000..f261ddc3 --- /dev/null +++ b/lib/philomena_web/templates/user_attribution/_user.html.heex @@ -0,0 +1,8 @@ +<%= if !!@object.user do %> + + <%= link(@object.user.name, to: ~p"/profiles/#{@object.user}") %> + + <%= if assigns[:awards] do %> + <%= render(PhilomenaWeb.ProfileView, "_awards.html", awards: @object.user.awards) %> + <% end %> +<% end %> diff --git a/lib/philomena_web/templates/user_attribution/_user.html.slime b/lib/philomena_web/templates/user_attribution/_user.html.slime deleted file mode 100644 index efd160bb..00000000 --- a/lib/philomena_web/templates/user_attribution/_user.html.slime +++ /dev/null @@ -1,5 +0,0 @@ -= if !!@object.user do - strong<> - = link(@object.user.name, to: ~p"/profiles/#{@object.user}") - = if assigns[:awards] do - = render PhilomenaWeb.ProfileView, "_awards.html", awards: @object.user.awards \ No newline at end of file diff --git a/lib/philomena_web/templates/user_attribution/_user_avatar.html.heex b/lib/philomena_web/templates/user_attribution/_user_avatar.html.heex new file mode 100644 index 00000000..3fcb3635 --- /dev/null +++ b/lib/philomena_web/templates/user_attribution/_user_avatar.html.heex @@ -0,0 +1,3 @@ +<%= if !!@object.user do %> + <%= user_avatar(@object, assigns[:class] || "avatar--100px") %> +<% end %> diff --git a/lib/philomena_web/templates/user_attribution/_user_avatar.html.slime b/lib/philomena_web/templates/user_attribution/_user_avatar.html.slime deleted file mode 100644 index 847499e7..00000000 --- a/lib/philomena_web/templates/user_attribution/_user_avatar.html.slime +++ /dev/null @@ -1,2 +0,0 @@ -= if !!@object.user do - = user_avatar(@object, assigns[:class] || "avatar--100px") diff --git a/lib/philomena_web/templates/user_attribution/_user_title.html.heex b/lib/philomena_web/templates/user_attribution/_user_title.html.heex new file mode 100644 index 00000000..8fbf4ec1 --- /dev/null +++ b/lib/philomena_web/templates/user_attribution/_user_title.html.heex @@ -0,0 +1,11 @@ +<%= for {class, label} <- user_labels(@object) do %> + <%= if assigns[:large] do %> +
+ <%= label %> +
+ <% else %> +
+ <%= label %> +
+ <% end %> +<% end %> diff --git a/lib/philomena_web/templates/user_attribution/_user_title.html.slime b/lib/philomena_web/templates/user_attribution/_user_title.html.slime deleted file mode 100644 index 1dba6410..00000000 --- a/lib/philomena_web/templates/user_attribution/_user_title.html.slime +++ /dev/null @@ -1,5 +0,0 @@ -= for {class, label} <- user_labels(@object) do - = if assigns[:large] do - .label.label--block class=class = label - - else - .label.label--block.label--small class=class = label