Get rid of grunt, fix users routing issues

This commit is contained in:
Matej Kramny 2015-03-09 12:17:34 +00:00
parent 50d60df7c4
commit f09478ec58
4 changed files with 31 additions and 10 deletions

2
.gitignore vendored
View File

@ -5,6 +5,8 @@ dist/
.vagrant .vagrant
bin/setup.js bin/setup.js
public/css/semaphore.css
# Logs # Logs
logs logs
*.log *.log

View File

@ -1,11 +1,12 @@
var util = require('../util') var util = require('../util')
, auth = require('./auth') auth = require('./auth'),
, playbooks = require('./playbook/playbooks') playbooks = require('./playbook/playbooks'),
, profile = require('./profile') profile = require('./profile'),
, identities = require('./identity/identities') identities = require('./identity/identities'),
, jobs = require('./job/jobs') jobs = require('./job/jobs'),
, hosts = require('./host/hosts') hosts = require('./host/hosts'),
, tasks = require('./task/tasks') tasks = require('./task/tasks'),
users = require('./user/users')
exports.router = function(app) { exports.router = function(app) {
var templates = require('../templates')(app); var templates = require('../templates')(app);
@ -15,7 +16,8 @@ exports.router = function(app) {
identities, identities,
jobs, jobs,
hosts, hosts,
tasks tasks,
users
]); ]);
templates.add('homepage') templates.add('homepage')
@ -31,6 +33,7 @@ exports.router = function(app) {
jobs.httpRouter(app); jobs.httpRouter(app);
hosts.httpRouter(app); hosts.httpRouter(app);
tasks.httpRouter(app); tasks.httpRouter(app);
users.httpRouter(app);
// only json beyond this point // only json beyond this point
app.get('*', function(req, res, next) { app.get('*', function(req, res, next) {
@ -51,6 +54,7 @@ exports.router = function(app) {
jobs.router(app); jobs.router(app);
hosts.router(app); hosts.router(app);
tasks.router(app); tasks.router(app);
users.router(app);
} }
function layout (req, res) { function layout (req, res) {

View File

@ -1,7 +1,7 @@
var models = require('../../models') var models = require('../../models')
var mongoose = require('mongoose') var mongoose = require('mongoose')
var identity = require('./user') var user = require('./user')
var validator = require('validator') var validator = require('validator')

View File

@ -0,0 +1,15 @@
define([
'app'
], function(app) {
app.registerService('users', function($http, $rootScope) {
var self = this;
self.getUsers = function(cb) {
$http.get('/users').success(function(data) {
self.users = data;
cb();
});
}
});
});