⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% block enquiry %} | |
<form id="enquiry_form" action="{{ contents.enquiries.api.create }}" method="post"> | |
{% editable_long_text 'welcome' %} | |
<h3>Got an enquiry?</h3> | |
<p>Please fill in the form below and we will get in touch as soon as possible.</p> | |
{% endeditable_long_text %} | |
<fieldset> | |
<div id="error_message">No Errors</div> | |
<ol> | |
<li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
activeRequests = [] | |
Backbone._sync = Backbone.sync | |
Backbone.sync = (method, model, options) -> | |
asyncToken = Backbone._sync.apply(this,arguments) | |
asyncToken.then () -> | |
activeRequests = _.without activeRequests, asyncToken | |
if activeRequests.length == 0 then console.log "LOADING COMPLETE" | |
if activeRequests.length == 0 | |
console.log "START LOADING" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
activeRequests = [] | |
Backbone._sync = Backbone.sync | |
Backbone.sync = (method, model, options) -> | |
asyncToken = Backbone._sync.apply(this,arguments) | |
asyncToken.then () -> | |
activeRequests = _.without activeRequests, asyncToken | |
if activeRequests.length == 0 then console.log "LOADING COMPLETE" | |
if activeRequests.length == 0 | |
console.log "START LOADING" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Backbone.Model::nestCollection = (attributeName, nestedCollection) -> | |
#setup nested references | |
for item, i in nestedCollection | |
@attributes[attributeName][i] = nestedCollection.at(i).attributes | |
#create empty arrays if none | |
nestedCollection.bind 'add', (initiative) => | |
if !@get(attributeName) | |
@attributes[attributeName] = [] | |
@get(attributeName).push(initiative.attributes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
activeRequests = [] | |
Backbone._sync = Backbone.sync | |
Backbone.sync = (method, model, options) -> | |
asyncToken = Backbone._sync.apply(this,arguments) | |
asyncToken.then () -> | |
activeRequests = _.without activeRequests, asyncToken | |
if activeRequests.length == 0 then console.log "LOADING COMPLETE" | |
if activeRequests.length == 0 | |
console.log "START LOADING" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# before this file is loaded, a locale should be set: | |
# | |
# In a browser environment, you can use: | |
# ```<script>__locale='en';</script>``` | |
# | |
# In a server environment (specifically node.js): | |
# ```global.__locale = 'en';``` | |
# normalize in-app locale string to "en" or "de-AT" | |
parts = @__locale.split('-') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@timezones = [ | |
{name: 'MIT', info: 'Midway Islands Time', seconds: -39600}, | |
{name: 'MIT', info: 'Hawaii Standard Time', seconds: -36000}, | |
{name: 'AKST', info: 'Alaska Standard Time', seconds: -32400}, | |
{name: 'AKDT', info: 'Alaska Daylight Savings Time', seconds: -28800}, | |
{name: 'PST', info: 'Pacific Standard Time', seconds: -28800}, | |
{name: 'PDT', info: 'Pacific Daylight Savings Time', seconds: -25200}, | |
{name: 'MST', info: 'Mountain Standard Time', seconds: -25200, country: "United States"}, | |
{name: 'MDT', info: 'Mountain Daylight Savings Time', seconds: -21600}, | |
{name: 'CST', info: 'Central Standard Time', seconds: -21600, country: "United States"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
Helps creating and submitting forms | |
- easy labeling | |
- automatically inserts values of the model to the form | |
- is able to serialize forms to JSON | |
- can submit the form to the server | |
- automatically displays errors if there are any | |
### | |
class FormHelper | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
was | |
<meta name='title' content='{{ organization.meta_title }}'> | |
<meta name='og:title' content='{{ organization.meta_title }}'> | |
<meta name='description' content='{{ organization.meta_description }}'> | |
<meta name='og:description' content='{{ organization.meta_description }}'> | |
<meta name='keywords' content='{{ organization.meta_keywords }}'> | |
replace | |
<meta name='title' content='{{ organization.meta_title }}'> | |
<meta name='description' content='{{ organization.meta_description }}'> |