Skip to content

Commit

Permalink
Merge pull request #110 from CodeforAustralia/features/97-about-page
Browse files Browse the repository at this point in the history
adds about page
  • Loading branch information
jessemoreburritos authored Aug 15, 2016
2 parents 05086af + 8552a98 commit 319aeec
Show file tree
Hide file tree
Showing 8 changed files with 126 additions and 6 deletions.
Binary file added prototype/images/logo-code-for-australia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions prototype/src/About.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
module About (view) where

import Html exposing (Html, section, header, div, p, span, img, a, i, text)
import Html.Attributes exposing (class, src, href)


{-| The main HTML view for about page -}
view : Html
view =
let
appInfo =
{ image = "images/logo.png"
, description = "Heritage Near Me is a government initiative to implement transformational change to protect, share, and celebrate heritage in NSW at the local level by working closely with local government and communities to ensure that local heritage values have greater recognition."
, title = "Heritage Near Me"
, url = "http://github.com/CodeforAustralia/heritage-near-me"
}
creditInfo =
{ image = "images/logo-code-for-australia.png"
, description = "Code for Australia is nonprofit whose vision is a responsive government that works seamlessly with the public to create meaningful change through technology. This project was built by Code for Australia's 2016 fellows in Sydney."
, title = "Code for Australia"
, url = "http://codeforaustralia.org"
}
in
div [class "content-area"]
[ aboutSectionHtml appInfo
, aboutSectionHtml creditInfo
]



type alias URL = String

type alias AboutEntry =
{ image : URL
, description : String
, title : String
, url : URL
}

aboutSectionHtml : AboutEntry -> Html
aboutSectionHtml entry =
section []
[ header []
[ img [src entry.image, class "about-image"] [] ]
, div []
[ p [] [text entry.description] ]
, div []
[ linkHtml entry.title entry.url ]
]


{-| The HTML for a single story link -}
linkHtml : String -> String -> Html
linkHtml name url = a [class "block-link", href url]
[ text name
, span [class "link-arrow"]
[ span [class "external-link"] [text "External Link"]
, i [class "fa fa-angle-right"] []
]
]
1 change: 1 addition & 0 deletions prototype/src/App.elm
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ updateModel action app = case (app.location, action) of
--(_, View story') -> {app | location = Viewing story' initialItemView screen1}
(_, View story' screen') -> {app | location = Viewing story' initialItemView screen'}
(_, ViewFavourites) -> {app | location = ViewingFavourites}
(_, ViewAboutScreen) -> {app | location = AboutScreen}
-- Data update actions
(_, LoadData updateItems) -> {app | items = updateItems app.items}
(_, LoadDiscoveryData items updateItems) -> {app | items = updateItems app.items, discovery = updateDiscoverableItems app.discovery items}
Expand Down
12 changes: 11 additions & 1 deletion prototype/src/Navigation.elm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ titleHtml location =

SplashPage -> none

AboutScreen ->
container [h1 [] [text "About"]]

Discovering ->
container [logoDiv]

Expand All @@ -42,14 +45,21 @@ buttonHtml address location =

SplashPage -> none

AboutScreen ->
backButton address

Discovering ->
button [onClick address ViewFavourites] [i [class "fa fa-heart fa-2x"] []]

Viewing _ _ _ ->
button [onClick address Back] [i [class "fa fa-angle-left fa-3x"] []]
backButton address

ViewingFavourites ->
button [onClick address Discover] [i [class "fa fa-map fa-2x"] []]

backButton : Signal.Address AppAction -> Html
backButton address =
button [onClick address Back] [i [class "fa fa-angle-left fa-3x"] []]

