faalis 0.15.1 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 90efe60cdb3bb64002f3545a2eeeb02a40c4de4d
4
- data.tar.gz: 32afd51398aaf2fb0ce6eb3934b279e0ca1b6314
3
+ metadata.gz: 6cb432bbaba6c1a12a581c9acdd3814d89be3d0a
4
+ data.tar.gz: 93eae05d5c3b2be637c518425199ddd6909dd522
5
5
  SHA512:
6
- metadata.gz: 58ca8d745e73ae6234c7a32833e3369d188f77716c8a05803942535d1d5f4f599e4f3cb64cbb479ab90db6f5234f977f9ea3c279a0ae66bd3c90be5a881c1d4c
7
- data.tar.gz: 32ce491a58a3a9e0dedb1e00e12c26cb4952694bd4010f8d8a352a38d41fef4907fda3191a77e30734713b448b19c8633571be138873c452fb1e706b40619e70
6
+ metadata.gz: 1b6df7c4975998f16542761762fa7bf68ea5a38be13d1c991fe0daa8aa326b9c7b3e2259f6da96e97e36fc0c35ac8df2e3e44734eecdb497a10d276eeecad2bb
7
+ data.tar.gz: f791ceaf0a0874ae4d754950fdd7bce0839a7c7c3beb5777af267b96003d4f29d1e2be3b1d2f8ce5f9ed26e14f369f7b40b708eb6af58b93aa250a213cbc4e57
@@ -27,11 +27,11 @@ Modules.controller("ModulesController", ["$location", "$scope", "$controller", "
27
27
  }
28
28
  // Check if user can pass the permission
29
29
  if (User.can(menu.permission.action, menu.permission.model)) {
30
- debug("You have " + menu.permission.action + " permission on " + menu.permission.model);
30
+ console.debug("You have " + menu.permission.action + " permission on " + menu.permission.model);
31
31
  module.menu_items.push(menu);
32
32
  }
33
33
  else {
34
- debug("User don't have " + menu.permission.action + " permission on " + menu.permission.model);
34
+ console.debug("User don't have " + menu.permission.action + " permission on " + menu.permission.model);
35
35
  }
36
36
  }
37
37
  else {
@@ -17,8 +17,3 @@ window.templates_path = "/templates/";
17
17
  // Any element of this queue will be appear as error after load event
18
18
  window.ErrorQueue = [];
19
19
  window.DashboardURL = "<%= url.dashboard_path %>";
20
- <% if Rails.env == "development" %>
21
- window.debug = true;
22
- <% else %>
23
- window.debug = false;
24
- <% end %>
@@ -1,7 +1,7 @@
1
1
  require_dependency "faalis/application_controller"
2
2
 
3
3
  module Faalis
4
- class API::V1::ConversationsController < APIController
4
+ class API::V1::ConversationsController < ::APIController
5
5
  before_filter :authenticate_user!
6
6
  helper_method :mailbox, :conversation
7
7
 
@@ -1,13 +1,13 @@
1
1
  require_dependency "faalis/api_controller"
2
2
 
3
3
  module Faalis
4
- class API::V1::GroupsController < APIController
4
+ class API::V1::GroupsController < ::APIController
5
5
  # TODO: Use strong params
6
6
  # TODO: implement authorization
7
7
 
8
8
  # GET /api/v1/groups
9
9
  def index
10
- @groups = Group.includes(:permissions).all
10
+ @groups = Group.includes(:permissions).to_a
11
11
  authorize! :read, Faalis::Group
12
12
  respond_with(@groups)
13
13
  end
@@ -1,7 +1,7 @@
1
1
  require_dependency "faalis/api_controller"
2
2
 
3
3
  module Faalis
4
- class API::V1::LogsController < APIController
4
+ class API::V1::LogsController < ::APIController
5
5
 
6
6
  # GET /api/v1/logs
7
7
  def index
@@ -1,7 +1,7 @@
1
1
  require_dependency "faalis/application_controller"
2
2
 
3
3
  module Faalis
4
- class API::V1::PermissionsController < APIController
4
+ class API::V1::PermissionsController < ::APIController
5
5
 
6
6
  class DummyPerm
7
7
  attr_accessor :model, :permission_type
@@ -1,7 +1,7 @@
1
1
  require_dependency "faalis/application_controller"
2
2
 
3
3
  module Faalis
4
- class API::V1::ProfilesController < APIController
4
+ class API::V1::ProfilesController < ::APIController
5
5
 
6
6
  def show
7
7
  @user = current_user
@@ -1,7 +1,7 @@
1
1
  require_dependency "faalis/application_controller"
2
2
 
3
3
  module Faalis
4
- class API::V1::UsersController < APIController
4
+ class API::V1::UsersController < ::APIController
5
5
 
6
6
  def index
7
7
  @users = User.joins(:group).all
@@ -1,6 +1,6 @@
1
1
  json.array! @groups do |group|
2
2
  json.extract! group, :id, :name
3
- json.permissions group.permissions do |json, permission|
3
+ json.permissions group.permissions do |permission|
4
4
  json.(permission, :string_repr)
5
5
  end
6
6
  end
@@ -18,5 +18,5 @@
18
18
  # -----------------------------------------------------------------------------
19
19
 
20
20
  module Faalis
21
- VERSION = "0.15.1"
21
+ VERSION = "0.16.0"
22
22
  end
@@ -128,6 +128,14 @@ module Faalis
128
128
  # PRIVATES --------------------------------------------
129
129
  private
130
130
 
131
+ # check for parent
132
+ def parent?
133
+ if options[:parent] != ""
134
+ return true
135
+ end
136
+ false
137
+ end
138
+
131
139
  # Path to the resource
132
140
  def resource_path
133
141
  path_parts = resource_name.split("/")
@@ -27,15 +27,15 @@ var <%= resource.pluralize %> = angular.module("<%= resource %>", ["ListView", "
27
27
 
28
28
  // Add any route you need here
29
29
  $routeProvider.
30
- when("<% if options[:parent] %>/<%= options[:parent] %>/:<%= options[:parent] %>_id<% end %>/<%= resource_url %>", {
30
+ when("<% if parent? %>/<%= options[:parent] %>/:<%= options[:parent] %>_id<% end %>/<%= resource_url %>", {
31
31
  templateUrl: template("<%= resource_path %>/index"),
32
32
  controller: "<%= resource %>Controller"
33
33
  }).
34
- when("<% if options[:parent] %>/<%= options[:parent] %>/:<%= options[:parent] %>_id<% end %>/<%= resource_url %>/new",{
34
+ when("<% if parent? %>/<%= options[:parent] %>/:<%= options[:parent] %>_id<% end %>/<%= resource_url %>/new",{
35
35
  templateUrl: template("<%= resource_path %>/new"),
36
36
  controller: "Add<%= resource %>Controller"
37
37
  }).
38
- when("<% if options[:parent] %>/<%= options[:parent] %>/:<%= options[:parent] %>_id<% end %>/<%= resource_url %>/:id/edit",{
38
+ when("<% if parent? %>/<%= options[:parent] %>/:<%= options[:parent] %>_id<% end %>/<%= resource_url %>/:id/edit",{
39
39
  templateUrl: template("<%= resource_path %>/new"),
40
40
  controller: "Add<%= resource %>Controller"
41
41
  });
@@ -47,7 +47,7 @@ var <%= resource.pluralize %> = angular.module("<%= resource %>", ["ListView", "
47
47
  <%= resource.pluralize %>.controller("<%= resource %>Controller", ["$scope", "gettext", "Restangular", "catch_error", "$location", "$routeParams",
48
48
  function($scope, gettext, API, catch_error, $location, $routeParams){
49
49
 
50
- <% if options[:parent] %>
50
+ <% if parent? %>
51
51
  var <%= options[:parent] %>_id = $routeParams.<%= options[:parent] %>_id;
52
52
  <% end %>
53
53
  <% unless options[:no_filter] %>$scope.filter_config = {
@@ -98,7 +98,7 @@ var <%= resource.pluralize %> = angular.module("<%= resource %>", ["ListView", "
98
98
  name: "create",
99
99
  model: "<%= resource.classify %>"
100
100
  },
101
- route: "#<% if options[:parent] %>/<%= options[:parent] %>/" + <%= options[:parent] %>_id + "<% end %>/<%= resource_url %>/new"
101
+ route: "#<% if parent? %>/<%= options[:parent] %>/" + <%= options[:parent] %>_id + "<% end %>/<%= resource_url %>/new"
102
102
 
103
103
  },<% unless options[:no_bulk] %>
104
104
  {
@@ -228,7 +228,7 @@ var <%= resource.pluralize %> = angular.module("<%= resource %>", ["ListView", "
228
228
 
229
229
  <%= resource.pluralize %>.controller("Add<%= resource %>Controller", ["Restangular", "$scope", "$location", "$routeParams", "gettext", "catch_error", function(API, $scope, $location, $routeParams, gettext, catch_error){
230
230
 
231
- <% if options[:parent] %>
231
+ <% if parent? %>
232
232
  var <%= options[:parent] %>_id = $routeParams.<%= options[:parent] %>_id;
233
233
  <% end %>
234
234
 
@@ -281,7 +281,7 @@ var <%= resource.pluralize %> = angular.module("<%= resource %>", ["ListView", "
281
281
 
282
282
  $scope.cancel = function(){
283
283
  $(".form input").val("");
284
- $location.path("#<% if options[:parent] %>/<%= options[:parent] %>/" + <%= options[:parent] %>_id + "<% end %>/<%= resource_url %>");
284
+ $location.path("#<% if parent? %>/<%= options[:parent] %>/" + <%= options[:parent] %>_id + "<% end %>/<%= resource_url %>");
285
285
  };
286
286
 
287
287
  $scope.save = function(save_another){
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faalis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sameer Rahmani