Browse Source

added subject and description for downloading event

pull/141/head
abhidj0090 4 years ago
parent
commit
6ae22f62a4
2 changed files with 15 additions and 2 deletions
  1. 8
    1
      assets/js/script.js
  2. 7
    1
      layouts/events/single.html

+ 8
- 1
assets/js/script.js View File

@@ -140,5 +140,12 @@ jQuery(function ($) {

});
function downloadEvent(){

var subject = $('#subject').val();
var subject = $('#description').val();
var begin = $('#start-date').val();
var end = $('#end-date').val();
var cal = ics();
cal.addEvent(subject, description, location, begin, end);
//cal.addEvent(subject, description, location, begin, end); // yes, you can have multiple events :-)
cal.download(filename)
}

+ 7
- 1
layouts/events/single.html View File

@@ -17,7 +17,13 @@
<div class="post-single-content">
{{ .Content }}
</div>
<button class="clndr btn btn-main" onclick="downloadEvent()"><i class="ti-calendar"></i>Block Calender</button>
<input type="hidden" id="subject" value="{{.Title }}"/>
<input type="hidden" id="description" value="{{.Content }}"/>
<input type="hidden" id="location" value="Kolkata, IN"/>
<input type="hidden" id="start-date" value="{{.Params.event_start_date }}"/>
<input type="hidden" id="end-date" value="{{.Params.event_end_date }}"/>
<button class="clndr btn btn-main" onclick="downloadEvent()">
<i class="ti-calendar"></i>Block Calender</button>
{{ if site.Params.post_share }}
{{ partial "post-share.html" . }}
{{ end }}

Loading…
Cancel
Save