diff --git a/src/assets/scripts/elm/Main.elm b/src/assets/scripts/elm/Main.elm
index 21bbcc5..a92d549 100644
--- a/src/assets/scripts/elm/Main.elm
+++ b/src/assets/scripts/elm/Main.elm
@@ -6,6 +6,7 @@ import Html exposing (Html, a, br, div, h1, img, text)
import Html.Attributes exposing (class, href, id, src)
import Html.Events exposing (onClick)
import Pages.Counselors as Counselors
+import Pages.Login as LoginPage
import Session exposing (User)
import Url exposing (Url)
import Url.Parser as Parser exposing (Parser, map, oneOf, s, top)
@@ -20,14 +21,15 @@ type alias Model =
type Page
- = Dashboard
+ = LoginPage
+ | Dashboard
| Counselors Counselors.Model
init : Maybe User -> Url -> Key -> ( Model, Cmd Msg )
init user url key =
( { navKey = key
- , page = whichPage url
+ , page = whichPage user url
, user = user
}
, Cmd.none
@@ -42,9 +44,13 @@ routes =
]
-whichPage : Url -> Page
-whichPage url =
- Maybe.withDefault Dashboard (Parser.parse routes url)
+whichPage : Maybe User -> Url -> Page
+whichPage user url =
+ if user == Nothing then
+ LoginPage
+
+ else
+ Maybe.withDefault Dashboard (Parser.parse routes url)
@@ -55,6 +61,7 @@ type Msg
= ClickedLink UrlRequest
| ChangedUrl Url
| CounselorsMsg Counselors.Msg
+ | LoginPageMsg LoginPage.Msg
| Logout
| NoOp
@@ -73,7 +80,7 @@ update msg model =
( model, Nav.load href )
( ChangedUrl url, _ ) ->
- ( { model | page = whichPage url }, Cmd.none )
+ ( { model | page = whichPage model.user url }, Cmd.none )
( CounselorsMsg cMsg, Counselors cModel ) ->
let
@@ -107,6 +114,9 @@ view model =
Dashboard ->
mainHtml
+
+ LoginPage ->
+ Html.map LoginPageMsg LoginPage.view
in
{ title = "InteroCare Admin"
, body =
diff --git a/src/assets/scripts/elm/Pages/Login.elm b/src/assets/scripts/elm/Pages/Login.elm
index 10b9f53..99d1e40 100644
--- a/src/assets/scripts/elm/Pages/Login.elm
+++ b/src/assets/scripts/elm/Pages/Login.elm
@@ -1,5 +1,16 @@
-module Pages.Login exposing (Model)
+module Pages.Login exposing (Model, Msg, view)
+
+import Html exposing (Html, div)
+
+
+type Msg
+ = NoOp
type alias Model =
{}
+
+
+view : Html Msg
+view =
+ div [] []
diff --git a/src/index.html b/src/index.html
index d511d54..e2cfbb6 100755
--- a/src/index.html
+++ b/src/index.html
@@ -3,8 +3,7 @@
- Dashboard
-
+ Sign In
+
-
-
-
-
-
-
+
+
+
+
+

+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Total Page Views
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
100k
-
Visitors From USA
-
50%
-
-
-
-
1M
-
Visitors From Europe
-
80%
-
-
-
-
450k
-
Visitors From Australia
-
40%
-
-
-
-
1B
-
Visitors From India
-
90%
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Monthly Stats
-
-
-
-
-
-
-
- 10%
- APPL
-
-
- 2%
- Average
-
-
- 15%
- Sales
-
-
- 8%
- Profit
-
-
-
-
-
-
-
-
-
-
-
-
-
Sales Report
-
-
-
-
-
-
November 2017
-
Sales Report
-
-
-
$6,000
-
-
-
-
-
-
-
- | Name |
- Status |
- Date |
- Price |
-
-
-
-
- | Item #1 Name |
- Unavailable |
- Nov 18 |
- $12 |
-
-
- | Item #2 Name |
- New |
- Nov 19 |
- $34 |
-
-
- | Item #3 Name |
- New |
- Nov 20 |
- -$45 |
-
-
- | Item #4 Name |
- Unavailable |
- Nov 21 |
- $65 |
-
-
- | Item #5 Name |
- Used |
- Nov 22 |
- $78 |
-
-
- | Item #6 Name |
- Used |
- Nov 23 |
- -$88 |
-
-
- | Item #7 Name |
- Old |
- Nov 22 |
- $56 |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Weather
-
-
-
-
-
-
-
-
-
-
-
-
- Partly Clouds
-
-
-
-
-
-
-
Monday
-
-
- Nov, 01 2017
-
-
-
-
-
-
-
-
-
-
-
-
- Wind
-
-
- 10km/h
-
-
-
-
-
-
- Sunrise
-
-
- 05:00 AM
-
-
-
-
-
-
- Pressure
-
-
- 1B
-
-
-
-
-
-
-
-
-
-
-
MON
-
- 32°F
-
-
-
TUE
-
- 30°F
-
-
-
WED
-
- 28°F
-
-
-
THR
-
- 32°F
-
-
-
FRI
-
- 24°F
-
-
-
SAT
-
- 28°F
-
-
-
SUN
-
- 32°F
-
-
-
-
-
-
-
-
-
-
-
-
Quick Chat
-
-
-
-
-
-
-
-

-
-
-
-
-
-
- 10:00 AM
-
-
- Lorem Ipsum is simply dummy text of
-
-
-
-
-
-
- 10:00 AM
-
-
- the printing and typesetting industry.
-
-
-
-
-
-
- 10:00 AM
-
-
- Lorem Ipsum has been the industry's
-
-
-
-
-
-
-
-
-
-
-

-
-
-
-
-
-
- 10:00 AM
-
-
- Heloo
-
-
-
-
-
-
- 10:00 AM
-
-
- ??
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-