This file contains hidden or 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
| Template.thing.rendered = function(template){ | |
| var element = this.find('.thingContainer'); | |
| var id = this.data._id; | |
| if (element) { | |
| Hammer(element).on("dragleft", dragLeft); | |
| Hammer(element).on("dragright", dragRight); | |
| } | |
| } |
This file contains hidden or 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
| <head> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/> | |
| <title>Heric List</title> | |
| </head> | |
| <body> | |
| <div id="outer"> | |
| {{> list}} | |
| </div> | |
| </body> |
This file contains hidden or 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
| // Subscribe to 'lists' collection on startup. | |
| // Select a list once data has arrived. | |
| var listsHandle = Meteor.subscribe('lists', function () { | |
| // | |
| //Check for our show guide token | |
| if (Session.get('list_id')){ | |
| var l = Lists.findOne(Session.get('list_id')); | |
| if (l && l.showGuide && l.showGuide == true){ | |
| Session.set('showGuide', true); |
This file contains hidden or 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
| // collection contains a list of things | |
| Things = new Meteor.Collection("things"); | |
| Lists = new Meteor.Collection("lists"); | |
| Things.allow({ | |
| insert: function() { | |
| return true; | |
| }, | |
| update: function() { | |
| return true; |
This file contains hidden or 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
| // Publish complete set of lists to all clients. | |
| Meteor.publish('lists', function () { | |
| return Lists.find(); | |
| }); | |
| // Publish all items for requested list_id. | |
| Meteor.publish('things', function (id) { | |
| return Things.find({list_id: id}); | |
| }); |
This file contains hidden or 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
| public List<Recipe> search(RecipeCriteria recipeCriteria) { | |
| Criteria c = this.getSessionFactory().getCurrentSession().createCriteria(Recipe.class); | |
| // | |
| //Property restrictions | |
| if (recipeCriteria.getQuery() != null) { | |
| Disjunction d = Restrictions.disjunction(); | |
| d.add(Restrictions.like("name", recipeCriteria.getQuery().trim(), MatchMode.ANYWHERE)); |
This file contains hidden or 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
| Ext.ns('youbrew', 'youbrew.recipe'); | |
| /** | |
| * youbrew.recipe.Grid | |
| * A recipe EditorGridPanel, clearly derived from the extjs examples. | |
| */ | |
| youbrew.recipe.Grid = Ext.extend(Ext.grid.EditorGridPanel, { | |
| renderTo: 'recipe-grid', | |
| iconCls: 'silk-grid', | |
| frame: true, | |
| title: 'YouBrew Recipe Grid', |
This file contains hidden or 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
| var textField = new Ext.form.TextField(); | |
| // Grid-columns with meta-data from backend. | |
| var recipeColumns = [ | |
| {header: "ID", width: 40, sortable: true, dataIndex: 'id'}, | |
| {header: "Name", width: 100, sortable: true, dataIndex: 'name', editor: textField}, | |
| {header: "Brew Notes", width: 180, sortable: true, dataIndex: 'brewNotes', editor: textField}, | |
| {header: "Taste Notes", width: 180, sortable: true, dataIndex: 'tasteNotes', editor: textField}, | |
| { | |
| header: 'Yeast', |
This file contains hidden or 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
| @Controller | |
| @RequestMapping(value="/recipe") | |
| public class RecipeController extends BaseController implements Serializable { | |
| private static final long serialVersionUID = 1L; | |
| private static final Logger log = LoggerFactory.getLogger(RecipeController.class); | |
| @Autowired | |
| private IRecipeService recipeService; |
This file contains hidden or 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
| Ext.ns("youbrew"); | |
| // Application instance for showing user-feedback messages. | |
| var App = new Ext.App({}); | |
| // HttpProxy instance, utilizes parameter "api" object here constructing url manually. | |
| var proxy = new Ext.data.HttpProxy({ | |
| api: { | |
| read : {url: 'recipe', method: 'GET'}, | |
| create : {url: 'recipe', method: 'POST'}, |