Skip to content

Commit

Permalink
Brandon: Incremental modifications to backend.
Browse files Browse the repository at this point in the history
  • Loading branch information
kwgoh committed Mar 5, 2013
1 parent 7a1cc6c commit a9e8e88
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 206 deletions.
33 changes: 27 additions & 6 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
<!--Username and profile link goes here.-->
Hello, <a href="#" class="navbar-link"><span id="heading">{{name}}</span></a>!
<button id="authorize-button" class="button btn-inverse" onClick="handleAuthResult()">Login</button>
<button class="button btn-inverse" ng-hide="name=='Anonymous User'" ng-click="logout()">Logout</button>
</p>
<div class="nav-collapse collapse">
<ul class="nav pull-right">
Expand Down Expand Up @@ -325,8 +326,8 @@ <h2>About Me</h2>
</div>
</div>
<div class="span7 offset1">
Name: {{name}}
Tag: {{etag}} <!-- This will be removed later! -->
Name: {{name}}<br>
Tag: {{etag}}<br> <!-- This will be removed later! -->
Description: <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
</div>
</div>
Expand All @@ -335,6 +336,16 @@ <h2>About Me</h2>
<div class="row-fluid">
<h2>My Sketches</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<td>Sketch ID</td>
<td>File Owner</td>
<td>Sketch Version</td>
<td>Parent Sketch</td>
<td>Sketch Name</td>
<td>Sketch Description</td>
</tr>
</thead>
<tbody>
<tr ng-repeat="files in items.entities | filter:name">
<td>{{files.data.sketchId}}</td>
Expand Down Expand Up @@ -366,16 +377,16 @@ <h2>My Sketches</h2>
<!-- Stuff goes here. -->
<div class="row-fluid">
<div class="row-fluid">
<div class="span6">
{{fileName}} (version {{version}}) by {{owner}}
</div>
<div class="span6">
<button class="btn btn-inverse btn-small" onclick="initNew()">New</button>
<button class="btn btn-inverse btn-small" onclick="initSave()" data-toggle="modal" href="#SaveSketch" ng-hide="fileName==''">Save</button>
<button class="btn btn-inverse btn-small" onclick="initSave()" data-toggle="modal" href="#SaveAsSketch">Save As</button>
<button class="btn btn-inverse btn-small" onclick="initLoad()">Load/Revert</button>
<input type="text" id="visibleTextData" ng-model="fileData">
</div>
<div class="span6">
{{fileName}} (version {{version}}) by {{owner}} [{{item.currentId}}]
</div>
</div>
</div>

<!-- Container for SWF Plugin - DO NOT REMOVE! -->
Expand Down Expand Up @@ -549,6 +560,16 @@ <h3 id="myUploadItems">Save Sketch</h3>
<!-- Stuff goes here. -->
<span style="display:none">{{fileData}}</span>
<table class="table table-bordered table-striped">
<thead>
<tr>
<td>Sketch ID</td>
<td>File Owner</td>
<td>Sketch Version</td>
<td>Parent Sketch</td>
<td>Sketch Name</td>
<td>Sketch Description</td>
</tr>
</thead>
<tbody>
<tr ng-repeat="files in items.entities | filter:query">
<td>{{files.data.sketchId}}</td>
Expand Down
12 changes: 10 additions & 2 deletions app/js/angular/sketch-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function SketchController($scope,$resource){

$scope.item.data = {"sketchId":"", "version":"", "original":"", "owner":"", "fileName":"", "fileData":"", "changeDescription":"", "permissions":""};
$scope.item.data.sketchId = "";
$scope.item.data.version = parseInt("1", 10);
//$scope.item.data.version = parseInt("1", 10);


$scope.item.data.original = $scope.sketchId + ":" + $scope.version;
Expand All @@ -77,7 +77,7 @@ function SketchController($scope,$resource){

$scope.item.data = {"sketchId":"", "version":"", "original":"", "owner":"", "fileName":"", "fileData":"", "changeDescription":"", "permissions":""};
$scope.item.data.sketchId = $scope.sketchId;
$scope.item.data.version = parseInt($scope.version, 10) + 1;
//$scope.item.data.version = parseInt($scope.version, 10) + 1;
$scope.item.data.original = $scope.sketchId + ":" + $scope.version;
$scope.item.data.owner = $scope.owner;
$scope.item.data.fileName = $scope.fileName;
Expand Down Expand Up @@ -107,6 +107,14 @@ function SketchController($scope,$resource){
$scope.name = l.displayName;
$scope.etag = l.result;
}

$scope.logout = function() {
$scope.name = "Anonymous User";
$scope.etag = ""

var authorizeButton = document.getElementById('authorize-button');
authorizeButton.style.visibility = '';
}

/*
General Add/List (pass "model" to m_type)
Expand Down
Loading

0 comments on commit a9e8e88

Please sign in to comment.