none : Html
none = text ""
2 changes: 2 additions & 0 deletions prototype/src/Route.elm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ action : List String -> List AppAction
action url = case url of
"discover"::_ -> [Discover]
"favourites"::_ -> [ViewFavourites]
"about"::_ -> [ViewAboutScreen]
"story"::storyId::storyScreen::_ ->
let
id = parseStoryId storyId
Expand All @@ -32,6 +33,7 @@ url : AppModel -> AppModel -> Maybe HashUpdate
url old new = if old.location /= new.location then
Just <| case new.location of
SplashPage -> RouteHash.set [""]
AboutScreen -> RouteHash.set ["about"]
Discovering -> RouteHash.set ["discover"]
ViewingFavourites -> RouteHash.set ["favourites"]
Viewing storyId _ storyScreen -> RouteHash.set ["story", storyIdToStr storyId, urliseStoryScreen storyScreen]
Expand Down
2 changes: 2 additions & 0 deletions prototype/src/Types.elm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ App screens:
-}
type Location id =
SplashPage
| AboutScreen
| Discovering
| Viewing id ItemView StoryScreen
| ViewingFavourites
Expand Down Expand Up @@ -54,6 +55,7 @@ type Action id a =
| View id StoryScreen
| ViewFavourites
| ViewSplashPage
| ViewAboutScreen
| Back
| LoadData UpdaterFunction
| LoadDiscoveryData (RemoteData (List id)) UpdaterFunction
Expand Down
6 changes: 6 additions & 0 deletions prototype/src/View.elm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Types exposing (..)
import Remote.Data
import Data
import Splash
import About
import Navigation exposing (navigation)
import Discover
import Story
Expand All @@ -39,6 +40,11 @@ screenView address app = case app.location of

SplashPage -> Splash.view

AboutScreen -> div [class "about-screen"]
[ navigation address app.location
, About.view
]

Discovering -> Discover.view address app
<| navigation address app.location

Expand Down
49 changes: 44 additions & 5 deletions prototype/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ html, body, body > div {

/* adjust some screens to start after nav bar
(but not all: screens with photos start beneath nav bar) */
.about-screen .content-area,
.favourites-screen .favourites,
.story-screen.story-body .fullStory-meta,
.story-screen.story-more-info .content-area,
Expand All @@ -54,12 +55,19 @@ html, body, body > div {
height: 100%;
text-align: center;
}
.favourites-screen .navigation-center {
/* .favourites-screen .navigation-center {
display: flex;
align-items: center;
justify-content: center;
}*/
.navigation-center {
display: flex;
align-items: center;
justify-content: center;
}
.favourites-screen .navigation-center h1 {
/*.favourites-screen .navigation-center h1 {*/

.navigation-center h1 {
color: white;
font-size: 24px;
font-weight: 400;
Expand Down Expand Up @@ -166,6 +174,34 @@ html, body, body > div {
}


/* About screen style */
.about-screen {
background: #383636;
}
.about-screen section {
margin: 0 16px;
color: #F9F9FB;
}
.about-screen p {
padding: 0;
color: #F9F9FB;
}
.about-image {
margin-top: 12px;
max-height: 40px;
}
.about-screen a {
color: white;
border-bottom: 1px solid #DCDCDC;
margin-bottom: 15px;
}
.about-screen a .external-link {
color: #DCDCDC;
}
.about-screen .content-area {
padding-bottom: 15px;
}

/* Discovery (swiping) style */
.discovery {
display: flex;
Expand Down Expand Up @@ -737,7 +773,7 @@ html, body, body > div {
border-bottom: none;
}

.links ul li a {
.links ul li a, .block-link {
display: flex;
justify-content: space-between;
align-items: center;
Expand All @@ -753,7 +789,10 @@ html, body, body > div {
background-color: #eee;
}

.links ul li a .link-arrow {
/*.links ul li a .link-arrow {*/
/*.links ul li a .link-arrow .external-link {*/

.link-arrow {
flex-shrink: 0;
}

Expand All @@ -766,7 +805,7 @@ html, body, body > div {
display: inline-block;
}

.links ul li a .link-arrow i {
.link-arrow i {
float: right;
margin-left: 5px;
padding: 2px;
Expand Down

0 comments on commit 319aeec

Please sign in to comment.