Skip to content

Commit

Permalink
reusable template example app
Browse files Browse the repository at this point in the history
  • Loading branch information
sandlerr committed Sep 12, 2014
1 parent ced35f4 commit 5b5e598
Show file tree
Hide file tree
Showing 12 changed files with 149 additions and 0 deletions.
48 changes: 48 additions & 0 deletions reuseable_template_app/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Copyright 2012 Zendesk

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

ADDITIONAL TERMS AND CONDITIONS

Capitalized terms used herein have the meaning set forth in the
Zendesk, Inc. (“Zendesk”) Terms of Service (available at www.zendesk.com/company/terms)
(the “Terms”). The software made available herein constitutes the source code for a
Zendesk Application (“Application Software”) which may be implemented to
enable features or functionality to be utilized in connection with a subscription
to the Service. Notwithstanding anything to the contrary set forth in the Terms
or any other agreement by and between you and Zendesk, Application Software is
provided “AS IS” and on an “AS AVAILABLE” basis, and that Zendesk makes no warranty
as to the Application Software. ZENDESK DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT AND THOSE ARISING FROM A COURSE
OF DEALING OR USAGE OF TRADE RELATED TO THE APPLICATION SOFTWARE, ITS USE OR ANY INABILITY
TO USE IT OR THE RESULTS OF ITS USE.

Zendesk makes Zendesk Applications available for use through the user interface of
the Service in the manner described (for each Zendesk Application) at www.zendesk.com/apps
(“Service Implementation”). Use of Application Software, other than in connection with a
Service Implementation is subject to the following risks and conditions: (i) the Application
Software may contain errors, design flaws or other problems; and (ii) use of the Application
Software may result in unexpected results, loss of data, project delays or other unpredictable
damage or loss. Zendesk only supports the Application Software currently available and installed
through the Service Implementation. By utilizing Application Software other than in connection
with the Service Implementation, you are agreeing that Zendesk shall have no obligation to
correct any bugs, defects or errors in the Application Software you have utilized or
otherwise to support or maintain the Application Software you have utilized.

If you elect to utilize any Application Software other than through a Service Implementation,
you are agreeing to release Zendesk from any claim with regard to the Application Software,
its operation, availability or its failure to operate or be available.
Without limiting the generality of the foregoing, You acknowledge and agree that neither the use,
availability nor operation of any Application Software shall be subject to any service level
commitment applicable to the Service.
15 changes: 15 additions & 0 deletions reuseable_template_app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Reusable Template Sample App

This very simple sample app shows you how to reuse templates in Zendesk apps. It is intended for demonstration purposes or for training purposes.

### The following information is displayed:

* A template that says hello, and another template that says goodbye. Both templates include a common template.
* The app.activated event.
* Click events.

Please submit bug reports to [Zendesk Support]([email protected]). Pull requests are welcome.

### Screenshot(s):

![](https://cloud.githubusercontent.com/assets/5535625/4245137/522167c6-3a2f-11e4-9d44-5145511e78ab.png)
27 changes: 27 additions & 0 deletions reuseable_template_app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
(function() {

return {
events: {
'app.activated': 'greet',
'click a': 'handleButton'
},

greet: function(type) {
if (typeof type != 'string') {
type = 'hello';
}
var currentUser = this.currentUser().name();
var boilerPlate = this.renderTemplate('boilerplate', { username: currentUser });
this.switchTo(type, {
heading: boilerPlate
});
},

handleButton: function(e) {
var nextType = e.target.classList[0];
this.greet(nextType);
}

};

}());
Binary file added reuseable_template_app/assets/logo-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added reuseable_template_app/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added reuseable_template_app/assets/promotion-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions reuseable_template_app/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Reusable Template App",
"author": {
"name": "Zendesk",
"email": "[email protected]"
},
"defaultLocale": "en",
"private": true,
"location": ["ticket_sidebar", "new_ticket_sidebar"],
"frameworkVersion": "1.0"
}
1 change: 1 addition & 0 deletions reuseable_template_app/templates/boilerplate.hdbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1><strong>{{username}}</strong></h1>
4 changes: 4 additions & 0 deletions reuseable_template_app/templates/goodbye.hdbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{{heading}}}
<h2>{{t "goodbye.main"}} </h2>
<p>{{t "goodbye.info"}}</p>
<a class="hello">{{t "hello.main"}}</a>
4 changes: 4 additions & 0 deletions reuseable_template_app/templates/hello.hdbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{{heading}}}
<h2>{{t "hello.main"}} </h2>
<p>{{t "hello.info"}}</p>
<a class="goodbye">{{t "goodbye.main"}}</a>
6 changes: 6 additions & 0 deletions reuseable_template_app/templates/layout.hdbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<header>
<span class="logo"/>
<h3>{{setting "name"}}</h3>
</header>
<section data-main/>

33 changes: 33 additions & 0 deletions reuseable_template_app/translations/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"app": {
"package": "reusable_template_sample",
"name": {
"value": "Reusable Template App",
"title": "app name"
},
"description": {
"value": "This is the best App ever",
"title": "app description"
}
},
"hello": {
"main": {
"title": "Enter a brief description of your string here",
"value": "Hello"
},
"info": {
"title": "This view includes some boilerplate!",
"value": "This view includes some boilerplate!"
}
},
"goodbye": {
"main": {
"title": "Enter a brief description of your string here",
"value": "Goodbye"
},
"info": {
"title": "This view also includes boilerplate",
"value": "This view also includes boilerplate"
}
}
}

0 comments on commit 5b5e598

Please sign in to comment.