Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds about page #110

Merged
merged 8 commits into from
Aug 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -53,12 +54,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 @@ -165,6 +173,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 @@ -736,7 +772,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 @@ -752,7 +788,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 @@ -765,7 +804,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