mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 21:47:59 +01:00
fix warnings
This commit is contained in:
parent
181931cf67
commit
9f6ac9753d
5 changed files with 6 additions and 7 deletions
|
@ -7,7 +7,7 @@ defimpl Philomena.Attribution, for: Philomena.Reports.Report do
|
|||
to_string(report.user_id || report.fingerprint || report.ip)
|
||||
end
|
||||
|
||||
def anonymous?(report) do
|
||||
def anonymous?(_report) do
|
||||
false
|
||||
end
|
||||
end
|
|
@ -7,7 +7,6 @@ defmodule Philomena.Reports.Query do
|
|||
ip_fields = ~W(ip)
|
||||
bool_fields = ~W(open)
|
||||
ngram_fields = ~W(reason)
|
||||
custom_fields = ~W(author user_id)
|
||||
default_field = "reason"
|
||||
|
||||
@parser Parser.parser(
|
||||
|
|
|
@ -8,7 +8,7 @@ defmodule PhilomenaWeb.Admin.ReportController do
|
|||
alias Philomena.Repo
|
||||
import Ecto.Query
|
||||
|
||||
plug :load_and_authorize_resource, model: Report, preload: [:admin, user: [:linked_tags, awards: :badge]]
|
||||
plug :load_and_authorize_resource, model: Report, only: [:show], preload: [:admin, user: [:linked_tags, awards: :badge]]
|
||||
|
||||
def index(conn, %{"rq" => query_string}) do
|
||||
{:ok, query} = Query.compile(query_string)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
- route = fn p -> Routes.admin_report_path(@conn, :index, p) end
|
||||
- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @reports
|
||||
- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", route: route, page: @reports, conn: @conn
|
||||
|
||||
h1 Reports
|
||||
|
||||
|
|
|
@ -57,13 +57,13 @@ defmodule PhilomenaWeb.ProfileView do
|
|||
|
||||
defp initials_abbrv(name) do
|
||||
case String.split(name, " ", parts: 4) do
|
||||
[<<a1::utf8, _rest::binary>>, <<a2::utf8, _rest::binary>>, <<a3::utf8, _rest::binary>>, <<a4::utf8, _rest::binary>>] ->
|
||||
[<<a1::utf8, _r1::binary>>, <<a2::utf8, _r2::binary>>, <<a3::utf8, _r3::binary>>, <<a4::utf8, _r4::binary>>] ->
|
||||
<<a1::utf8, a2::utf8, a3::utf8, a4::utf8>>
|
||||
|
||||
[<<a1::utf8, _rest::binary>>, <<a2::utf8, _rest::binary>>, <<a3::utf8, _rest::binary>>] ->
|
||||
[<<a1::utf8, _r1::binary>>, <<a2::utf8, _r2::binary>>, <<a3::utf8, _r3::binary>>] ->
|
||||
<<a1::utf8, a2::utf8, a3::utf8>>
|
||||
|
||||
[<<a1::utf8, _rest::binary>>, <<a2::utf8, _rest::binary>>] ->
|
||||
[<<a1::utf8, _r1::binary>>, <<a2::utf8, _r2::binary>>] ->
|
||||
<<a1::utf8, a2::utf8>>
|
||||
|
||||
_ ->
|
||||
|
|
Loading…
Reference in a new issue