Commit 73dcaa11 authored by Christopher League's avatar Christopher League 🖥

Fixes for full-width; support lead time

parent 2e70e76a
...@@ -27,6 +27,7 @@ calendar-credentials: ...@@ -27,6 +27,7 @@ calendar-credentials:
free-calendar: _env:BOOKME_FREE_CAL:mock-free free-calendar: _env:BOOKME_FREE_CAL:mock-free
busy-calendar: _env:BOOKME_BUSY_CAL:mock-busy busy-calendar: _env:BOOKME_BUSY_CAL:mock-busy
look-ahead-weeks: 4 look-ahead-weeks: 4
lead-time-minutes: 120
development: "_env:BOOKME_DEVEL:false" development: "_env:BOOKME_DEVEL:false"
......
...@@ -29,6 +29,7 @@ import Calendar ...@@ -29,6 +29,7 @@ import Calendar
import Control.Monad.Trans.Maybe import Control.Monad.Trans.Maybe
import Data.FileEmbed (embedFile) import Data.FileEmbed (embedFile)
import qualified Data.SortedList as SL import qualified Data.SortedList as SL
import Data.Time.Clock (getCurrentTime, addUTCTime)
import qualified Network.Wai import qualified Network.Wai
import Development.GitRev import Development.GitRev
import Data.Time.Zones (localTimeToUTCTZ, utcToLocalTimeTZ) import Data.Time.Zones (localTimeToUTCTZ, utcToLocalTimeTZ)
...@@ -66,12 +67,14 @@ formSuccess ((formResult, _), _) = ...@@ -66,12 +67,14 @@ formSuccess ((formResult, _), _) =
getAvailR :: Handler Html getAvailR :: Handler Html
getAvailR = do getAvailR = do
QF.QueryForm {..} <- formSuccess =<< runFormGet (QF.queryForm "" Nothing) QF.QueryForm {..} <- formSuccess =<< runFormGet (QF.queryForm "" Nothing)
App { appSettings = AppSettings {appApptLengthsMinutes, appLookaheadWeeks} App { appSettings = AppSettings {..}
, appCalendarCache , appCalendarCache
} <- getYesod } <- getYesod
earliest <- addUTCTime appLeadTime <$> liftIO getCurrentTime
daysWithSlots <- daysWithSlots <-
groupByDay . groupByDay .
SL.map (applyTz (tzByLabel queryTzLabel)) . SL.map (applyTz (tzByLabel queryTzLabel)) .
SL.dropWhile ((< earliest) . seStart) .
partitionSlots (headMay appApptLengthsMinutes) queryApptLength . partitionSlots (headMay appApptLengthsMinutes) queryApptLength .
SL.filter (summaryMatches (locSearch queryLocation)) <$> SL.filter (summaryMatches (locSearch queryLocation)) <$>
FC.readCache appCalendarCache FC.readCache appCalendarCache
......
...@@ -105,6 +105,8 @@ data AppSettings = AppSettings ...@@ -105,6 +105,8 @@ data AppSettings = AppSettings
-- ^ Calendar specifying busy times -- ^ Calendar specifying busy times
, appLookaheadWeeks :: Int , appLookaheadWeeks :: Int
-- ^ How far to look ahead when fetching calendar events -- ^ How far to look ahead when fetching calendar events
, appLeadTime :: NominalDiffTime
-- ^ Minimum advance notice required for a meeting
, appApptLengthsMinutes :: [Int] , appApptLengthsMinutes :: [Int]
-- ^ Valid lengths of appointments, in minutes -- ^ Valid lengths of appointments, in minutes
, appCacheExpiry :: NominalDiffTime , appCacheExpiry :: NominalDiffTime
...@@ -156,6 +158,7 @@ instance FromJSON AppSettings where ...@@ -156,6 +158,7 @@ instance FromJSON AppSettings where
appFreeCalendarId <- o .: "free-calendar" appFreeCalendarId <- o .: "free-calendar"
appBusyCalendarId <- o .: "busy-calendar" appBusyCalendarId <- o .: "busy-calendar"
appLookaheadWeeks <- o .: "look-ahead-weeks" appLookaheadWeeks <- o .: "look-ahead-weeks"
appLeadTime <- (*60) <$> (o .: "lead-time-minutes")
appApptLengthsMinutes <- o .: "appointment-lengths-minutes" appApptLengthsMinutes <- o .: "appointment-lengths-minutes"
appProviderName <- o .:? "provider-name" appProviderName <- o .:? "provider-name"
appProviderAvatar <- o .:? "provider-avatar" appProviderAvatar <- o .:? "provider-avatar"
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
$maybe pic <- appProviderAvatar (appSettings master) $maybe pic <- appProviderAvatar (appSettings master)
<div .container> <div .container>
<div .row #avatar> <div .row>
<div .col-md-12.hidden-md.hidden-lg> <div .col-md-12 style="margin: -60px 0 1ex 0;">
<img .img-circle width=100 height=100 src=#{pic}> <img .img-circle width=100 height=100 src=#{pic} style="float:right">
<div .container> <div .container>
$maybe msg <- mmsg $maybe msg <- mmsg
......
...@@ -2,14 +2,6 @@ body { ...@@ -2,14 +2,6 @@ body {
font-family: #{fontFamily}; font-family: #{fontFamily};
} }
#avatar {
margin-top: -60px;
margin-bottom: 1ex;
}
#avatar img {
float: right;
}
h1 { h1 {
font-size: 28px; font-size: 28px;
margin: 0 0 1ex 0; margin: 0 0 1ex 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment