Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/jonniespratley/angular-cms
Browse files Browse the repository at this point in the history
… into develop

Conflicts:
	README.md
	package.json
  • Loading branch information
jonniespratley committed Dec 8, 2014
2 parents f8cd965 + fe4af0e commit 7478d44
Show file tree
Hide file tree
Showing 16 changed files with 700 additions and 742 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: node web.js
web: node server.js
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ This is a boilerplate CMS built with Angular, Twitter Bootstrap and Node; it is

[![Build Status](https://travis-ci.org/jonniespratley/angular-cms.png)](https://travis-ci.org/jonniespratley/angular-cms)

[![Codacy Badge](https://www.codacy.com/project/badge/0825389c11854c23a05cc512385ec82d)](https://www.codacy.com/public/jonniespratley/angular-cms)

[![Coverage Status](https://coveralls.io/repos/jonniespratley/angular-cms/badge.png)](https://coveralls.io/r/jonniespratley/angular-cms)


[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/jonniespratley/angular-cms/trend.png)](https://bitdeli.com/free)

[![Coverage Status](https://coveralls.io/repos/jonniespratley/angular-cms/badge.png)](https://coveralls.io/r/jonniespratley/angular-cms)[![Dependency Status](https://david-dm.org/jonniespratley/angular-cms.svg)](https://david-dm.org/jonniespratley/angular-cms)

### Technologies

Expand Down Expand Up @@ -69,9 +73,13 @@ To run the application on your local machine please take the following steps.

To start mongodb execute the following command:

<<<<<<< HEAD
```
$ sh ./bin/db.sh
```
=======
$ sh ./bin/db.sh
>>>>>>> fe4af0e14ef3596c823d4777d672ba00406ddb90
> **Note:** If errors when executing command remove the `db/mongod.lock` file.
Expand Down Expand Up @@ -130,8 +138,13 @@ $ grunt protractor
---

<<<<<<< HEAD
RESTful Server
--------------
=======
## RESTful Server
The server is a Node.js server that supports dynamic RESTful API calls to resource endpoints. It will automatically create a database if it does not exist and collection(s).
>>>>>>> fe4af0e14ef3596c823d4777d672ba00406ddb90
The server is a Node.js server that supports dynamic RESTful API calls to resource endpoints. It will automatically create a database if it does not exist and collection(s).

Expand Down
1 change: 1 addition & 0 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
<script src="scripts/services/cmssessionservice.js"></script>
<script src="scripts/services/cmsnotify.js"></script>
<script src="scripts/filters/gravatar.js"></script>
<script src="scripts/services/cmssocketservice.js"></script>
<!-- endbuild -->
</body>
</html>
105 changes: 52 additions & 53 deletions app/scripts/controllers/users.coffee
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')
)
)
38 changes: 38 additions & 0 deletions app/scripts/services/cmssocketservice.coffee
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
2 changes: 1 addition & 1 deletion app/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ html {
}

.cms-sidebar.closed .well {
width: 45px;
width: 65px;

}

Expand Down
102 changes: 0 additions & 102 deletions app/views/admin.html
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>&times;</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-->

Loading

0 comments on commit 7478d44

Please sign in to comment.