Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Christopher League
bookme
Commits
2e70e76a
Commit
2e70e76a
authored
Jun 06, 2018
by
Christopher League
Browse files
Name/avatar from environment
parent
e2d47bcd
Pipeline
#536
passed with stage
in 1 minute and 9 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
config/settings.yml
View file @
2e70e76a
...
...
@@ -10,6 +10,8 @@ ip-from-header: "_env:IP_FROM_HEADER:false"
# Uncomment to set an explicit approot
#approot: "_env:APPROOT:http://localhost:3000"
provider-name
:
"
_env:BOOKME_PROVIDER_NAME"
provider-avatar
:
"
_env:BOOKME_PROVIDER_AVATAR"
time-zone
:
_env:BOOKME_TIME_ZONE:America/New_York
appointment-lengths-minutes
:
[
15
,
20
,
25
]
locations
:
...
...
src/Settings.hs
View file @
2e70e76a
...
...
@@ -109,6 +109,10 @@ data AppSettings = AppSettings
-- ^ Valid lengths of appointments, in minutes
,
appCacheExpiry
::
NominalDiffTime
-- ^ Cached calendar data older than this will be refreshed
,
appProviderName
::
Maybe
Text
-- ^ Name of person/service providing appointments
,
appProviderAvatar
::
Maybe
Text
-- ^ URL to image of person/service providing appointments
}
-- | Wrap a time zone label, so we can specify type classes.
...
...
@@ -153,6 +157,8 @@ instance FromJSON AppSettings where
appBusyCalendarId
<-
o
.:
"busy-calendar"
appLookaheadWeeks
<-
o
.:
"look-ahead-weeks"
appApptLengthsMinutes
<-
o
.:
"appointment-lengths-minutes"
appProviderName
<-
o
.:?
"provider-name"
appProviderAvatar
<-
o
.:?
"provider-avatar"
appCredentials
<-
o
.:
"calendar-credentials"
appCacheExpiry
<-
o
.:?
"calendar-refresh-seconds"
.!=
...
...
stack.yaml
View file @
2e70e76a
...
...
@@ -22,9 +22,9 @@ extra-deps:
-
gogol-apps-calendar
# Nix support
#nix:
nix
:
pure
:
false
# enable: true
# pure: false
# Build options
build
:
...
...
templates/avail.hamlet
View file @
2e70e76a
$if null daysWithSlots
No appointments available in the next #{pluralN appLookaheadWeeks "week" "weeks"}.
<p .alert.alert-warning>
<b>Sorry!
There seem to be no appointments available
in the next #{pluralN appLookaheadWeeks "week" "weeks"}.
$else
$forall eachDay <- daysWithSlots
$maybe firstSlot <- headMay eachDay
...
...
templates/default-layout.hamlet
View file @
2e70e76a
...
...
@@ -3,13 +3,15 @@
<div .navbar-header>
<a .navbar-brand href=@{HomeR}>
<span .glyphicon.glyphicon-calendar aria-hidden="true">
<p .navbar-text>
Prof. League
$maybe name <- appProviderName (appSettings master)
<p .navbar-text>
#{name}
<div .container>
<div .row #avatar>
<div .col-md-12.hidden-md.hidden-lg>
<img .img-circle width=100 height=100 src="https://avatars3.githubusercontent.com/u/50286?s=100&v=4">
$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 .container>
$maybe msg <- mmsg
...
...
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