diff --git a/assets/css/common/base.scss b/assets/css/common/base.scss index 4b4a6749..d871268a 100644 --- a/assets/css/common/base.scss +++ b/assets/css/common/base.scss @@ -27,13 +27,14 @@ body { font-size: 13px; margin: 0; padding: 0; - line-height: 15px; + line-height: 1.15em; } h1, h2, h3, h4, h5 { font-weight: normal; text-rendering: optimizeLegibility; margin-bottom: 0.62em; + line-height: 1.15em; } h1 { font-size: 24px; } diff --git a/lib/philomena/users/ability.ex b/lib/philomena/users/ability.ex index a68286d0..d2264259 100644 --- a/lib/philomena/users/ability.ex +++ b/lib/philomena/users/ability.ex @@ -115,7 +115,8 @@ defimpl Canada.Can, for: [Atom, Philomena.Users.User] do # View filters they own and system filters 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 def can?(%User{id: id}, action, %Filter{user_id: id}) when action in [:edit, :update], do: true diff --git a/lib/philomena_web/image_reverse.ex b/lib/philomena_web/image_reverse.ex index 22cbf2c3..7b0f28a1 100644 --- a/lib/philomena_web/image_reverse.ex +++ b/lib/philomena_web/image_reverse.ex @@ -29,6 +29,7 @@ defmodule PhilomenaWeb.ImageReverse do {:ok, analysis} = Analyzers.analyze(path) {analysis, path} end + defp analyze(_upload), do: :error defp intensities(:error), do: :error defp intensities({analysis, path}) do diff --git a/lib/philomena_web/plugs/recode_parameter_plug.ex b/lib/philomena_web/plugs/recode_parameter_plug.ex index c5b99405..9a5f6bbb 100644 --- a/lib/philomena_web/plugs/recode_parameter_plug.ex +++ b/lib/philomena_web/plugs/recode_parameter_plug.ex @@ -9,6 +9,7 @@ defmodule PhilomenaWeb.RecodeParameterPlug do |> to_string() |> URI.encode_www_form() |> String.replace("%2B", "+") + |> String.replace("%25", "%") params = Map.put(conn.params, name, fixed_value) diff --git a/lib/philomena_web/templates/avatar/edit.html.slime b/lib/philomena_web/templates/avatar/edit.html.slime index f88d4c32..936ffc35 100644 --- a/lib/philomena_web/templates/avatar/edit.html.slime +++ b/lib/philomena_web/templates/avatar/edit.html.slime @@ -39,4 +39,7 @@ => submit "Update my avatar", class: "button" br - = button_to "Remove my avatar", Routes.avatar_path(@conn, :delete), method: "delete", class: "button", data: [confirm: "Are you really, really sure?"] \ No newline at end of file + = 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) \ No newline at end of file diff --git a/lib/philomena_web/views/error_helpers.ex b/lib/philomena_web/views/error_helpers.ex index 05b1a173..1945207e 100644 --- a/lib/philomena_web/views/error_helpers.ex +++ b/lib/philomena_web/views/error_helpers.ex @@ -10,7 +10,7 @@ defmodule PhilomenaWeb.ErrorHelpers do """ def error_tag(form, field) do 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 @@ -41,4 +41,12 @@ defmodule PhilomenaWeb.ErrorHelpers do Gettext.dgettext(PhilomenaWeb.Gettext, "errors", msg, opts) end end + + defp humanize_name(field) do + field + |> to_string() + |> String.replace("_", " ") + |> String.capitalize() + |> Kernel.<>(" ") + end end