diff options
Diffstat (limited to 'views')
-rwxr-xr-x | views/404.handlebars | 3 | ||||
-rwxr-xr-x | views/event.handlebars | 397 | ||||
-rwxr-xr-x | views/home.handlebars | 26 | ||||
-rwxr-xr-x | views/layouts/main.handlebars | 79 | ||||
-rwxr-xr-x | views/login.handlebars | 32 | ||||
-rwxr-xr-x | views/newevent.handlebars | 120 | ||||
-rwxr-xr-x | views/optionsform.handlebars | 47 | ||||
-rw-r--r-- | views/partials/importeventform.handlebars | 15 | ||||
-rwxr-xr-x | views/partials/neweventform.handlebars | 110 | ||||
-rwxr-xr-x | views/partials/sidebar-dropdown.handlebars | 11 | ||||
-rwxr-xr-x | views/partials/sidebar.handlebars | 5 | ||||
-rwxr-xr-x | views/register.handlebars | 15 |
12 files changed, 860 insertions, 0 deletions
diff --git a/views/404.handlebars b/views/404.handlebars new file mode 100755 index 0000000..9d7393a --- /dev/null +++ b/views/404.handlebars @@ -0,0 +1,3 @@ +<h1>404</h1> + +<p>Sorry buddy, event not found. Maybe try making a new one?</p>
\ No newline at end of file diff --git a/views/event.handlebars b/views/event.handlebars new file mode 100755 index 0000000..ab04987 --- /dev/null +++ b/views/event.handlebars @@ -0,0 +1,397 @@ +{{#if eventHasCoverImage}} + <div id="eventImageContainer" style="background-image: url(/images/{{eventData.image}});"></div> +{{else}} + <div id="genericEventImageContainer" style="background-image: url(/images/seigaiha.png);"></div> +{{/if}} +<div class="row"> + <div class="col-lg"> + <h3 id="eventName">{{eventData.name}}</h3> + </div> + {{#if editingEnabled}} + <div class="col-lg-2 text-right"> + <div class="btn-group" role="group" aria-label="Event controls"> + <button type="button" id="editEvent" class="btn btn-success" data-toggle="modal" data-target="#editModal"><i class="fas fa-pencil-alt"></i></button> + <button type="button" id="deleteEvent" class="btn btn-danger" data-toggle="modal" data-target="#deleteModal"><i class="fas fa-trash"></i></button> + </div> + </div> + {{/if}} +</div> +<div class="card mt-4 mb-4"> + <div class="card-body"> + <ul class="fa-ul eventInformation"> + <li> + <span class="fa-li"> + <i class="fas fa-map-marker-alt"></i> + </span> + {{eventData.location}} + <a href="http://maps.google.com/?q={{parsedLocation}}" class="eventInformationAction btn btn-outline-secondary btn-sm"> + <i class="fas fa-map-marker-alt"></i> Find on Google Maps + </a> + </li> + {{#if eventHasHost}} + <li> + <span class="fa-li"> + <i class="fas fa-fw fa-user-circle"></i> + </span> + <span class="text-muted">Hosted by</span> {{eventData.hostName}} + </li> + {{/if}} + <li> + <span class="fa-li"> + <i class="far fa-fw fa-calendar-alt"></i> + </span> + {{{displayDate}}} + <a href="http://www.google.com/calendar/event?action=TEMPLATE&dates={{parsedStart}}%2F{{parsedEnd}}&text={{escapedName}}&location={{parsedLocation}}" class="eventInformationAction btn btn-outline-secondary btn-sm"> + <i class="far fa-calendar-plus"></i> Add to Google Calendar + </a> + <br> + <span class="text-muted"> + {{fromNow}} + </span> + </li> + {{#if eventData.url}} + <li> + <span class="fa-li"> + <i class="fas fa-link"></i> + </span> + <a href="{{eventData.url}}"> + {{eventData.url}} + </a> + </li> + {{/if}} + <li> + <span class="fa-li"> + <i class="fas fa-share-square"></i> + </span> + <a href="https://gath.io/{{eventData.id}}"> + gath.io/{{eventData.id}} + </a> + <button type="button" id="copyEventLink" class="eventInformationAction btn btn-outline-secondary btn-sm" data-clipboard-text="https://gath.io/{{eventData.id}}"> + <i class="fas fa-copy"></i> Copy + </button> + </li> + </ul> + </div> +</div> +{{#if eventHasConcluded}} +<div class="alert alert-warning mb-4" role="alert"> + This event has concluded. It will be automatically deleted <span class="daysToDeletion"></span>. +</div> +{{/if}} +{{#if firstLoad}} +<div class="alert alert-success alert-dismissible fade show" role="alert"> + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + Welcome to your event! We've just sent you an email with your secret editing link, which you can also see in the address bar above. Haven't got the email? Check your spam or junk folder. To share your event, use the link you can see just above this message - that way your attendees won't be able to edit or delete your event! +</div> +{{/if}} +<div class="card mb-4" id="eventDescription"> + <h5 class="card-header">About</h5> + <div class="card-body"> + {{{parsedDescription}}} + </div> +</div> + +{{#if eventData.usersCanAttend}} +<div class="card mb-4" id="eventAttendees"> + <h5 class="card-header" style="width:100%;display:flex;justify-content:space-between;align-items:center">Attendees {{#if eventData.attendees}}({{eventData.attendees.length}}){{/if}}<button type="button" id="attendEvent" class="btn btn-primary" data-toggle="modal" data-target="#attendModal"><i class="fas fa-user-plus"></i> I'm going!</button></h5> + <div class="card-body"> + {{#if eventData.attendees}} + <ul class="attendeesList"> + {{#each eventData.attendees}} + <li>{{this.name}}</li> + {{/each}} + </ul> + {{else}} + <p class="text-center text-muted mb-0">No attendees yet!</p> + {{/if}} + </div> +</div> + +<div class="modal fade" id="attendModal" tabindex="-1" role="dialog" aria-labelledby="attendModalLabel" aria-hidden="true"> + <div class="modal-dialog" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <h5 class="modal-title" id="attendModalLabel">Add yourself to '{{eventData.name}}'</h5> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + </div> + <form id="attendEventForm" action="/attendevent/{{eventData.id}}" method="post"> + <div class="modal-body"> + <div class="form-group row"> + <label for="attendeeName" class="col-sm-2 col-form-label">Your name</label> + <div class="form-group col-sm-10"> + <input type="text" class="form-control" id="attendeeName" name="attendeeName" placeholder="Or an alias, perhaps..." data-validation="required length" data-validation-length="3-16"> + </div> + </div> + <div class="form-group row"> + <label for="attendeeEmail" class="col-sm-2 col-form-label">Your email</label> + <div class="form-group col-sm-10"> + <input type="email" class="form-control" id="attendeeEmail" name="attendeeEmail" placeholder="We won't spam you <3" data-validation="email" data-validation-optional="true"> + <small class="form-text">Optional - we'll use it to send you any updates to the event.</small> + </div> + </div> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> + <button type="submit" class="btn btn-primary">Add myself</button> + </div> + </form> + </div> + </div> +</div> +{{/if}} + +{{#if eventData.usersCanComment}} +<div class="card mb-4" id="eventComments"> + <h5 class="card-header">Discussion</h5> + <div class="card-body"> + <form id="commentForm" action="/post/comment/{{eventData.id}}/" method="post"> + <div class="form-group"> + <input type="text" class="form-control" id="commentAuthor" name="commentAuthor" placeholder="Your name" data-validation="required length" data-validation-length="3-60"> + </div> + <div class="form-group"> + <div class="input-group"> + <textarea class="form-control" id="commentContent" name="commentContent" style="resize: none;" placeholder="What would you like to ask?" data-validation="required length" data-validation-length="3-280"></textarea> + <div class="input-group-append"> + <button type="submit" class="btn btn-primary btn-block h-100" id="postComment">Send <i class="fas fa-chevron-right"></i></button> + </div> + </div> + </div> + </form> + {{#if eventData.comments}} + <hr style="border-style:dashed;"> + <div class="container commentsList"> + {{#each eventData.comments}} + <div class="comment"> + <div class="row commentContainer"> + <div class="col-lg commentText"> + <p class="mb-0"><strong>{{this.author}}</strong> <small class="commentTimestamp text-muted">{{this.timestamp}}</small></p> + <p>{{this.content}}</p> + {{#if this.replies}} + <hr> + <div class="repliesContainer"> + {{#each this.replies}} + <p class="mb-0"><strong><i class="fas fa-reply text-muted"></i> {{this.author}}</strong> <small class="commentTimestamp text-muted">{{this.timestamp}}</small></p> + <p>{{this.content}}</p> + {{/each}} + </div> + {{/if}} + </div> + <div class="col-lg-3 commentMetadata text-right"> + <button type="button" class="btn btn-outline-primary btn-sm openReplyBox"> + <i class="fas fa-comment"></i> Reply + </button> + {{#if ../editingEnabled}} + <form class="d-inline" action="/deletecomment/{{../eventData.id}}/{{this._id}}/{{../eventData.editToken}}" method="post"> + <button type="submit" class="btn btn-outline-danger btn-sm deleteComment"> + <i class="fas fa-trash"></i> Delete + </button> + </form> + {{/if}} + </div> + </div> + <div class="row replyContainer"> + <div class="col-md"> + <form id="replyForm" action="/post/reply/{{../eventData.id}}/{{this._id}}" method="post"> + <div class="form-group"> + <input type="text" class="form-control form-control-sm" id="replyAuthor" name="replyAuthor" placeholder="Your name" data-validation="required length" data-validation-length="3-60"> + </div> + <div class="form-group"> + <div class="input-group"> + <textarea class="form-control form-control-sm" id="replyContent" name="replyContent" style="resize: none;" placeholder="What would you like to reply?" data-validation="required length" data-validation-length="3-280"></textarea> + <div class="input-group-append"> + <button type="submit" class="btn btn-primary btn-block h-100 btn-sm" id="postReply">Reply <i class="fas fa-chevron-right"></i></button> + </div> + </div> + </div> + </form> + </div> + </div> + </div> + {{/each}} + </div> + {{/if}} + </div> +</div> +{{/if}} + +{{#if editingEnabled}} +<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="editModalLabel" aria-hidden="true"> + <div class="modal-dialog" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <h5 class="modal-title" id="editModalLabel">Edit '{{eventData.name}}'</h5> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + </div> + <form id="editEventForm" action="/editevent/{{eventData.id}}/{{eventData.editToken}}" method="post" enctype="multipart/form-data"> + <div class="modal-body"> + <div class="form-group row"> + <label for="eventName" class="col-sm-2 col-form-label">Event name</label> + <div class="form-group col-sm-10"> + <input type="text" class="form-control" id="eventName" name="eventName" placeholder="Make it snappy." value="{{eventData.name}}" data-validation="required length" data-validation-length="3-60"> + </div> + </div> + <div class="form-group row"> + <label for="eventLocation" class="col-sm-2 col-form-label">Location</label> + <div class="form-group col-sm-10"> + <input type="text" class="form-control" id="eventLocation" name="eventLocation" placeholder="Be specific." value="{{eventData.location}}" data-validation="required length" data-validation-length="3-60"> + </div> + </div> + <div class="form-group row"> + <label for="eventStart" class="col-sm-2 col-form-label">Starts</label> + <div class="form-group col-sm-10"> + <input readonly type="text" class="form-control" id="eventStart" name="eventStart" value="" data-validation="required"> + </div> + </div> + <div class="form-group row"> + <label for="eventEnd" class="col-sm-2 col-form-label">Ends</label> + <div class="form-group col-sm-10"> + <input readonly type="text" class="form-control" id="eventEnd" name="eventEnd" value="" data-validation="required"> + </div> + </div> + <div class="form-group row"> + <label for="eventDescription" class="col-sm-2 col-form-label">Description</label> + <div class="form-group col-sm-10"> + <textarea class="form-control" id="eventDescription" name="eventDescription" data-validation="required">{{eventData.description}}</textarea> + <small class="form-text"><a href="https://commonmark.org/help/">Markdown</a> formatting supported.</small> + </div> + </div> + <div class="form-group row"> + <label for="eventURL" class="col-sm-2 col-form-label">Link</label> + <div class="form-group col-sm-10"> + <input type="url" class="form-control" id="eventURL" name="eventURL" value="{{eventData.url}}" placeholder="For tickets or another event page (optional)." data-validation="url" data-validation-optional="true"> + </div> + </div> + <div class="form-group row"> + <label for="hostName" class="col-sm-2 col-form-label">Host name</label> + <div class="form-group col-sm-10"> + <input type="text" class="form-control" id="hostName" name="hostName" placeholder="Will be shown on the event page (optional)." value="{{eventData.hostName}}" data-validation="length" data-validation-length="3-60" data-validation-optional="true"> + </div> + </div> + <div class="form-group row"> + <label for="eventImage" class="col-sm-2 col-form-label">Cover image</label> + <div class="form-group col-sm-10"> + <div id="image-preview"> + <label for="image-upload" id="image-label">Choose file</label> + <input type="file" name="imageUpload" id="image-upload" /> + </div> + <small class="form-text">Recommended dimensions (w x h): 920px by 300px.</small> + </div> + </div> + <div class="form-group row"> + <div class="col-sm-2">Options</div> + <div class="col-sm-10"> + <div class="form-check"> + <input class="form-check-input" type="checkbox" id="joinCheckbox" name="joinCheckbox" {{#if eventData.usersCanAttend}}checked{{/if}}> + <label class="form-check-label" for="joinCheckbox"> + Users can mark themselves as attending this event + </label> + </div> + <div class="form-check"> + <input class="form-check-input" type="checkbox" id="interactionCheckbox" name="interactionCheckbox" {{#if eventData.usersCanComment}}checked{{/if}}> + <label class="form-check-label" for="interactionCheckbox"> + Users can post comments on this event + </label> + </div> + </div> + </div> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> + <button type="submit" class="btn btn-primary">Save changes</button> + </div> + </form> + </div> + </div> +</div> + +<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true"> + <div class="modal-dialog" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <h5 class="modal-title" id="deleteModalLabel">Delete '{{eventData.name}}'</h5> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + </div> + <form id="editEventForm" action="/deleteevent/{{eventData.id}}/{{eventData.editToken}}" method="post"> + <div class="modal-body"> + <p>Are you sure you want to delete this event? This action cannot be undone.</p> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> + <button type="submit" class="btn btn-danger">Delete event</button> + </div> + </form> + </div> + </div> +</div> + +{{/if}} + + +<script> + $.validate({ + lang: 'en', + errorElementClass: "is-invalid", + errorMessageClass: "text-danger", + successElementClass: "is-valid" + }); + {{#if editingEnabled}} + $('#eventStart').datepicker({ + language: 'en', + minDate: new Date(), + timepicker: true, + dateFormat: 'd MM yyyy', + dateTimeSeparator: ', ', + onSelect: function(formattedDate, rawDate){ + $('#eventEnd').datepicker().data('datepicker').update('minDate', rawDate).clear(); + } + }); + $('#eventEnd').datepicker({ + language: 'en', + minDate: new Date(), + timepicker: true, + dateFormat: 'd MM yyyy', + dateTimeSeparator: ', ' + }); + {{/if}} + $(".commentTimestamp").html(function(){ + parsedDate = moment($(this).html()).fromNow(); + return parsedDate; + }); + $(".openReplyBox").click(function(){ +// let replyID = $(this).attr("data-id"); + $(this).closest(".comment").find(".replyContainer").slideToggle(); + }) + $(document).ready(function() { + $.uploadPreview({ + input_field: "#image-upload", + preview_box: "#image-preview", + label_field: "#image-label", + label_default: "Choose file", + label_selected: "Change file", + no_label: false + }); + $("#image-preview").css("background-image", "url('/images/{{eventData.image}}')"); + $("#image-preview").css("background-size", "cover"); + $("#image-preview").css("background-position", "center center"); + {{#if editingEnabled}} + $('#eventStart').datepicker().data('datepicker').selectDate(moment('{{parsedStart}}', 'YYYYMMDD[T]HHmmss').toDate()); + $('#eventEnd').datepicker().data('datepicker').selectDate(moment('{{parsedEnd}}', 'YYYYMMDD[T]HHmmss').toDate()); + {{/if}} + new ClipboardJS('#copyEventLink'); + autosize($('textarea')); + $("#copyEventLink").click(function(){ + $(this).html('<i class="fas fa-copy"></i> Copied!'); + setTimeout(function(){ $("#copyEventLink").html('<i class="fas fa-copy"></i> Copy');}, 5000); + }) + $(".daysToDeletion").html(moment("{{eventData.end}}").add('days', 7).fromNow()); + }); + + </script> diff --git a/views/home.handlebars b/views/home.handlebars new file mode 100755 index 0000000..ae1e8c6 --- /dev/null +++ b/views/home.handlebars @@ -0,0 +1,26 @@ +<h1>Organise all the things</h1> + +<p class="lead"> + <strong>gath<span class="text-muted">io</span></strong> is a quick and easy way to make and share events which respects your privacy. +</p> + +<hr> + +<p>You don't need to sign up for an account - we just use your email to send you a secret link you can use to edit or delete your event. Send all your guests the public link, and all your co-hosts the editing link. A week after the event finishes, it's deleted from our servers for ever, and your email goes with it.</p> + +<p>Oh, and events look <em>great</em>:</p> + +<div id="example-event" class="text-center w-100 mt-4 mb-5"> + <img src="images/example-event.jpg" class="img-fluid w-75 mx-auto shadow-lg rounded"> +</div> + +<p>Also, we don't show you ads, don't sell your data, and never send you unnecessary emails.</p> + +<p>But remember: all our events are visible to anyone who knows the link, so probably don't use <strong>gath<span class="text-muted">io</span></strong> to plot your surprise birthday party or revolution. Or whatever, you do you.</p> + +<div class="card border-secondary mt-5 mb-3 mx-auto" style="min-width:300px;max-width:50%;"> + <div class="card-body text-secondary"> + <p>If you find yourself using and enjoying <strong>gath<span class="text-muted">io</span></strong>, consider buying me a coffee. It'll help keep the site running! <i class="far fa-heart"></i></p> + <script type='text/javascript' src='https://ko-fi.com/widgets/widget_2.js'></script><script type='text/javascript'>kofiwidget2.init('Support Me on Ko-fi', '#46b798', 'Q5Q2O7T5');kofiwidget2.draw();</script> + </div> +</div> diff --git a/views/layouts/main.handlebars b/views/layouts/main.handlebars new file mode 100755 index 0000000..caa00a9 --- /dev/null +++ b/views/layouts/main.handlebars @@ -0,0 +1,79 @@ +<!DOCTYPE html> +<html> + + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + + <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> + <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> + <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> + <link rel="manifest" href="/site.webmanifest"> + <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"> + <meta name="msapplication-TileColor" content="#da532c"> + <meta name="theme-color" content="#ffffff"> + + <meta property="og:image:width" content="260"> + <meta property="og:image:height" content="260"> + <meta property="og:description" content="An easier, quicker, and much less privacy-invading way to make and share events"> + <meta property="og:title" content="gathio"> + <meta property="og:url" content="http://gath.io/"> + <meta property="og:image" content="http://gath.io/og-image.jpg"> + + <meta name="twitter:card" content="summary"> + <meta name="twitter:title" content="gathio"> + <meta name="twitter:description" content="An easier, quicker, and much less privacy-invading way to make and share events. "> + <meta name="twitter:image" content="http://gath.io/og-image.jpg"> + + + <title>{{#if title}}{{title}} · {{/if}}gathio</title> + + <!-- FONTS --> + + <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet"> + + <link href="https://fonts.googleapis.com/css?family=Raleway:900" rel="stylesheet"> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous"> + + <!-- CSS --> + + <link rel="stylesheet" href="/css/bootstrap.min.css"> + <link href="/css/datepicker.min.css" rel="stylesheet" type="text/css"> + <link rel="stylesheet" href="/css/style.css"> + + <!-- JS --> + + <script + src="https://code.jquery.com/jquery-3.4.1.min.js" + integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" + crossorigin="anonymous"></script> + <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script> + <script src="/js/jquery.form-validator.js"></script> + <script src="/js/bootstrap.min.js"></script> + <script src="/js/datepicker.min.js"></script> + <script src="/js/moment.js"></script> + <script src="/js/jquery.uploadPreview.min.js"></script> + <script src="/js/clipboard.min.js"></script> + <script src="/js/autosize.min.js"></script> + <script src="/js/i18n/datepicker.en.js"></script> + + </head> + + <body> + <div class="container h-100"> + <div class="row" id="container"> + <div class="col-lg-2 col-md-3 col-sm-4 pt-3" id="sidebar"> + {{>sidebar}} + </div> + <div class="col-sm pt-3" id="content"> + <div id="bodyContainer"> + {{{body}}} + </div> + <div id="footerContainer"> + <a href="https://github.com/lowercasename/gathio">GitHub</a> · <small class="text-muted">Made with <i class="far fa-heart"></i> by <a href="http://raphaelkabo.com">Raphael</a> · Need help? <a href="mailto:support@gath.io">Email us</a>.</small> + </div> + </div> + </div> + </div> + </body> +</html> diff --git a/views/login.handlebars b/views/login.handlebars new file mode 100755 index 0000000..b5907c0 --- /dev/null +++ b/views/login.handlebars @@ -0,0 +1,32 @@ +<h2>Log in</h2> +<div class="form-group row"> + <div class="col-sm-12"> + {{#if isPublic}} + <p class="form-text">Register or log in to your account to be able to show this event on your profile, edit it, and delete it. <strong>Associating an event with an account is optional, but keep in mind that an unassociated event can not be modified in any way and will be automatically deleted 30 days after it concludes.</strong></p> + {{else if isPrivate}} + <p class="form-text">You must <a href="/register">register</a> or log in to your account to create a private event.</p> + {{else if isOrganisation}} + <p class="form-text">You must <a href="/register">register</a> or log in to an organisation account to create an organisation event.</p> + {{/if}} + </div> +</div> +<div class="form-group row"> + <label for="email" class="col-sm-2 col-form-label">Email address</label> + <div class="form-group col-sm-10"> + <input type="email" class="form-control" id="email" name="email" placeholder="We will never spam you or share your email." value="{{data.email}}" data-validation="{{#unless isPublic}}required{{/unless}} email" {{#if isPublic}}data-validation-optional="true"{{/if}}> + </div> +</div> +<div class="form-group row"> + <label for="password" class="col-sm-2 col-form-label">Password</label> + <div class="form-group col-sm-10"> + <input type="password" class="form-control" id="password" name="password" placeholder="Don't forget it!" {{#unless isPublic}}data-validation="required"{{/unless}}> + </div> + <div class="form-group col-sm-10 offset-sm-2"> + <div class="" id="passwordStrengthBar"></div> + </div> +</div> + + +<p> + <a href="/register">Register</a> | <a href="/forgotpassword">Forgot password</a> +</p>
\ No newline at end of file diff --git a/views/newevent.handlebars b/views/newevent.handlebars new file mode 100755 index 0000000..b63b43c --- /dev/null +++ b/views/newevent.handlebars @@ -0,0 +1,120 @@ +{{#if isPublic}} + <h2>New public event</h2> + <hr> + <div class="alert alert-info mb-4 text-center" role="alert"> + <i class="fas fa-exclamation-circle"></i> A public event is visible to anyone who knows the link. + </div> +{{else if isPrivate}} + <h2>New private event</h2> + <hr> + <p>A private event is only visible to those who know the <strong>event password</strong>.</p> + <hr> +{{else if isOrganisation}} + <h2>New organisation event</h2> + <p>An organisation event is linked to an existing <strong>organisation</strong>. It can be made public, in which case it is visible to anyone who has the link, or private, in which case it is only visible to those who know the <strong>event password</strong>. </p> + <hr> +{{else if isUnknownType}} + <h2>New event</h2> + <hr> + <div class="alert alert-warning" role="alert"> + Event creation error: unknown event type. Please select an event type from the sidebar. + </div> +{{else}} + <h2>New event</h2> + <hr> + <div class="alert alert-warning" role="alert"> + Event creation error: unknown event type. Please select an event type from the sidebar. + </div> +{{/if}} + + +{{#each errors}} + <div class="alert alert-danger" role="alert">{{this.msg}}</div> +{{/each}} + +<div class="container mb-4"> + <div class="row"> + <div class="col-sm-6 p-2"> + <button type="button" id="showNewEventFormButton" class="btn btn-lg btn-secondary w-100"><i class="fas fa-file"></i> Create a new event</button> + </div> + <div class="col-sm-6 p-2"> + <button type="button" id="showImportEventFormButton" class="btn btn-lg btn-secondary w-100"><i class="fas fa-file-import"></i> Import an existing event</button> + </div> + </div> +</div> + +<div id="newEventFormContainer"> + {{#if isPublic}} + {{>neweventform}} + {{else if isPrivate}} + {{>neweventform}} + {{else if isOrganisation}} + {{>neweventform}} + {{else}} + {{/if}} +</div> + +<div id="importEventFormContainer"> + {{>importeventform}} +</div> + + + <script> + $.validate({ + lang: 'en', + errorElementClass: "is-invalid", + errorMessageClass: "text-danger", + successElementClass: "is-valid" + }); + $(document).ready(function(){ + if ($('#icsImportControl')[0].files[0] != null){ + var file = $('#icsImportControl')[0].files[0].name; + $('#icsImportControl').next('label').html('<i class="far fa-file-alt"></i> ' + file); + } + $('#eventStart').datepicker({ + language: 'en', + minDate: new Date(), + timepicker: true, + dateFormat: 'd MM yyyy', + dateTimeSeparator: ', ', + onSelect: function(formattedDate, rawDate){ + $('#eventEnd').datepicker().data('datepicker').update('minDate', rawDate).clear(); + } + }); + $('#eventEnd').datepicker({ + language: 'en', + minDate: new Date(), + timepicker: true, + dateFormat: 'd MM yyyy', + dateTimeSeparator: ', ' + }); + $("#showNewEventFormButton").click(function(){ + $("#showImportEventFormButton").removeClass("active"); + if ($("#newEventFormContainer").is(":visible")){ + $("#newEventFormContainer").slideUp("fast"); + $(this).removeClass("active"); + } + else { + $("#newEventFormContainer").slideDown("fast"); + $("#importEventFormContainer").slideUp("fast"); + $(this).addClass("active"); + } + }) + $("#showImportEventFormButton").click(function(){ + $("#showNewEventFormButton").removeClass("active"); + if ($("#importEventFormContainer").is(":visible")){ + $("#importEventFormContainer").slideUp("fast"); + $(this).removeClass("active"); + } + else { + $("#importEventFormContainer").slideDown("fast"); + $("#newEventFormContainer").slideUp("fast"); + $(this).addClass("active"); + } + }) + $('#icsImportControl').change(function(){ + var file = $('#icsImportControl')[0].files[0].name; + $(this).next('label').html('<i class="far fa-file-alt"></i> ' + file); + }); + }) + </script> diff --git a/views/optionsform.handlebars b/views/optionsform.handlebars new file mode 100755 index 0000000..4b3e7a3 --- /dev/null +++ b/views/optionsform.handlebars @@ -0,0 +1,47 @@ +<div class="form-group row"> + <div class="col-sm-2">Options</div> + <div class="col-sm-10"> + <div class="form-check"> + <input class="form-check-input" type="checkbox" id="joinCheckbox" name="joinCheckbox" {{#if data.joinCheckbox}}checked{{/if}}> + <label class="form-check-label" for="joinCheckbox"> + Users can mark themselves as attending this event + </label> + </div> + <div class="form-check"> + <input class="form-check-input" type="checkbox" id="guestlistCheckbox" name="guestlistCheckbox" {{#if data.guestlistCheckbox}}checked{{/if}}> + <label class="form-check-label" for="guestlistCheckbox"> + {{#if isPrivate}}Privately display{{else}}Publicly display{{/if}} the list of attendees + </label> + </div> + <div class="form-check"> + <input class="form-check-input" type="checkbox" id="interactionCheckbox" name="interactionCheckbox" {{#if data.interactionCheckbox}}checked{{/if}}> + <label class="form-check-label" for="interactionCheckbox"> + Users can post comments on this event + </label> + </div> + </div> + </div> + + <div class="form-group row"> + <div class="col-sm-2">Options</div> + <div class="col-sm-10"> + <div class="form-check"> + <input class="form-check-input" type="checkbox" id="joinCheckbox" name="joinCheckbox" {{#if eventData.usersCanAttend}}checked{{/if}}> + <label class="form-check-label" for="joinCheckbox"> + Users can mark themselves as attending this event + </label> + </div> + <div class="form-check"> + <input class="form-check-input" type="checkbox" id="guestlistCheckbox" name="guestlistCheckbox" {{#if eventData.showUsersList}}checked{{/if}}> + <label class="form-check-label" for="guestlistCheckbox"> + Display the list of attendees + </label> + </div> + <div class="form-check"> + <input class="form-check-input" type="checkbox" id="interactionCheckbox" name="interactionCheckbox" {{#if eventData.usersCanComment}}checked{{/if}}> + <label class="form-check-label" for="interactionCheckbox"> + Users can post comments on this event + </label> + </div> + </div> + </div> diff --git a/views/partials/importeventform.handlebars b/views/partials/importeventform.handlebars new file mode 100644 index 0000000..35baf6e --- /dev/null +++ b/views/partials/importeventform.handlebars @@ -0,0 +1,15 @@ +<p> + Upload an .ics file here to instantly create an event. You can save a Facebook event as an .ics file by clicking on the context menu next to the 'Import' and 'Edit' buttons on the event page and choosing the 'Export Event' option. Then select the 'Save to calendar' option and save the file on your computer. +</p> + +<img class="img-thumbnail mb-3 d-block mx-auto" src="/images/facebook-export.png" alt="Image showing the location of the export option on Facebook" /> + +<form id="icsImportForm" action="/importevent" method="post" enctype="multipart/form-data"> + <div class="custom-file" id="icsImportContainer"> + <input required name="icsImportControl" type="file" class="custom-file-input" id="icsImportControl" aria-describedby="fileHelp" accept="text/calendar"> + <label name="icsImportLabel" class="custom-file-label" id="icsImportLabel" for="icsImportControl"> + <i class="far fa-file-alt"></i> Select file + </label> + </div> + <button type="submit" class="d-block mt-3 mx-auto btn btn-primary w-50">Import</button> +</form> diff --git a/views/partials/neweventform.handlebars b/views/partials/neweventform.handlebars new file mode 100755 index 0000000..8f2b32e --- /dev/null +++ b/views/partials/neweventform.handlebars @@ -0,0 +1,110 @@ +<form id="newEventForm" action="/newevent" method="post" enctype="multipart/form-data"> + <input type="text" hidden class="form-control" id="eventType" name="eventType" value="{{eventType}}"> + <div class="form-group row"> + <label for="eventName" class="col-sm-2 col-form-label">Event name</label> + <div class="form-group col-sm-10"> + <input type="text" class="form-control" id="eventName" name="eventName" placeholder="Make it snappy." value="{{data.eventName}}" data-validation="required length" data-validation-length="3-60"> + </div> + </div> + <div class="form-group row"> + <label for="eventLocation" class="col-sm-2 col-form-label">Location</label> + <div class="form-group col-sm-10"> + <input type="text" class="form-control" id="eventLocation" name="eventLocation" placeholder="Be specific." value="{{data.eventLocation}}" data-validation="required length" data-validation-length="3-60"> + </div> + </div> + <div class="form-group row"> + <label for="eventStart" class="col-sm-2 col-form-label">Starts</label> + <div class="form-group col-sm-10"> + <input readonly type="text" class="form-control" id="eventStart" name="eventStart" placeholder="Click me!" value="{{data.eventStart}}" data-validation="required"> + </div> + </div> + <div class="form-group row"> + <label for="eventEnd" class="col-sm-2 col-form-label">Ends</label> + <div class="form-group col-sm-10"> + <input readonly type="text" class="form-control" id="eventEnd" name="eventEnd" placeholder="Click me!" value="{{data.eventEnd}}" data-validation="required"> + </div> + </div> + <div class="form-group row"> + <label for="eventDescription" class="col-sm-2 col-form-label">Description</label> + <div class="form-group col-sm-10"> + <textarea class="form-control expand" id="eventDescription" name="eventDescription" data-validation="required" placeholder="You can always edit it later."></textarea> + <small class="form-text"><a href="https://commonmark.org/help/">Markdown</a> formatting supported.</small> + </div> + </div> + <div class="form-group row"> + <label for="eventURL" class="col-sm-2 col-form-label">Link</label> + <div class="form-group col-sm-10"> + <input type="url" class="form-control" id="eventURL" name="eventURL" placeholder="For tickets or another event page (optional)." data-validation="url" data-validation-optional="true"> + </div> + </div> + <div class="form-group row"> + <label for="eventImage" class="col-sm-2 col-form-label">Cover image</label> + <div class="form-group col-sm-10"> + <div id="image-preview"> + <label for="image-upload" id="image-label">Choose file</label> + <input type="file" name="imageUpload" id="image-upload" /> + </div> + <small class="form-text">Recommended dimensions (w x h): 920px by 300px.</small> + </div> + </div> + {{#unless isPublic}} + <div class="form-group row"> + <label for="eventPassword" class="col-sm-2 col-form-label">Event password</label> + <div class="form-group col-sm-10"> + <input type="password" class="form-control" id="eventPassword" name="eventPassword" placeholder="Don't forget it!" data-validation="required"> + </div> + <div class="form-group col-sm-10 offset-sm-2"> + <div class="" id="passwordStrengthBar"></div> + </div> + </div> + {{/unless}} + <div class="form-group row"> + <label for="hostName" class="col-sm-2 col-form-label">Host name</label> + <div class="form-group col-sm-10"> + <input type="text" class="form-control" id="hostName" name="hostName" placeholder="Will be shown on the event page (optional)." data-validation="length" data-validation-length="2-60" data-validation-optional="true"> + </div> + </div> + <div class="form-group row"> + <label for="creatorEmail" class="col-sm-2 col-form-label">Your email</label> + <div class="form-group col-sm-10"> + <input type="email" class="form-control" id="creatorEmail" name="creatorEmail" placeholder="We won't spam you <3" data-validation="email required"> + <small class="form-text">We will send your secret editing link to this email address.</small> + </div> + </div> + <div class="form-group row"> + <div class="col-sm-2">Options</div> + <div class="col-sm-10"> + <div class="form-check"> + <input class="form-check-input" type="checkbox" id="joinCheckbox" name="joinCheckbox"> + <label class="form-check-label" for="joinCheckbox"> + Users can mark themselves as attending this event + </label> + </div> + <div class="form-check"> + <input class="form-check-input" type="checkbox" id="interactionCheckbox" name="interactionCheckbox"> + <label class="form-check-label" for="interactionCheckbox"> + Users can post comments on this event + </label> + </div> + </div> + </div> + <div class="form-group row"> + <div class="col-sm-12 pt-3 pb-3 text-center"> + <button type="submit" class="btn btn-primary w-50">Create</button> + </div> + </div> +</form> + +<script> + $(document).ready(function() { + $.uploadPreview({ + input_field: "#image-upload", + preview_box: "#image-preview", + label_field: "#image-label", + label_default: "Choose file", + label_selected: "Change file", + no_label: false + }); + autosize($('textarea')); + }); +</script> diff --git a/views/partials/sidebar-dropdown.handlebars b/views/partials/sidebar-dropdown.handlebars new file mode 100755 index 0000000..9f9e564 --- /dev/null +++ b/views/partials/sidebar-dropdown.handlebars @@ -0,0 +1,11 @@ +<div class="dropdown mb-2"> + <a class="w-100 btn btn-dark dropdown-toggle" href="#" role="button" id="newEventDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + New event + </a> + + <div class="dropdown-menu" aria-labelledby="newEventDropdownMenuLink"> + <a class="dropdown-item" href="/new/event/private">Private</a> + <a class="dropdown-item" href="/new/event/public">Public</a> + <a class="dropdown-item" href="/new/event/organisation">Organisation</a> + </div> +</div>
\ No newline at end of file diff --git a/views/partials/sidebar.handlebars b/views/partials/sidebar.handlebars new file mode 100755 index 0000000..75f5ca8 --- /dev/null +++ b/views/partials/sidebar.handlebars @@ -0,0 +1,5 @@ +<h1><a href="/" class="text-dark">gath<span class="text-muted">io</span></a></h1> + +<p class="lead text-center mb-4">Nicer events</p> + +<a class="btn btn-success mb-2 btn-block" href="/new/event/public"><i class="far fa-calendar-plus"></i> New event</a> diff --git a/views/register.handlebars b/views/register.handlebars new file mode 100755 index 0000000..1e097c1 --- /dev/null +++ b/views/register.handlebars @@ -0,0 +1,15 @@ +<div class="form-group row"> + <label for="email" class="col-sm-2 col-form-label">Email address</label> + <div class="form-group col-sm-10"> + <input type="email" class="form-control" id="email" name="email" placeholder="We will never spam you or share your email." value="{{data.email}}" data-validation="{{#unless isPublic}}required{{/unless}} email" {{#if isPublic}}data-validation-optional="true"{{/if}}> + </div> + </div> + <div class="form-group row"> + <label for="password" class="col-sm-2 col-form-label">Password</label> + <div class="form-group col-sm-10"> + <input type="password" class="form-control" id="password" name="password" placeholder="Don't forget it!" {{#unless isPublic}}data-validation="required"{{/unless}}> + </div> + <div class="form-group col-sm-10 offset-sm-2"> + <div class="" id="passwordStrengthBar"></div> + </div> + </div>
\ No newline at end of file |