From 8055071b8bbf909db036ed45c17d787c8a05eeee Mon Sep 17 00:00:00 2001 From: Vidir Valberg Gudmundsson Date: Wed, 16 Aug 2017 19:58:04 +0200 Subject: [PATCH] Adding ICS button. Make sidebar not sticky. --- schedule/src/Views/FilterView.elm | 34 +++++++++++++++++++++++++++---- src/static_src/css/bornhack.css | 4 ---- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/schedule/src/Views/FilterView.elm b/schedule/src/Views/FilterView.elm index 333b7621..8a641868 100644 --- a/schedule/src/Views/FilterView.elm +++ b/schedule/src/Views/FilterView.elm @@ -14,8 +14,8 @@ import Regex -- External modules -import Html exposing (Html, text, div, ul, li, span, i, h4, small) -import Html.Attributes exposing (class, classList, style) +import Html exposing (Html, text, div, ul, li, span, i, h4, small, a) +import Html.Attributes exposing (class, classList, style, href) import Html.Events exposing (onClick) import Date.Extra exposing (Interval(..), equalBy) @@ -60,9 +60,7 @@ filterSidebar model = [ classList [ ( "col-sm-3", True ) , ( "col-sm-push-9", True ) - , ( "schedule-sidebar", True ) , ( "schedule-filter", True ) - , ( "sticky", True ) ] ] [ h4 [] [ text "Filter" ] @@ -86,9 +84,37 @@ filterSidebar model = model.eventInstances .videoState ] + , icsButton model ] +icsButton : Model -> Html Msg +icsButton model = + let + filterString = + case filterToString model.filter of + "" -> + "" + + filter -> + "?" ++ filter + + icsURL = + model.flags.ics_button_href ++ filterString + in + a + [ classList + [ ( "btn", True ) + , ( "btn-default", True ) + ] + , href <| icsURL + ] + [ i [ classList [ ( "fa", True ), ( "fa-calendar", True ) ] ] + [] + , text " ICS file with these filters" + ] + + videoRecordingFilters : List FilterType videoRecordingFilters = [ VideoFilter "Will not be recorded" "not-to-be-recorded" diff --git a/src/static_src/css/bornhack.css b/src/static_src/css/bornhack.css index 48ee6176..84b3c188 100644 --- a/src/static_src/css/bornhack.css +++ b/src/static_src/css/bornhack.css @@ -233,10 +233,6 @@ footer { } } -.schedule-sidebar { - top: 120px; -} - .sticky { position: sticky; background-color: #fff;