summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2018-09-05 17:33:12 +0200 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2018-09-05 17:33:12 +0200 |
commit | cac1a06891a47c78dacd4c1002e1893fec5be270 (patch) | |
tree | c36d459388889791000e3f539bec1fd00ca9feb0 /src/main-menu | |
parent | bb2ea8aeecba2dca692e695e16b81c14c92724a7 (diff) |
Adds map listing.
Diffstat (limited to 'src/main-menu')
-rw-r--r-- | src/main-menu/src/ElmModule/View.elm | 4 | ||||
-rw-r--r-- | src/main-menu/src/View/MapListing.elm | 74 |
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") + ] + ) + ] + ) |