Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (31 sloc) 1.178 kb
.hero-unit
h2= <%= names.property.singular %>.<%= properties['default'].name %>
!= linkTo('Edit this <%= names.property.singular %>', edit<%= names.constructor.singular %>Path(params.id), {class: 'btn pull-right'})
h2 <%= names.constructor.singular %> Properties
each property, key in <%= names.property.singular %>
if key !== 'saved'
.row.list-item
.span4
h3= key
.span8
h3
i.icon-list-alt
span(class=key)= property
script(type="text/javascript")
$(function () {
var pageId = window.location.pathname.split('/')[2];
geddy.io.addListenersForModels(['<%= names.constructor.singular %>']);
geddy.model.<%= names.constructor.singular %>.on('update', function (<%= names.property.singular %>) {
if (<%= names.property.singular %>.id == pageId) {
var properties = <%= names.property.singular %>.toData();
for (var i in properties) {
$('.'+i).text(properties[i]);
}
}
});
geddy.model.<%= names.constructor.singular %>.on('remove', function (id) {
if (id == pageId) {
window.location = '/<%= names.property.plural %>';
}
});
});
Jump to Line
Something went wrong with that request. Please try again.