Skip to content

Commit

Permalink
added some gulp
Browse files Browse the repository at this point in the history
  • Loading branch information
jonniespratley committed Dec 17, 2014
1 parent afdd226 commit 9d1149e
Show file tree
Hide file tree
Showing 5 changed files with 218 additions and 93 deletions.
2 changes: 1 addition & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="scripts/config.js"></script>
<script src="scripts/app.js"></script>
<script src="scripts/templates.js"></script>
<!--script src="scripts/templates.js"></script-->
<script src="scripts/controllers/main.js"></script>
<script src="scripts/controllers/docs.js"></script>
<script src="scripts/controllers/admin.js"></script>
Expand Down
90 changes: 90 additions & 0 deletions app/scripts/controllers/pages.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,93 @@ angular.module('angularCmsApp')
$scope.getPages()
$log.info('Page deleted', res)
)

#Page Form Schema
$scope.pageSchema = {
"fields": [
{
"type": "text",
"name": "title",
"displayName": "Title:",
"validation": {
"messages": {},
"required": true,
"minlength": 2,
"maxlength": 18
},
"placeholder": "Enter title here",
"tooltip": "Enter the page title here"
},
{
"type": "selectlist",
"name": "parent",
"displayName": "Parent:",
"options": [
{
"value": "1",
"text": "Option 1"
},
{
"value": "2",
"text": "Option 2"
},
{
"value": "3",
"text": "Option 3"
}
],
"value": "1"
},
{
"type": "selectlist",
"name": "template",
"displayName": "Template:",
"options": [
{
"value": "1",
"text": "Option 1"
},
{
"value": "2",
"text": "Option 2"
},
{
"value": "3",
"text": "Option 3"
}
],
"value": "1"
},
{
"type": "textarea",
"name": "body",
"displayName": "Body:",
"validation": {
"messages": {}
},
"placeholder": "Enter body here",
"tooltip": "Enter page body here"
},
{
"type": "checkboxlist",
"name": "status",
"displayName": "Status:",
"options": [
{
"value": "published",
"text": "Published"
},
{
"value": "draft",
"text": "Draft"
},
{
"value": "private",
"text": "Private"
}
],
"value": "draft",
"tooltip": "Select the page status"
}
]
}
205 changes: 116 additions & 89 deletions app/views/pages.html
Original file line number Diff line number Diff line change
@@ -1,90 +1,117 @@

<div class="page-container">
<div class="">
<cms-header title="Pages" icon="folder-open"></cms-header>
<section>
<div class="row">
<div class="col-sm-12">
<div class="alerts"></div>



<table class="table table-condensed table-hover table-striped clearfix table-bordered">
<thead>
<tr>
<th class="th-checkbox"><input type="checkbox" class="checkbox"></th>
<th>Title</th>
<th>Date</th>
<th>Actions</th>
</tr>
</thead>
<tbody>

<tr ng-repeat="page in pages">
<td><input type="checkbox" value="{{page._id}}"/></td>
<td>
<a href="" ng-click="selectPage(page)" title="{{page.title}}">{{page.title}}</a>
<span class="label label-default">{{page.publish}}</span>
</td>
<td>{{page.created | date:'medium'}}</td>
<td class="actions">
<div class="btn-group">
<button type="button" class="btn btn-default btn-sm" ng-click="selectPage(page);" data-toggle="modal" data-target="#user-modal">
<i class="fa fa-edit"></i>
</button>
<button type="button" class="btn btn-default btn-sm" ng-click="remove(page);">
<i class="fa fa-trash-o"></i>
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<div class="row">
<div class="col-sm-7 col-xs-7">
<input type="text" class="form-control" placeholder="Enter title here" ng-model="page.title">
<span class="help-block">
<strong>Permlink:</strong> http://{{App.baseurl}}/?page_id={{page.slug}}
</span>
<textarea class="form-control" rows="5" ng-model="page.body"></textarea>
</div>
<div class="col-sm-5 col-xs-5">
<ul class="list-unstyled form-list">
<li class="form-group">
<label class="col-sm-2 control-label">Published:</label>
<input type="checkbox" ng-model="page.status" value="true">
</li>
<li class="form-group">
<label class="col-sm-2 control-label">Order:</label>
<input type="number">
</li>
<li class="form-group">
<label class="col-sm-2 control-label">Parent:</label>
<select>
<option>Page 1</option>
<option>Option 2</option>
<option>Option 3</option>
</select>
</li>
<li class="form-group">
<label class="col-sm-2 control-label">Template:</label>
<select>
<option>Template 1</option>
<option>Option 2</option>
<option>Option 3</option>
</select>
</li>
<li class="form-actions">
<button href="#" class="btn btn-danger btn-block btn-xs" ng-click="remove(page)">Move to trash</button>
<button class="btn pull-right btn-primary btn-block" ng-click="save(page)">Save</button>
</li>
</ul>

</div>
</div>
</div>
<!--/span-->
<!--/row-->
<div class="">
<cms-header title="Pages" icon="folder-open"></cms-header>
<section>
<div class="row">
<div class="col-sm-12">
<div class="alerts"></div>



<table class="table table-condensed table-hover table-striped clearfix table-bordered">
<thead>
<tr>
<th class="th-checkbox">
<input type="checkbox" class="checkbox">
</th>
<th>Title</th>
<th>Date</th>
<th>Actions</th>
</tr>
</thead>
<tbody>

<tr ng-repeat="page in pages">
<td>
<input type="checkbox" value="{{page._id}}" />
</td>
<td>
<a href="" ng-click="selectPage(page)" title="{{page.title}}">{{page.title}}</a>
<span class="label label-default">{{page.publish}}</span>
</td>
<td>{{page.created | date:'medium'}}</td>
<td class="actions">
<div class="btn-group">
<button type="button" class="btn btn-default btn-sm" ng-click="selectPage(page);" data-toggle="modal" data-target="#user-modal">
<i class="fa fa-edit"></i>
</button>
<button type="button" class="btn btn-default btn-sm" ng-click="remove(page);">
<i class="fa fa-trash-o"></i>
</button>
</div>
</td>
</tr>
</tbody>
</table>







</div>
</div>
</section>
<div class="row ">




<!-- Create normal bootstrap form element -->
<form class="form-horizontal" ng-submit="save(page)">


<div class="col-sm-7 col-xs-7">

<!-- Embed the schema editor on the form -->
<div
fg-form
fg-form-data="page"
fg-schema="pageSchema"></div>


</div>
<div class="col-sm-5 col-xs-5">
<span class="help-block">
<strong>Permlink:</strong> http://{{App.baseurl}}/?page_id={{page.slug}}
</span>
<ul class="list-unstyled form-list">
<li class="form-group">
<label class="col-sm-2 control-label">Published:</label>
<input type="checkbox" ng-model="page.status" value="true">
</li>
<li class="form-group">
<label class="col-sm-2 control-label">Order:</label>
<input type="number">
</li>
<li class="form-group">
<label class="col-sm-2 control-label">Parent:</label>
<select>
<option>Page 1</option>
<option>Option 2</option>
<option>Option 3</option>
</select>
</li>
<li class="form-group">
<label class="col-sm-2 control-label">Template:</label>
<select>
<option>Template 1</option>
<option>Option 2</option>
<option>Option 3</option>
</select>
</li>
<li class="form-actions">
<button href="#" class="btn btn-danger btn-block" ng-click="remove(page)">Move to trash</button>
<button class="btn pull-right btn-primary btn-block">Save</button>
</li>
</ul>

</div>
</div>

</form>

</div>
<!--/span-->
<!--/row-->
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,12 @@
"grunt-rev": "~0.1.0",
"grunt-svgmin": "~0.2.0",
"grunt-usemin": "~2.0.2",
"gulp": "^3.8.10",
"gulp-coffee": "^2.2.0",
"gulp-ng-annotate": "^0.4.3",
"gulp-ng-templates": "0.0.5",
"gulp-ngmin": "^0.3.0",
"gulp-protractor": "0.0.11",
"gulp-protractor": "0.0.12",
"gulp-uglify": "^1.0.2",
"intern": "^2.2.2",
"jasmine-core": "^2.1.2",
Expand Down
8 changes: 6 additions & 2 deletions routes/cms-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ module.exports = function (config, app) {
};

router.use(express.static(config.staticDir, options));

router.use('/', function(res, req, next){
app.all('/', function(req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'X-Requested-With');
next();
});
app.get('/', function(res, req, next){
req.send(config.publicDir + path.sep + 'index.html');
next();
});
Expand Down

0 comments on commit 9d1149e

Please sign in to comment.