Skip to content
Open
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: 4 additions & 0 deletions site/themes/s2b_hugo_theme/assets/css/cal/addevent.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
width:100%;
background:white;
padding: 8px 16px;
text-align: center;
}
.caledit-content {
text-align: center;
}

.unpublished-event {
Expand Down
6 changes: 6 additions & 0 deletions site/themes/s2b_hugo_theme/assets/css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,12 @@ body.boxed .navbar-affixed-top.affix {
#login-modal {
overflow: hidden;
}
.modal-header {
text-align: center;
}
.modal-body {
padding: 5px 15px;
}
#login-modal .modal-header h4 {
text-transform: uppercase;
}
Expand Down
14 changes: 9 additions & 5 deletions site/themes/s2b_hugo_theme/assets/js/cal/addevent.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@

$.fn.getAddEventForm = function(id, secret, callback) {
// TODO: loading spinner
if (id && secret) {
const editing = id && secret;

// why do we have one page for editing and creating events?
$('.page-title').text(editing ? 'Edit Event' : 'Add Event');
document.title = (editing ? 'Edit Event - Shift' : 'Add Event - Shift');

if (editing) {
let url = new URL(API_RETRIEVE_URL);
url.searchParams.set('id', id);
url.searchParams.set('secret', secret);
Expand Down Expand Up @@ -151,8 +157,7 @@
}

if (shiftEvent.published) {
$('.published-save-button').show();
$('.duplicate-button').show();
$('.published-button').show();

// show the user's selected image after they select it:
// first, attach to the input button.
Expand Down Expand Up @@ -203,8 +208,7 @@
success: function(returnVal) {
if (returnVal.published) {
$('.unpublished-event').remove();
$('.published-save-button').show();
$('.duplicate-button').show();
$('.published-button').show();
_isFormDirty = false;
}
if (!isNew) {
Expand Down
38 changes: 17 additions & 21 deletions site/themes/s2b_hugo_theme/layouts/caledit/single.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
{{ define "page_body" }}
<div class="col-md-12">

{{ partial "alert_banner.html" . }}

<div>
{{ .Content }}

{{ if isset .Params "pp" }}
{{ partial "cal/pp-header.html" . }}
{{ end }}
</div>

<!-- add/edit form -->
<div id="mustache-html" class="container"></div>

</div>
<div class="col-md-12">
<div>
{{ if isset .Params "pp" }}
{{ partial "cal/pp-header.html" . }}
{{ end }}
</div>
<div id="mustache-html" class="container"></div>
<div class="caledit-content">
{{ .Content }}
</div>
{{ partial "alert_banner.html" . }}
</div>
{{ end }}
{{ define "postscript" }}
{{ partial "cal/scripts.html" . }}
{{ partial "cal/edit.html" . }}
{{ partial "cal/scripts.html" . }}
{{ partial "cal/edit.html" . }}

<script type="text/javascript">
window.cal_renderpage = "{{ .Params.id }}";
</script>
<script type="text/javascript">
window.cal_renderpage = "{{ .Params.id }}";
</script>
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>{{ .Title }}</h1>
<h1 class="page-title">{{ .Title }}</h1>
</div>
</div>
</div>
Expand Down
52 changes: 16 additions & 36 deletions site/themes/s2b_hugo_theme/layouts/partials/cal/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,16 @@ <h4>Are you sure you want to cancel?</h4>
</div><!-- /.modal -->

<div class="modal fade" tabindex="-1" id="delete-modal" role="dialog">
<div class="modal-dialog modal-sm">
<div class="modal-dialog">
<div class="modal-content">
<h4 class="modal-header">
Delete Event
</h4>
<div class="modal-body">
<p>If this event is no longer happening, we recommend <a href="#dateandtime-fields" data-dismiss="modal">cancelling</a> instead of deleting. Cancelling gives you an opportunity to inform riders, like if it's been rescheduled to another date.</p>
<p><strong>Once an event is deleted, it can't be restored!</strong></p>
<p>If this is a series of repeating events, <strong>this will delete the entire series</strong>.</p>

<h4>Are you sure you want to delete this event?</h4>
<p>The event will be permanently deleted. This can't be undone.</p>
</div>
Expand Down Expand Up @@ -72,9 +79,6 @@ <h4>Event Submitted</h4>

<script id="mustache-edit" type="text/template">

[[^ id ]]<h1>Add Event</h1>[[/ id ]]
[[# id ]]<h1>Edit Event</h1>[[/ id ]]

[[# id ]]
[[^ published ]]
<!-- event has been created, but is not yet published -->
Expand Down Expand Up @@ -478,46 +482,22 @@ <h2>
</div>
[[/ id ]]

[[# id ]]
<div class="panel panel-default">
<div class="panel-heading">
<h2>
<a role="button" data-toggle="collapse" href="#delete-event-fields" aria-expanded="true">
Delete Event
<svg class="icon expand" role="img" aria-hidden="true">
<use href="{{ absURL "img/cal/icons/icon-set.svg#icon-arrow-down" }}"/>
</svg>
</a>
</h2>
</div>

<div id="delete-event-fields" class="panel-collapse collapse in">
<div class="panel-body">
<div class="form-group">
<p class="input-help">If an event is no longer happening, we recommend <a href="#dateandtime-fields">cancelling</a> instead of deleting. Cancelling it gives you an opportunity to post a message to inform riders, like if it's been rescheduled to another date.</p>
<p class="input-help">If this is a series of repeating events, <strong>this will delete the entire series</strong>.</p>
<p class="input-help"><strong>Once an event is deleted, it can't be restored!</strong> If you're sure: </p>

<button id="delete-button" type="button" class="btn btn-add-event" data-toggle="modal" data-target="#delete-modal">Delete</button>
</div>
</div>
</div>

</div>
[[/ id ]]

</div>
</form>

<hr>

<div class="edit-buttons" >
<button type="button" class="preview-edit-button btn btn-add-event" style="display: none;">Edit</button>
<button type="button" class="preview-button btn btn-add-event">Preview</button>
[[# id ]]
<button type="button" class="save-button published-save-button btn btn-add-event" style="display: none;">Save</button>
<button type="button" class="duplicate-button btn btn-add-event" style="display: none;">Duplicate</button>
<button type="button" class="save-button btn btn-add-event published-button" style="display: none;">Save</button>
<button type="button" class="duplicate-button btn btn-add-event published-button" style="display: none;">Duplicate</button>
<button type="button" class="btn btn-add-event delete-button published-button" id="delete-button" data-toggle="modal" data-target="#delete-modal" style="display: none;">Delete</button>
[[/ id ]]
[[^ id ]]
<button type="button" class="save-button btn btn-add-event">Save</button>
<button type="button" class="cancel-button btn btn-add-event" data-toggle="modal" data-target="#cancel-modal">Discard</button>
<button type="button" class="save-button btn btn-add-event">Save</button>
<button type="button" class="cancel-button btn btn-add-event" data-toggle="modal" data-target="#cancel-modal">Discard</button>
[[/ id ]]

<span class="save-result"></span>
Expand Down