Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
aflatter committed Jun 6, 2011
0 parents commit 6f8571f
Show file tree
Hide file tree
Showing 29 changed files with 331 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
tmp
12 changes: 12 additions & 0 deletions Buildfile
@@ -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.
4 changes: 4 additions & 0 deletions Gemfile
@@ -0,0 +1,4 @@
gem 'sproutcore', '1.6.0.rc.2'
gem 'chunky_png', '1.1.0'

source :rubygems
38 changes: 38 additions & 0 deletions Gemfile.lock
@@ -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)
6 changes: 6 additions & 0 deletions README
@@ -0,0 +1,6 @@
==========================================================================
Project: Teams
Copyright: @2011 My Company, Inc.
==========================================================================

TODO: Describe Your Project
Binary file added apps/teams/.core.js.swp
Binary file not shown.
Binary file added apps/teams/.main.js.swp
Binary file not shown.
14 changes: 14 additions & 0 deletions apps/teams/Buildfile
@@ -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.
17 changes: 17 additions & 0 deletions apps/teams/controllers/teams_controller.js
@@ -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 */ {


}) ;
27 changes: 27 additions & 0 deletions apps/teams/core.js
@@ -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 added apps/teams/fixtures/.player_fixtures.js.swp
Binary file not shown.
Binary file added apps/teams/fixtures/.team_fixtures.js.swp
Binary file not shown.
16 changes: 16 additions & 0 deletions apps/teams/fixtures/player_fixtures.js
@@ -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},

];
14 changes: 14 additions & 0 deletions apps/teams/fixtures/team_fixtures.js
@@ -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]}

];
30 changes: 30 additions & 0 deletions apps/teams/main.js
@@ -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 added apps/teams/models/.player_model.js.swp
Binary file not shown.
Binary file added apps/teams/models/.team_model.js.swp
Binary file not shown.
22 changes: 22 additions & 0 deletions apps/teams/models/player_model.js
@@ -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 }
)

}) ;
22 changes: 22 additions & 0 deletions apps/teams/models/team_model.js
@@ -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 added apps/teams/resources/.main_page.js.swp
Binary file not shown.
9 changes: 9 additions & 0 deletions apps/teams/resources/loading.rhtml
@@ -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 %>
21 changes: 21 additions & 0 deletions apps/teams/resources/main_page.js
@@ -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 added apps/teams/templates/.teams.handlebars.swp
Binary file not shown.
6 changes: 6 additions & 0 deletions apps/teams/templates/teams.handlebars
@@ -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}}
15 changes: 15 additions & 0 deletions apps/teams/tests/controllers/teams_test.js
@@ -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");
});

15 changes: 15 additions & 0 deletions apps/teams/tests/models/player_test.js
@@ -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");
});

15 changes: 15 additions & 0 deletions apps/teams/tests/models/team_test.js
@@ -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");
});

27 changes: 27 additions & 0 deletions apps/teams/theme.js
@@ -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';

0 comments on commit 6f8571f

Please sign in to comment.