1
1
mirror of https://github.com/aelve/guide.git synced 2024-11-22 03:12:58 +03:00

Add explanation field for Trait

This commit is contained in:
Andrei 2018-11-23 23:56:28 +03:00
parent bc63e3a2d5
commit bb8c591768
2 changed files with 14 additions and 4 deletions

View File

@ -21,6 +21,7 @@ overloaded and can be used with many types.
module Guide.Types.Core
(
Trait(..),
explanation,
ItemKind(..),
hackageName,
ItemSection(..),
@ -90,14 +91,20 @@ For an explanation of deriveSafeCopySorted, see Note [acid-state].
-- | A trait (pro or con). Traits are stored in items.
data Trait = Trait {
_traitUid :: Uid Trait,
_traitContent :: MarkdownInline }
_traitUid :: Uid Trait,
_traitContent :: MarkdownInline,
_traitExplanation :: Maybe MarkdownBlock }
deriving (Show, Generic, Data)
deriveSafeCopySorted 4 'extension ''Trait
makeFields ''Trait
changelog ''Trait (Current 4, Past 3) []
deriveSafeCopySorted 5 'extension ''Trait
changelog ''Trait (Current 5, Past 4) [
Added "_traitExplanation" [t|Nothing|] ]
deriveSafeCopySorted 4 'extension ''Trait_v4
changelog ''Trait (Past 4, Past 3) []
deriveSafeCopySorted 3 'base ''Trait_v3
instance A.ToJSON Trait where

View File

@ -10,6 +10,8 @@ Required context:
* trait.uid
trait.content.html
trait.content.text
trait.explanation?.html
trait.explanation?.text
HTML
@ -19,6 +21,7 @@ HTML
<div class="section normal editable shown noscript-shown">
{{{trait.content.html}}}
{{{trait.explanation}}}
</div>
<div class="section editable">