faalis 1.0.0.alpha4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/faalis/angular-manifest.js +1 -0
  3. data/app/assets/javascripts/faalis/dashboard/app.js +1 -2
  4. data/app/assets/javascripts/faalis/dashboard/controllers/group.js.coffee +9 -7
  5. data/app/assets/javascripts/faalis/dashboard/controllers/user.js +11 -0
  6. data/app/assets/javascripts/faalis/dashboard/functions.js.erb +36 -0
  7. data/app/assets/javascripts/faalis/dashboard/lib/controllers/generic_index_controller.js.coffee +13 -6
  8. data/app/assets/javascripts/faalis/dashboard/lib/fields/has_many_field.js.coffee +0 -2
  9. data/app/assets/javascripts/faalis/dashboard/lib/resource.js.coffee +17 -4
  10. data/app/assets/javascripts/faalis/dashboard/modules/auth/user.js +0 -96
  11. data/app/assets/javascripts/faalis/dashboard/modules/fake.js +41 -0
  12. data/app/assets/javascripts/faalis/dashboard/modules/fields/datetime.js +4 -1
  13. data/app/assets/javascripts/faalis/dashboard/resources/group_resource.js.coffee +1 -0
  14. data/app/assets/javascripts/faalis/dashboard/resources/user_resource.js.coffee +0 -0
  15. data/app/assets/javascripts/faalis/dashboard/services/api.js.coffee +8 -6
  16. data/app/assets/javascripts/faalis/dashboard/services/user.js.coffee +0 -4
  17. data/app/assets/javascripts/faalis/dashboard/variables.js.erb +2 -1
  18. data/app/assets/stylesheets/faalis/dashboard/ltr/application.css +4 -2
  19. data/app/assets/stylesheets/faalis/dashboard/rtl/application.css +2 -0
  20. data/app/controllers/faalis/api/v1/permissions_controller.rb +2 -1
  21. data/app/controllers/faalis/api_controller.rb +0 -3
  22. data/app/controllers/faalis/application_controller.rb +3 -0
  23. data/app/controllers/faalis/dashboard/groups_controller.rb +80 -0
  24. data/app/controllers/faalis/dashboard/users_controller.rb +100 -0
  25. data/app/controllers/faalis/dashboard_controller.rb +5 -1
  26. data/app/helpers/faalis/users_helper.rb +4 -0
  27. data/app/models/faalis/concerns/user/permission.rb +5 -0
  28. data/app/models/faalis/group.rb +14 -0
  29. data/app/models/faalis/permission.rb +3 -0
  30. data/app/views/angular/auth/groups/details.html +2 -21
  31. data/app/views/angular/auth/groups/index.html +2 -5
  32. data/app/views/angular/auth/groups/new.html +2 -47
  33. data/app/views/faalis/api/v1/groups/index.json.jbuilder +4 -4
  34. data/app/views/faalis/api/v1/permissions/index.json.jbuilder +1 -1
  35. data/app/views/faalis/dashboard/groups/_form.html.slim +72 -0
  36. data/app/views/faalis/dashboard/groups/create.js.erb +3 -0
  37. data/app/views/faalis/dashboard/groups/edit.html.slim +3 -0
  38. data/app/views/faalis/dashboard/groups/errors.js.erb +3 -0
  39. data/app/views/faalis/dashboard/groups/new.html.slim +2 -0
  40. data/app/views/faalis/dashboard/groups/update.js.erb +3 -0
  41. data/app/views/faalis/dashboard/users/_form.html.slim +80 -0
  42. data/app/views/faalis/dashboard/users/_password_form.html.slim +37 -0
  43. data/app/views/faalis/dashboard/users/create.js.erb +3 -0
  44. data/app/views/faalis/dashboard/users/edit.html.slim +3 -0
  45. data/app/views/faalis/dashboard/users/edit_password.html.slim +1 -0
  46. data/app/views/faalis/dashboard/users/errors.js.erb +3 -0
  47. data/app/views/faalis/dashboard/users/index.html.slim +67 -0
  48. data/app/views/faalis/dashboard/users/new.html.slim +2 -0
  49. data/app/views/faalis/dashboard/users/show.html.slim +6 -0
  50. data/app/views/faalis/dashboard/users/update.js.erb +3 -0
  51. data/app/views/faalis/dashboard/users/update_password.js.erb +3 -0
  52. data/db/migrate/20131013091000_devise_create_faalis_users.rb +0 -3
  53. data/lib/faalis.rb +2 -0
  54. data/lib/faalis/action_dispatch.rb +3 -0
  55. data/lib/faalis/configuration.rb +25 -0
  56. data/lib/faalis/engine.rb +2 -0
  57. data/lib/faalis/fake_assets.rb +1 -0
  58. data/lib/faalis/route.rb +73 -2
  59. data/lib/faalis/version.rb +3 -3
  60. data/lib/faalis_application.rb +10 -6
  61. data/lib/faalis_plugin.rb +5 -4
  62. data/lib/generators/faalis/install_generator.rb +1 -0
  63. data/lib/generators/faalis/js/list_view_generator.rb +4 -0
  64. data/lib/generators/faalis/scaffold_generator.rb +98 -72
  65. data/lib/generators/faalis/templates/angularjs/new.html.erb +10 -10
  66. data/lib/generators/faalis/templates/js/list_view/new.html.erb +10 -10
  67. data/lib/generators/faalis/templates/js/list_view/partials/add_controller.js.erb +4 -4
  68. data/lib/generators/faalis/templates/js/list_view/partials/config.js.erb +11 -8
  69. data/lib/generators/faalis/templates/js/list_view/partials/index_controller.js.erb +5 -5
  70. data/lib/generators/faalis/templates/policy/application_policy.rb +2 -0
  71. data/lib/generators/faalis/templates/policy/policy.rb.erb +2 -0
  72. data/spec/dummy/db/development.sqlite3 +0 -0
  73. data/spec/dummy/db/migrate/{20150121060012_create_application_models.model_discovery_engine.rb → 20150723215115_create_application_models.model_discovery_engine.rb} +0 -0
  74. data/spec/dummy/db/migrate/20150725103007_devise_create_faalis_users.faalis.rb +63 -0
  75. data/spec/dummy/db/migrate/20150725103008_create_faalis_groups.faalis.rb +13 -0
  76. data/spec/dummy/db/migrate/20150725103009_create_faalis_permissions.faalis.rb +13 -0
  77. data/spec/dummy/db/migrate/20150725103010_add_permissions_groups_table.faalis.rb +9 -0
  78. data/spec/dummy/db/migrate/20150725103011_add_users_groups_table.faalis.rb +9 -0
  79. data/spec/dummy/db/schema.rb +5 -2
  80. data/spec/dummy/db/seeds.rb +1 -0
  81. data/spec/dummy/db/test.sqlite3 +0 -0
  82. data/spec/dummy/log/development.log +6474 -466
  83. data/spec/dummy/log/test.log +23493 -9554
  84. data/spec/dummy/tmp/app/assets/javascripts/controlpanel/application.js +22 -0
  85. data/spec/dummy/tmp/app/assets/stylesheets/dashboard/ltr/application.css +3 -0
  86. data/spec/dummy/tmp/app/assets/stylesheets/dashboard/rtl/application.css +3 -0
  87. data/spec/dummy/tmp/app/assets/stylesheets/ltr/application.css +3 -0
  88. data/spec/dummy/tmp/app/assets/stylesheets/rtl/application.css +3 -0
  89. data/spec/dummy/tmp/app/controllers/api_controller.rb +2 -0
  90. data/spec/dummy/tmp/app/controllers/application_controller.rb +0 -0
  91. data/spec/dummy/tmp/app/policies/application_policy.rb +2 -0
  92. data/spec/dummy/tmp/config/initializers/devise.rb +251 -0
  93. data/spec/dummy/tmp/config/initializers/faalis.rb +13 -0
  94. data/spec/dummy/tmp/config/initializers/fast_gettext.rb +4 -0
  95. data/spec/dummy/tmp/config/initializers/formstatic.rb +76 -0
  96. data/spec/dummy/tmp/config/routes.rb +0 -0
  97. data/spec/dummy/tmp/db/seeds.rb +1 -0
  98. metadata +73 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4142c1bbc7a9acf734840f8549f57bcbd1423197
