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