various fixes:

add base line-height: 1.5em
add appropriate placeholder color to inputs
show number of faves on fave index
link to correct location in watched images list on activity page
don't show pagination info when there are no results
don't create a source history entry if the source wasn't changed
This commit is contained in:
byte[] 2019-12-10 19:41:29 -05:00
parent 2fcfa3a344
commit d4d4ee0e2d
8 changed files with 39 additions and 18 deletions

View file

@ -27,6 +27,7 @@ body {
font-size: 13px; font-size: 13px;
margin: 0; margin: 0;
padding: 0; padding: 0;
line-height: 1.5em;
} }
h1, h2, h3, h4, h5 { h1, h2, h3, h4, h5 {

View file

@ -26,6 +26,11 @@ form p {
max-width: 100%; /* prevent resizable inputs from overflowing the container */ max-width: 100%; /* prevent resizable inputs from overflowing the container */
} }
.input::placeholder {
opacity: 0.54;
color: inherit;
}
.input[required]:invalid { .input[required]:invalid {
box-shadow: none; box-shadow: none;
} }

View file

@ -119,7 +119,15 @@ defmodule Philomena.Images do
Multi.new Multi.new
|> Multi.update(:image, image_changes) |> Multi.update(:image, image_changes)
|> Multi.insert(:source_change, source_changes) |> Multi.run(:source_change, fn repo, _changes ->
case image_changes.changes do
%{source_url: _new_source} ->
repo.insert(source_changes)
_ ->
{:ok, nil}
end
end)
|> Repo.isolated_transaction(:serializable) |> Repo.isolated_transaction(:serializable)
end end

View file

@ -36,7 +36,7 @@ defmodule PhilomenaWeb.StatController do
open_commissions: open_commissions, open_commissions: open_commissions,
commission_items: commission_items, commission_items: commission_items,
open_reports: open_reports, open_reports: open_reports,
report_count: report_count, report_stat_count: report_count,
response_time: response_time, response_time: response_time,
gallery_count: gallery_count, gallery_count: gallery_count,
gallery_size: gallery_size, gallery_size: gallery_size,

View file

@ -39,7 +39,7 @@
.column-layout__main .column-layout__main
= render PhilomenaWeb.ImageView, "index.html", conn: @conn, images: @images, size: :thumb = render PhilomenaWeb.ImageView, "index.html", conn: @conn, images: @images, size: :thumb
= if !!@watched and @watched != [] do = if not is_nil(@watched) and Enum.any?(@watched) do
.block .block
.block__header .block__header
span.block__header__title span.block__header__title
@ -49,4 +49,5 @@
span.hide-mobile span.hide-mobile
' Browse Watched Images ' Browse Watched Images
.block__content.js-resizable-media-container .block__content.js-resizable-media-container
= render PhilomenaWeb.ImageView, "index.html", conn: @conn, images: @watched, size: :thumb_small - route = fn p -> Routes.search_path(@conn, :index, p) end
= render PhilomenaWeb.ImageView, "index.html", conn: @conn, images: @watched, size: :thumb_small, route: route, scope: [q: "my:watched"]

View file

@ -1,4 +1,7 @@
h5 Favorited by h5
' Faved by
=> @image.faves_count
= pluralize("user", "users", @image.faves_count)
= for fave <- Enum.sort_by(@image.faves, & &1.user.name) do = for fave <- Enum.sort_by(@image.faves, & &1.user.name) do
=> link fave.user.name, to: Routes.profile_path(@conn, :show, fave.user), class: "interaction-user-list-item" => link fave.user.name, to: Routes.profile_path(@conn, :show, fave.user), class: "interaction-user-list-item"

View file

@ -1,13 +1,16 @@
' Showing = if @page.total_entries > 0 do
= if @page.total_entries == 1 do ' Showing
' result => pluralize("result", "results", @page.total_entries)
strong
=> max(((@page.page_number - 1) * @page.page_size) - 1, 1)
' -
=> min(@page.page_number * @page.page_size, @page.total_entries)
' of
strong
=> @page.total_entries
' total
- else - else
' results ' No results found
strong
=> max(((@page.page_number - 1) * @page.page_size) - 1, 1)
' -
=> min(@page.page_number * @page.page_size, @page.total_entries)
' of
strong
=> @page.total_entries
' total

View file

@ -107,7 +107,7 @@ elixir:
p p
' We have received ' We have received
span.stat> span.stat>
= number_with_delimiter(@report_count) = number_with_delimiter(@report_stat_count)
' reports. Out of these reports, ' reports. Out of these reports,
=> number_with_delimiter(@open_reports) => number_with_delimiter(@open_reports)
' reports are outstanding and awaiting action. ' reports are outstanding and awaiting action.