Skip to content

Commit

Permalink
Move page templates into directory
Browse files Browse the repository at this point in the history
  • Loading branch information
katjam committed Oct 13, 2024
1 parent 5bac80b commit aec61c5
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 42 deletions.
6 changes: 3 additions & 3 deletions app/Route/About.elm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/Route/Events.elm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions app/Route/Events/Event_.elm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Head
import PagesMsg
import RouteBuilder
import Shared
import Theme.EventPage
import Theme.Page.Event
import Theme.PageTemplate
import View

Expand Down Expand Up @@ -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)
}
]
}
4 changes: 2 additions & 2 deletions app/Route/Index.elm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Head
import PagesMsg
import RouteBuilder
import Shared
import Theme.IndexPage
import Theme.Page.Index
import Theme.PageTemplate
import View

Expand Down Expand Up @@ -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 ]
}
14 changes: 7 additions & 7 deletions app/Route/JoinUs.elm
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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
)
Expand All @@ -58,7 +58,7 @@ route =
|> RouteBuilder.buildWithLocalState
{ init = init
, view = view
, update = Theme.JoinUsPage.update
, update = Theme.Page.JoinUs.update
, subscriptions = subscriptions
}

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/Route/News.elm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Head
import PagesMsg
import RouteBuilder
import Shared
import Theme.NewsPage
import Theme.Page.News
import Theme.PageTemplate
import View

Expand Down Expand Up @@ -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)
)
}
Expand Down
4 changes: 2 additions & 2 deletions app/Route/News/NewsItem_.elm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
}
]
Expand Down
4 changes: 2 additions & 2 deletions app/Route/Partners.elm
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import Head
import PagesMsg
import RouteBuilder
import Shared
import Theme.Page.Partners
import Theme.PageTemplate
import Theme.PartnersPage
import View


Expand Down Expand Up @@ -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
}
]
Expand Down
4 changes: 2 additions & 2 deletions app/Route/Partners/Partner_.elm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/Theme/AboutPage.elm → src/Theme/Page/About.elm
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Theme/EventPage.elm → src/Theme/Page/Event.elm
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Theme/EventsPage.elm → src/Theme/Page/Events.elm
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
10 changes: 5 additions & 5 deletions src/Theme/IndexPage.elm → src/Theme/Page/Index.elm
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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


Expand Down Expand Up @@ -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)
Expand All @@ -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 ""
Expand Down
2 changes: 1 addition & 1 deletion src/Theme/JoinUsPage.elm → src/Theme/Page/JoinUs.elm
Original file line number Diff line number Diff line change
@@ -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(..))
Expand Down
2 changes: 1 addition & 1 deletion src/Theme/NewsPage.elm → src/Theme/Page/News.elm
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Theme/NewsItemPage.elm → src/Theme/Page/NewsItem.elm
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
10 changes: 5 additions & 5 deletions src/Theme/PartnerPage.elm → src/Theme/Page/Partner.elm
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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


Expand Down Expand Up @@ -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
Expand All @@ -67,15 +67,15 @@ viewPartnerEvents localModel { partner, events } =
[ if List.length futureEvents > 0 then
div []
[ eventAreaTitle
, Theme.EventsPage.viewEventsList futureEvents
, Theme.Page.Events.viewEventsList futureEvents
]

else
div [] []
, 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
Expand Down
2 changes: 1 addition & 1 deletion src/Theme/PartnersPage.elm → src/Theme/Page/Partners.elm
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit aec61c5

Please sign in to comment.