2021-09-13 01:19:00 +02:00
|
|
|
defmodule PhilomenaWeb.MarkdownView do
|
|
|
|
use PhilomenaWeb, :view
|
|
|
|
|
|
|
|
def anonymous_by_default?(conn) do
|
|
|
|
conn.assigns.current_user.anonymous_by_default
|
|
|
|
end
|
2021-09-30 23:56:38 +02:00
|
|
|
|
2021-10-01 02:31:25 +02:00
|
|
|
def required?(required) when required == false, do: nil
|
2021-09-30 23:56:38 +02:00
|
|
|
def required?(_), do: true
|
2021-10-01 02:31:25 +02:00
|
|
|
|
2021-10-24 22:19:01 +02:00
|
|
|
def add_classes(base_classes, new_classes) when is_binary(new_classes),
|
|
|
|
do: "#{base_classes} #{new_classes}"
|
|
|
|
|
2021-10-01 02:31:25 +02:00
|
|
|
def add_classes(base_classes, _), do: base_classes
|
2021-09-13 01:19:00 +02:00
|
|
|
end
|