4
- data.tar.gz: 6bdc7be8afae5e8db1684a8e2034379f4528a3df
3
+ metadata.gz: 48423f7be005515dd296b6e41f13451db95aece8
4
+ data.tar.gz: 47ff6d348cb1af52a72a60ce5706d7ed011ace98
5
5
  SHA512:
6
- metadata.gz: 86bafa8c2f59fd59482bcbd6d92d69bdb5ff07346e3010c65817849a111976a4de6465331fc95e0ecafe40f9c76e4c0275328cf0ad942687cdf0a9164e943f37
7
- data.tar.gz: a1e0aa9ebed472d454a21949bb712054f4744afc9b5c0248266eca7f37d4b9fd0a3ca499319a0294bade56b6738d415536febc0b89feff63ab414b74f504bfbd
6
+ metadata.gz: 729d1153859a5a6235b732a3c6a192f98107c2ed2bddddf687789149988efdd71d80e3e36376b7ab63251eb92146f1820774915ea212ae73a37daf6a8532c1fd
7
+ data.tar.gz: 9680abe59e5b2884cabf106b32e2a4895cb48b4a45ac9361792567af212c6cf09deca9de97d8ca479b23bcc53c5156d2910ebb97837a2bfdb362d6b56ec7b175
@@ -16,6 +16,7 @@
16
16
  //= require select2/select2
