faalis 0.26.0 → 0.26.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/faalis/angular-manifest.js +1 -1
- data/app/controllers/faalis/#1.sh# +0 -0
- data/app/controllers/faalis/api/v1/#conversations_controller.rb# +120 -0
- data/lib/faalis/engine.rb +1 -0
- data/lib/faalis/generators/concerns/tabs.rb +2 -1
- data/lib/faalis/version.rb +1 -1
- data/lib/generators/faalis/templates/api/controller.rb.erb +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 +47 -26
- data/app/assets/javascripts/faalis/dashboard/lib/lodash.underscore.js +0 -4893
- data/app/controllers/faalis/#api_controller.rb# +0 -51
- data/lib/faalis/generators/fields/#relation.rb# +0 -61
@@ -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
|