This repository has been archived by the owner on Oct 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6f8571f
Showing
29 changed files
with
331 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tmp |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# ========================================================================== | ||
# Project: Teams | ||
# Copyright: @2011 My Company, Inc. | ||
# ========================================================================== | ||
|
||
# This is your Buildfile, which sets build settings for your project. | ||
# For example, this tells SproutCore's build tools that your requires | ||
# the SproutCore framework. | ||
config :all, :required => :sproutcore | ||
|
||
# In addition to this Buildfile, which gives settings for your entire project, | ||
# each of your apps has its own Buildfile with settings specific to that app. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
gem 'sproutcore', '1.6.0.rc.2' | ||
gem 'chunky_png', '1.1.0' | ||
|
||
source :rubygems |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
GEM | ||
remote: http://rubygems.org/ | ||
specs: | ||
chunky_png (1.1.0) | ||
compass (0.11.1) | ||
chunky_png (~> 1.1) | ||
fssm (>= 0.2.7) | ||
sass (~> 3.1) | ||
daemons (1.1.3) | ||
erubis (2.7.0) | ||
eventmachine (0.12.10) | ||
extlib (0.9.15) | ||
fssm (0.2.7) | ||
haml (3.1.1) | ||
json_pure (1.4.6) | ||
rack (1.3.0) | ||
sass (3.1.1) | ||
sproutcore (1.6.0.rc.2) | ||
compass (~> 0.11.1) | ||
erubis (~> 2.6) | ||
extlib (~> 0.9.15) | ||
haml (~> 3.1.1) | ||
json_pure (~> 1.4.6) | ||
rack (~> 1.2) | ||
thin (~> 1.2.11) | ||
thor (~> 0.14.3) | ||
thin (1.2.11) | ||
daemons (>= 1.0.9) | ||
eventmachine (>= 0.12.6) | ||
rack (>= 1.0.0) | ||
thor (0.14.6) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
chunky_png (= 1.1.0) | ||
sproutcore (= 1.6.0.rc.2) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
========================================================================== | ||
Project: Teams | ||
Copyright: @2011 My Company, Inc. | ||
========================================================================== | ||
|
||
TODO: Describe Your Project |
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# ========================================================================== | ||
# Project: Teams | ||
# Copyright: @2011 My Company, Inc. | ||
# ========================================================================== | ||
|
||
# This is your Buildfile for your app, Teams. This tells SproutCore | ||
# how to build your app. These settings override those in your project | ||
# Buildfile, which contains default settings for all apps in your project. | ||
# | ||
# This line tells SproutCore's CSS preprocessor what class names to target. | ||
# Since your app has a theme named 'teams', and it is based on SproutCore's | ||
# Ace theme (named 'ace'), it is set to 'ace.teams'. | ||
config :teams, :css_theme => 'ace.teams' | ||
|
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// ========================================================================== | ||
// Project: Teams.teamsController | ||
// Copyright: @2011 My Company, Inc. | ||
// ========================================================================== | ||
/*globals Teams */ | ||
|
||
/** @class | ||
(Document Your Controller Here) | ||
@extends SC.Object | ||
*/ | ||
Teams.teamsController = SC.ObjectController.create( | ||
/** @scope Teams.teamsController.prototype */ { | ||
|
||
|
||
}) ; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// ========================================================================== | ||
// Project: Teams | ||
// Copyright: @2011 My Company, Inc. | ||
// ========================================================================== | ||
/*globals Teams */ | ||
|
||
/** @namespace | ||
My cool new app. Describe your application. | ||
@extends SC.Object | ||
*/ | ||
Teams = SC.Application.create( | ||
/** @scope Teams.prototype */ { | ||
|
||
NAMESPACE: 'Teams', | ||
VERSION: '0.1.0', | ||
|
||
// This is your application store. You will use this store to access all | ||
// of your model data. You can also set a data source on this store to | ||
// connect to a backend server. The default setup below connects the store | ||
// to any fixtures you define. | ||
store: SC.Store.create().from(SC.Record.fixtures) | ||
|
||
// TODO: Add global constants or singleton objects needed by your app here. | ||
|
||
}) ; |
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// ========================================================================== | ||
// Project: Teams.Player Fixtures | ||
// Copyright: @2011 My Company, Inc. | ||
// ========================================================================== | ||
/*globals Teams */ | ||
|
||
sc_require('models/player_model'); | ||
|
||
Teams.Player.FIXTURES = [ | ||
|
||
{guid: 1, name: 'One', team: 1}, | ||
{guid: 2, name: 'Two', team: 1}, | ||
{guid: 3, name: 'Three', team: 2}, | ||
{guid: 4, name: 'Four', team: 2}, | ||
|
||
]; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// ========================================================================== | ||
// Project: Teams.Team Fixtures | ||
// Copyright: @2011 My Company, Inc. | ||
// ========================================================================== | ||
/*globals Teams */ | ||
|
||
sc_require('models/team_model'); | ||
|
||
Teams.Team.FIXTURES = [ | ||
|
||
{guid: 1, name: 'Team Red', players: [1,2]}, | ||
{guid: 2, name: 'Team Blue', players: [3,4]} | ||
|
||
]; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// ========================================================================== | ||
// Project: Teams | ||
// Copyright: @2011 My Company, Inc. | ||
// ========================================================================== | ||
/*globals Teams */ | ||
|
||
// This is the function that will start your app running. The default | ||
// implementation will load any fixtures you have created then instantiate | ||
// your controllers and awake the elements on your page. | ||
// | ||
// As you develop your application you will probably want to override this. | ||
// See comments for some pointers on what to do next. | ||
// | ||
Teams.main = function main() { | ||
|
||
// Step 1: Instantiate Your Views | ||
// The default code here will make the mainPane for your application visible | ||
// on screen. If you app gets any level of complexity, you will probably | ||
// create multiple pages and panes. | ||
Teams.getPath('mainPage.mainPane').append() ; | ||
|
||
// Step 2. Set the content property on your primary controller. | ||
// This will make your app come alive! | ||
|
||
Teams.teams = Teams.store.find(Teams.Team); | ||
Teams.teamsController.set('content', Teams.teams); | ||
|
||
} ; | ||
|
||
function main() { Teams.main(); } |
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// ========================================================================== | ||
// Project: Teams.Player | ||
// Copyright: @2011 My Company, Inc. | ||
// ========================================================================== | ||
/*globals Teams */ | ||
|
||
/** @class | ||
(Document your Model here) | ||
@extends SC.Record | ||
@version 0.1 | ||
*/ | ||
Teams.Player = SC.Record.extend( | ||
/** @scope Teams.Player.prototype */ { | ||
name: SC.Record.attr(String), | ||
team: SC.Record.toOne( | ||
'Teams.Team', | ||
{ isMaster: NO } | ||
) | ||
|
||
}) ; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// ========================================================================== | ||
// Project: Teams.Team | ||
// Copyright: @2011 My Company, Inc. | ||
// ========================================================================== | ||
/*globals Teams */ | ||
|
||
/** @class | ||
(Document your Model here) | ||
@extends SC.Record | ||
@version 0.1 | ||
*/ | ||
Teams.Team = SC.Record.extend( | ||
/** @scope Teams.Team.prototype */ { | ||
name: SC.Record.attr(String), | ||
players: SC.Record.toMany( | ||
'Teams.Player', | ||
{ isMaster: YES, inverse: 'team' } | ||
) | ||
|
||
}) ; |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<% content_for :loading do %> | ||
<% # Any HTML in this file will be visible on screen while your page loads | ||
# its application JavaScript. SproutCore applications are optimized for | ||
# caching and startup very fast, so your users will often only see this | ||
# content for a brief moment on their first app load, if at all. | ||
%> | ||
<p class="loading">Loading...<p> | ||
|
||
<% end %> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// ========================================================================== | ||
// Project: Teams - mainPage | ||
// Copyright: @2011 My Company, Inc. | ||
// ========================================================================== | ||
/*globals Teams */ | ||
|
||
// This page describes the main user interface for your application. | ||
Teams.mainPage = SC.Page.design({ | ||
|
||
// The main pane is made visible on screen as soon as your app is loaded. | ||
// Add childViews to this pane for views to display immediately on page | ||
// load. | ||
mainPane: SC.MainPane.design({ | ||
childViews: 'teamsView'.w(), | ||
|
||
teamsView: SC.TemplateView.design({ | ||
templateName: 'teams' | ||
}) | ||
}) | ||
|
||
}); |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{{#collection SC.TemplateCollectionView contentBinding="Teams.teamsController.content"}} | ||
Team: {{content.name}} | ||
{{#collection SC.TemplateCollectionView contentBinding=".parentView.content.players"}} | ||
Player: {{content.name}} | ||
{{/collection}} | ||
{{/collection}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// ========================================================================== | ||
// Project: Teams.teamsController Unit Test | ||
// Copyright: @2011 My Company, Inc. | ||
// ========================================================================== | ||
/*globals Teams module test ok equals same stop start */ | ||
|
||
module("Teams.teamsController"); | ||
|
||
// TODO: Replace with real unit test for Teams.teamsController | ||
test("test description", function() { | ||
var expected = "test"; | ||
var result = "test"; | ||
equals(result, expected, "test should equal test"); | ||
}); | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// ========================================================================== | ||
// Project: Teams.Player Unit Test | ||
// Copyright: @2011 My Company, Inc. | ||
// ========================================================================== | ||
/*globals Teams module test ok equals same stop start */ | ||
|
||
module("Teams.Player"); | ||
|
||
// TODO: Replace with real unit test for Player | ||
test("test description", function() { | ||
var expected = "test"; | ||
var result = "test"; | ||
equals(result, expected, "test should equal test"); | ||
}); | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// ========================================================================== | ||
// Project: Teams.Team Unit Test | ||
// Copyright: @2011 My Company, Inc. | ||
// ========================================================================== | ||
/*globals Teams module test ok equals same stop start */ | ||
|
||
module("Teams.Team"); | ||
|
||
// TODO: Replace with real unit test for Team | ||
test("test description", function() { | ||
var expected = "test"; | ||
var result = "test"; | ||
equals(result, expected, "test should equal test"); | ||
}); | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// ========================================================================== | ||
// Project: Teams | ||
// Copyright: @2011 My Company, Inc. | ||
// ========================================================================== | ||
/*globals Teams */ | ||
|
||
// This is the theme that defines how your app renders. | ||
// | ||
// Your app is given its own theme so it is easier and less | ||
// messy for you to override specific things just for your | ||
// app. | ||
// | ||
// You don't have to create the whole theme on your own, though: | ||
// your app's theme is based on SproutCore's Ace theme. | ||
// | ||
// NOTE: if you want to change the theme this one is based on, don't | ||
// forget to change the :css_theme property in your buildfile. | ||
Teams.Theme = SC.AceTheme.create({ | ||
name: 'teams' | ||
}); | ||
|
||
// SproutCore needs to know that your app's theme exists | ||
SC.Theme.addTheme(Teams.Theme); | ||
|
||
// Setting it as the default theme makes every pane SproutCore | ||
// creates default to this theme unless otherwise specified. | ||
SC.defaultTheme = 'teams'; |