Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bookme
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Christopher League
bookme
Commits
73dcaa11
Commit
73dcaa11
authored
Jun 06, 2018
by
Christopher League
🖥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for full-width; support lead time
parent
2e70e76a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
12 deletions
+11
-12
config/settings.yml
config/settings.yml
+1
-0
src/Handlers.hs
src/Handlers.hs
+4
-1
src/Settings.hs
src/Settings.hs
+3
-0
templates/default-layout.hamlet
templates/default-layout.hamlet
+3
-3
templates/default-layout.lucius
templates/default-layout.lucius
+0
-8
No files found.
config/settings.yml
View file @
73dcaa11
...
...
@@ -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"
...
...
src/Handlers.hs
View file @
73dcaa11
...
...
@@ -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
...
...
src/Settings.hs
View file @
73dcaa11
...
...
@@ -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"
...
...
templates/default-layout.hamlet
View file @
73dcaa11
...
...
@@ -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
...
...
templates/default-layout.lucius
View file @
73dcaa11
...
...
@@ -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;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment