Added event metrics route and action.
This commit is contained in:
Родитель
bce0589fe0
Коммит
98523273e5
|
@ -3,6 +3,7 @@
|
|||
@import "events/map";
|
||||
@import "events/party";
|
||||
@import "events/admin";
|
||||
@import "events/metrics";
|
||||
|
||||
body#events {
|
||||
* { box-sizing: border-box; }
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
body#events.metrics {
|
||||
|
||||
}
|
|
@ -149,6 +149,10 @@ module.exports = function(init) {
|
|||
})
|
||||
});
|
||||
});
|
||||
},
|
||||
metrics: function(req, res)
|
||||
{
|
||||
res.reply('metrics');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@ module.exports = function (C, app) {
|
|||
|
||||
// Admin Interface
|
||||
route( 'GET', '/events/admin', C.Events.admin );
|
||||
route( 'GET', '/events/metrics', C.Events.metrics );
|
||||
|
||||
route( 'GET', '/events', C.Events.index );
|
||||
route( 'GET', '/events/metrics', C.Events.metrics );
|
||||
route( 'GET', '/events/:id', C.Events.details );
|
||||
route( 'POST', '/events', C.Events.create );
|
||||
route( 'PATCH', '/events/:id', C.Events.change );
|
||||
|
|
|
@ -1,128 +1,7 @@
|
|||
{% extends "events/layout.html" %}
|
||||
|
||||
{% block title %}{{ event.title }}{% endblock %}
|
||||
{% block title %}Event Metrics{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
{{ super() }}
|
||||
<form id="edit-event" action="/events/{{ event.id }}" method="POST">
|
||||
<input name="_csrf" value="{{ csrf }}" type="hidden">
|
||||
|
||||
<div class="ui-wrapper ui-body">
|
||||
<div id="details-pane" class="ui-section">
|
||||
<div class="gallery-sidebar">
|
||||
{% if event.picture %}
|
||||
<span class="show">
|
||||
<img id="event-picture" src="{{ event.picture }}" onerror="this.style.display='none'" />
|
||||
</span>
|
||||
{% endif %}
|
||||
<span class="edit hidden">
|
||||
<div class="upload">
|
||||
<input type="file" accept="image/*" />
|
||||
<input name="picture" type="hidden" />
|
||||
<div id="image-upload">Change Event Picture</div>
|
||||
</div>
|
||||
</span>
|
||||
{% if event.registerLink %}
|
||||
<span class="show">
|
||||
<div id="event-registration">
|
||||
<a id="registerLink" href="{{ event.registerLink }}">Sign up for the event <span class="icon-chevron-right"></span></a>
|
||||
<p>This link will take you to an external event registration service, such as Eventbrite.</p>
|
||||
</div>
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<span id="event-description">
|
||||
<div id="event-title">
|
||||
<h1 class="show">{{ event.title }}</h1>
|
||||
<span class="edit hidden">
|
||||
<input type="text" name="title" placeholder="{{ event.title }}" />
|
||||
</span>
|
||||
</div>
|
||||
{% if email and event.organizer == email %}
|
||||
<div id="owner-panel">
|
||||
<span class="show">
|
||||
<button id="edit-mode" type="button" class="owner-btn ui-btn">Edit</button>
|
||||
</span>
|
||||
<span class="edit hidden">
|
||||
<button id="save-edit" class="owner-btn ui-btn"
|
||||
type="submit" name="_method" value="PATCH">Save</button>
|
||||
<button id="cancel-edit" type="button" class="owner-btn ui-btn">Cancel</button>
|
||||
<button id="delete-event" class="owner-btn ui-btn"
|
||||
type="submit" name="_method" value="DELETE">Delete</button>
|
||||
<div id="delete-confirm" class="hidden" title="Delete Event">
|
||||
Are you sure you want to permanently delete this event?
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div id="event-whenwhere">
|
||||
{% if event.beginDate or event.endDate or event.beginTime %}
|
||||
<span class="show">
|
||||
<div class="temporal-local">
|
||||
<img class="calendar-icon" src="/img/event-detail-icon-calendar.png" />
|
||||
<div class="datetime-range">
|
||||
<div>
|
||||
{{ event.beginDate }}
|
||||
{% if event.beginDate and event.endDate %} - {% endif %}
|
||||
{{ event.endDate }}
|
||||
</div>
|
||||
<div>
|
||||
{{ event.beginTime }}
|
||||
{% if event.beginTime and event.endTime %} - {% endif %}
|
||||
{{ event.endTime }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
{% endif %}
|
||||
<span class="edit hidden">
|
||||
<div class="temporal-local">
|
||||
<img class="calendar-icon" src="/img/event-detail-icon-calendar.png" />
|
||||
<div class="datetime-range">
|
||||
<div> <input type="text" name="beginDate" class="datepicker"
|
||||
placeholder="{{ event.beginDate or "--/--/----" }}" />
|
||||
- <input type="text" name="endDate" class="datepicker"
|
||||
placeholder="{{ event.endDate or "--/--/----" }}" />
|
||||
</div>
|
||||
<div> <input type="text" name="beginTime" class="timepicker"
|
||||
placeholder="{{ event.beginTime or "-- : -- --" }}" />
|
||||
- <input type="text" name="endTime" class="timepicker"
|
||||
placeholder="{{ event.endTime or "-- : -- --" }}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
<div class="temporal-local">
|
||||
{% if event.address %}
|
||||
<span class="show">
|
||||
<img class="pin-icon" src="/img/event-detail-icon-pointer.png" />
|
||||
<div class="address">{{ event.address }}</div>
|
||||
</span>
|
||||
{% endif %}
|
||||
<span class="edit hidden">
|
||||
<img class="pin-icon" src="/img/event-detail-icon-pointer.png" />
|
||||
<input type="text" name="address" class="address" placeholder="{{ event.address }}" />
|
||||
<input name="latitude" type="hidden" />
|
||||
<input name="longitude" type="hidden" />
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="event-organizer">
|
||||
<img src="https://secure.gravatar.com/avatar/{{ event.organizerHash }}" />
|
||||
<span class="organized-by">Organized by <strong class="organizer">{{ event.organizerId }}</strong></span>
|
||||
</div>
|
||||
<br />
|
||||
<span id="description-body" class="show">{{ event.description|markdown|safe }}</span>
|
||||
<span class="edit hidden">
|
||||
<textarea name="description" data-provide="markdown">{{ event.description }}</textarea>
|
||||
<label for="event_registerLink">Registration Link: </label>
|
||||
<input id="event_registerLink" type="text" name="registerLink"
|
||||
placeholder="{{ event.registerLink or "http://example.com/" }}" />
|
||||
</span>
|
||||
|
||||
<div class="clear"></div>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
|
Загрузка…
Ссылка в новой задаче