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

Dates & where they met #41

Merged
merged 4 commits into from
Dec 17, 2017
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
29 changes: 16 additions & 13 deletions elm-package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{
"version": "1.0.0",
"summary": "an elm boilerplate",
"repository": "https://github.com/astroash/elm-spa-boiler-plate.git",
"license": "BSD3",
"source-directories": ["src/elm"],
"exposed-modules": [],
"dependencies": {
"elm-community/elm-datepicker": "7.2.5 <= v < 8.0.0",
"elm-lang/core": "5.1.1 <= v < 6.0.0",
"elm-lang/html": "2.0.0 <= v < 3.0.0",
"elm-lang/navigation": "2.1.0 <= v < 3.0.0"
},
"elm-version": "0.18.0 <= v < 0.19.0"
"version": "1.0.0",
"summary": "an elm boilerplate",
"repository": "https://github.com/astroash/elm-spa-boiler-plate.git",
"license": "BSD3",
"source-directories": [
"src/elm"
],
"exposed-modules": [],
"dependencies": {
"elm-community/elm-datepicker": "7.2.5 <= v < 8.0.0",
"elm-lang/core": "5.1.1 <= v < 6.0.0",
"elm-lang/html": "2.0.0 <= v < 3.0.0",
"elm-lang/navigation": "2.1.0 <= v < 3.0.0",
"mgold/elm-date-format": "1.4.2 <= v < 2.0.0"
},
"elm-version": "0.18.0 <= v < 0.19.0"
}
7 changes: 1 addition & 6 deletions src/css/_custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ button {
/**/
.interactionDetailsImage {
background: url('./assets/png/record_bg.png') no-repeat;
background-size: contain;
}

.imageInteractionItem {
Expand All @@ -179,12 +180,6 @@ button {
background-color: #ffffffcf;
}

.interactionDetailsImage {
background: url('./assets/png/record_bg.png') no-repeat;
background-size: cover;
z-index: -1;
}

.h6 {
height: 25rem;
}
Expand Down
1 change: 1 addition & 0 deletions src/elm/Routes/NewContactDetailsPage.elm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ newContactDetailsPage model =
, formItem "assets/svg_icons/email.svg" "Email" model.currentInteraction.email SetContactEmail
, formItem "assets/svg_icons/phone.svg" "Phone" model.currentInteraction.phone SetContactPhone
, formItem "assets/svg_icons/company.svg" "Organisation" model.currentInteraction.organisation SetContactOrganisation
, formItem "assets/svg_icons/handshake_icn.svg" "Where did you meet" model.currentInteraction.event SetContactWhere
, div [ class "bb b--blue bw1 w-80 center flex items-center pb2 mb2" ]
[ img [ src "assets/svg_icons/cal.svg", class "w2" ] []
, div [ class "" ]
Expand Down
2 changes: 1 addition & 1 deletion src/elm/Routes/NewNotesPage.elm
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ audioView model =


buttonClass =
"dim b pointer w7 h3 f4 ma2"
"dim b pointer w7 h3 f4 ma2 button-transparent"


textView : Model -> Html Msg
Expand Down
2 changes: 1 addition & 1 deletion src/elm/Routes/NewRecommendPage.elm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ viewMaker : Html Types.Msg -> Html Types.Msg
viewMaker filler =
div [ class "fixed bottom-0 left-0 vh-100 w-100 pt5" ]
[ div [ class "ba b--blue bw2 br3 bg-white z-999 w-90 vh-75 pa0 ma0 center mt5 grows transition-none " ]
[ button [ class "link ma2 relative top-0 left-0", onClick <| ChangeDetails ChooseDeets ]
[ button [ class "button-transparent link ma2 relative top-0 left-0", onClick <| ChangeDetails ChooseDeets ]
[ img [ src "./assets/svg_icons/remove.svg" ] []
]
, filler
Expand Down
15 changes: 0 additions & 15 deletions src/elm/Routes/NewSharePage.elm

This file was deleted.

14 changes: 0 additions & 14 deletions src/elm/Routes/NewThankYouPage.elm

This file was deleted.

85 changes: 51 additions & 34 deletions src/elm/Routes/PreviousDetailPage.elm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module Routes.PreviousDetailPage exposing (..)

import Date.Format exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
Expand All @@ -21,46 +22,62 @@ previousDetailPage model =
case model.liveInteraction.notes.audioUrl of
audioUrl ->
audio [ controls False, class " mv3 pa3", id "audio", src audioUrl ] []

date =
case model.liveInteraction.interactionDate of
Just d ->
Date.Format.format "%A, %B %d, %Y" d

_ ->
"No date given"

fUDate =
case model.liveInteraction.followUpDate of
Just d ->
Date.Format.format "%A, %B %d, %Y" d

_ ->
"No date given"
in
div [ class "interactionDetailsImage w-60-ns center brand tc" ]
[ div [ class "w-100 h4 bg-white bb b--black-10 v-mid flex" ]
[ a [ href "#" ] [ img [ class "pa3 h3", src "./assets/png/icon.png" ] [] ]
, h2 [ class "blue center pt2" ] [ text model.liveInteraction.name ]
div [ class "interactionDetailsImage w-60-ns center brand tc" ]
[ div [ class "w-100 h4 bg-white bb b--black-10 v-mid flex" ]
[ a [ href "#" ] [ img [ class "pa3 h3", src "./assets/png/icon.png" ] [] ]
, h2 [ class "blue center pt2" ] [ text model.liveInteraction.name ]
]
, div [ class "w-100 center ma0 pa0" ]
[ div [ class "inline-flex flex-wrap" ]
[ button [ onClick <| PlayAudio True, class "button-transparent" ] [ img [ class "ma2 br-100", src "./assets/svg_icons/hear_rec.svg" ] [ interactionAudioHtml ] ]
, img [ class "ma2", src "./assets/svg_icons/man.svg" ] []
, button [ class "button-transparent" ] [ img [ class "ma2 br-100", src "./assets/svg_icons/cal.svg" ] [] ]
]
, div [ class "w-100 center ma0 pa0" ]
[ div [ class "inline-flex flex-wrap" ]
[ button [ onClick <| PlayAudio True, class "button-transparent" ] [ img [ class "ma3 br-100", src "./assets/svg_icons/hear_rec.svg" ] [ interactionAudioHtml ] ]
, img [ class "ma3", src "./assets/svg_icons/man.svg" ] []
, button [ class "button-transparent" ] [ img [ class "ma3 br-100", src "./assets/svg_icons/cal.svg" ] [] ]
]
]
, interactionAudioHtml
, div [ class " w-100" ]
[ div [ class "bg-blue white pa0 ma0" ]
[ h3 [ class "center pt3 underline" ] [ text "Date:" ]
, p [ class "f5" ] [ text date ]
, p [ class "f5 ma0 pb3" ] [ text <| "at " ++ model.liveInteraction.event ]
]
, div [ class "bg-moon-gray blue ma0" ]
[ h3 [ class "bold center pt3 mt0" ] [ text "Notes" ]
, interactionTextHtml
]
, interactionAudioHtml
, div [ class " w-100" ]
[ div [ class "bg-blue white pa0 ma0" ]
[ h3 [ class "center pt3 underline" ] [ text "Date and time" ]
, p [ class "f5" ] [ text "Met on Aug 3rd, 2017 at 6pm" ]
, p [ class "f5 ma0 pb3" ] [ text "at New Town Hall, GL8 9JDF" ]
]
, div [ class "bg-moon-gray blue ma0" ]
[ h3 [ class "bold center pt3 mt0" ] [ text "Notes" ]
, interactionTextHtml
]
, div [ class "bg-light-gray blue ma0" ]
[ h3 [ class "mt0 pt3" ] [ text "Contact" ]
, p [] [ text <| "Email: " ++ model.liveInteraction.email ]
, p [ class "pb3 ma0" ] [ text <| "Phone: " ++ model.liveInteraction.phone ]
]
, div [ class "bg-near-white blue ma0" ] <|
[ h3 [ class "mt0 pt3" ] [ text "Actions" ]
, p [] [ text "Shared" ]
, p [ class "pb3 ma0" ] [ text "Reminders" ]
]
, div [ class "bg-light-gray blue ma0" ]
[ h3 [ class "mt0 pt3" ] [ text "Contact" ]
, p [] [ text <| "Email: " ++ model.liveInteraction.email ]
, p [ class "pb3 ma0" ] [ text <| "Phone: " ++ model.liveInteraction.phone ]
]
, div [ class "bg-white blue ma0" ] <|
[ h3 [ class "mt0 pt3" ] [ text "Recommendations" ]
, div [ class "bg-near-white blue ma0" ] <|
[ h3 [ class "mt0 pt3" ] [ text "Actions" ]
, p [ class "f5 pb2" ] [ text "You shared this with " ]
, p [ class "f5 pb3" ] [ text <| "Follow this up on " ++ fUDate ]
]
++ List.map recommendItem model.liveInteraction.recommendations
]
, div [ class "bg-white blue ma0" ] <|
[ h3 [ class "mt0 pt3" ] [ text "Recommendations" ]
]
++ List.map recommendItem model.liveInteraction.recommendations
]


recommendItem : Recommendation -> Html Msg
Expand Down
18 changes: 15 additions & 3 deletions src/elm/Routes/PreviousOverviewPage.elm
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
module Routes.PreviousOverviewPage exposing (..)

import Components.TitleBar exposing (..)
import Date.Format exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Types exposing (..)
import Components.TitleBar exposing (..)


previousOverviewPage : Model -> Html Msg
Expand All @@ -23,10 +24,21 @@ previousOverviewPage model =

interactionItem : Interaction -> Html Msg
interactionItem interaction =
let
date =
case interaction.interactionDate of
Just d ->
Date.Format.format "%d/%m/%Y" d

_ ->
"No date given"
in
button [ class "w-100 interactionItem button-border", onClick <| SelectInteractionItem interaction ]
[ li [ class "db b--blue-10" ]
[ div [ class "flex justify-end" ]
[ p [ class "bg-blue w3 h1 br3 white mr3 mb0" ] [ text interaction.tags ] ]
[ div [ class "flex justify-between" ]
[ p [ class "bg-blue ph2 h1 br3 white mr3 mb0" ] [ text date ]
, p [ class "bg-blue ph2 h1 br3 white mr3 mb0" ] [ text interaction.tags ]
]
, h1 [ class "f4 b blue f3 mt0" ] [ text interaction.organisation ]
, p [ class "ma1 b blue f4" ] [ text interaction.name ]
, div [ class "b blue" ] [ text interaction.notes.text ]
Expand Down
37 changes: 23 additions & 14 deletions src/elm/State.elm
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ init =
DatePicker.init
in
( { route = HomeRoute
, currentInteraction = Interaction Nothing "" "" "" "" (Notes "" "") "" [] Nothing CurrentMemberNotSet
, currentInteraction = Interaction Nothing "" "" "" "" (Notes "" "") "" [] Nothing CurrentMemberNotSet ""
, recordedInteractions = listRecordedInteractions
, notesPage = Choose
, isRecording = False
, datePicker = datePicker
, liveInteraction = Interaction Nothing "" "" "" "" (Notes "" "") "" [] Nothing CurrentMemberNotSet
, liveInteraction = Interaction Nothing "" "" "" "" (Notes "" "") "" [] Nothing CurrentMemberNotSet ""
, searchInput = ""
, detailsPage = ChooseDeets
, newRecommend = Recommendation "" ""
Expand All @@ -40,14 +40,19 @@ init =

listRecordedInteractions : List Interaction
listRecordedInteractions =
[ Interaction Nothing "Alexa Vega" "PHS Limited" "[email protected]" "+447598772611" (Notes "A grafitti artist from Stroud that is looking for work" "") "Visual Arts" [ Recommendation "Lucy" "TBSA ltd", Recommendation "Rebe" "NHS" ] Nothing CurrentMemberNotSet
, Interaction Nothing "Daryl Sabara" "Cortez Ltd" "[email protected]" "+447532172611" (Notes "school teacher looking for a grafitti artist" "") "Education" [ Recommendation "Mavis" "Monzo", Recommendation "Ronan" "AirBnb" ] Nothing CurrentMemberNotSet
, Interaction Nothing "Antonio Banderas" "Cargo S.L." "[email protected]" "+447598772987" (Notes "school teacher looking for a grafitti artist" "") "Theatre" [ Recommendation "Max" "Uber Eats", Recommendation "Zooey" "Queen" ] Nothing CurrentMemberNotSet
, Interaction Nothing "Carla Gugino" "Organisation" "[email protected]" "+447532172611" (Notes "school teacher looking for a grafitti artist" "") "Community" [ Recommendation "Jen" "Tate Modern", Recommendation "Ellie" "Deliveroo" ] Nothing CurrentMemberNotSet
, Interaction Nothing "Antonio Banderas" "Cargo S.L." "[email protected]" "+447598772987" (Notes "school teacher looking for a grafitti artist" "") "New Media" [ Recommendation "Dan" "Olympics ltd", Recommendation "Ash" "British Council" ] Nothing CurrentMemberNotSet
[ Interaction (makeDate "12/12/2017") "Alexa Vega" "PHS Limited" "[email protected]" "+447598772611" (Notes "A grafitti artist from Stroud that is looking for work" "") "Artist" [ Recommendation "Lucy" "TBSA ltd", Recommendation "Rebe" "NHS" ] (makeDate "12/21/2017") CurrentMemberNotSet "Farmers Market"
, Interaction (makeDate "11/28/2017") "Daryl Sabara" "Cortez Ltd" "[email protected]" "+447532172611" (Notes "school teacher looking for a grafitti artist" "") "Fine Arts" [ Recommendation "Mavis" "Monzo", Recommendation "Ronan" "AirBnb" ] (makeDate "12/19/2017") CurrentMemberNotSet "Farmers Market"
, Interaction (makeDate "11/19/2017") "Antonio Banderas" "Cargo S.L." "[email protected]" "+447598772987" (Notes "school teacher looking for a grafitti artist" "") "Event" [ Recommendation "Max" "Uber Eats", Recommendation "Zooey" "Queen" ] (makeDate "12/01/2017") CurrentMemberNotSet "Farmers Market"
, Interaction (makeDate "11/12/2017") "Carla Gugino" "Organisation" "[email protected]" "+447532172611" (Notes "school teacher looking for a grafitti artist" "") "Community" [ Recommendation "Jen" "Tate Modern", Recommendation "Ellie" "Deliveroo" ] (makeDate "11/18/2017") CurrentMemberNotSet "Farmers Market"
, Interaction (makeDate "10/01/2017") "Antonio Banderas" "Cargo S.L." "[email protected]" "+447598772987" (Notes "school teacher looking for a grafitti artist" "") "New Media" [ Recommendation "Dan" "Olympics ltd", Recommendation "Ash" "British Council" ] (makeDate "10/29/2017") CurrentMemberNotSet "Farmers Market"
]


makeDate : String -> Maybe Date
makeDate string =
Result.toMaybe (Date.fromString string)



--UPDATE

Expand All @@ -67,12 +72,6 @@ getRoute hash =
"#newRecommend" ->
NewRecommendRoute

"#newShare" ->
NewShareRoute

"#newThankYou" ->
NewThankYouRoute

"#previousOverview" ->
PreviousInteractionsOverviewRoute

Expand Down Expand Up @@ -193,6 +192,16 @@ update msg model =
in
( { model | currentInteraction = newInteraction }, Cmd.none )

SetContactWhere input ->
let
interaction =
model.currentInteraction

newInteraction =
{ interaction | event = input }
in
( { model | currentInteraction = newInteraction }, Cmd.none )

GoBack ->
( model, Navigation.back 1 )

Expand Down Expand Up @@ -352,7 +361,7 @@ update msg model =
Navigation.newUrl "#previousDetail"

resetInt =
Interaction Nothing "" "" "" "" (Notes "" "") "" [] Nothing CurrentMemberNotSet
Interaction Nothing "" "" "" "" (Notes "" "") "" [] Nothing CurrentMemberNotSet ""

updateList =
model.currentInteraction :: model.recordedInteractions
Expand Down
4 changes: 2 additions & 2 deletions src/elm/Types.elm
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ type Route
| NewContactDetailsRoute
| NewNotesRoute
| NewRecommendRoute
| NewShareRoute --| with follow up date
| NewThankYouRoute
| PreviousInteractionsOverviewRoute
| PreviousInteractionsDetailRoute
| NotFoundRoute
Expand Down Expand Up @@ -64,6 +62,7 @@ type alias Interaction =
, recommendations : List Recommendation
, followUpDate : Maybe Date
, currentMember : CurrentMemberOptions
, event : String
}


Expand Down Expand Up @@ -116,6 +115,7 @@ type Msg
| SetContactEmail String
| SetContactPhone String
| SetContactOrganisation String
| SetContactWhere String
| GoBack
| SetCurrentContact CurrentMemberOptions
| ChangeNotes NoteState
Expand Down
12 changes: 2 additions & 10 deletions src/elm/View.elm
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import Routes.Home exposing (..)
import Routes.NewContactDetailsPage exposing (..)
import Routes.NewNotesPage exposing (..)
import Routes.NewRecommendPage exposing (..)
import Routes.NewSharePage exposing (..)
import Routes.NewThankYouPage exposing (..)
import Routes.NotFoundPage exposing (..)
import Routes.PreviousDetailPage exposing (..)
import Routes.PreviousOverviewPage exposing (..)
Expand All @@ -33,12 +31,6 @@ view model =
NewRecommendRoute ->
newRecommendPage model

NewShareRoute ->
newSharePage model

NewThankYouRoute ->
newThankYouPage model

PreviousInteractionsOverviewRoute ->
previousOverviewPage model

Expand All @@ -48,5 +40,5 @@ view model =
NotFoundRoute ->
notFoundPage model
in
div []
[ page ]
div []
[ page ]