faalis 0.24.4 → 0.25.0
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/dashboard/modules/auth/group.js +7 -1
- data/app/assets/javascripts/faalis/dashboard/modules/fields/relation.js +50 -3
- data/app/assets/stylesheets/faalis/base.css.scss +16 -1
- data/app/assets/stylesheets/faalis/ltr/foundation_and_overrides.scss +4 -0
- data/app/assets/stylesheets/faalis/rtl/foundation_and_overrides.css.scss +1 -1
- data/app/assets/stylesheets/faalis/variables.css.scss +1 -1
- data/app/controllers/faalis/#api_controller.rb# +144 -0
- data/app/controllers/faalis/api/v1/#conversations_controller.rb# +120 -0
- data/app/controllers/faalis/api/v1/workflows_controller.rb +18 -0
- data/app/controllers/faalis/api_controller.rb +3 -3
- data/app/controllers/faalis/application_controller.rb +0 -1
- data/app/models/faalis/workflow.rb +4 -0
- data/app/views/angularjs_templates/auth/groups/new.html +47 -25
- data/app/views/angularjs_templates/fields/relation/relation.html +9 -2
- data/app/views/devise/sessions/new.html.erb +52 -88
- data/app/views/faalis/api/v1/workflows/index.json.jbuilder +5 -0
- data/app/views/faalis/home/index.html.erb +14 -11
- data/app/views/layouts/faalis/application.html.erb +21 -30
- data/app/views/layouts/faalis/simple.html.erb +37 -0
- data/app/workflows/faalis/administration_workflow.rb +7 -0
- data/config/routes.rb +15 -13
- data/db/migrate/20140413180202_create_faalis_workflows.rb +9 -0
- data/db/seeds.rb +17 -13
- data/lib/faalis.rb +12 -10
- data/lib/faalis/engine.rb +9 -8
- data/lib/faalis/generators/concerns.rb +15 -13
- data/lib/faalis/generators/concerns/bulk.rb +2 -5
- data/lib/faalis/generators/concerns/fieldset.rb +48 -0
- data/lib/faalis/generators/concerns/resource_fields.rb +43 -45
- data/lib/faalis/generators/concerns/where.rb +46 -0
- data/lib/faalis/generators/dashboard_scaffold.rb +6 -5
- data/lib/faalis/version.rb +1 -1
- data/lib/faalis/workflows.rb +7 -0
- data/lib/faalis/workflows/base.rb +69 -0
- data/lib/faalis/workflows/discovery.rb +42 -0
- data/lib/generators/faalis/templates/js/list_view/new.html.erb +7 -5
- data/lib/tasks/sync.rake +10 -0
- data/spec/factories/faalis_workflows.rb +7 -0
- data/spec/models/faalis/workflow_spec.rb +7 -0
- metadata +36 -4
@@ -0,0 +1,18 @@
|
|
1
|
+
require_dependency "faalis/application_controller"
|
2
|
+
|
3
|
+
module Faalis
|
4
|
+
class API::V1::WorkflowsController < ::APIController
|
5
|
+
|
6
|
+
def index
|
7
|
+
workflows = Faalis::Workflow.all
|
8
|
+
@workflows = []
|
9
|
+
|
10
|
+
workflows.map do |workflow_instance|
|
11
|
+
@workflows << workflow_instance.name.constantize.new(workflow_instance)
|
12
|
+
end
|
13
|
+
|
14
|
+
respond_with(@worklows)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
@@ -30,7 +30,7 @@ class Faalis::APIController < Faalis::ApplicationController
|
|
30
30
|
respond_to :json
|
31
31
|
|
32
32
|
# Authenticate user before any action take place
|
33
|
-
before_filter :
|
33
|
+
before_filter :authenticate_filter
|
34
34
|
|
35
35
|
# Check for any presence of filtering query, In querystring and load
|
36
36
|
# resource using them
|
@@ -63,7 +63,7 @@ class Faalis::APIController < Faalis::ApplicationController
|
|
63
63
|
#
|
64
64
|
# If you want to change authentication method ? just override this method
|
65
65
|
# in you **APIController**
|
66
|
-
def
|
66
|
+
def authenticate_filter
|
67
67
|
authenticate_user!
|
68
68
|
end
|
69
69
|
|
@@ -71,7 +71,7 @@ class Faalis::APIController < Faalis::ApplicationController
|
|
71
71
|
def load_resource_by_query
|
72
72
|
# If any query string parameter provided and allow fields specified
|
73
73
|
if not request.query_parameters.empty? and not allowed_fields.empty?
|
74
|
-
|
74
|
+
|
75
75
|
logger.info ("Load resource by query parameters")
|
76
76
|
# Iterate over parameters in query string
|
77
77
|
request.query_parameters.each do |key, value|
|
@@ -20,7 +20,6 @@ class Faalis::ApplicationController < ActionController::Base
|
|
20
20
|
include FastGettext::Translation
|
21
21
|
before_filter :set_locale
|
22
22
|
|
23
|
-
|
24
23
|
def set_locale
|
25
24
|
FastGettext.add_text_domain 'faalis', :path => "#{Faalis::Engine.root}/config/locales", :type => :po
|
26
25
|
# All languages you want to allow
|
@@ -1,45 +1,67 @@
|
|
1
1
|
<div class="newform">
|
2
|
-
<form name="from" novalidate>
|
2
|
+
<form name="from" novalidate>
|
3
3
|
|
4
|
-
|
4
|
+
<fieldset class="form">
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
<legend ng-if="!editing"><span translate>New Group</span></legend>
|
7
|
+
<legend ng-if="editing"><span translate>Edit Group</span></legend>
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
<div class="row">
|
10
|
+
<div class="small-4 columns">
|
11
|
+
<label translate>Name :</label>
|
12
|
+
<input id="id_name" ng-model="new_name" type="text" required>
|
13
|
+
<small id="id_name_msg"></small>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
</fieldset>
|
16
17
|
|
17
|
-
|
18
|
-
|
18
|
+
<fieldset>
|
19
|
+
<legend translate>Workflows</legend>
|
20
|
+
<div class="row">
|
21
|
+
<div class="small-12 columns">
|
22
|
+
<p translate>Choose any workflow which you want to allow user to have access to.</p>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
<div class="row">
|
26
|
+
<div class="small-2 columns text-center" ng-repeat="workflow in workflows">
|
19
27
|
|
20
|
-
|
28
|
+
<span class="fa-stack fa-2x" ng-if="workflow.have_icon == true">
|
29
|
+
<i class="fa fa-circle fa-stack-2x"></i>
|
30
|
+
<i class="{{ workflow.icon }} fa-stack-1x fa-inverse"></i>
|
31
|
+
</span>
|
32
|
+
<img ng-src="workflow.image" ng-if="workflow.have_iamge == true"/>
|
33
|
+
<span>{{ workflow.title }}</span>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
</fieldset>
|
21
37
|
|
38
|
+
<fieldset>
|
39
|
+
<legend translate>Advance Permissions</legend>
|
22
40
|
<div class="row">
|
23
|
-
<
|
24
|
-
|
41
|
+
<label for="permissions" translate>Permissions</label>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<div class="small-10 columns permissions">
|
45
|
+
|
46
|
+
<div class="row">
|
47
|
+
<div id="id_permissions" class="small-8 columns field">
|
48
|
+
<ul>
|
25
49
|
|
26
50
|
<li ng-repeat="permission in permissions" id="{{permission.name}}" ng-click="select_permission(permission)"> <i ng-show="is_selected(permission)" class="fa fa-check"></i> {{ permission.string }} </li>
|
27
51
|
|
28
|
-
|
52
|
+
</ul>
|
53
|
+
</div>
|
54
|
+
<small id="id_permissions_msg"></small>
|
29
55
|
</div>
|
30
|
-
<small id="id_permissions_msg"></small>
|
31
56
|
</div>
|
32
|
-
</
|
33
|
-
</div>
|
34
|
-
</fieldset>
|
35
|
-
|
57
|
+
</fieldset>
|
36
58
|
|
37
|
-
|
59
|
+
<div class="row">
|
38
60
|
<div class="small-6 columns">
|
39
61
|
<button class="btn small green" ng-click="save()" ng-disabled="form.$invalid"><i class="fa fa-check"></i> <span translate>Save</span></button>
|
40
62
|
<button class="btn small red" ng-click="cancel()"><i class="fa fa-times"></i><span translate>Cansel</span></button>
|
41
63
|
</div>
|
42
|
-
|
43
|
-
</form>
|
64
|
+
</div>
|
65
|
+
</form>
|
44
66
|
|
45
67
|
</div>
|
@@ -8,15 +8,22 @@
|
|
8
8
|
<option ng-repeat="item in all_options" value="{{ item.id }}" title="{{ item[titleField] || item }}" ng-selected="have(item.id)">{{ item[titleField] || item }}</option>
|
9
9
|
</select>
|
10
10
|
|
11
|
-
<select ui-select2="options" id="{{ element_id }}" ng-model="model" name="{{ field.name }}" data-placeholder="{{ placeholder }}" ng-required="required" ng-if="field.type === 'in'" ng-change="on_select_change()">
|
11
|
+
<select ui-select2="options" id="{{ element_id }}" ng-model="model" name="{{ field.name }}" data-placeholder="{{ placeholder }}" ng-required="required" ng-if="(field.type === 'in') && (multiple() == false)" ng-change="on_select_change()">
|
12
12
|
<option ng-repeat="item in field.choices" value="{{ item.name }}" title="{{ item.title }}" ng-selected="model === item.name">{{ item.title }}</option>
|
13
13
|
</select>
|
14
|
+
<select ui-select2="options" id="{{ element_id }}" ng-model="model" name="{{ field.name }}" data-placeholder="{{ placeholder }}" ng-required="required" ng-if="(field.type === 'in') && (multiple() == true)" multiple ng-change="on_select_change()">
|
15
|
+
<option ng-repeat="item in field.choices" value="{{ item.name }}" title="{{ item.title }}" ng-selected="model === item.name">{{ item.title }}</option>
|
16
|
+
</select>
|
17
|
+
|
18
|
+
|
19
|
+
|
14
20
|
|
15
21
|
<!-- Add and Refresh buttons -->
|
16
22
|
<div class="float-left">
|
17
23
|
<span class="helptext" ng-if="options.help_text && show_help_text">{{ options.help_text }}</span>
|
18
24
|
</div>
|
19
|
-
<div class="float-right relation_links" ng-if="(field.type === 'belongs_to') || (field.type === 'has_many')">
|
25
|
+
<div class="float-right relation_links" ng-if="((field.type === 'belongs_to') || (field.type === 'has_many')) && show_buttons() ">
|
26
|
+
|
20
27
|
<span ng-click="help_btn_clicked()" ng-if="show_help_btn">
|
21
28
|
<i class="fa fa-question"></i>
|
22
29
|
</span>
|
@@ -1,98 +1,62 @@
|
|
1
|
-
<div class="
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
38
|
-
|
39
|
-
<%= devise_error_messages! %>
|
40
|
-
<div class="field">
|
41
|
-
<label><%=_("E-mail") %></label>
|
42
|
-
<%= f.email_field :email, :autofocus => true, :type => "text", :class => " input email ", :placeholder=>_("E-mail") %>
|
43
|
-
<% if resource.errors[:email] -%>
|
44
|
-
<dd class="danger abel"><%= resource.errors[:first_name][0]%></dd>
|
45
|
-
<% end -%>
|
46
|
-
|
47
|
-
</div>
|
48
|
-
|
49
|
-
<div class="field">
|
50
|
-
<label><%=_("Password") %></label>
|
51
|
-
<%= f.password_field :password, :class => "input password" %>
|
52
|
-
<% if resource.errors[:first_name] -%>
|
53
|
-
<dd class="danger abel"><%= resource.errors[:first_name][0] %></dd> <% end -%>
|
54
|
-
|
55
|
-
</div>
|
56
|
-
<div class="field">
|
57
|
-
<% if devise_mapping.rememberable? -%>
|
58
|
-
<div><%= f.check_box :remember_me, :class=>"checkbox" %> <%= f.label _("remember me") %></div>
|
59
|
-
<% end %>
|
60
|
-
</div>
|
61
|
-
<div class="submit">
|
62
|
-
<%= f.submit _(" Sign in "), :class => "button"%><br><br>
|
63
|
-
|
64
|
-
<%= render "devise/shared/links" %>
|
65
|
-
</div>
|
1
|
+
<div class="row single-form">
|
2
|
+
|
3
|
+
<div class="small-6 columns">
|
4
|
+
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
5
|
+
<fieldset>
|
6
|
+
<legend><%= _("Sign In") %></legend>
|
7
|
+
<%= devise_error_messages! %>
|
8
|
+
<div class="field">
|
9
|
+
<%= f.email_field :email, :autofocus => true, :class => "input email", :placeholder=>_("E-mail") %>
|
10
|
+
<% if resource.errors[:email] -%>
|
11
|
+
<dd class="danger abel"><%= resource.errors[:email][0]%></dd>
|
12
|
+
<% end -%>
|
13
|
+
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<div class="field">
|
17
|
+
<%= f.password_field :password, :class => "input password", :placeholder=>_("Password") %>
|
18
|
+
<% if resource.errors[:password] -%>
|
19
|
+
<dd class="danger abel"><%= resource.errors[:password][0] %></dd>
|
20
|
+
<% end %>
|
21
|
+
</div>
|
22
|
+
<div class="field">
|
23
|
+
<% if devise_mapping.rememberable? -%>
|
24
|
+
<div><%= f.check_box :remember_me, :class=>"checkbox" %> <%= f.label _("Remember me") %></div>
|
25
|
+
<% end %>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<div class="right submit">
|
29
|
+
<%= f.submit _("Sign in"), :class => "button"%><br><br>
|
30
|
+
</div>
|
31
|
+
<%= render "devise/shared/links" %>
|
32
|
+
|
33
|
+
</fieldset>
|
34
|
+
|
35
|
+
<% end %>
|
36
|
+
</div>
|
66
37
|
|
67
|
-
<% end %>
|
68
|
-
</div>
|
69
|
-
</section>
|
70
|
-
</div>
|
71
38
|
|
72
|
-
|
73
|
-
|
39
|
+
<div class="small-6 columns">
|
40
|
+
<div class="row">
|
41
|
+
<fieldset>
|
74
42
|
|
75
|
-
|
76
|
-
<div class="text-left">
|
77
|
-
<a href="/auth/google_oauth2/" class="pull_right">
|
78
|
-
<i class="fa-google-plus-square fa fa-3x"></i>
|
79
|
-
</a>
|
43
|
+
<legend><%= _("Login using") %>:</legend>
|
80
44
|
|
81
|
-
|
82
|
-
|
83
|
-
|
45
|
+
<div class="text-left">
|
46
|
+
<a href="/auth/google_oauth2/" class="pull_right">
|
47
|
+
<i class="fa-google-plus-square fa fa-3x"></i>
|
48
|
+
</a>
|
84
49
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
</div>
|
89
|
-
</div>
|
50
|
+
<a href="/auth/facebook/" class="pull_right">
|
51
|
+
<i class="fa-facebook-square fa fa-3x"></i>
|
52
|
+
</a>
|
90
53
|
|
91
|
-
|
54
|
+
<a href="/auth/twitter/" class="pull_right">
|
55
|
+
<i class="fa-twitter-square fa fa-3x"></i>
|
56
|
+
</a>
|
57
|
+
</div>
|
58
|
+
</fieldset>
|
92
59
|
|
93
|
-
</div>
|
94
60
|
</div>
|
95
|
-
|
96
|
-
<br><br>
|
97
61
|
</div>
|
98
62
|
</div>
|
@@ -97,20 +97,23 @@
|
|
97
97
|
|
98
98
|
<div class="large-4 columns hide-for-small">
|
99
99
|
|
100
|
+
<% unless user_signed_in? %>
|
100
101
|
<h4>Get In Touch!</h4><hr/>
|
101
102
|
|
102
|
-
<
|
103
|
-
<
|
104
|
-
<strong><%= _("Sign UP") %></strong>
|
105
|
-
</
|
106
|
-
</
|
107
|
-
|
108
|
-
<a href="<%= faalis.user_session_path %>" class="btn-big">
|
109
|
-
<div class="panel radius callout" align="center">
|
110
|
-
<strong><%= _("Sign In") %></strong>
|
111
|
-
</div>
|
112
|
-
</a>
|
103
|
+
<div class="row">
|
104
|
+
<a href="<%= faalis.new_user_registration_path %>" class="success button large large-12 columns">
|
105
|
+
<i class="fa fa-user"></i> <strong><%= _("Sign UP") %></strong>
|
106
|
+
</a>
|
107
|
+
</div>
|
113
108
|
|
109
|
+
<div class="row">
|
110
|
+
<a href="<%= faalis.user_session_path %>" class="large large-12 columns button">
|
111
|
+
<i class="fa fa-sign-in"></i> <strong><%= _("Sign In") %></strong>
|
112
|
+
</a>
|
113
|
+
</div>
|
114
|
+
<% else %>
|
115
|
+
<p>Checkout dashboard section.</p>
|
116
|
+
<% end %>
|
114
117
|
</div>
|
115
118
|
|
116
119
|
<!-- End Content -->
|
@@ -3,18 +3,16 @@
|
|
3
3
|
<head>
|
4
4
|
<title><%= Faalis::Engine.site_title %></title>
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
6
|
-
|
6
|
+
<%= stylesheet_link_tag Faalis::I18n.direction(I18n.locale) + "/application", media: "all" %>
|
7
7
|
<%= javascript_include_tag :modernizr %>
|
8
8
|
<%= csrf_meta_tags %>
|
9
9
|
</head>
|
10
10
|
<body>
|
11
11
|
<div class="header">
|
12
12
|
<div class="large-12 columns">
|
13
|
-
<div class="">
|
14
13
|
<!-- Navigation -->
|
15
|
-
<nav class="top-bar">
|
14
|
+
<nav class="top-bar" data-topbar>
|
16
15
|
<ul class="title-area">
|
17
|
-
<!-- Title Area -->
|
18
16
|
<li class="name">
|
19
17
|
<h1>
|
20
18
|
<a href="<%= faalis.root_path %>">
|
@@ -22,12 +20,27 @@
|
|
22
20
|
</a>
|
23
21
|
</h1>
|
24
22
|
</li>
|
25
|
-
<li class="toggle-topbar menu-icon"><a href="#"
|
23
|
+
<li class="toggle-topbar menu-icon"><a href="#"><%= _('Menu') %></a></li>
|
26
24
|
</ul>
|
27
25
|
|
28
26
|
<section class="top-bar-section">
|
29
|
-
|
30
|
-
|
27
|
+
<!-- Right Nav Section -->
|
28
|
+
<ul class="<%= Faalis::I18n.direction(I18n.locale) == "ltr" ? "right" : "left" %>">
|
29
|
+
<% unless user_signed_in? %>
|
30
|
+
<li class="has-form"><%= link_to(faalis.new_user_registration_path, :class => "alert button expand") { content_tag(:i, "", class: "fa fa-user") + " #{_('Register')}" } %></li>
|
31
|
+
|
32
|
+
<li class="has-form"><%= link_to(faalis.user_session_path, :class => "button expand") { content_tag(:i, "", class: "fa fa-sign-in") + " #{_('Sign in')}" } %></li>
|
33
|
+
<% else %>
|
34
|
+
<li class="has-form"><%= link_to(faalis.dashboard_path, :class => "success button expand") { content_tag(:i, "", class: "fa fa-dashboard") + " #{_('Dashboard')}" }%></li>
|
35
|
+
</li>
|
36
|
+
<li class="has-form"><%= link_to(faalis.destroy_user_session_path, :class => "alert button expand", :method => :delete) { content_tag(:i, "", class: "fa fa-sign-out") + " #{_('Sign out')}" } %></li>
|
37
|
+
<% end %>
|
38
|
+
</ul>
|
39
|
+
|
40
|
+
<!-- Left Nav Section -->
|
41
|
+
<ul class="<%= Faalis::I18n.direction(I18n.locale) == "ltr" ? "left" : "right" %>">
|
42
|
+
|
43
|
+
<li class="has-dropdown"><a href="#"><i class="fa fa-flag"></i> <%= _("Languages") %></a>
|
31
44
|
<ul class="dropdown">
|
32
45
|
<% ::I18n.available_locales.each do |locale| %>
|
33
46
|
<li><a href="<%= "/#{locale.to_s}/" %>"><%= locale %></a></li>
|
@@ -35,30 +48,11 @@
|
|
35
48
|
</ul>
|
36
49
|
</li>
|
37
50
|
|
38
|
-
<li class="has-dropdown">
|
39
|
-
<% if not user_signed_in? %>
|
40
|
-
<a href="#"><%= _("Membership")%></a>
|
41
|
-
<%else%>
|
42
|
-
<a href="#">User<%= current_user.first_name %> <%= current_user.first_name %></a>
|
43
|
-
<%end%>
|
44
|
-
|
45
|
-
<ul class="dropdown">
|
46
|
-
<% if user_signed_in? %>
|
47
|
-
<li><a href="<%= faalis.dashboard_path %>"><%= _("Dashboard") %></a></li>
|
48
|
-
<li><a href="">Change Password</a></li>
|
49
|
-
<li><a href="<%= faalis.destroy_user_session_path %>" data-method="delete">Sign Out</a></li>
|
50
|
-
<%else%>
|
51
|
-
<li><%= link_to _("Register"), faalis.new_user_registration_path %></li>
|
52
|
-
<li><%= link_to _("Sign in"), faalis.user_session_path %></li>
|
53
|
-
<%end%>
|
54
|
-
</ul>
|
55
|
-
</li>
|
56
51
|
</ul>
|
57
52
|
</section>
|
58
53
|
</nav>
|
59
54
|
|
60
55
|
<!-- End Navigation -->
|
61
|
-
</div>
|
62
56
|
</div>
|
63
57
|
</div>
|
64
58
|
|
@@ -67,9 +61,7 @@
|
|
67
61
|
<%= debug I18n.locale %>
|
68
62
|
<!-- Footer -->
|
69
63
|
|
70
|
-
<footer
|
71
|
-
<div class="large-12 columns">
|
72
|
-
<hr>
|
64
|
+
<footer>
|
73
65
|
<div class="row">
|
74
66
|
<div class="large-6 columns">
|
75
67
|
<p>© Copyright no one at all. Go to town.</p>
|
@@ -83,7 +75,6 @@
|
|
83
75
|
</ul>
|
84
76
|
</div>
|
85
77
|
</div>
|
86
|
-
</div>
|
87
78
|
</footer>
|
88
79
|
<%= javascript_include_tag "faalis/application" %>
|
89
80
|
</body>
|