summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main-menu/src/ElmModule/View.elm4
-rw-r--r--src/main-menu/src/View/MapListing.elm74
2 files changed, 77 insertions, 1 deletions
diff --git a/src/main-menu/src/ElmModule/View.elm b/src/main-menu/src/ElmModule/View.elm
index b37116c..7adf573 100644
--- a/src/main-menu/src/ElmModule/View.elm
+++ b/src/main-menu/src/ElmModule/View.elm
@@ -15,6 +15,7 @@ import Struct.UI
import Util.Html
import View.BattleListing
+import View.MapListing
import View.Header
--------------------------------------------------------------------------------
@@ -50,7 +51,8 @@ view model =
"Events"
"main-menu-events"
(Struct.Player.get_events model.player)
- )
+ ),
+ (View.MapListing.get_html (Struct.Player.get_maps model.player))
]
)
]
diff --git a/src/main-menu/src/View/MapListing.elm b/src/main-menu/src/View/MapListing.elm
new file mode 100644
index 0000000..79c39b4
--- /dev/null
+++ b/src/main-menu/src/View/MapListing.elm
@@ -0,0 +1,74 @@
+module View.MapListing exposing (get_html)
+
+-- Elm -------------------------------------------------------------------------
+import Html
+import Html.Attributes
+-- import Html.Events
+
+-- Map -------------------------------------------------------------------
+import Struct.MapSummary
+import Struct.Event
+
+--------------------------------------------------------------------------------
+-- LOCAL -----------------------------------------------------------------------
+--------------------------------------------------------------------------------
+get_item_html : Struct.MapSummary.Type -> (Html.Html Struct.Event.Type)
+get_item_html item =
+ (Html.a
+ [
+ (Html.Attributes.href
+ (
+ "/map-editor/?id="
+ ++ (Struct.MapSummary.get_id item)
+ )
+ )
+ ]
+ [
+ (Html.div
+ [
+ (Html.Attributes.class "main-menu-map-summary-name")
+ ]
+ [
+ (Html.text (Struct.MapSummary.get_name item))
+ ]
+ )
+ ]
+ )
+
+--------------------------------------------------------------------------------
+-- EXPORTED --------------------------------------------------------------------
+--------------------------------------------------------------------------------
+get_html : (
+ (List Struct.MapSummary.Type) ->
+ (Html.Html Struct.Event.Type)
+ )
+get_html map_summaries =
+ (Html.div
+ [
+ (Html.Attributes.class "main-menu-map-listing")
+ ]
+ [
+ (Html.div
+ [
+ (Html.Attributes.class "main-menu-map-listing-header")
+ ]
+ [
+ (Html.text "Territories")
+ ]
+ ),
+ (Html.div
+ [
+ (Html.Attributes.class "main-menu-map-listing-body")
+ ]
+ (List.map (get_item_html) map_summaries)
+ ),
+ (Html.div
+ [
+ (Html.Attributes.class "main-menu-map-listing-add-new")
+ ]
+ [
+ (Html.text "New")
+ ]
+ )
+ ]
+ )