faalis 0.24.3 → 0.24.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/faalis/dashboard/gen-doc.sh~ +3 -0
- data/app/controllers/faalis/#1.sh# +0 -0
- data/app/controllers/faalis/api/v1/users_controller.rb +1 -1
- data/app/controllers/faalis/api_controller.rb +1 -1
- data/lib/faalis/version.rb +1 -1
- data/spec/dummy/log/development.log +0 -0
- data/spec/dummy/log/test.log +15 -0
- data/spec/dummy/tmp/ember-rails/ember-data.js +10204 -0
- data/spec/dummy/tmp/ember-rails/ember.js +36991 -0
- metadata +31 -24
- data/app/assets/javascripts/faalis/dashboard/modules/auth/#group.js# +0 -155
- data/app/controllers/faalis/#api_controller.rb# +0 -51
- data/lib/faalis/generators/fields/#relation.rb# +0 -61
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.24.
|
|
4
|
+
version: 0.24.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sameer Rahmani
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2014-04-
|
|
12
|
+
date: 2014-04-07 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|
|
@@ -365,6 +365,7 @@ files:
|
|
|
365
365
|
- app/assets/javascripts/faalis/dashboard/app.js
|
|
366
366
|
- app/assets/javascripts/faalis/dashboard/application.js.erb
|
|
367
367
|
- app/assets/javascripts/faalis/dashboard/functions.js.erb
|
|
368
|
+
- app/assets/javascripts/faalis/dashboard/gen-doc.sh~
|
|
368
369
|
- app/assets/javascripts/faalis/dashboard/init.js
|
|
369
370
|
- app/assets/javascripts/faalis/dashboard/lib/angular-animate.js
|
|
370
371
|
- app/assets/javascripts/faalis/dashboard/lib/angular-gettext.js
|
|
@@ -380,7 +381,6 @@ files:
|
|
|
380
381
|
- app/assets/javascripts/faalis/dashboard/locale/translations.js
|
|
381
382
|
- app/assets/javascripts/faalis/dashboard/modules/anim.js
|
|
382
383
|
- app/assets/javascripts/faalis/dashboard/modules/api.js
|
|
383
|
-
- app/assets/javascripts/faalis/dashboard/modules/auth/#group.js#
|
|
384
384
|
- app/assets/javascripts/faalis/dashboard/modules/auth/auth.js
|
|
385
385
|
- app/assets/javascripts/faalis/dashboard/modules/auth/group.js
|
|
386
386
|
- app/assets/javascripts/faalis/dashboard/modules/auth/profile.js
|
|
@@ -458,7 +458,7 @@ files:
|
|
|
458
458
|
- app/assets/stylesheets/faalis/rtl/foundation_and_overrides.css.scss
|
|
459
459
|
- app/assets/stylesheets/faalis/users.css
|
|
460
460
|
- app/assets/stylesheets/faalis/variables.css.scss
|
|
461
|
-
- app/controllers/faalis/#
|
|
461
|
+
- app/controllers/faalis/#1.sh#
|
|
462
462
|
- app/controllers/faalis/api/v1/conversations_controller.rb
|
|
463
463
|
- app/controllers/faalis/api/v1/groups_controller.rb
|
|
464
464
|
- app/controllers/faalis/api/v1/logs_controller.rb
|
|
@@ -604,7 +604,6 @@ files:
|
|
|
604
604
|
- lib/faalis/generators/concerns/resource_name.rb
|
|
605
605
|
- lib/faalis/generators/concerns/tabs.rb
|
|
606
606
|
- lib/faalis/generators/dashboard_scaffold.rb
|
|
607
|
-
- lib/faalis/generators/fields/#relation.rb#
|
|
608
607
|
- lib/faalis/generators/fields/relation.rb
|
|
609
608
|
- lib/faalis/i18n.rb
|
|
610
609
|
- lib/faalis/initialize.rb
|
|
@@ -693,10 +692,14 @@ files:
|
|
|
693
692
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
|
694
693
|
- spec/dummy/config/locales/en.yml
|
|
695
694
|
- spec/dummy/config/routes.rb
|
|
695
|
+
- spec/dummy/log/development.log
|
|
696
|
+
- spec/dummy/log/test.log
|
|
696
697
|
- spec/dummy/public/404.html
|
|
697
698
|
- spec/dummy/public/422.html
|
|
698
699
|
- spec/dummy/public/500.html
|
|
699
700
|
- spec/dummy/public/favicon.ico
|
|
701
|
+
- spec/dummy/tmp/ember-rails/ember-data.js
|
|
702
|
+
- spec/dummy/tmp/ember-rails/ember.js
|
|
700
703
|
- spec/spec_helper.rb
|
|
701
704
|
homepage: https://github.com/Yellowen/Faalis
|
|
702
705
|
licenses:
|
|
@@ -725,35 +728,39 @@ summary: Faalis is a ruby on rails engine which provides a very basic web applic
|
|
|
725
728
|
to use with other ruby on rails applications.
|
|
726
729
|
test_files:
|
|
727
730
|
- spec/spec_helper.rb
|
|
728
|
-
- spec/dummy/
|
|
731
|
+
- spec/dummy/tmp/ember-rails/ember.js
|
|
732
|
+
- spec/dummy/tmp/ember-rails/ember-data.js
|
|
733
|
+
- spec/dummy/log/development.log
|
|
734
|
+
- spec/dummy/log/test.log
|
|
735
|
+
- spec/dummy/public/500.html
|
|
736
|
+
- spec/dummy/public/404.html
|
|
737
|
+
- spec/dummy/public/422.html
|
|
738
|
+
- spec/dummy/public/favicon.ico
|
|
739
|
+
- spec/dummy/config.ru
|
|
740
|
+
- spec/dummy/README.rdoc
|
|
729
741
|
- spec/dummy/app/views/layouts/application.html.erb
|
|
730
|
-
- spec/dummy/app/helpers/application_helper.rb
|
|
731
742
|
- spec/dummy/app/assets/javascripts/application.js
|
|
732
743
|
- spec/dummy/app/assets/stylesheets/application.css
|
|
744
|
+
- spec/dummy/app/controllers/application_controller.rb
|
|
745
|
+
- spec/dummy/app/helpers/application_helper.rb
|
|
746
|
+
- spec/dummy/Rakefile
|
|
747
|
+
- spec/dummy/bin/rake
|
|
733
748
|
- spec/dummy/bin/bundle
|
|
734
749
|
- spec/dummy/bin/rails
|
|
735
|
-
- spec/dummy/bin/rake
|
|
736
|
-
- spec/dummy/public/404.html
|
|
737
|
-
- spec/dummy/public/422.html
|
|
738
|
-
- spec/dummy/public/500.html
|
|
739
|
-
- spec/dummy/public/favicon.ico
|
|
740
|
-
- spec/dummy/config.ru
|
|
741
750
|
- spec/dummy/config/application.rb
|
|
742
|
-
- spec/dummy/config/environments/development.rb
|
|
743
751
|
- spec/dummy/config/environments/test.rb
|
|
752
|
+
- spec/dummy/config/environments/development.rb
|
|
744
753
|
- spec/dummy/config/environments/production.rb
|
|
745
|
-
- spec/dummy/config/
|
|
746
|
-
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
|
747
|
-
- spec/dummy/config/initializers/secret_token.rb
|
|
748
|
-
- spec/dummy/config/initializers/session_store.rb
|
|
749
|
-
- spec/dummy/config/initializers/wrap_parameters.rb
|
|
750
|
-
- spec/dummy/config/initializers/mime_types.rb
|
|
751
|
-
- spec/dummy/config/initializers/inflections.rb
|
|
754
|
+
- spec/dummy/config/routes.rb
|
|
752
755
|
- spec/dummy/config/environment.rb
|
|
753
756
|
- spec/dummy/config/database.yml
|
|
754
757
|
- spec/dummy/config/locales/en.yml
|
|
755
|
-
- spec/dummy/config/routes.rb
|
|
756
758
|
- spec/dummy/config/boot.rb
|
|
757
|
-
- spec/dummy/
|
|
758
|
-
- spec/dummy/
|
|
759
|
+
- spec/dummy/config/initializers/session_store.rb
|
|
760
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
|
761
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
|
762
|
+
- spec/dummy/config/initializers/inflections.rb
|
|
763
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
|
764
|
+
- spec/dummy/config/initializers/mime_types.rb
|
|
765
|
+
- spec/dummy/config/initializers/secret_token.rb
|
|
759
766
|
has_rdoc:
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
var Group = angular.module("Group", ["ListView", "Errors"]);
|
|
2
|
-
|
|
3
|
-
Group.config(["$routeProvider", function($routeProvider){
|
|
4
|
-
$routeProvider.
|
|
5
|
-
when("/auth/groups",{
|
|
6
|
-
templateUrl: template("auth/groups/index"),
|
|
7
|
-
controller: "GroupsController"
|
|
8
|
-
}).
|
|
9
|
-
when("/auth/groups/new",{
|
|
10
|
-
templateUrl: template("auth/groups/new"),
|
|
11
|
-
controller: "AddGroupController"
|
|
12
|
-
}).
|
|
13
|
-
when("/auth/groups/:id/edit",{
|
|
14
|
-
templateUrl: template("auth/groups/new"),
|
|
15
|
-
controller: "AddGroupController"
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
}]);
|
|
19
|
-
|
|
20
|
-
Group.controller("GroupsController", ["$scope", "gettext", "Restangular", "catch_error", function($scope, gettext, API, catch_error){
|
|
21
|
-
$scope.details_template = template("auth/groups/details");
|
|
22
|
-
|
|
23
|
-
$scope.buttons = [
|
|
24
|
-
{
|
|
25
|
-
title: gettext("new"),
|
|
26
|
-
icon: "fa fa-plus",
|
|
27
|
-
classes: "btn tiny green",
|
|
28
|
-
route: "#/auth/groups/new"
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
];
|
|
32
|
-
|
|
33
|
-
$scope.on_delete = function(groups){
|
|
34
|
-
|
|
35
|
-
var query = [];
|
|
36
|
-
groups.forEach(function(group){
|
|
37
|
-
query.push(group.id);
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
API.all("groups").customDELETE(query.join(","))
|
|
41
|
-
.then(function(data) {
|
|
42
|
-
|
|
43
|
-
$scope.groups = _.filter($scope.groups, function(x){
|
|
44
|
-
return !(query.indexOf(x.id) != -1);
|
|
45
|
-
});
|
|
46
|
-
success_message(data.msg);
|
|
47
|
-
})
|
|
48
|
-
.catch(catch_error);
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
API.all("groups").getList()
|
|
54
|
-
.then(function(data){
|
|
55
|
-
$scope.groups = data;
|
|
56
|
-
})
|
|
57
|
-
.catch(catch_error);
|
|
58
|
-
|
|
59
|
-
}]);
|
|
60
|
-
|
|
61
|
-
Group.controller("AddGroupController", ["Restangular", "$scope", "$location", "$routeParams", "gettext", "catch_error", function(API, $scope, $location, $routeParams, gettext, catch_error){
|
|
62
|
-
|
|
63
|
-
$scope.selected_perms = [];
|
|
64
|
-
$scope.permissions = [];
|
|
65
|
-
$scope.editing = false;
|
|
66
|
-
|
|
67
|
-
$scope.$on("update_perms", function(event) {
|
|
68
|
-
var sel_perms = [];
|
|
69
|
-
event.targetScope.selected_perms.forEach(function(perm){
|
|
70
|
-
|
|
71
|
-
var tmpobj = _.find(event.targetScope.permissions, function(x) {
|
|
72
|
-
return perm.name == x.name;
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
if ( tmpobj ) {
|
|
76
|
-
event.targetScope.select_permission(tmpobj);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
$scope.obj_id = null;
|
|
83
|
-
|
|
84
|
-
if("id" in $routeParams){
|
|
85
|
-
$scope.obj_id = $routeParams.id;
|
|
86
|
-
$scope.editing = true;
|
|
87
|
-
var obj = API.one("groups", $scope.obj_id).get()
|
|
88
|
-
.then(function(data) {
|
|
89
|
-
$scope.new_name = data.name;
|
|
90
|
-
$scope.selected_perms = data.permissions;
|
|
91
|
-
$scope.$emit("update_perms");
|
|
92
|
-
})
|
|
93
|
-
.catch(catch_error);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
var permissions = API.all('permissions').getList()
|
|
98
|
-
.then(function(data){
|
|
99
|
-
$scope.permissions = data;
|
|
100
|
-
$scope.$emit("update_perms");
|
|
101
|
-
})
|
|
102
|
-
.catch(catch_error);
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
$scope.select_permission = function(perm){
|
|
106
|
-
if( "is_selected" in perm ){
|
|
107
|
-
perm.is_selected = ! perm.is_selected;
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
perm.is_selected = true;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
$scope.is_selected = function(perm){
|
|
114
|
-
if( "is_selected" in perm ){
|
|
115
|
-
return perm.is_selected;
|
|
116
|
-
}
|
|
117
|
-
return false;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
$scope.cancel = function(){
|
|
121
|
-
$(".form input").val("");
|
|
122
|
-
for(var i = 0; i < $scope.permissions.length;i++) {
|
|
123
|
-
$scope.permissions[i].is_selected = false;
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
$scope.save = function(){
|
|
128
|
-
var permissions = [];
|
|
129
|
-
|
|
130
|
-
for(var i = 0; i < $scope.permissions.length;i++) {
|
|
131
|
-
if ($scope.permissions[i].is_selected){
|
|
132
|
-
permissions.push($scope.permissions[i].name);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
var group = {name: $scope.new_name,
|
|
137
|
-
permissions: permissions};
|
|
138
|
-
if ($scope.obj_id) {
|
|
139
|
-
API.one("groups", $scope.obj_id).patch(group)
|
|
140
|
-
.then(function(){
|
|
141
|
-
success_message(gettext("Group updated successfully."));
|
|
142
|
-
$location.path("/auth/groups");
|
|
143
|
-
})
|
|
144
|
-
.catch(catch_error);
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
API.all("groups").post(group).then(function(){
|
|
148
|
-
success_message(gettext("Group created successfully."));
|
|
149
|
-
$location.path("/auth/groups");
|
|
150
|
-
|
|
151
|
-
}).catch(catch_error);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
};
|
|
155
|
-
}]);
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# -----------------------------------------------------------------------------
|
|
2
|
-
# Faalis - Basic website skel engine
|
|
3
|
-
# Copyright (C) 2012-2013 Yellowen
|
|
4
|
-
#
|
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
|
6
|
-
# it under the terms of the GNU General Public License as published by
|
|
7
|
-
# the Free Software Foundation; either version 2 of the License, or
|
|
8
|
-
# (at your option) any later version.
|
|
9
|
-
#
|
|
10
|
-
# This program is distributed in the hope that it will be useful,
|
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
# GNU General Public License for more details.
|
|
14
|
-
#
|
|
15
|
-
# You should have received a copy of the GNU General Public License along
|
|
16
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
17
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
18
|
-
# -----------------------------------------------------------------------------
|
|
19
|
-
require_dependency "faalis/api_controller"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class Faalis::APIController < Faalis::ApplicationController
|
|
23
|
-
respond_to :json
|
|
24
|
-
|
|
25
|
-
before_filter :authenticate_user!
|
|
26
|
-
|
|
27
|
-
protect_from_forgery
|
|
28
|
-
|
|
29
|
-
after_filter :set_csrf_cookie_for_ng
|
|
30
|
-
|
|
31
|
-
def set_csrf_cookie_for_ng
|
|
32
|
-
cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
rescue_from CanCan::AccessDenied do |exception|
|
|
36
|
-
|
|
37
|
-
render :status => 403, :json => {
|
|
38
|
-
:error => _("You don't have access to this page"),
|
|
39
|
-
:orig_msg => exception.message,
|
|
40
|
-
:action => exception.action,
|
|
41
|
-
}
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
protected
|
|
45
|
-
|
|
46
|
-
def verified_request?
|
|
47
|
-
super || form_authenticity_token == request.headers['X-XSRF-TOKEN']
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
:
|
|
51
|
-
end
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
module Faalis
|
|
2
|
-
module Generators
|
|
3
|
-
class Relation < String
|
|
4
|
-
attr_accessor :to
|
|
5
|
-
|
|
6
|
-
def initialize(value, to, options = "")
|
|
7
|
-
super(value)
|
|
8
|
-
@options = options
|
|
9
|
-
@to = to
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def resource_name
|
|
13
|
-
to.split("/").last
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def to
|
|
17
|
-
result = "'"
|
|
18
|
-
if options.include? "parents"
|
|
19
|
-
field_parents.each do |parent|
|
|
20
|
-
result = "#{result}/#{parent}/' + $scope.#{parent}_id + '"
|
|
21
|
-
end
|
|
22
|
-
result = "#{result}/"
|
|
23
|
-
end
|
|
24
|
-
"#{result}#{@to}'"
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def options
|
|
28
|
-
unless @options.empty?
|
|
29
|
-
Hash[@options.split(',').map {|pair| pair.strip.split(':').map(&:strip) }]
|
|
30
|
-
else
|
|
31
|
-
{}
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def field_parents
|
|
36
|
-
if options.include? "parents"
|
|
37
|
-
options["parents"].split(";")
|
|
38
|
-
else
|
|
39
|
-
[]
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def restangular
|
|
44
|
-
result = "API"
|
|
45
|
-
if options.include? "parents"
|
|
46
|
-
field_parents.each do |parent|
|
|
47
|
-
result = "#{result}.one('#{parent}', #{}_id)"
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
to.split("/").each do |resource|
|
|
51
|
-
result = "#{result}.all(\"#{resource}\")"
|
|
52
|
-
end
|
|
53
|
-
result
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
def get_list
|
|
57
|
-
"#{restangular}.getList()"
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
end
|