Skip to content

Commit

Permalink
Added a lot of fun stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Mar 3, 2012
1 parent f8f7d13 commit b745562
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 6 deletions.
15 changes: 15 additions & 0 deletions app/controllers/student/Student.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,30 @@ Ext.regController('Student', {
// Just show the info pane
UPSApp.views.viewport.setActiveItem('studentinfo');
},
news: function() {
UPSApp.views.viewport.setActiveItem('studentnews');
},
tickettotacoma: function() {
UPSApp.views.viewport.setActiveItem('tickettotacoma');
},
heyyousubmission: function() {
UPSApp.views.viewport.setActiveItem('heyyousubmission');
},
submitheyyou: function(params) {
console.log("Hey you submission:");
console.log(params.data.heyyoutext);
},
login: function(params) {

// TODO: Attempt to login and store a session cookie
// For now, we just create some fake user info

/*
if(!params)
console.log("No username or password passed to login, assuming we're resuming session");
else
console.log("Username and password supplied \"logging in\"");
*/

if(!UPSApp.stores.studentinfo.first())
UPSApp.stores.studentinfo.add({username:''});
Expand Down
11 changes: 10 additions & 1 deletion app/views/Viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,26 @@ UPSApp.views.Viewport = Ext.extend(Ext.Panel, {
UPSApp.views.studentLogin = new UPSApp.views.StudentLogin();
UPSApp.views.studentInfo = new UPSApp.views.StudentInfo();
UPSApp.views.studentHome = new UPSApp.views.StudentHome();
UPSApp.views.studentNews = new UPSApp.views.StudentNews();
UPSApp.views.newsDetail = new UPSApp.views.NewsDetail();
UPSApp.views.ticketToTacoma = new UPSApp.views.TicketToTacoma();
UPSApp.views.heyYouSubmission = new UPSApp.views.HeyYouSubmission();

this.add(UPSApp.views.selectUserType);
this.add(UPSApp.views.parentHome);
this.add(UPSApp.views.studentLogin);
this.add(UPSApp.views.studentInfo);
this.add(UPSApp.views.studentHome);
this.add(UPSApp.views.studentHome);
this.add(UPSApp.views.studentNews);
this.add(UPSApp.views.newsDetail);
this.add(UPSApp.views.ticketToTacoma);
this.add(UPSApp.views.heyYouSubmission);

if(User.GetUserType() == "none") // Go to the select user type panel
this.setActiveItem('selectusertype');
else if(User.GetUserType() == "parent") // DEBUG: just reset to none, otherwise we will probably go to school website
{
// TEMP
User.SetUserType("none");
this.setActiveItem('selectusertype');
}
Expand Down
12 changes: 9 additions & 3 deletions app/views/student/StudentHome.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ UPSApp.views.StudentHome = Ext.extend(Ext.Panel, {

var elements = [
{xtype:'button',text:'Student Info',handler:function(){Ext.dispatch({controller: 'Student',action:'info'});}},
{xtype:'button',text:'News'},
{xtype:'button',text:'News', handler:function(){
Ext.dispatch({controller:'Student', action:'news'});
}},
{xtype:'button',text:'Events'},
{xtype:'button',text:'Finances'},
{xtype:'button',text:'Fifth element'}
{xtype:'button',text:'Hey You!', handler:function(){
Ext.dispatch({controller:'Student', action:'heyyousubmission'});
}},
{xtype:'button',text:'Ticket To Tacoma', handler:function(){
Ext.dispatch({controller:'Student', action:'tickettotacoma'});
}}
];

var idx = 0; var hboxes = [header];
Expand Down
11 changes: 9 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,19 @@
<script type="text/javascript" charset="utf-8" src="app/views/parent/ParentHome.js"></script>

<!-- Student -->
<script type="text/javascript" charset="utf-8" src="app/models/StudentInfo.js"></script>
<script type="text/javascript" charset="utf-8" src="app/models/StudentNews.js"></script>
<script type="text/javascript" charset="utf-8" src="app/stores/StudentInfo.js"></script>
<script type="text/javascript" charset="utf-8" src="app/stores/StudentNews.js"></script>
<script type="text/javascript" charset="utf-8" src="app/views/NewsDetail.js"></script>
<script type="text/javascript" charset="utf-8" src="app/views/Student/HeyYouSubmission.js"></script>
<script type="text/javascript" charset="utf-8" src="app/views/student/TicketToTacoma.js"></script>
<script type="text/javascript" charset="utf-8" src="app/views/student/StudentNews.js"></script>
<script type="text/javascript" charset="utf-8" src="app/views/student/StudentLogin.js"></script>
<script type="text/javascript" charset="utf-8" src="app/views/student/StudentInfo.js"></script>
<script type="text/javascript" charset="utf-8" src="app/views/student/StudentHome.js"></script>
<script type="text/javascript" charset="utf-8" src="app/controllers/student/Student.js"></script>
<script type="text/javascript" charset="utf-8" src="app/models/StudentInfo.js"></script>
<script type="text/javascript" charset="utf-8" src="app/stores/StudentInfo.js"></script>


</head>
<body></body>
Expand Down

0 comments on commit b745562

Please sign in to comment.