mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
various fixes:
line-heights ability to edit filters fix tag parameter decoding again better error_tag message
This commit is contained in:
parent
54be9dfa5d
commit
d851e8cf62
6 changed files with 19 additions and 4 deletions
|
@ -27,13 +27,14 @@ body {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
line-height: 15px;
|
line-height: 1.15em;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1, h2, h3, h4, h5 {
|
h1, h2, h3, h4, h5 {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
text-rendering: optimizeLegibility;
|
text-rendering: optimizeLegibility;
|
||||||
margin-bottom: 0.62em;
|
margin-bottom: 0.62em;
|
||||||
|
line-height: 1.15em;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 { font-size: 24px; }
|
h1 { font-size: 24px; }
|
||||||
|
|
|
@ -115,7 +115,8 @@ defimpl Canada.Can, for: [Atom, Philomena.Users.User] do
|
||||||
|
|
||||||
# View filters they own and system filters
|
# View filters they own and system filters
|
||||||
def can?(_user, :show, %Filter{system: true}), do: true
|
def can?(_user, :show, %Filter{system: true}), do: true
|
||||||
def can?(%User{id: id}, :show, %Filter{user_id: id}), do: true
|
def can?(%User{}, action, Filter) when action in [:index, :new, :create], do: true
|
||||||
|
def can?(%User{id: id}, action, %Filter{user_id: id}) when action in [:show, :edit, :update], do: true
|
||||||
|
|
||||||
# Edit filters they own
|
# Edit filters they own
|
||||||
def can?(%User{id: id}, action, %Filter{user_id: id}) when action in [:edit, :update], do: true
|
def can?(%User{id: id}, action, %Filter{user_id: id}) when action in [:edit, :update], do: true
|
||||||
|
|
|
@ -29,6 +29,7 @@ defmodule PhilomenaWeb.ImageReverse do
|
||||||
{:ok, analysis} = Analyzers.analyze(path)
|
{:ok, analysis} = Analyzers.analyze(path)
|
||||||
{analysis, path}
|
{analysis, path}
|
||||||
end
|
end
|
||||||
|
defp analyze(_upload), do: :error
|
||||||
|
|
||||||
defp intensities(:error), do: :error
|
defp intensities(:error), do: :error
|
||||||
defp intensities({analysis, path}) do
|
defp intensities({analysis, path}) do
|
||||||
|
|
|
@ -9,6 +9,7 @@ defmodule PhilomenaWeb.RecodeParameterPlug do
|
||||||
|> to_string()
|
|> to_string()
|
||||||
|> URI.encode_www_form()
|
|> URI.encode_www_form()
|
||||||
|> String.replace("%2B", "+")
|
|> String.replace("%2B", "+")
|
||||||
|
|> String.replace("%25", "%")
|
||||||
|
|
||||||
params = Map.put(conn.params, name, fixed_value)
|
params = Map.put(conn.params, name, fixed_value)
|
||||||
|
|
||||||
|
|
|
@ -40,3 +40,6 @@
|
||||||
|
|
||||||
br
|
br
|
||||||
= button_to "Remove my avatar", Routes.avatar_path(@conn, :delete), method: "delete", class: "button", data: [confirm: "Are you really, really sure?"]
|
= button_to "Remove my avatar", Routes.avatar_path(@conn, :delete), method: "delete", class: "button", data: [confirm: "Are you really, really sure?"]
|
||||||
|
|
||||||
|
br
|
||||||
|
= link "Back", to: Routes.pow_registration_path(@conn, :edit)
|
|
@ -10,7 +10,7 @@ defmodule PhilomenaWeb.ErrorHelpers do
|
||||||
"""
|
"""
|
||||||
def error_tag(form, field) do
|
def error_tag(form, field) do
|
||||||
Enum.map(Keyword.get_values(form.errors, field), fn error ->
|
Enum.map(Keyword.get_values(form.errors, field), fn error ->
|
||||||
content_tag(:span, translate_error(error), class: "help-block")
|
content_tag(:span, humanize_name(field) <> translate_error(error), class: "help-block")
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -41,4 +41,12 @@ defmodule PhilomenaWeb.ErrorHelpers do
|
||||||
Gettext.dgettext(PhilomenaWeb.Gettext, "errors", msg, opts)
|
Gettext.dgettext(PhilomenaWeb.Gettext, "errors", msg, opts)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
defp humanize_name(field) do
|
||||||
|
field
|
||||||
|
|> to_string()
|
||||||
|
|> String.replace("_", " ")
|
||||||
|
|> String.capitalize()
|
||||||
|
|> Kernel.<>(" ")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue