-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/jonniespratley/angular-cms…
… into develop Conflicts: README.md package.json
- Loading branch information
Showing
16 changed files
with
700 additions
and
742 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 |
---|---|---|
@@ -1 +1 @@ | ||
web: node web.js | ||
web: node server.js |
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
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
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 |
---|---|---|
@@ -1,63 +1,62 @@ | ||
'use strict' | ||
angular.module('angularCmsApp').controller('UsersCtrl', ($scope, DataService) -> | ||
$scope.awesomeThings = [ | ||
'HTML5 Boilerplate' | ||
'AngularJS' | ||
'Karma' | ||
] | ||
|
||
$scope.user = | ||
username: null | ||
email: null | ||
password: null | ||
role: null | ||
created: new Date() | ||
modified: new Date() | ||
metadata: | ||
avatar: '' | ||
name: null | ||
aboue: null | ||
|
||
#Hold the users | ||
$scope.users = [] | ||
|
||
#Holds the user groups | ||
$scope.groups = ['Admin', 'Member', 'Public'] | ||
|
||
$scope.getGroups = () -> | ||
DataService.fetch('groups').then((data) -> | ||
$scope.groups = data | ||
console.log(data) | ||
) | ||
$scope.awesomeThings = [ | ||
'HTML5 Boilerplate' | ||
'AngularJS' | ||
'Karma' | ||
] | ||
|
||
#Select user | ||
$scope.selectUser = (user) -> | ||
$scope.user = user | ||
$scope.user = | ||
username: null | ||
email: null | ||
password: null | ||
role: null | ||
created: new Date() | ||
modified: new Date() | ||
metadata: | ||
avatar: '' | ||
name: null | ||
aboue: null | ||
|
||
#Get users | ||
$scope.getUsers = () -> | ||
DataService.fetch('users').then((data) -> | ||
$scope.users = data | ||
$scope.getGroups() unless $scope.groups | ||
) | ||
#Hold the users | ||
$scope.users = [] | ||
|
||
#Holds the user groups | ||
$scope.groups = ['Admin', 'Member', 'Public'] | ||
|
||
#Delete user | ||
$scope.deleteUser = (index, user) -> | ||
ask = confirm "Delete #{user.email}?" | ||
$scope.getGroups = () -> | ||
DataService.fetch('groups').then((results) -> | ||
$scope.groups = results.data | ||
console.log(data) | ||
) | ||
|
||
if ask | ||
DataService.destroy('users', user).then((data) -> | ||
$scope.users.pop(index) | ||
$scope.getUsers() | ||
) | ||
#Select user | ||
$scope.selectUser = (user) -> | ||
$scope.user = user | ||
|
||
#Add user to database | ||
$scope.addUser = (user) -> | ||
DataService.save('users', user).then((data) -> | ||
#Get users | ||
$scope.getUsers = () -> | ||
DataService.fetch('users').then((results) -> | ||
$scope.users = results.data | ||
$scope.getGroups() unless $scope.groups | ||
) | ||
|
||
#Delete user | ||
$scope.deleteUser = (index, user) -> | ||
ask = confirm "Delete #{user.email}?" | ||
|
||
if ask | ||
DataService.destroy('users', user).then((data) -> | ||
$scope.users.pop(index) | ||
$scope.getUsers() | ||
#$scope.users.push(user) unless user._id | ||
$scope.user = {} | ||
$('#user-modal').modal('hide') | ||
) | ||
|
||
|
||
#Add user to database | ||
$scope.addUser = (user) -> | ||
DataService.save('users', user).then((data) -> | ||
$scope.getUsers() | ||
#$scope.users.push(user) unless user._id | ||
$scope.user = {} | ||
$('#user-modal').modal('hide') | ||
) | ||
) |
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 @@ | ||
'use strict' | ||
|
||
###* | ||
# @ngdoc service | ||
# @name angularCmsApp.cmsSocketService | ||
# @description | ||
# # cmsSocketService | ||
# Service in the angularCmsApp. | ||
### | ||
angular.module('angularCmsApp').service 'cmsSocketService', -> | ||
# AngularJS will instantiate a singleton by calling "new" on this function | ||
WebSocketClient = (options) -> | ||
_ws = undefined | ||
_ws = new WebSocket(options.endpoint, options.protocol) | ||
_ws.onmessage = (e) -> | ||
console.log e.data | ||
|
||
_ws.onerror = (e) -> | ||
console.log e | ||
|
||
_ws.onclose = (e) -> | ||
console.log e | ||
|
||
_ws.onopen = (e) -> | ||
_ws.send "update" | ||
return | ||
instance: _ws | ||
close: -> | ||
_ws.close() | ||
|
||
send: (obj) -> | ||
try | ||
_ws.send obj | ||
catch err | ||
throw err | ||
return | ||
|
||
return WebSocketClient |
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 |
---|---|---|
|
@@ -163,7 +163,7 @@ html { | |
} | ||
|
||
.cms-sidebar.closed .well { | ||
width: 45px; | ||
width: 65px; | ||
|
||
} | ||
|
||
|
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 |
---|---|---|
@@ -1,102 +0,0 @@ | ||
|
||
<div class="container"> | ||
<div class="row row-offcanvas row-offcanvas-left"> | ||
<div class="col-xs-3 col-sm-3 col-md-2 sidebar-offcanvas" id="sidebar" role="navigation" ng-include src="'views/_sidebar.html'"></div> | ||
<div class="col-xs-8 col-sm-9 col-md-10"> | ||
<p class="pull-left visible-xs"> | ||
<button type="button" class="btn btn-primary btn-xs" data-toggle="offcanvas">Toggle nav</button></p> | ||
<div class="well well-sm"> | ||
<button type="button" class="close" aria-hidden="true"> | ||
<small>×</small> | ||
</button> | ||
<h2>Welcome to Angular-CMS!</h2> | ||
<p>Here are some links to help get you started:</p><br> | ||
<div class="row"> | ||
<div class="col-xs-4 col-sm-4 col-md-4 hidden-xs"> | ||
<p><strong>Get Started</strong></p> | ||
<p><a href="#/themes" class="btn btn-primary btn-lg hidden-sm">Customize Your Site</a></p> | ||
</div> | ||
<div class="col-xs-6 col-sm-4 col-md-4"> | ||
<p><strong>Next Steps</strong></p> | ||
<p><i class="glyphicon glyphicon-edit"></i> <a href="#/plugins"> Add some plugins</a></p> | ||
<p><i class="glyphicon glyphicon-upload"></i> <a href="#/media"> Upload media</a></p> | ||
</div> | ||
<div class="col-xs-6 col-sm-4 col-md-4"> | ||
<p><strong>More Actions</strong></p> | ||
<p><i class="glyphicon glyphicon-user"></i> <a href="#/users"> Manage Users</a></p> | ||
<p><i class="glyphicon glyphicon-cog"></i> <a href="#/settings"> Site Settings</a></p> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-6 col-sm-6 col-lg-6"> | ||
<div class="panel panel-default"> | ||
<header class="panel-heading">Overview</header> | ||
<section class="panel-body"> | ||
<div class="row"> | ||
<div class="col-6 col-sm-6"> | ||
<legend>Content</legend> | ||
<ul class="list-unstyled"> | ||
<li> | ||
<span class="badge">42</span> Pages</li> | ||
<li> | ||
<span class="badge">2</span> Categories</li> | ||
<li> | ||
<span class="badge">5</span> Tags</li> | ||
<li> | ||
<span class="badge">23</span> Files</li> | ||
<li> | ||
<span class="badge">5</span> Plugins</li> | ||
</ul> | ||
</div> | ||
<div class="col-6 col-sm-6"> | ||
<legend>System</legend> | ||
</div> | ||
</div> | ||
<p>You are using <strong>Angular-CMS 0.1.0</strong></p> | ||
</section> | ||
<div class="panel-footer clearfix"> | ||
<button class="btn pull-left hidden-sm btn-default" type="reset">Check for Update</button> | ||
<button class="btn btn-primary pull-right">Install Plugin</button> | ||
</div> | ||
</div> | ||
<p></p> | ||
</div> | ||
<!--/span--> | ||
<div class="col-6 col-sm-6 col-mg-6 col-lg-6"> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading">Quick Post | ||
</div> | ||
<div class="panel-body"> | ||
<form> | ||
<div class="form-group"> | ||
<div class="controls"> | ||
<input type="text" class="form-control" placeholder="Enter title here..."> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<div class="controls"> | ||
<textarea class="form-control" rows="3"></textarea> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<div class="controls"> | ||
<input type="text" class="form-control" placeholder="Tags (separate with commas)"> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
<div class="panel-footer clearfix"> | ||
<button class="btn pull-left btn-default" type="button">Save Draft</button> | ||
<button class="btn btn-primary pull-right">Publish</button> | ||
</div> | ||
</div> | ||
</div> | ||
<!--/span--> | ||
<!--/row--> | ||
</div> | ||
</div> | ||
<!--/span--> | ||
</div> | ||
<!--/row--> | ||
|
||
Oops, something went wrong.