mirror of
https://gitlab.com/upRootNutrition/website.git
synced 2025-08-10 04:14:38 -05:00
feat: so very close
This commit is contained in:
parent
131dbfe8a3
commit
f9b8f59df9
30 changed files with 1500 additions and 1272 deletions
|
@ -2,6 +2,7 @@ module Config.Helpers.Articles.Article exposing (..)
|
|||
|
||||
import Config.Data.Identity exposing (pageNames)
|
||||
import Config.Helpers.Articles.Types exposing (References)
|
||||
import Config.Helpers.Cards.Inner.Helpers exposing (detailFormat)
|
||||
import Config.Helpers.Cards.Outer.Helpers exposing (cardMaker)
|
||||
import Config.Helpers.Cards.Outer.Types as C
|
||||
import Config.Helpers.Format exposing (..)
|
||||
|
@ -45,34 +46,44 @@ import Shared exposing (..)
|
|||
import View exposing (View)
|
||||
|
||||
|
||||
contentList : BlogArticle -> List (Element msg)
|
||||
contentList article =
|
||||
[ articleImage article.articleImage
|
||||
, renderDeviceMarkdown article.articleBody
|
||||
contentList : BlogArticle -> List (Element msg) -> List (Element msg)
|
||||
contentList article extraElements =
|
||||
[ case article.articleImage of
|
||||
"" ->
|
||||
none
|
||||
|
||||
_ ->
|
||||
articleImage article.articleImage
|
||||
, case article.hasTableOfContents of
|
||||
True ->
|
||||
renderDeviceMarkdown article.articleBody
|
||||
|
||||
False ->
|
||||
renderDeviceMarkdownNoToc article.articleBody
|
||||
, case article.hasReferences of
|
||||
True ->
|
||||
articleReferences article
|
||||
|
||||
False ->
|
||||
none
|
||||
, detailFormat column extraElements
|
||||
]
|
||||
|
||||
|
||||
articleReferences : BlogArticle -> Element msg
|
||||
articleReferences article =
|
||||
el
|
||||
[ width fill
|
||||
, height fill
|
||||
]
|
||||
<|
|
||||
column [ width fill, F.size 15, spacing 10 ] <|
|
||||
List.map2 (\x y -> makeReference x y)
|
||||
article.articleReferences
|
||||
(List.range 1 (List.length article.articleReferences))
|
||||
column [ width fill, F.size 15, spacing 10 ] <|
|
||||
List.map2 (\x y -> makeReference x y)
|
||||
article.articleReferences
|
||||
(List.range 1 (List.length article.articleReferences))
|
||||
|
||||
|
||||
makeReference : References -> Int -> Element msg
|
||||
makeReference references index =
|
||||
let
|
||||
comma =
|
||||
", "
|
||||
in
|
||||
el
|
||||
[ F.regular
|
||||
, F.alignLeft
|
||||
|
@ -86,9 +97,9 @@ makeReference references index =
|
|||
, transitionStyleFast
|
||||
]
|
||||
{ url = references.link, label = text (String.fromInt index ++ ". ") }
|
||||
, text (references.author ++ ", ")
|
||||
, text (references.title ++ ", ")
|
||||
, text (references.journal ++ ", ")
|
||||
, text (references.author ++ comma)
|
||||
, text (references.title ++ comma)
|
||||
, text (references.journal ++ comma)
|
||||
, text references.year
|
||||
]
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ cardMaker device cardable contents =
|
|||
hasLink =
|
||||
case cardable of
|
||||
C.Contact _ ->
|
||||
False
|
||||
True
|
||||
|
||||
C.Cuck c ->
|
||||
False
|
||||
|
@ -81,6 +81,9 @@ cardMaker device cardable contents =
|
|||
C.ServicePage _ ->
|
||||
False
|
||||
|
||||
C.ContactPage _ ->
|
||||
False
|
||||
|
||||
cardTitleMaker : String -> Maybe String -> Element msg
|
||||
cardTitleMaker title maybeUrl =
|
||||
el
|
||||
|
@ -397,8 +400,11 @@ cardMaker device cardable contents =
|
|||
in
|
||||
case cardable of
|
||||
C.Contact contact ->
|
||||
cardWithNoImage
|
||||
(String.toUpper contact.contactName)
|
||||
cardWithImageWithLink
|
||||
contact.isNewTabLink
|
||||
contact.contactName
|
||||
(imagePathMaker M.Contact contact.contactImage)
|
||||
contact.contactLink
|
||||
contents
|
||||
|
||||
C.Cuck cuck ->
|
||||
|
@ -473,6 +479,11 @@ cardMaker device cardable contents =
|
|||
(String.toUpper service.serviceName)
|
||||
contents
|
||||
|
||||
C.ContactPage contact ->
|
||||
cardWithNoImage
|
||||
(String.toUpper contact.contactName)
|
||||
contents
|
||||
|
||||
|
||||
cardContentMaker : List (Element msg) -> Element msg
|
||||
cardContentMaker content =
|
||||
|
|
|
@ -14,6 +14,7 @@ import Config.Pages.Services.Types exposing (Service, ServicePage)
|
|||
|
||||
type Cardable msg
|
||||
= Contact Contact
|
||||
| ContactPage Contact
|
||||
| Cuck Cuck
|
||||
| BlogArticle BlogArticle
|
||||
| BlogCard BlogArticle
|
||||
|
|
|
@ -47,9 +47,13 @@ getImageFolderString imageFolder =
|
|||
ServicePage ->
|
||||
"services"
|
||||
|
||||
Contact ->
|
||||
"contact"
|
||||
|
||||
|
||||
type ImageFolder
|
||||
= Interviews
|
||||
| Contact
|
||||
| Gibberish
|
||||
| Cuck
|
||||
| BlogArticle
|
||||
|
|
|
@ -96,13 +96,14 @@ renderDeviceMarkdownNoToc : String -> Element msg
|
|||
renderDeviceMarkdownNoToc markdown =
|
||||
case renderMarkdownNoToc markdown of
|
||||
Ok ( _, renderedMarkdown ) ->
|
||||
-- Pattern match to get just the List (Element msg)
|
||||
column
|
||||
[ width fill
|
||||
, centerX
|
||||
, spacing 10
|
||||
paragraph []
|
||||
[ column
|
||||
[ width fill
|
||||
, centerX
|
||||
, spacing 10
|
||||
]
|
||||
renderedMarkdown
|
||||
]
|
||||
renderedMarkdown
|
||||
|
||||
Err error ->
|
||||
E.text error
|
||||
|
@ -365,7 +366,7 @@ elmUiRenderer =
|
|||
, unorderedList =
|
||||
\items ->
|
||||
E.column
|
||||
[ E.spacing 3
|
||||
[ E.spacing 10
|
||||
, paragraphFontSize
|
||||
]
|
||||
(items
|
||||
|
@ -398,8 +399,7 @@ elmUiRenderer =
|
|||
, orderedList =
|
||||
\startingIndex items ->
|
||||
E.column
|
||||
[ E.spacing 3
|
||||
, paragraphFontSize
|
||||
[ E.spacing 10
|
||||
, E.width fill
|
||||
]
|
||||
(items
|
||||
|
@ -413,10 +413,12 @@ elmUiRenderer =
|
|||
, width <| px 25
|
||||
, F.bold
|
||||
, alignRight
|
||||
, headerFontSizeMedium
|
||||
]
|
||||
(E.text (String.fromInt (index + startingIndex) ++ "."))
|
||||
, E.column
|
||||
[ alignLeft
|
||||
, paragraphFontSize
|
||||
, E.width fill
|
||||
]
|
||||
itemBlocks
|
||||
|
@ -481,7 +483,12 @@ codeBlock details =
|
|||
heading : { level : Block.HeadingLevel, rawText : String, children : List (Element msg) } -> Element msg
|
||||
heading { level, rawText, children } =
|
||||
column [ width fill, spacing 20 ]
|
||||
[ divider
|
||||
[ case level of
|
||||
Block.H1 ->
|
||||
divider
|
||||
|
||||
_ ->
|
||||
none
|
||||
, E.paragraph
|
||||
[ case level of
|
||||
Block.H1 ->
|
||||
|
@ -493,7 +500,12 @@ heading { level, rawText, children } =
|
|||
_ ->
|
||||
headerFontSizeSmall
|
||||
, F.bold
|
||||
, F.center
|
||||
, case level of
|
||||
Block.H1 ->
|
||||
F.center
|
||||
|
||||
_ ->
|
||||
F.alignLeft
|
||||
, width fill
|
||||
, F.color colourTheme.textLightOrange
|
||||
, Region.heading (Block.headingLevelToInt level)
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
module Config.Pages.Contact.Types exposing (..)
|
||||
|
||||
import Route.Path as Path
|
||||
|
||||
|
||||
type alias Contact =
|
||||
{ contactName : String
|
||||
, contactImage : String
|
||||
, contactLink : String
|
||||
, contactDescription : String
|
||||
, isNewTabLink : Bool
|
||||
}
|
||||
|
||||
|
||||
|
@ -11,7 +17,31 @@ type alias Method =
|
|||
}
|
||||
|
||||
|
||||
contactTitle : Contact
|
||||
contactTitle =
|
||||
{ contactName = "Contact"
|
||||
contactInquiry : Contact
|
||||
contactInquiry =
|
||||
{ contactName = "General Inquiry"
|
||||
, contactImage = "email"
|
||||
, contactDescription = ""
|
||||
, contactLink = Path.toString Path.Contact_Inquiry
|
||||
, isNewTabLink = True
|
||||
}
|
||||
|
||||
|
||||
contactCriticism : Contact
|
||||
contactCriticism =
|
||||
{ contactName = "Criticism"
|
||||
, contactImage = "discord"
|
||||
, contactDescription = ""
|
||||
, contactLink = Path.toString Path.Contact_Criticism
|
||||
, isNewTabLink = True
|
||||
}
|
||||
|
||||
|
||||
contactMain : Contact
|
||||
contactMain =
|
||||
{ contactName = "Contact"
|
||||
, contactImage = ""
|
||||
, contactDescription = ""
|
||||
, contactLink = ""
|
||||
, isNewTabLink = False
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import Config.Pages.Debate.Arguments.Types exposing (..)
|
|||
|
||||
argumentAgriculturalPredation : Argument
|
||||
argumentAgriculturalPredation =
|
||||
{ argumentTitle = toTitleCase "Argument for Animal Agirculture as Predation"
|
||||
{ argumentTitle = toTitleCase "Argument for Animal Agrirculture as Predation"
|
||||
, propositionTitle = "Animal agriculture counts as predation."
|
||||
, propositionReductio = ""
|
||||
, propositionSummary = "Some vegans suggest that killing odd order predators is wrong because predation is permissible. However, if animal agriculture also counts as predation, it's analytically entailed that animal agriculture is permissible as well."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue