Skip to content
This repository has been archived by the owner on Jul 21, 2019. It is now read-only.

updates CFP OPEN footer to use time comparisons #641

Merged
merged 3 commits into from
Aug 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ The YYYY-CITY.yml file is the main configuration file for your event. This is wh
| `speakers_verbose` | String | No | Set this to "true" if you want verbose speaker attributes (URLs visible). | "true" |

### Date-related Fields
All dates are in unquoted YYYY-MM-DD, like this: `variable: 2016-01-05`
All dates are in unquoted YYYY-MM-DD, like this: `variable: 2016-01-05`, or like `variable: 2016-01-05T23:59:00-06:00`

| Field Name | Type | Required | Description | Example |
|-------------------------|------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------|
| `startdate` | YYYY-MM-DD | No | The start date of your event. Leave blank if you don't have a venue reserved yet. | 2016-01-05 |
| `enddate` | YYYY-MM-DD | No | The end date of your event. Leave blank if you don't have a venue reserved yet. | 2016-01-05 |
| `cfp_date_start` | YYYY-MM-DD | No | The date you will start accepting talk proposals. Can be a blank value. | 2016-01-05 |
| `cfp_date_end` | YYYY-MM-DD | No | The date you will close your call for proposals. Can be a blank value. | 2016-01-05 |
| `cfp_date_end` | YYYY-MM-DD | No | The date you will close your call for proposals. Can be a blank value. If you set the full datetime string with correct TZ, CFP will display as open until local close time. | 2016-01-05T23:59:00-06:00 |
| `cfp_date_announce` | YYYY-MM-DD | No | The date you will inform proposers of status. Can be a blank value. | 2016-01-05 |
| `cfp_open` | String | No | Either "true" or "false". Can be blank. This controls whether or not the "propose" button shows on your event page. *Deprecated field; if you have set `cfp_date_start` and `cfp_date_end` they will serve the same purpose.* | "true" |
| `cfp_link` | String | No | If you have a custom link for submitting proposals, add it here. This will control the Propose menu item as well as the "Propose" button. | "https://myurlhere" |
Expand Down
3 changes: 1 addition & 2 deletions exampleSite/data/events/2018-singapore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ enddate: 2018-10-12 # The end date of your event. Leave blank if you don't have

# Leave CFP dates blank if you don't know yet, or set all three at once.
cfp_date_start: 2018-07-05 # start accepting talk proposals.
cfp_date_end: 2018-08-31 # close your call for proposals.
cfp_date_end: 2018-08-31T00:00:00+08:00 # close your call for proposals.
cfp_date_announce: 2018-09-11 # inform proposers of status

cfp_open: "false"
Expand Down Expand Up @@ -277,4 +277,3 @@ program:
date: 2018-10-12
start_time: "16:45"
end_time: "17:00"

2 changes: 1 addition & 1 deletion layouts/partials/events/cta.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<!-- propose button -->
{{- if $e.startdate -}}
{{- if $e.cfp_date_start -}}
{{- if and (ge (dateFormat "2006-01-02" (dateFormat "2006-01-02" now)) (dateFormat "2006-01-02" $e.cfp_date_start)) (le (dateFormat "2006-01-02" (dateFormat "2006-01-02" now)) (dateFormat "2006-01-02" $e.cfp_date_end)) -}}
{{- if and (ge now (time $e.cfp_date_start)) (le now (time $e.cfp_date_end)) -}}
{{- if $e.cfp_link -}}
{{- if eq $e.cfp_link "" -}}
{{- $.Scratch.Set "cfp_link" ((printf "/events/%s/propose" $e.name) | absURL ) -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h2 class="footer-heading">{{ dateFormat "02 January, 2006" .Date }}</h2>
<h3 class="footer-nav">CFP OPEN</h3>
{{- range sort $.Site.Data.events "startdate" -}}
{{- if .cfp_date_end -}}
{{- if and (ge (dateFormat "2006-01-02" (dateFormat "2006-01-02" now)) (dateFormat "2006-01-02" .cfp_date_start)) (ge (dateFormat "2006-01-02" .cfp_date_end) (dateFormat "2006-01-02" (dateFormat "2006-01-02" now))) -}}
{{- if and (ge now (time .cfp_date_start)) (ge (time .cfp_date_end) now) -}}
<a href = "{{ (printf "events/%s" .name) | absURL }}" class = "footer-content">{{ .city }}</a><br />
{{- end -}} {{/* end: date is now or afterwards */}}
{{- end -}} {{/* end: if .cfp_date_end */}}
Expand Down
6 changes: 3 additions & 3 deletions layouts/partials/speaking.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{{- $.Scratch.Add "events" "<table class = 'table sortable table-condensed'><thead><tr><th>City</th><th>&nbsp;&nbsp;CFP Closes</th><th>&nbsp;&nbsp;&nbsp;&nbsp;Event Starts</th></tr></thead><tbody>" -}}
{{- range sort $.Site.Data.events "startdate" -}}
{{- if .cfp_date_end -}}
{{- if and (ge (dateFormat "2006-01-02" (dateFormat "2006-01-02" now)) (dateFormat "2006-01-02" .cfp_date_start)) (ge (dateFormat "2006-01-02" .cfp_date_end) (dateFormat "2006-01-02" (dateFormat "2006-01-02" now))) -}}
{{- if and (ge now (time .cfp_date_start)) (ge (time .cfp_date_end) now) -}}
{{- $.Scratch.Add "events" "<tr><td><a href = '/events/" -}}
{{- $.Scratch.Add "events" .name -}}
{{- $.Scratch.Add "events" "/' class = 'speaking'>" -}}
{{- $.Scratch.Add "events" .city -}}
{{- $.Scratch.Add "events" "</a></td><td data-dateformat='YYYY-MM-DD'>&nbsp;&nbsp;" -}}
{{- $.Scratch.Add "events" .cfp_date_end -}}
{{- $.Scratch.Add "events" (dateFormat "2006-01-02" .cfp_date_end) -}}
{{- $.Scratch.Add "events" "</td><td data-dateformat='YYYY-MM-DD'>&nbsp;&nbsp;&nbsp;&nbsp;" -}}
{{- $.Scratch.Add "events" .startdate -}}
{{- $.Scratch.Add "events" (dateFormat "2006-01-02" .startdate) -}}
{{- $.Scratch.Add "events" "</td></tr>" -}}
{{- end }} {{/* end: date is now or afterwards */}}
{{- end }} {{/* end: if .cfp_date_end */}}
Expand Down