From aec61c51a3771e0f1cf1347b6a8ca70d59a266cb Mon Sep 17 00:00:00 2001 From: katjam Date: Sun, 13 Oct 2024 11:53:44 +0100 Subject: [PATCH] Move page templates into directory --- app/Route/About.elm | 6 +++--- app/Route/Events.elm | 4 ++-- app/Route/Events/Event_.elm | 6 +++--- app/Route/Index.elm | 4 ++-- app/Route/JoinUs.elm | 14 +++++++------- app/Route/News.elm | 4 ++-- app/Route/News/NewsItem_.elm | 4 ++-- app/Route/Partners.elm | 4 ++-- app/Route/Partners/Partner_.elm | 4 ++-- src/Theme/{AboutPage.elm => Page/About.elm} | 2 +- src/Theme/{EventPage.elm => Page/Event.elm} | 2 +- src/Theme/{EventsPage.elm => Page/Events.elm} | 2 +- src/Theme/{IndexPage.elm => Page/Index.elm} | 10 +++++----- src/Theme/{JoinUsPage.elm => Page/JoinUs.elm} | 2 +- src/Theme/{NewsPage.elm => Page/News.elm} | 2 +- src/Theme/{NewsItemPage.elm => Page/NewsItem.elm} | 2 +- src/Theme/{PartnerPage.elm => Page/Partner.elm} | 10 +++++----- src/Theme/{PartnersPage.elm => Page/Partners.elm} | 2 +- 18 files changed, 42 insertions(+), 42 deletions(-) rename src/Theme/{AboutPage.elm => Page/About.elm} (99%) rename src/Theme/{EventPage.elm => Page/Event.elm} (99%) rename src/Theme/{EventsPage.elm => Page/Events.elm} (99%) rename src/Theme/{IndexPage.elm => Page/Index.elm} (98%) rename src/Theme/{JoinUsPage.elm => Page/JoinUs.elm} (99%) rename src/Theme/{NewsPage.elm => Page/News.elm} (98%) rename src/Theme/{NewsItemPage.elm => Page/NewsItem.elm} (98%) rename src/Theme/{PartnerPage.elm => Page/Partner.elm} (96%) rename src/Theme/{PartnersPage.elm => Page/Partners.elm} (99%) diff --git a/app/Route/About.elm b/app/Route/About.elm index 0a99ce2..b602827 100644 --- a/app/Route/About.elm +++ b/app/Route/About.elm @@ -17,7 +17,7 @@ import Markdown.Block import PagesMsg import RouteBuilder import Shared -import Theme.AboutPage +import Theme.Page.About import Theme.PageTemplate import Theme.TransMarkdown import View @@ -198,10 +198,10 @@ view app _ = , title = app.data.main.title , bigText = { text = app.data.main.subtitle, node = "p" } , smallText = Nothing - , innerContent = Just (Theme.AboutPage.viewIntro app.data.main.body) + , innerContent = Just (Theme.Page.About.viewIntro app.data.main.body) , outerContent = Just - (Theme.AboutPage.viewSections + (Theme.Page.About.viewSections { accessibilityData = app.data.accessibility , makersData = app.data.makers , aboutPlaceCalData = app.data.placecal diff --git a/app/Route/Events.elm b/app/Route/Events.elm index 38be9f9..3dee6a0 100644 --- a/app/Route/Events.elm +++ b/app/Route/Events.elm @@ -19,7 +19,7 @@ import PagesMsg import RouteBuilder import Shared import Task -import Theme.EventsPage +import Theme.Page.Events import Theme.PageTemplate import Theme.Paginator exposing (Msg(..)) import Time @@ -176,7 +176,7 @@ view _ _ model = , title = t EventsTitle , bigText = { text = t EventsSummary, node = "h3" } , smallText = Nothing - , innerContent = Just (Theme.EventsPage.viewEvents model) + , innerContent = Just (Theme.Page.Events.viewEvents model) , outerContent = Nothing } |> Html.Styled.map PagesMsg.fromMsg diff --git a/app/Route/Events/Event_.elm b/app/Route/Events/Event_.elm index 0354f7c..d747c9e 100644 --- a/app/Route/Events/Event_.elm +++ b/app/Route/Events/Event_.elm @@ -16,7 +16,7 @@ import Head import PagesMsg import RouteBuilder import Shared -import Theme.EventPage +import Theme.Page.Event import Theme.PageTemplate import View @@ -103,8 +103,8 @@ view app _ = , title = t EventsTitle , bigText = { text = event.name, node = "h3" } , smallText = Nothing - , innerContent = Just (Theme.EventPage.viewEventInfo eventWithPartner) - , outerContent = Just (Theme.EventPage.viewButtons event) + , innerContent = Just (Theme.Page.Event.viewEventInfo eventWithPartner) + , outerContent = Just (Theme.Page.Event.viewButtons event) } ] } diff --git a/app/Route/Index.elm b/app/Route/Index.elm index e40015d..93a8521 100644 --- a/app/Route/Index.elm +++ b/app/Route/Index.elm @@ -14,7 +14,7 @@ import Head import PagesMsg import RouteBuilder import Shared -import Theme.IndexPage +import Theme.Page.Index import Theme.PageTemplate import View @@ -67,5 +67,5 @@ view : -> View.View (PagesMsg.PagesMsg Msg) view app _ = { title = t SiteTitle - , body = [ Theme.IndexPage.view app.sharedData ] + , body = [ Theme.Page.Index.view app.sharedData ] } diff --git a/app/Route/JoinUs.elm b/app/Route/JoinUs.elm index 04b1e89..e024be6 100644 --- a/app/Route/JoinUs.elm +++ b/app/Route/JoinUs.elm @@ -16,18 +16,18 @@ import Html.Styled import PagesMsg import RouteBuilder import Shared -import Theme.JoinUsPage +import Theme.Page.JoinUs import Theme.PageTemplate import UrlPath import View exposing (View) type alias Model = - Theme.JoinUsPage.Model + Theme.Page.JoinUs.Model type alias Msg = - Theme.JoinUsPage.Msg + Theme.Page.JoinUs.Msg type alias RouteParams = @@ -39,8 +39,8 @@ init : -> Shared.Model -> ( Model, Effect.Effect Msg ) init _ _ = - ( { userInput = Theme.JoinUsPage.blankForm - , formState = Theme.JoinUsPage.Inputting + ( { userInput = Theme.Page.JoinUs.blankForm + , formState = Theme.Page.JoinUs.Inputting } , Effect.none ) @@ -58,7 +58,7 @@ route = |> RouteBuilder.buildWithLocalState { init = init , view = view - , update = Theme.JoinUsPage.update + , update = Theme.Page.JoinUs.update , subscriptions = subscriptions } @@ -98,7 +98,7 @@ view _ _ model = , title = t JoinUsTitle , bigText = { text = t JoinUsSubtitle, node = "p" } , smallText = Just [ t JoinUsDescription ] - , innerContent = Just (Theme.JoinUsPage.view model) + , innerContent = Just (Theme.Page.JoinUs.view model) , outerContent = Nothing } |> Html.Styled.map PagesMsg.fromMsg diff --git a/app/Route/News.elm b/app/Route/News.elm index 0ad8522..159bb94 100644 --- a/app/Route/News.elm +++ b/app/Route/News.elm @@ -15,7 +15,7 @@ import Head import PagesMsg import RouteBuilder import Shared -import Theme.NewsPage +import Theme.Page.News import Theme.PageTemplate import View @@ -77,7 +77,7 @@ view app _ = , innerContent = Nothing , outerContent = Just - (Theme.NewsPage.viewNewsList + (Theme.Page.News.viewNewsList (Data.PlaceCal.Articles.replacePartnerIdWithName app.sharedData.articles app.sharedData.partners) ) } diff --git a/app/Route/News/NewsItem_.elm b/app/Route/News/NewsItem_.elm index 48b231a..c77698d 100644 --- a/app/Route/News/NewsItem_.elm +++ b/app/Route/News/NewsItem_.elm @@ -16,7 +16,7 @@ import Helpers.TransRoutes import PagesMsg import RouteBuilder import Shared -import Theme.NewsItemPage +import Theme.Page.NewsItem import Theme.PageTemplate import View @@ -84,7 +84,7 @@ view app _ = , title = t NewsTitle , bigText = { text = article.title, node = "h3" } , smallText = Nothing - , innerContent = Just (Theme.NewsItemPage.viewArticle article) + , innerContent = Just (Theme.Page.NewsItem.viewArticle article) , outerContent = Nothing } ] diff --git a/app/Route/Partners.elm b/app/Route/Partners.elm index 953ea62..8df778e 100644 --- a/app/Route/Partners.elm +++ b/app/Route/Partners.elm @@ -14,8 +14,8 @@ import Head import PagesMsg import RouteBuilder import Shared +import Theme.Page.Partners import Theme.PageTemplate -import Theme.PartnersPage import View @@ -73,7 +73,7 @@ view app _ = , title = t PartnersTitle , bigText = { text = t PartnersIntroSummary, node = "p" } , smallText = Just [ t PartnersIntroDescription ] - , innerContent = Just (Theme.PartnersPage.viewPartners app.sharedData.partners) + , innerContent = Just (Theme.Page.Partners.viewPartners app.sharedData.partners) , outerContent = Nothing } ] diff --git a/app/Route/Partners/Partner_.elm b/app/Route/Partners/Partner_.elm index c093889..75f2988 100644 --- a/app/Route/Partners/Partner_.elm +++ b/app/Route/Partners/Partner_.elm @@ -23,9 +23,9 @@ import RouteBuilder import Shared import Task import Theme.Global +import Theme.Page.Partner import Theme.PageTemplate import Theme.Paginator exposing (Msg(..)) -import Theme.PartnerPage import Time import UrlPath import View @@ -221,7 +221,7 @@ view app _ model = , smallText = Nothing , innerContent = Just - (Theme.PartnerPage.viewInfo model + (Theme.Page.Partner.viewInfo model { partner = aPartner , events = eventsFromPartnerId aPartner.id app.sharedData.events } diff --git a/src/Theme/AboutPage.elm b/src/Theme/Page/About.elm similarity index 99% rename from src/Theme/AboutPage.elm rename to src/Theme/Page/About.elm index d33aab0..fcb6aa8 100644 --- a/src/Theme/AboutPage.elm +++ b/src/Theme/Page/About.elm @@ -1,4 +1,4 @@ -module Theme.AboutPage exposing (viewIntro, viewSections) +module Theme.Page.About exposing (viewIntro, viewSections) import Css exposing (Style, absolute, after, alignItems, auto, backgroundImage, backgroundPosition, backgroundRepeat, backgroundSize, batch, before, block, bottom, calc, center, column, display, displayFlex, flexDirection, flexShrink, height, important, int, justifyContent, left, margin, margin2, margin4, marginBottom, marginTop, minus, noRepeat, nthChild, padding, paddingBottom, paddingLeft, paddingRight, paddingTop, pct, position, property, px, relative, rem, right, spaceAround, top, url, vw, width, zIndex) import Css.Global exposing (descendants, typeSelector) diff --git a/src/Theme/EventPage.elm b/src/Theme/Page/Event.elm similarity index 99% rename from src/Theme/EventPage.elm rename to src/Theme/Page/Event.elm index 2a5aefe..5a55cd2 100644 --- a/src/Theme/EventPage.elm +++ b/src/Theme/Page/Event.elm @@ -1,4 +1,4 @@ -module Theme.EventPage exposing (viewButtons, viewEventInfo) +module Theme.Page.Event exposing (viewButtons, viewEventInfo) import Copy.Keys exposing (Key(..)) import Copy.Text exposing (isValidUrl, t) diff --git a/src/Theme/EventsPage.elm b/src/Theme/Page/Events.elm similarity index 99% rename from src/Theme/EventsPage.elm rename to src/Theme/Page/Events.elm index 5ffdcf2..c596d9e 100644 --- a/src/Theme/EventsPage.elm +++ b/src/Theme/Page/Events.elm @@ -1,4 +1,4 @@ -module Theme.EventsPage exposing (viewEvents, viewEventsList) +module Theme.Page.Events exposing (viewEvents, viewEventsList) import Copy.Keys exposing (Key(..)) import Copy.Text exposing (t) diff --git a/src/Theme/IndexPage.elm b/src/Theme/Page/Index.elm similarity index 98% rename from src/Theme/IndexPage.elm rename to src/Theme/Page/Index.elm index e831407..412dd77 100644 --- a/src/Theme/IndexPage.elm +++ b/src/Theme/Page/Index.elm @@ -1,4 +1,4 @@ -module Theme.IndexPage exposing (view) +module Theme.Page.Index exposing (view) import Copy.Keys exposing (Key(..)) import Copy.Text exposing (t) @@ -9,9 +9,9 @@ import Helpers.TransRoutes import Html.Styled exposing (Html, a, div, h1, h2, img, p, section, text) import Html.Styled.Attributes exposing (alt, css, href, src) import Shared -import Theme.EventsPage import Theme.Global -import Theme.NewsPage +import Theme.Page.Events +import Theme.Page.News import Time @@ -51,7 +51,7 @@ viewFeatured : Time.Posix -> List Data.PlaceCal.Events.Event -> Html msg viewFeatured fromTime eventList = section [ css [ sectionStyle, Theme.Global.darkBlueBackgroundStyle, eventsSectionStyle ] ] [ h2 [ css [ Theme.Global.smallFloatingTitleStyle ] ] [ text (t IndexFeaturedHeader) ] - , Theme.EventsPage.viewEventsList (Data.PlaceCal.Events.next4Events eventList fromTime) + , Theme.Page.Events.viewEventsList (Data.PlaceCal.Events.next4Events eventList fromTime) , p [ css [ Theme.Global.buttonFloatingWrapperStyle, width (calc (pct 100) minus (rem 2)) ] ] [ a [ href (Helpers.TransRoutes.toAbsoluteUrl Helpers.TransRoutes.Events) @@ -68,7 +68,7 @@ viewLatestNews maybeNewsItem title buttonText = [ h2 [ css [ Theme.Global.smallFloatingTitleStyle ] ] [ text title ] , case maybeNewsItem of Just news -> - Theme.NewsPage.viewNewsArticle news + Theme.Page.News.viewNewsArticle news Nothing -> text "" diff --git a/src/Theme/JoinUsPage.elm b/src/Theme/Page/JoinUs.elm similarity index 99% rename from src/Theme/JoinUsPage.elm rename to src/Theme/Page/JoinUs.elm index 0689280..981789a 100644 --- a/src/Theme/JoinUsPage.elm +++ b/src/Theme/Page/JoinUs.elm @@ -1,4 +1,4 @@ -module Theme.JoinUsPage exposing (FormInput, FormState(..), Model, Msg(..), blankForm, update, view) +module Theme.Page.JoinUs exposing (FormInput, FormState(..), Model, Msg(..), blankForm, update, view) import Constants exposing (joinUsFunctionUrl) import Copy.Keys exposing (Key(..)) diff --git a/src/Theme/NewsPage.elm b/src/Theme/Page/News.elm similarity index 98% rename from src/Theme/NewsPage.elm rename to src/Theme/Page/News.elm index e42227f..7059bbf 100644 --- a/src/Theme/NewsPage.elm +++ b/src/Theme/Page/News.elm @@ -1,4 +1,4 @@ -module Theme.NewsPage exposing (viewNewsArticle, viewNewsList) +module Theme.Page.News exposing (viewNewsArticle, viewNewsList) import Copy.Keys exposing (Key(..)) import Copy.Text exposing (t) diff --git a/src/Theme/NewsItemPage.elm b/src/Theme/Page/NewsItem.elm similarity index 98% rename from src/Theme/NewsItemPage.elm rename to src/Theme/Page/NewsItem.elm index a113729..3248932 100644 --- a/src/Theme/NewsItemPage.elm +++ b/src/Theme/Page/NewsItem.elm @@ -1,4 +1,4 @@ -module Theme.NewsItemPage exposing (viewArticle) +module Theme.Page.NewsItem exposing (viewArticle) import Css exposing (Style, after, auto, batch, block, bold, borderRadius, center, display, firstChild, fontSize, fontWeight, height, margin, margin2, margin4, marginTop, maxWidth, pct, property, px, rem, textAlign, width) import Css.Global exposing (descendants, typeSelector) diff --git a/src/Theme/PartnerPage.elm b/src/Theme/Page/Partner.elm similarity index 96% rename from src/Theme/PartnerPage.elm rename to src/Theme/Page/Partner.elm index a65e7d5..b99c4df 100644 --- a/src/Theme/PartnerPage.elm +++ b/src/Theme/Page/Partner.elm @@ -1,4 +1,4 @@ -module Theme.PartnerPage exposing (viewInfo) +module Theme.Page.Partner exposing (viewInfo) import Copy.Keys exposing (Key(..)) import Copy.Text exposing (t) @@ -7,8 +7,8 @@ import Data.PlaceCal.Events import Data.PlaceCal.Partners import Html.Styled exposing (Html, a, address, div, h3, hr, p, section, span, text) import Html.Styled.Attributes exposing (css, href, id, target) -import Theme.EventsPage import Theme.Global exposing (hrStyle, introTextLargeStyle, linkStyle, normalFirstParagraphStyle, pink, smallInlineTitleStyle, white, withMediaMediumDesktopUp, withMediaTabletLandscapeUp, withMediaTabletPortraitUp) +import Theme.Page.Events import Theme.TransMarkdown @@ -53,7 +53,7 @@ viewPartnerEvents localModel { partner, events } = (if List.length events > 0 then if List.length events > 20 then [ eventAreaTitle - , Theme.EventsPage.viewEvents localModel + , Theme.Page.Events.viewEvents localModel ] else @@ -67,7 +67,7 @@ viewPartnerEvents localModel { partner, events } = [ if List.length futureEvents > 0 then div [] [ eventAreaTitle - , Theme.EventsPage.viewEventsList futureEvents + , Theme.Page.Events.viewEventsList futureEvents ] else @@ -75,7 +75,7 @@ viewPartnerEvents localModel { partner, events } = , if List.length pastEvents > 0 then div [] [ h3 [ css [ smallInlineTitleStyle, color white ] ] [ text (t (PartnerPreviousEventsText partner.name)) ] - , Theme.EventsPage.viewEventsList pastEvents + , Theme.Page.Events.viewEventsList pastEvents ] else diff --git a/src/Theme/PartnersPage.elm b/src/Theme/Page/Partners.elm similarity index 99% rename from src/Theme/PartnersPage.elm rename to src/Theme/Page/Partners.elm index 3233b12..a2a6683 100644 --- a/src/Theme/PartnersPage.elm +++ b/src/Theme/Page/Partners.elm @@ -1,4 +1,4 @@ -module Theme.PartnersPage exposing (viewPartners) +module Theme.Page.Partners exposing (viewPartners) import Copy.Keys exposing (Key(..)) import Copy.Text exposing (t)