17
17
  //= require angular-ui-select2/select2
18
18
  //= require flow.js/flow
19
+ //= require angular-loading-bar/loading-bar
19
20
  //= require ng-flow
20
21
  //= require faalis/dashboard/functions
21
22
  //= require_tree ./dashboard/lib
@@ -76,9 +76,8 @@ angular.element(document).ready(function(){
76
76
  url: API_PREFIX + "permissions/user"})
77
77
  .success(function(data, status, headers, config){
78
78
  PERMISSIONS = data.permissions;
79
-
80
79
  console.groupCollapsed('User Permissions');
81
- console.log(data.permissions);
80
+ console.log(data);
82
81
  console.groupEnd();
83
82
 
84
83
  angular.bootstrap(document, ["Dashboard"]);
@@ -13,10 +13,10 @@ Group.config ["$stateProvider", "ResourcesProvider",
13
13
  }).
14
14
  state("groups.new",{
15
15
  url: "/new",
16
- templateUrl: template_url("auth/groups/new"),
16
+ templateUrl :template_url("auth/groups/new"),
17
17
  controller: "NewGroupController"
18
18
  }).
19
- state("groups.edit",{
19
+ state("groups-edit",{
20
20
  url: "/:id/edit",
21
21
  templateUrl: template_url("auth/groups/new"),
22
22
  controller: "AddGroupController"
@@ -27,17 +27,19 @@ Group.config ["$stateProvider", "ResourcesProvider",
27
27
  ]
28
28
 
29
29
 
30
- Group.controller "NewGroupController", ["$state", "$rootScope", "$scope", "Resources", "$stateParams", "gettext",
31
- ($state, $rootScope, $scope, Resources, $stateParams, _) ->
30
+ Group.controller "NewGroupController", ["$state", "$rootScope", "$scope", "Restangular", "$stateParams", "gettext", "catch_error",
31
+ ($state, $rootScope, $scope, Resources, $stateParams, _, catch_error) ->
32
32
 
33
33
 
34
- $scope.resource = Resources.main_resource()
35
34
  $scope.group = {}
36
35
 
37
36
  $rootScope.section_name = _("Groups")
38
37
  $rootScope.section_slug = _("Add")
39
38
 
40
- resource.initialize($stateParams)
39
+ Resources.all('permissions').getList().then (data)->
40
+ console.log(data);
41
+ $scope.permissions = data[0].permissions
42
+ , (data)->
43
+ catch_error(data)
41
44
 
42
- $scope.relations = resource.get_all_relations()
43
45
  ]
@@ -0,0 +1,11 @@
1
+ var User = angular.module("User", ["ListView", "Errors", "ui.router"]);
2
+
3
+ User.config(["$stateProvider", function($stateProvider){
4
+
5
+ $stateProvider.
6
+ state("users", {
7
+ url: "/auth/users",
8
+ templateUrl: template("auth/users/index"),
9
+ controller: "UsersController"
10
+ });
11
+ }]);
@@ -1,3 +1,35 @@
1
+
2
+ //TODO: Use a js template engine in here
3
+ function form_error(data) {
4
+ var msg = data.title + "<br/><ul>";
5
+ delete data.title;
6
+
7
+ //TODO: Replace this with *sugar*
8
+ _.each(_.keys(data), function(x){
9
+ msg += "<li>" + data[x] + "</li>";
10
+ $('input[name="' + x + '"], [data-name="' + x + '"]').addClass('has-error');
11
+ });
12
+
13
+ msg += "</ul>";
14
+
15
+ error_message(msg);
16
+ }
17
+
18
+ function redirect_to(target) {
19
+ var dashboard_namespace = "<%= Faalis::Engine.dashboard_namespace.to_s %>";
20
+ var uri = target.replace("/"+ dashboard_namespace + "/",
21
+ "/" + dashboard_namespace + "#/");
22
+
23
+ console.log("Redirecting to: %s", uri);
24
+ window.location.href = uri;
25
+ }
26
+
27
+ function big_random() {
28
+ return Math.random(0,10)*100000000000000000;
29
+ }
30
+
31
+ // OLD FUCNTIONS ---------------------
32
+
1
33
  function add_dependency(module) {
2
34
 
3
35
  window.dashboard_dependencies = window.dashboard_dependencies || [];
@@ -111,6 +143,10 @@ function catch_error1(error){
111
143
  }
112
144
  };
113
145
 
146
+ String.prototype.readable = function() {
147
+ return this.replace(/::/g, ' ').humanize();
148
+ };
149
+
114
150
  $(function(){
115
151
  $("#flash").on("click", hide_flash);
116
152
  show_error_queue();
@@ -2,7 +2,7 @@
2
2
  # controller.
3
3
  class Faalis.GenericIndexController extends Faalis.BaseController
4
4
 
5
- constructor: ($scope, _, Resources, $rootScope, $state, $stateParams, $user) ->
5
+ constructor: ($scope, _, Resources, $rootScope, $state, $stateParams) ->
6
6
  # Call constructor of **Faalis.BaseController** which maps all
7
7
  # the methods (prototype methods) of current object to $scope except of those that
8
8
  # their name starts with a '_' ( underscore ). Those methods are reserved for internal
@@ -18,7 +18,8 @@ class Faalis.GenericIndexController extends Faalis.BaseController
18
18
  @rootScope = $rootScope
19
19
  @state = $state
20
20
  @stateParams = $stateParams
21
- @user = $user
21
+
22
+ $scope.__resource__ = @Resource
22
23
 
23
24
  @__init__()
24
25
  @__setup_buttons__()
@@ -62,7 +63,6 @@ class Faalis.GenericIndexController extends Faalis.BaseController
62
63
  @scope.buttons = []
63
64
 
64
65
  for button in @__buttons__()
65
- if @user.can button.permission, @Resource.__name__
66
66
  @scope.buttons.push(button)
67
67
 
68
68
  # Fetch remote resource using API interface
@@ -75,11 +75,18 @@ class Faalis.GenericIndexController extends Faalis.BaseController
75
75
  scope[Resource.plural_name()] = data
76
76
  scope.$apply()
77
77
 
78
- on_delete: (resources) ->
78
+ on_delete: (objects, resource, scope) ->
79
+ console.log(resource)
80
+ _.each(objects, (x) ->
81
+ console.log(x)
82
+ resource.destroy(x.id).then(
83
+ )
84
+ $('#tr-' + x.id).remove()
85
+ )
79
86
 
80
87
 
81
88
 
82
- Faalis.GenericIndexController.$inject = ["$scope", "gettext", "Resources", "$rootScope", "$state", "$stateParams", "$user"]
89
+ Faalis.GenericIndexController.$inject = ["$scope", "gettext", "Resources", "$rootScope", "$state", "$stateParams"]
83
90
 
84
- angular.module('Faalis.Controllers', ["Faalis.ResourceFactory", "User"])
91
+ angular.module('Faalis.Controllers', ["Faalis.ResourceFactory"])
85
92
  .controller("Faalis.GenericIndexController", Faalis.GenericIndexController)
@@ -10,8 +10,6 @@ class Faalis.HasManyField extends Faalis.BaseField
10
10
  console.log(resource)
11
11
 
12
12
  __init__: ->
13
- console.log("<<<<<<<<<<<<<<<<")
14
- console.log(this)
15
13
  #console.log(@resource)
16
14
  return
17
15
  @resource = new @resource()
@@ -101,17 +101,30 @@ class Faalis.Resource
101
101
  resource: resource
102
102
  }
103
103
 
104
+ edit_link: (object) ->
105
+ if @root_path
106
+ return @root_path + '/' + object.id;
107
+ else
108
+ return @to_path() + '/' + object.id;
109
+
104
110
  # Return the url of current `Resource`
105
111
  to_path: (params...) ->
112
+ _parents = @parents[0..]
113
+ return '/' + _parents.filter(Boolean).join('/') + @plural_name()
114
+
106
115
  if @_parents_values_is_set == false
107
116
  throw 'You need to set parents values to continue.'
108
117
 
109
- _parents = @parents[0..]
118
+ if @parents.length > 0
119
+ _parents = @parents[0..]
110
120
 
111
- for item in params
112
- _parents.push(item)
121
+ if params.length > 1
122
+ for item in params
123
+ console.log(item)
124
+ _parents.push(item)
113
125
 
114
- return '/' + _parents.filter(Boolean).join('/') + @plural_name()
126
+ console.log(_parents)
127
+ return '/' + _parents.filter(Boolean).join('/') + @plural_name()
115
128
 
116
129
  plural_name: ->
117
130
  @__name__.pluralize()
@@ -7,101 +7,5 @@ User.config(["$stateProvider", function($stateProvider){
7
7
  url: "/auth/users",
8
8
  templateUrl: template("auth/users/index"),
9
9
  controller: "UsersController"
10
- }).
11
- state("users.new",{
12
- url: "/auth/users/new",
13
- templateUrl: template("auth/users/new"),
14
- controller: "AddUsersController"
15
- }).
16
- state("/auth/users/:id/edit",{
17
- templateUrl: template("auth/users/new"),
18
- controller: "AddUsersController"
19
10
  });
20
11
  }]);
21
-
22
- User.controller("UsersController", ["$scope", "Restangular","gettext", "catch_error",
23
- function($scope, API, gettext, catch_error){
24
-
25
- $scope.details_template = template("auth/users/details");
26
-
27
- API.all("users").getList().then(function(data){
28
- $scope.users = data;
29
- });
30
-
31
- $scope.buttons = [
32
- {
33
- title: gettext("New"),
34
- icon: "fa fa-plus",
35
- classes: "btn tiny green",
36
- state: "#/auth/users/new"
37
- }
38
- ];
39
-
40
-
41
- $scope.on_delete = function(users){
42
- var query = [];
43
- users.forEach(function(user){
44
- query.push(user.id);
45
- });
46
-
47
- API.all("users").customDELETE(query.join(","))
48
- .then(function(data) {
49
-
50
- $scope.users = _.filter($scope.users, function(x){
51
- return !(query.indexOf(x.id) != -1);
52
- });
53
- success_message(data.msg);
54
- })
55
- .catch(catch_error);
56
-
57
- };
58
-
59
-
60
- }]);
61
-
62
-
63
- User.controller("AddUsersController", ["$scope","Restangular","$location" ,"$stateParams", "gettext", "catch_error", function($scope, API, $location , $stateParams, gettext, catch_error){
64
-
65
- API.all("groups").getList().then(
66
- function(data){
67
- $scope.groups = data;
68
- });
69
-
70
- $scope.obj_id = null;
71
- if("id" in $stateParams){
72
- $scope.obj_id = $stateParams.id;
73
- var obj = API.one("users", $scope.obj_id).get()
74
- .then(function(data){
75
- $scope.first_name = data.first_name;
76
- $scope.last_name = data.last_name;
77
- $scope.email = data.email;
78
- $scope.group = data.group;
79
- $scope.password = data.password;
80
- });
81
- }
82
- $scope.save = function() {
83
- var user = {
84
- first_name: $scope.first_name,
85
- last_name: $scope.last_name,
86
- email: $scope.email,
87
- password: $scope.password,
88
- group: $scope.group
89
- };
90
- if ($scope.obj_id){
91
- API.one("users",$scope.obj_id).patch(user).then(function(){
92
- success_message(gettext("User updated successfully."));
93
- $location.path("/auth/users");
94
- });
95
- }else{
96
- API.all("users").post(user).then(function(){
97
- success_message(gettext("User created Successfully"));
98
- $location.path("/auth/users");
99
- }).catch(catch_error);
100
- }
101
- };
102
-
103
- $scope.cancel = function(){
104
- $(".form input").val("");
105
- $location.path("auth/users");
106
- };
107
- }]);
@@ -0,0 +1,41 @@
1
+ angular.module('Fake', [])
2
+ .config(['$stateProvider', function($stateProvider){
3
+ $stateProvider
4
+ .state('fake-group-new', {
5
+ url: '/auth/groups/new',
6
+ templateUrl: '/dashboard/auth/groups/new'
7
+ })
8
+ .state('fake-group-edit', {
9
+ url: '/auth/groups/:id',
10
+ templateUrl: function($stateParams){
11
+ return '/dashboard/auth/groups/' + $stateParams.id + '?' + big_random();
12
+ }
13
+ })
14
+ .state('fake-user-index', {
15
+ url: '/auth/users',
16
+ templateUrl: '/dashboard/auth/users'
17
+ })
18
+ .state('fake-user-show', {
19
+ url: '/auth/users/:id',
20
+ templateUrl: function($stateParams){
21
+ return '/dashboard/auth/users/' + $stateParams.id + '?' + big_random();
22
+ }
23
+ })
24
+ .state('fake-user-edit', {
25
+ url: '/auth/users/:id/edit',
26
+ templateUrl: function($stateParams){
27
+ return '/dashboard/auth/users/' + $stateParams.id + '/edit?' + big_random();
28
+ }
29
+ })
30
+ .state('fake-user-edit-password', {
31
+ url: '/auth/users/:id/password',
32
+ templateUrl: function($stateParams){
33
+ return '/dashboard/auth/users/' + $stateParams.id + '/password?' + big_random();
34
+ }
35
+ })
36
+
37
+ .state('fake-user-new', {
38
+ url: '/auth/users/new',
39
+ templateUrl: '/dashboard/auth/users/new'
40
+ });
41
+ }]);
@@ -8,6 +8,7 @@ Datetime_.directive('datetimeField', ["$filter", "gettext", function($filter, g
8
8
 
9
9
  function link(scope, element, attrs){
10
10
  var ltr = is_ltr();
11
+ var ltr = true;
11
12
  var locale = (ltr) ? 'en' : 'fa';
12
13
  scope.element_id = "id_" + scope.field;
13
14
  //TODO: change the find selector to use ID
@@ -31,7 +32,9 @@ Datetime_.directive('datetimeField', ["$filter", "gettext", function($filter, g
31
32
 
32
33
  });
33
34
 
34
- scope.$watch('fake_model', function(x, y) {
35
+ element.find('div.date input').bind('blur keyup change', function(){
36
+ scope.model = element.find('div.date input').val();
37
+ console.log( element.find('div.date input').val());
35
38
  });
36
39
  }
37
40
  // Actual object of <datetime-field> directive
@@ -6,5 +6,6 @@ class @GroupResource extends Faalis.Resource
6
6
  new Faalis.StringField('title'),
7
7
  new Faalis.HasManyField('permissions', Faalis.PermissionResource)
8
8
  ]
9
+ root_path: '/dashboard#/auth/groups'
9
10
 
10
11
  Faalis.GroupResource = @GroupResource
@@ -32,8 +32,9 @@ class Faalis.APIFactory
32
32
  .then (data) ->
33
33
  return data.data
34
34
  , (data) ->
35
- @log.error(data)
36
- @catch_error(data)
35
+ #@log.error(data)
36
+ console.log('Operation Failed.')
37
+ #@catch_error(data)
37
38
 
38
39
  # Raw queries -----------------------
39
40
  get: (url, params) ->
@@ -57,17 +58,18 @@ class Faalis.APIFactory
57
58
  @execute('GET', url)
58
59
 
59
60
  find: (id) ->
60
- url = @resource.to_path(id)
61
+ url = @_resource.to_path(id)
61
62
  @execute('GET', url)
62
63
 
63
64
  create: (data) ->
64
- url = @resource.to_path
65
+ url = @_resource.to_path
65
66
  @execute('POST', url, data)
66
67
 
67
68
  update: (id, data) ->
68
- url = @resource.to_path(id)
69
+ url = @_resource.to_path(id)
69
70
  @execute('PUT', url, data)
70
71
 
71
72
  destroy: (id) ->
72
- url = @resource.to_path(id)
73
+ url = @_resource.to_path(id)
74
+ url = url + '/' + id;
73
75
  @execute('DELETE', url)
@@ -1,4 +0,0 @@
1
- User = angular.module("User")
2
- .service "$user", ->
3
- can: (object, perm)->
4
- return true
@@ -21,4 +21,5 @@ window.Faalis = {};
21
21
 
22
22
  window.STATIC_REQUIREMENTS = ["gettext", "Modules", "ui.select2", 'Errors',
23
23
  "ngAnimate", "ui.router", "restangular", "ngQuickDate",
24
- "Errors", "Profile", "Permissions", 'ng'];
24
+ "Errors", "Profile", "Permissions", 'ng',
25
+ 'angular-loading-bar', 'Fake'];
@@ -1,9 +1,11 @@
1
- // require variables
1
+ /* require variables
2
2
  // require bootstrap
3
3
  // require font-awesome
4
4
  // require AdminLTE
5
5
  // require base
6
6
  // require home
7
7
 
8
+ //= require angular-loading-bar/loading-bar
8
9
  //= require dashstrap/dashboard/ltr/application
9
- //= require dashstrap/ltr/application
10
+ //= require dashstrap/ltr/application
11
+ */