aboutsummaryrefslogtreecommitdiff
path: root/src/View
diff options
context:
space:
mode:
authorJoris Guyonvarch2015-04-18 11:03:56 +0200
committerJoris Guyonvarch2015-04-18 11:03:56 +0200
commita14b3c3d4447cbeb77e4146fba7e0d31393e625e (patch)
treea325de340e88df4706925dd166aefa985f085a06 /src/View
parent3eff27c41a0501d07586b90c8bbb835a3ec86b84 (diff)
Parsing images in detail and show URLs in notifications
Diffstat (limited to 'src/View')
-rw-r--r--src/View/Ad.hs19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/View/Ad.hs b/src/View/Ad.hs
index 5ab08e6..ec5da2d 100644
--- a/src/View/Ad.hs
+++ b/src/View/Ad.hs
@@ -7,16 +7,21 @@ module View.Ad
import Data.List (intersperse)
import Data.Maybe (fromMaybe)
+
import Data.Text (Text)
import qualified Data.Text as T
import Model.Ad (Ad(..))
import qualified Model.Ad as Ad
+
import Model.Resume (Resume(..))
import qualified Model.Resume as Resume
+
import Model.Detail (Detail(..))
import qualified Model.Detail as Detail
+import Model.URL
+
renderConsoleAds :: Text -> [Ad] -> Text
renderConsoleAds time ads =
let (title, message) = renderAds ads
@@ -72,4 +77,16 @@ renderResume resume =
renderDetail :: Detail -> Text
renderDetail detail =
- fromMaybe "−" (Detail.description detail)
+ T.concat
+ [ fromMaybe "−" (Detail.description detail)
+ , renderURLs "\n\nImages" (Detail.images detail)
+ ]
+
+renderURLs :: Text -> [URL] -> Text
+renderURLs title [] = ""
+renderURLs title urls =
+ T.concat
+ [ title
+ , "\n\n"
+ , T.intercalate "\n" urls
+ ]