fix up user-facing pagination widgets

This commit is contained in:
byte[] 2020-12-11 11:53:40 -05:00
parent 92d7e3c30c
commit 358691711b
17 changed files with 135 additions and 126 deletions

View file

@ -84,7 +84,7 @@ a.block__header--single-item, .block__header a {
} }
} }
.block__header a, .block__header > span, .header__span { .block__header a, .header__span {
background: $block_header_color; background: $block_header_color;
} }
@ -96,7 +96,7 @@ a.block__header--single-item, .block__header a {
.block__header--light { .block__header--light {
background: $block_header_light_color; background: $block_header_light_color;
a, > span, .header__span { a, .header__span {
background: $block_header_light_color; background: $block_header_light_color;
} }

View file

@ -1,9 +1,9 @@
.imagelist__header { .page__header {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
.imagelist__title, .imagelist__pagination { .page__title, .page__pagination {
display: inline-flex; display: inline-flex;
flex-wrap: nowrap; flex-wrap: nowrap;
flex-shrink: 0; flex-shrink: 0;
@ -14,16 +14,16 @@
} }
@media (max-width: $min_px_width_for_desktop_thumb) { @media (max-width: $min_px_width_for_desktop_thumb) {
.imagelist__title, .imagelist__options { .page__title, .page__options {
display: none; display: none;
} }
.imagelist__header, .imagelist__pagination, .imagelist__info { .page__header, .page__pagination, .page__info {
display: block; display: block;
text-align: center; text-align: center;
} }
.imagelist__pagination nav { .page__pagination nav {
display: flex; display: flex;
width: 100%; width: 100%;

View file

@ -9,8 +9,8 @@ h1 Livestreams
= submit "Search", class: "hform__button button" = submit "Search", class: "hform__button button"
.block .block
.block__header .block__header.page__header
= pagination .page__pagination = pagination
= if @conn.cookies["chan_nsfw"] == "true" do = if @conn.cookies["chan_nsfw"] == "true" do
a href=Routes.channel_nsfw_path(@conn, :delete) data-method="delete" a href=Routes.channel_nsfw_path(@conn, :delete) data-method="delete"
@ -25,8 +25,8 @@ h1 Livestreams
= for channel <- @channels do = for channel <- @channels do
= render PhilomenaWeb.ChannelView, "_channel_box.html", channel: channel, conn: @conn, subscriptions: @subscriptions = render PhilomenaWeb.ChannelView, "_channel_box.html", channel: channel, conn: @conn, subscriptions: @subscriptions
.block__header .block__header.page__header
= pagination .page__pagination = pagination
br br
= if can?(@conn, :create, Philomena.Channels.Channel) do = if can?(@conn, :create, Philomena.Channels.Channel) do

View file

@ -21,10 +21,11 @@ h2 Search Results
= render PhilomenaWeb.CommentView, "_comment_with_image.html", body: body, comment: comment, conn: @conn = render PhilomenaWeb.CommentView, "_comment_with_image.html", body: body, comment: comment, conn: @conn
.block .block
.block__header.block__header--light.flex .block__header.block__header--light.page__header
= pagination .page__pagination = pagination
span.block__header__title .page__info
= render PhilomenaWeb.PaginationView, "_pagination_info.html", page: @comments, conn: @conn span.block__header__title
= render PhilomenaWeb.PaginationView, "_pagination_info.html", page: @comments, conn: @conn
- assigns[:error] -> - assigns[:error] ->
p p

View file

@ -3,18 +3,18 @@ elixir:
pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @commissions, route: route, conn: @conn, params: [commission: @conn.params["commission"]] pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @commissions, route: route, conn: @conn, params: [commission: @conn.params["commission"]]
.block .block
.block__header .block__header.page__header
span.block__header__title Open Commissions span.block__header__title.page__title Open Commissions
= pagination .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: Routes.profile_commission_path(@conn, :show, @conn.assigns.current_user)
= cond do - not is_nil(@conn.assigns.current_user) ->
- not is_nil(@conn.assigns.current_user) and not is_nil(@conn.assigns.current_user.commission) -> = link "Create my listing", to: Routes.profile_commission_path(@conn, :new, @conn.assigns.current_user)
= link "View my listing", to: Routes.profile_commission_path(@conn, :show, @conn.assigns.current_user)
- not is_nil(@conn.assigns.current_user) -> - true ->
= link "Create my listing", to: Routes.profile_commission_path(@conn, :new, @conn.assigns.current_user)
- true ->
.block__content .block__content
= cond do = cond do

View file

@ -4,12 +4,13 @@ elixir:
h1 My Conversations h1 My Conversations
.block .block
.block__header .block__header.page__header
a href=Routes.conversation_path(@conn, :new) .page__pagination = pagination
i.fa.fa-paper-plane>
' Create New Conversation
= pagination .page__info
a href=Routes.conversation_path(@conn, :new)
i.fa.fa-paper-plane>
' Create New Conversation
.block__content .block__content
table.table.table--communication-list table.table.table--communication-list
@ -39,5 +40,5 @@ h1 My Conversations
' &bull; ' &bull;
=> link "Hide", to: Routes.conversation_hide_path(@conn, :create, c), data: [method: "post"], data: [confirm: "Are you really, really sure?"] => link "Hide", to: Routes.conversation_hide_path(@conn, :create, c), data: [method: "post"], data: [confirm: "Are you really, really sure?"]
.block__header.block__header--light .block__header.block__header--light.page__header
= pagination .page__pagination = pagination

View file

@ -11,24 +11,25 @@ h1 = @conversation.title
=> link @conversation.title, to: Routes.conversation_path(@conn, :show, @conversation) => link @conversation.title, to: Routes.conversation_path(@conn, :show, @conversation)
' Conversation with ' Conversation with
=> render PhilomenaWeb.UserAttributionView, "_user.html", object: %{user: other}, conn: @conn => render PhilomenaWeb.UserAttributionView, "_user.html", object: %{user: other}, conn: @conn
.block__header--sub.block__header--light .block__header--sub.block__header--light.page__header
span.block__header__title> span.block__header__title.page__title>
=> @messages.total_entries => @messages.total_entries
= pluralize("message", "messages", @messages.total_entries) = pluralize("message", "messages", @messages.total_entries)
= pagination .page__pagination = pagination
= if hidden_by?(@current_user, @conversation) do .page__options
= link "Restore conversation", to: Routes.conversation_hide_path(@conn, :delete, @conversation), data: [method: "delete"] = if hidden_by?(@current_user, @conversation) do
- else = link "Restore conversation", to: Routes.conversation_hide_path(@conn, :delete, @conversation), data: [method: "delete"]
= link "Remove conversation", to: Routes.conversation_hide_path(@conn, :create, @conversation), data: [method: "post", confirm: "Are you really, really sure?"] - else
= link "Report conversation", to: Routes.conversation_report_path(@conn, :new, @conversation) = link "Remove conversation", to: Routes.conversation_hide_path(@conn, :create, @conversation), data: [method: "post", confirm: "Are you really, really sure?"]
= link "Mark as unread", to: Routes.conversation_read_path(@conn, :delete, @conversation), data: [method: "delete"] = link "Report conversation", to: Routes.conversation_report_path(@conn, :new, @conversation)
= link "Mark as unread", to: Routes.conversation_read_path(@conn, :delete, @conversation), data: [method: "delete"]
= for {message, body} <- @messages do = for {message, body} <- @messages do
= render PhilomenaWeb.MessageView, "_message.html", message: message, body: body, conn: @conn = render PhilomenaWeb.MessageView, "_message.html", message: message, body: body, conn: @conn
.block .block
.block__header.block__header--light .block__header.block__header--light.page__header
= pagination .page__pagination = pagination
= cond do = cond do
- @conn.assigns.current_ban -> - @conn.assigns.current_ban ->

View file

@ -34,9 +34,9 @@ h3 The List
- route = fn p -> Routes.dnp_entry_path(@conn, :index, p) end - route = fn p -> Routes.dnp_entry_path(@conn, :index, p) end
- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @dnp_entries, route: route, conn: @conn - pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @dnp_entries, route: route, conn: @conn
.block__header .block__header.page__header
span.block__header__title The DNP List span.block__header__title.page__title The DNP List
= pagination .page__pagination = pagination
.block__content .block__content
table.table table.table
@ -71,5 +71,5 @@ h3 The List
td td
= link "More Info", to: Routes.dnp_entry_path(@conn, :show, entry) = link "More Info", to: Routes.dnp_entry_path(@conn, :show, entry)
.block__header .block__header.page__header
= pagination .page__pagination = pagination

View file

@ -4,21 +4,21 @@ h1 Duplicate Reports
- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @duplicate_reports, route: route, conn: @conn, params: [states: @conn.params["states"] || ["open", "claimed"]] - pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @duplicate_reports, route: route, conn: @conn, params: [states: @conn.params["states"] || ["open", "claimed"]]
.block .block
.block__header .block__header.page__header
= pagination .page__pagination = pagination
.page__info
span.block__header__title Display only: span.block__header__title Display only:
=> link "Open (All)", to: Routes.duplicate_report_path(@conn, :index, states: ~W(open claimed)) => link "Open (All)", to: Routes.duplicate_report_path(@conn, :index, states: ~W(open claimed))
=> link "Open (Unclaimed)", to: Routes.duplicate_report_path(@conn, :index, states: ~W(open)) => link "Open (Unclaimed)", to: Routes.duplicate_report_path(@conn, :index, states: ~W(open))
=> link "Open (Claimed)", to: Routes.duplicate_report_path(@conn, :index, states: ~W(claimed)) => link "Open (Claimed)", to: Routes.duplicate_report_path(@conn, :index, states: ~W(claimed))
=> link "Open + Rejected", to: Routes.duplicate_report_path(@conn, :index, states: ~W(open rejected)) => link "Open + Rejected", to: Routes.duplicate_report_path(@conn, :index, states: ~W(open rejected))
=> link "Rejected", to: Routes.duplicate_report_path(@conn, :index, states: ~W(rejected)) => link "Rejected", to: Routes.duplicate_report_path(@conn, :index, states: ~W(rejected))
=> link "Rejected + Accepted", to: Routes.duplicate_report_path(@conn, :index, states: ~W(rejected accepted)) => link "Rejected + Accepted", to: Routes.duplicate_report_path(@conn, :index, states: ~W(rejected accepted))
=> link "Accepted", to: Routes.duplicate_report_path(@conn, :index, states: ~W(accepted)) => link "Accepted", to: Routes.duplicate_report_path(@conn, :index, states: ~W(accepted))
= link "All", to: Routes.duplicate_report_path(@conn, :index, states: ~W(open rejected accepted claimed)) = link "All", to: Routes.duplicate_report_path(@conn, :index, states: ~W(open rejected accepted claimed))
= render PhilomenaWeb.DuplicateReportView, "_list.html", duplicate_reports: @duplicate_reports, conn: @conn = render PhilomenaWeb.DuplicateReportView, "_list.html", duplicate_reports: @duplicate_reports, conn: @conn
.block .block
.block__header.block__header--light .block__header.block__header--light.page__header
= pagination .page__pagination = pagination

View file

@ -14,10 +14,11 @@ h1 = @forum.name
span.spacing-left span.spacing-left
=> @forum.topic_count => @forum.topic_count
' topics ' topics
.block__header--sub.block__header--light .block__header--sub.block__header--light.page__header
= pagination .page__pagination = pagination
span.block__header__title = @forum.description .page__info
= render PhilomenaWeb.Forum.SubscriptionView, "_subscription.html", forum: @forum, watching: @watching, conn: @conn span.block__header__title = @forum.description
= render PhilomenaWeb.Forum.SubscriptionView, "_subscription.html", forum: @forum, watching: @watching, conn: @conn
.block__content .block__content
table.table.table--communication-list table.table.table--communication-list
thead thead
@ -49,8 +50,8 @@ h1 = @forum.name
= render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: topic.last_post, conn: @conn = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: topic.last_post, conn: @conn
br br
=> pretty_time(topic.last_post.created_at) => pretty_time(topic.last_post.created_at)
.block__header.block__header--light .block__header.block__header--light.page__header
= pagination .page__pagination = pagination
/- if current_user /- if current_user
/ = render partial: 'topics/form' / = render partial: 'topics/form'

View file

@ -31,8 +31,8 @@ elixir:
.column-layout__main .column-layout__main
.block .block
.block__header .block__header.page__header
= pagination .page__pagination = pagination
.block__content.js-resizable-media-container .block__content.js-resizable-media-container
= if Enum.any?(@galleries) do = if Enum.any?(@galleries) do
@ -43,5 +43,5 @@ elixir:
.block.block--fixed.block--no-margin.block--warning .block.block--fixed.block--no-margin.block--warning
' No galleries found! ' No galleries found!
.block__header.block__header--light .block__header.block__header--light.page__header
= pagination .page__pagination = pagination

View file

@ -7,15 +7,16 @@ elixir:
#sortable class=sortable_classes(@conn) #sortable class=sortable_classes(@conn)
.block#imagelist-container .block#imagelist-container
section.block__header.flex section.block__header.flex.page__header
span.block__header__title.hide-mobile span.block__header__title.page__title
' Viewing gallery span
strong> ' Viewing gallery
= @gallery.title strong>
= @gallery.title
= pagination .page__pagination = pagination
.flex__right .flex__right.page__options
= render PhilomenaWeb.ImageView, "_random_button.html", conn: @conn, params: scope = render PhilomenaWeb.ImageView, "_random_button.html", conn: @conn, params: scope
a href=Routes.gallery_report_path(@conn, :new, @gallery) a href=Routes.gallery_report_path(@conn, :new, @gallery)
@ -50,8 +51,9 @@ elixir:
' with ' with
=> @gallery.image_count => @gallery.image_count
= pluralize("image", "images", @gallery.image_count) = pluralize("image", "images", @gallery.image_count)
' , last updated span.hide-mobile-t
= pretty_time(@gallery.updated_at) ' , last updated
= pretty_time(@gallery.updated_at)
.block__content.flex.js-imagelist-info .block__content.flex.js-imagelist-info
.flex__fixed.thumb-tiny-container.spacing-right .flex__fixed.thumb-tiny-container.spacing-right
@ -75,8 +77,8 @@ elixir:
= for {image, hit} <- @gallery_images do = for {image, hit} <- @gallery_images do
= render PhilomenaWeb.ImageView, "_image_box.html", image: image, link: image_url.(image, hit), size: :thumb, conn: @conn = render PhilomenaWeb.ImageView, "_image_box.html", image: image, link: image_url.(image, hit), size: :thumb, conn: @conn
.block__header.block__header--light.flex .block__header.block__header--light.flex.page__header
= pagination .page__pagination = pagination
span.block__header__title span.block__header__title.page__info
= info = info

View file

@ -3,19 +3,20 @@ elixir:
pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @comments, route: route pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @comments, route: route
.block .block
.block__header .block__header.page__header
=<> pagination .page__pagination = pagination
span.block__header__title .page__info
=<> @image.comments_count span.block__header__title
=> pluralize("comment", "comments", @image.comments_count) =<> @image.comments_count
' posted => pluralize("comment", "comments", @image.comments_count)
button.button#js-refresh-comments title="Refresh" data-disable-with="..." ' posted
i.fa.fa-sync button.button#js-refresh-comments title="Refresh" data-disable-with="..."
span.hide-mobile<> Refresh i.fa.fa-sync
span.hide-mobile<> Refresh
= for {comment, body} <- @comments, not comment.destroyed_content or (can?(@conn, :show, comment) and not hide_staff_tools?(@conn)) do = for {comment, body} <- @comments, not comment.destroyed_content or (can?(@conn, :show, comment) and not hide_staff_tools?(@conn)) do
= render PhilomenaWeb.CommentView, "_comment.html", comment: comment, body: body, conn: @conn = render PhilomenaWeb.CommentView, "_comment.html", comment: comment, body: body, conn: @conn
.block .block
.block__header.block__header--light .block__header.block__header--light.page__header
= pagination .page__pagination = pagination

View file

@ -10,13 +10,13 @@ elixir:
info = render PhilomenaWeb.PaginationView, "_pagination_info.html", page: @images info = render PhilomenaWeb.PaginationView, "_pagination_info.html", page: @images
.block#imagelist-container .block#imagelist-container
section.block__header.imagelist__header.flex section.block__header.page__header.flex
span.block__header__title.imagelist__title.hide-mobile span.block__header__title.page__title.hide-mobile
=> header => header
.imagelist__pagination = pagination .page__pagination = pagination
.flex__right.imagelist__options .flex__right.page__options
= random_button @conn, params = random_button @conn, params
= hidden_toggle @conn, route, params = hidden_toggle @conn, route, params
= deleted_toggle @conn, route, params = deleted_toggle @conn, route, params
@ -33,13 +33,13 @@ elixir:
- image -> - image ->
= render PhilomenaWeb.ImageView, "_image_box.html", image: image, link: image_url.(image), size: assigns[:size] || :thumb, conn: @conn = render PhilomenaWeb.ImageView, "_image_box.html", image: image, link: image_url.(image), size: assigns[:size] || :thumb, conn: @conn
.block__header.block__header--light.imagelist__header.flex .block__header.block__header--light.page__header.flex
.imagelist__pagination = pagination .page__pagination = pagination
span.block__header__title.imagelist__info span.block__header__title.page__info
= info = info
.flex__right.imagelist__options .flex__right.page__options
a href="/settings/edit" title="Display Settings" a href="/settings/edit" title="Display Settings"
i.fa.fa-cog i.fa.fa-cog
span.hide-mobile.hide-limited-desktop<> span.hide-mobile.hide-limited-desktop<>

View file

@ -21,10 +21,11 @@ h2 Search Results
= render PhilomenaWeb.PostView, "_post.html", body: body, post: post, conn: @conn = render PhilomenaWeb.PostView, "_post.html", body: body, post: post, conn: @conn
.block .block
.block__header.block__header--light.flex .block__header.block__header--light.page__header
= pagination .page__pagination = pagination
span.block__header__title .page__info
= render PhilomenaWeb.PaginationView, "_pagination_info.html", page: @posts, conn: @conn span.block__header__title
= render PhilomenaWeb.PaginationView, "_pagination_info.html", page: @posts, conn: @conn
- assigns[:error] -> - assigns[:error] ->
p p

View file

@ -21,10 +21,11 @@ h2 Search Results
= render PhilomenaWeb.TagView, "_tag_list.html", tags: @tags, conn: @conn = render PhilomenaWeb.TagView, "_tag_list.html", tags: @tags, conn: @conn
.block .block
.block__header.block__header--light.flex .block__header.block__header--light.page__header
= pagination .page__pagination = pagination
span.block__header__title .page__info
= render PhilomenaWeb.PaginationView, "_pagination_info.html", page: @tags span.block__header__title
= render PhilomenaWeb.PaginationView, "_pagination_info.html", page: @tags
- assigns[:error] -> - assigns[:error] ->
p p

View file

@ -26,8 +26,6 @@ h1 = @topic.title
/ Header section / Header section
.block .block
.block__header .block__header
=> link("Forums", to: Routes.forum_path(@conn, :index))
' &raquo;
=> link(@forum.name, to: Routes.forum_path(@conn, :show, @forum)) => link(@forum.name, to: Routes.forum_path(@conn, :show, @forum))
' &raquo; ' &raquo;
=> link(@topic.title, to: Routes.forum_topic_path(@conn, :show, @forum, @topic)) => link(@topic.title, to: Routes.forum_topic_path(@conn, :show, @forum, @topic))
@ -36,20 +34,22 @@ h1 = @topic.title
a href=Routes.post_path(@conn, :index, pq: "topic_id:#{@topic.id}") a href=Routes.post_path(@conn, :index, pq: "topic_id:#{@topic.id}")
i.fa.fa-fw.fa-search> i.fa.fa-fw.fa-search>
' Search Posts ' Search Posts
.flex.flex--wrap.block__header.block__header--light .flex.flex--wrap.block__header.block__header--light.page__header
.flex--fixed .flex--fixed.page__pagination
= pagination = pagination
.flex--fixed.block__header__item .flex--fixed.block__header__item.page__options
' Started by ' Started by
=> render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @topic, conn: @conn => render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @topic, conn: @conn
.flex--fixed.block__header__item .page__info
' Posted .flex.flex--center-distributed
=< pretty_time(@topic.created_at) .flex--fixed.block__header__item
.flex--fixed.block__header__item ' Posted
=> @topic.post_count - 1 =< pretty_time(@topic.created_at)
' replies .flex--fixed.block__header__item
= if not @topic.hidden_from_users do => @topic.post_count - 1
= render PhilomenaWeb.Topic.SubscriptionView, "_subscription.html", forum: @forum, topic: @topic, watching: @watching, conn: @conn ' 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 = if not @topic.hidden_from_users or can?(@conn, :hide, @topic) do
/ Display the poll, if any / Display the poll, if any
@ -67,8 +67,8 @@ h1 = @topic.title
/ Footer section / Footer section
.block .block
.block__header.block__header--light .block__header.block__header--light.page__header
= pagination .page__pagination = pagination
= if @topic.locked_at do = if @topic.locked_at do
.block.block--fixed.block--warning .block.block--fixed.block--warning