From b457269ff7b2776e849a84f11d3a3812e7cd2d81 Mon Sep 17 00:00:00 2001 From: codevictory Date: Tue, 8 Jun 2021 23:52:51 +0300 Subject: [PATCH] Link to performers home site. --- assets/css/pages/performer.scss | 4 ++++ lib/runosaari/registration/performer.ex | 2 ++ lib/runosaari_web/templates/performer/form.html.eex | 6 +++++- lib/runosaari_web/templates/performer/show.html.eex | 3 +++ priv/repo/migrations/20210608203019_performer-link.exs | 9 +++++++++ 5 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 priv/repo/migrations/20210608203019_performer-link.exs diff --git a/assets/css/pages/performer.scss b/assets/css/pages/performer.scss index 25a02af..3fff1ba 100644 --- a/assets/css/pages/performer.scss +++ b/assets/css/pages/performer.scss @@ -50,3 +50,7 @@ } } } + +.performer-link { + color: blue; +} diff --git a/lib/runosaari/registration/performer.ex b/lib/runosaari/registration/performer.ex index 8b0f888..dc24540 100644 --- a/lib/runosaari/registration/performer.ex +++ b/lib/runosaari/registration/performer.ex @@ -9,6 +9,7 @@ defmodule Runosaari.Registration.Performer do field :paragraph3, :string field :paragraph4, :string field :paragraph5, :string + field :link, :string field :photo_path, :string field :confirmed, :boolean, default: false @@ -25,6 +26,7 @@ defmodule Runosaari.Registration.Performer do :paragraph3, :paragraph4, :paragraph5, + :link, :photo_path, :confirmed ]) diff --git a/lib/runosaari_web/templates/performer/form.html.eex b/lib/runosaari_web/templates/performer/form.html.eex index 2a73ba6..4b92b6d 100644 --- a/lib/runosaari_web/templates/performer/form.html.eex +++ b/lib/runosaari_web/templates/performer/form.html.eex @@ -29,7 +29,11 @@ <%= textarea form, :paragraph5 %> <%= error_tag form, :paragraph5 %> - <%= label form, :photo, "Esiintyjän kuva (muokatessa ei vaadi uudelleen lisäys vaikka tyhjä)" %> + <%= label form, :link, "Linkki esiintyjän sivuille" %> + <%= textarea form, :link %> + <%= error_tag form, :link %> + + <%= label form, :photo, "Esiintyjän kuva (muokatessa ei vaadi uudelleen lisäystä vaikka tyhjä)" %> <%= file_input form, :photo %> <%= error_tag form, :photo %> diff --git a/lib/runosaari_web/templates/performer/show.html.eex b/lib/runosaari_web/templates/performer/show.html.eex index cfd7e3a..bbc5d2a 100644 --- a/lib/runosaari_web/templates/performer/show.html.eex +++ b/lib/runosaari_web/templates/performer/show.html.eex @@ -15,6 +15,9 @@ <%= if @performer.paragraph5 != nil do %>

<%= @performer.paragraph5 %>

<% end %> + <%= if @performer.link != nil do %> + <%= @performer.link %> + <% end %> Esiintyjän kuva <%= link "Takaisin esiintyjälistalle", to: Routes.performer_path(@conn, :index) %> diff --git a/priv/repo/migrations/20210608203019_performer-link.exs b/priv/repo/migrations/20210608203019_performer-link.exs new file mode 100644 index 0000000..5f279d2 --- /dev/null +++ b/priv/repo/migrations/20210608203019_performer-link.exs @@ -0,0 +1,9 @@ +defmodule :"Elixir.Runosaari.Repo.Migrations.Performer-link" do + use Ecto.Migration + + def change do + alter table("performers") do + add :link, :string + end + end +end