diff --git a/aion/web/elm/src/General/View.elm b/aion/web/elm/src/General/View.elm index e172f22..40e5a0b 100644 --- a/aion/web/elm/src/General/View.elm +++ b/aion/web/elm/src/General/View.elm @@ -18,17 +18,16 @@ notFoundView = ] +asGridContainer : List (Html msg) -> Html msg asGridContainer data = - Grid.container [] data + Grid.containerFluid [] data roomListView : Model -> Html Msg roomListView model = div [] - [ h4 [ class "room-list-label" ] [ text "Recommended" ] - , displayRooms model.rooms Recommended + [ displaySpecialRooms model.rooms , hr [ class "room-content-separator" ] [] - , h4 [ class "room-list-label" ] [ text "All rooms" ] , displayRooms model.rooms All ] @@ -38,6 +37,27 @@ type FilterType | All +displaySpecialRooms : WebData RoomsData -> Html Msg +displaySpecialRooms rooms = + let + fun = + \rooms -> + let + data = + rooms + |> .data + |> List.take 3 + in + Grid.container [] + [ Grid.row [] (List.map displaySpecialRoom data) ] + in + div [] [ displayWebData rooms fun ] + + +displaySpecialRoom room = + Grid.col [] [ div [ class "tile" ] [ displayRoomLabel room Recommended ] ] + + displayRooms : WebData RoomsData -> FilterType -> Html Msg displayRooms rooms filterType = let @@ -75,11 +95,11 @@ listRoomsSlice rooms = listSingleRoom : Room -> Grid.Column Msg listSingleRoom room = Grid.col [ Col.lg2, Col.md4 ] - [ div [ class "tile" ] [ displayRoomLabel room ] ] + [ div [ class "tile" ] [ displayRoomLabel room All ] ] -displayRoomLabel : Room -> Html Msg -displayRoomLabel room = +displayRoomLabel : Room -> FilterType -> Html Msg +displayRoomLabel room roomType = let url = "#rooms/" ++ (toString room.id) @@ -97,8 +117,22 @@ displayRoomLabel room = _ -> toString (room.player_count) ++ " players" + + extras = + let + label = + case roomType of + All -> + [] + + Recommended -> + [ text "The most crowded right now" ] + in + p [ class "tile-room-description" ] label in a [ href url ] - [ p [ class "tile-room-name" ] [ text roomName ] - , p [ class "tile-player-count" ] [ text playerCount ] - ] + ([ p [ class "tile-room-name" ] [ text roomName ] + , p [ class "tile-player-count" ] [ text playerCount ] + ] + ++ [ extras ] + ) diff --git a/aion/web/static/css/app.css b/aion/web/static/css/app.css index b4f13f6..9254985 100644 --- a/aion/web/static/css/app.css +++ b/aion/web/static/css/app.css @@ -121,7 +121,7 @@ footer p { margin-bottom: 0px; border-radius: 3px; background-color: #5cb85c; - max-height: 90px; + max-height: 150px; } .tile a { @@ -148,9 +148,14 @@ footer p { } .tile-player-count { - padding-bottom: 30px; + /*padding-bottom: 30px;*/ font-size: 12px; } +.tile-room-description { + padding-bottom: 10px; + font-style: italic; + text-align: justify; +} .tile-player-count::before { content: "\f007";