faalis 2.0.0.rc6 → 2.0.0

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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/faalis/dashboard/rtl/application.css +16 -0
  3. data/app/controllers/faalis/dashboard/application_controller.rb +1 -1
  4. data/app/controllers/faalis/dashboard/users_controller.rb +7 -5
  5. data/app/views/faalis/dashboard/groups/create.js.erb +1 -1
  6. data/app/views/faalis/dashboard/groups/update.js.erb +1 -1
  7. data/app/views/faalis/dashboard/users/_form.html.slim +12 -16
  8. data/app/views/faalis/dashboard/users/_password_form.html.slim +2 -2
  9. data/app/views/faalis/dashboard/users/create.js.erb +1 -1
  10. data/app/views/faalis/dashboard/users/index.html.slim +2 -2
  11. data/app/views/faalis/dashboard/users/update.js.erb +1 -1
  12. data/app/views/faalis/dashboard/users/update_password.js.erb +1 -1
  13. data/app/views/layouts/faalis/dashboard.html.erb +1 -1
  14. data/config/locales/faalis.fa.yml +8 -1
  15. data/lib/faalis.rb +2 -3
  16. data/lib/faalis/configuration.rb +45 -17
  17. data/lib/faalis/engine.rb +2 -51
  18. data/lib/faalis/version.rb +1 -1
  19. metadata +4 -26
  20. data/lib/faalis/generators.rb +0 -1
  21. data/lib/faalis/generators/concerns.rb +0 -17
  22. data/lib/faalis/generators/concerns/allow_query_on.rb +0 -34
  23. data/lib/faalis/generators/concerns/angular.rb +0 -28
  24. data/lib/faalis/generators/concerns/bulk.rb +0 -19
  25. data/lib/faalis/generators/concerns/child.rb +0 -31
  26. data/lib/faalis/generators/concerns/dependency.rb +0 -37
  27. data/lib/faalis/generators/concerns/fieldset.rb +0 -47
  28. data/lib/faalis/generators/concerns/globalize.rb +0 -14
  29. data/lib/faalis/generators/concerns/hstore.rb +0 -19
  30. data/lib/faalis/generators/concerns/input_file.rb +0 -49
  31. data/lib/faalis/generators/concerns/menu.rb +0 -27
  32. data/lib/faalis/generators/concerns/model.rb +0 -28
  33. data/lib/faalis/generators/concerns/parent.rb +0 -62
  34. data/lib/faalis/generators/concerns/render.rb +0 -22
  35. data/lib/faalis/generators/concerns/required.rb +0 -18
  36. data/lib/faalis/generators/concerns/resource_fields.rb +0 -147
  37. data/lib/faalis/generators/concerns/resource_name.rb +0 -39
  38. data/lib/faalis/generators/concerns/tabs.rb +0 -56
  39. data/lib/faalis/generators/concerns/where.rb +0 -44
  40. data/lib/faalis/generators/dashboard_scaffold.rb +0 -62
  41. data/lib/faalis/generators/fields/relation.rb +0 -61
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54fc2bddb9547f9ff69fb6946ac9318210ee907c
4
- data.tar.gz: 0a9105a8da26665726635a5f85b3dfd6f03f4b07
3
+ metadata.gz: a8393f4cff680393d20bfd24d04b72150399c6c2
4
+ data.tar.gz: 876bfdae7c8febd26278835eb059a32adb69a685
5
5
  SHA512:
6
- metadata.gz: a6e3d0f4413c13713465c71747e6eb5d86f4fe9510dcec500c9a4b0bf1902c1912458babc838c64350e3f46a8f08534c4bf1b8e0147656bcb19d0c2dbc2d9a8b
7
- data.tar.gz: 439987e49ba6b5b029fa9c58df240f1ad0ebfe33ee791594571a4faa3dc2ef3dc29982e0837639715e6ba6404f7895f53017c7741c76b29accf05cde42859a77
6
+ metadata.gz: a18545deef8a4ee2da81af606712d374005eec662dbb3f11613499774166efa9bafeeebabefb246b3994c2b2b985080070d1642c9a6aa641bc5890c566f243cc
7
+ data.tar.gz: ebe48d5747a4b2471d0c1dec8803fb427fc681c8fffd1d39735109d81600751ca37d6680034c57349d00f82c086c0b971ba42e564d0a1007f03edb645aa25506
@@ -18,3 +18,19 @@
18
18
  .dropdown.user.user-menu {
19
19
  width: auto;
20
20
  }
21
+
22
+ .pagination li:first-child a {
23
+ border-bottom-left-radius: 0;
24
+ border-top-left-radius: 0;
25
+ border-bottom-right-radius: 4px;
26
+ border-top-right-radius: 4px;
27
+
28
+ }
29
+
30
+ .pagination li:last-child a {
31
+ border-bottom-left-radius: 4px;
32
+ border-top-left-radius: 4px;
33
+ border-bottom-right-radius: 0;
34
+ border-top-right-radius: 0;
35
+
36
+ }
@@ -32,7 +32,7 @@ module Faalis
32
32
 
33
33
  def redirect_to_404(e)
34
34
  respond_to do |f|
35
- f.html { redirect_to dashboard_not_found_url }
35
+ f.html { redirect_to faalis.dashboard_not_found_url }
36
36
  f.js { render 'faalis/dashboard/not_found' }
37
37
  end
38
38
  end
@@ -42,16 +42,18 @@ module Faalis::Dashboard
42
42
  end
43
43
 
44
44
  def update
45
- puts "---", user_params
46
45
  parameters = user_params
47
- #groups = parameters.delete(:groups)
48
- group_ids = parameters.delete(:groups).map(&:to_i)
46
+ groups = parameters.delete(:groups)
47
+
49
48
 
50
49
  @user = Faalis::User.find(params[:id])
51
50
  authorize @user
52
51
 
53
- @user.groups = Faalis::Group.where(id: group_ids)
54
- @user.save
52
+ unless groups.nil?
53
+ group_ids = groups.map(&:to_i)
54
+ @user.groups = Faalis::Group.where(id: group_ids)
55
+ @user.save
56
+ end
55
57
 
56
58
  respond_to do |f|
57
59
  if @user.update_without_password(parameters)
@@ -1,3 +1,3 @@
1
1
  success_message('<%= t("faalis.dashboard.saved_successfully", resource: t("faalis.group.group")) %>');
2
- var target = '<%= Rails.application.routes.url_helpers.send("#{Faalis::Engine.dashboard_namespace}_auth_groups_path".to_sym) %>';
2
+ var target = '<%= faalis.dashboard_auth_groups_path %>';
3
3
  redirect_to(target);
@@ -1,3 +1,3 @@
1
1
  success_message('<%= t("faalis.dashboard.updated_successfully", resource: t("faalis.group.group")) %>');
2
- var target = '<%= dashboard_auth_groups_path %>';
2
+ var target = '<%= faalis.dashboard_auth_groups_path %>';
3
3
  redirect_to(target);
@@ -3,11 +3,6 @@
3
3
  .col-sm-12.col-lg-12
4
4
  .box.box-primary
5
5
  .box-header
6
- .box-title
7
- - if @user.new_record?
8
- = t('faalis.dashboard.new_resource_title', resource: t('faalis.user.user'))
9
- - else
10
- = t('faalis.dashboard.edit_resource_title', resource: t('faalis.user.user'))
11
6
 
12
7
  .box-body
13
8
  .row
@@ -30,18 +25,19 @@
30
25
  = t('faalis.user.user.email')
31
26
  input#group_name.form-control[name="user[email]" type="text" required value=(@user.email)]
32
27
 
33
- .row
34
- .col-sm-12.col-lg-6
35
- .form-group data-name="password"
36
- label for="password"
37
- = t('password')
38
- input#group_name.form-control[name="user[password]" type="password"]
28
+ - if @user.new_record?
29
+ .row
30
+ .col-sm-12.col-lg-6
31
+ .form-group data-name="password"
32
+ label for="password"
33
+ = t('password')
34
+ input#group_name.form-control[name="user[password]" type="password"]
39
35
 
40
- .col-sm-12.col-lg-6
41
- .form-group data-name="password_confirmation"
42
- label for="password_confirmation"
43
- = t('password_confirmation')
44
- input#group_name.form-control[name="user[password_confirmation]" type="password"]
36
+ .col-sm-12.col-lg-6
37
+ .form-group data-name="password_confirmation"
38
+ label for="password_confirmation"
39
+ = t('password_confirmation')
40
+ input#group_name.form-control[name="user[password_confirmation]" type="password"]
45
41
 
46
42
  .row
47
43
  .col-sm-12
@@ -1,5 +1,5 @@
1
- - form_target = Rails.application.routes.url_helpers.send("#{Faalis::Engine.dashboard_namespace}_auth_users_edit_password_path".to_sym, @user.id)
2
- - index = Rails.application.routes.url_helpers.send("#{Faalis::Engine.dashboard_namespace}_auth_users_path".to_sym)
1
+ - form_target = faalis.auth_users_edit_password_dashboard_auth_user_path({id: @user.id})
2
+ - index = faalis.dashboard_auth_users_path
3
3
  = form_tag(form_target, remote: true, method: :patch) do
4
4
  .row
5
5
  .col-sm-12
@@ -1,3 +1,3 @@
1
1
  success_message('<%= t("faalis.dashboard.saved_successfully", resource: t('faalis.user.user')) %>');
2
- var target = '<%= dashboard_auth_users_path %>';
2
+ var target = '<%= faalis.dashboard_auth_users_path %>';
3
3
  redirect_to(target);
@@ -8,7 +8,7 @@
8
8
  - new_user = faalis.new_dashboard_auth_user_path
9
9
  a.btn.btn-success.pull-right.btn-sm href=(new_user)
10
10
  i.fa.fa-plus
11
- = t('faalis.dashboard.index_section.add_button' , resource: 'user')
11
+ = t('faalis.dashboard.index_section.add_button' , resource: t('faalis.user.user'))
12
12
 
13
13
  .box-body.no-padding
14
14
  table.table.table-striped
@@ -59,7 +59,7 @@
59
59
  td.btn-user
60
60
  a.warning.link.pull-left href=(edit_target)
61
61
  i.fa.fa-edit
62
- a.pass-change.link.pull-left href=()
62
+ a.pass-change.link.pull-left href=(faalis.auth_users_edit_password_dashboard_auth_user_path({id: user.id}))
63
63
  i.fa.fa-key.change-pass
64
64
  a.link.pull-left href=(show_target) data-remote="true" data-method="delete"
65
65
  i.fa.fa-remove.btn-remove
@@ -1,3 +1,3 @@
1
1
  success_message('<%= t("faalis.dashboard.updated_successfully", resource: "user") %>');
2
- var target = '<%= Rails.application.routes.url_helpers.send("#{Faalis::Engine.dashboard_namespace}_auth_users_path".to_sym) %>';
2
+ var target = '<%= faalis.dashboard_auth_users_path %>';
3
3
  redirect_to(target);
@@ -1,3 +1,3 @@
1
1
  success_message('<%= t("faalis.dashboard.updated_successfully", resource: t("password")) %>');
2
- var target = '<%= Rails.application.routes.url_helpers.send("#{Faalis::Engine.dashboard_namespace}_auth_users_path".to_sym) %>';
2
+ var target = '<%= faalis.dashboard_auth_users_path %>';
3
3
  redirect_to(target);
@@ -17,7 +17,7 @@
17
17
  <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
18
18
  <![endif]-->
19
19
  </head>
20
- <body class="skin-blue sidebar-mini">
20
+ <body class="skin-blue sidebar-mini sidebar-collapse">
21
21
  <div class="wrapper">
22
22
  <%= render 'faalis/shared/header' %>
23
23
  <%= render 'faalis/shared/sidebar' %>
@@ -23,6 +23,12 @@ fa:
23
23
  password: گذرواژه
24
24
  remember_me: مرا بخاطر بسپار
25
25
 
26
+ group:
27
+ group: گروه
28
+
29
+ user:
30
+ user: کاربر
31
+
26
32
  member_since: "عضو از %{date}"
27
33
  not_authorized: شما مجاز به انجام این فعالیت نیستید.
28
34
  engine_name: فالیس
@@ -41,7 +47,8 @@ fa:
41
47
  sidebar:
42
48
  online: آنلاین
43
49
  search: جستجو
44
-
50
+ index_section:
51
+ add_button: "%{resource} جدید"
45
52
  permissions:
46
53
  read: خواندن
47
54
  update: بروزرسانی
data/lib/faalis.rb CHANGED
@@ -29,9 +29,10 @@ require 'kaminari'
29
29
 
30
30
  # Faalis Module
31
31
  module Faalis
32
- autoload :Configuration, 'faalis/configuration'
32
+
33
33
  end
34
34
 
35
+ require 'faalis/configuration'
35
36
  require 'faalis/engine'
36
37
  require 'faalis/orm'
37
38
  require 'faalis/concerns'
@@ -39,8 +40,6 @@ require 'faalis/dashboard'
39
40
  require 'faalis/extension'
40
41
  require 'faalis/omniauth'
41
42
  require 'faalis/i18n'
42
- require 'faalis/generators/concerns'
43
- require 'faalis/generators'
44
43
  require 'faalis/route'
45
44
  require 'faalis/action_dispatch'
46
45
  require 'faalis/discovery'
@@ -1,25 +1,53 @@
1
- module Faalis
2
- class Configuration
1
+ module Faalis::Configuration
3
2
 
4
- class << self
5
- attr_accessor :features, :enabled_features
3
+ # Configure logger
4
+ mattr_accessor :logger
5
+ @@logger = Logger.new(STDOUT)
6
6
 
7
- def enabled_features
8
- @enabled_features || []
9
- end
7
+ # Dashboard url prefix
8
+ mattr_accessor :dashboard_namespace
9
+ @@dashboard_namespace = :dashboard
10
10
 
11
- def features
12
- [:colorize_output]
13
- end
11
+ # ==> ORM configuration
12
+ # Load and configure the ORM. Supports :active_record (default) and
13
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
14
+ # available as additional gems.
15
+ # ORM name to use. either 'active_record' or 'mongoid'
16
+ mattr_accessor :orm
14
17
 
15
- def enable(feature)
16
- fail "No such feature: '#{feature}'" unless features.include? feature
17
- features << featue unless enabled_features.include? feature
18
- end
18
+ def self.orm=(orm_name)
19
+ @@orm = orm_name
20
+ require "devise/orm/#{orm_name}"
21
+ end
19
22
 
20
- def disable
21
- fail 'TODO: create a disable method'
22
- end
23
+ # We have to move this method somewhere else
24
+ def collect_i18n_missing_keys=(value)
25
+ if value
26
+ ::I18n.exception_handler = Faalis::I18n::MissingKeyHandler.new
23
27
  end
24
28
  end
29
+
30
+ # Site Title
31
+ attr_accessor :site_title
32
+ @site_title = 'Faalis'
33
+
34
+ mattr_accessor :slug
35
+
36
+ # Dashboard default javascript manifest
37
+ mattr_accessor :dashboard_js_manifest
38
+ @@dashboard_js_manifest = 'dashboard/application.js'
39
+
40
+ # Devise options
41
+ # Include default devise modules. Others available are:
42
+ # :token_authenticatable, :confirmable,
43
+ # :lockable, :timeoutable and :omniauthable
44
+ mattr_accessor :devise_options
45
+ @@devise_options = [:database_authenticatable,
46
+ :registerable,
47
+ :recoverable,
48
+ :rememberable,
49
+ :trackable,
50
+ :lockable,
51
+ :timeoutable,
52
+ :validatable]
25
53
  end
data/lib/faalis/engine.rb CHANGED
@@ -19,12 +19,13 @@
19
19
 
20
20
  require_relative './middlewares/locale'
21
21
 
22
-
23
22
  module Faalis
24
23
 
25
24
  # `Engine` class of **Faalis**.
26
25
  class Engine < ::Rails::Engine
27
26
 
27
+ extend Faalis::Configuration
28
+
28
29
  # TODO: Break this class to modules
29
30
  # TODO: Add a facility to allow developers to select
30
31
  # features of faalis
@@ -45,43 +46,11 @@ module Faalis
45
46
  g.helper false
46
47
  end
47
48
 
48
- # Configure logger
49
- mattr_accessor :logger
50
- @@logger = Logger.new(STDOUT)
51
-
52
- # Dashboard url prefix
53
- mattr_accessor :dashboard_namespace
54
- @@dashboard_namespace = :dashboard
55
-
56
- # ==> ORM configuration
57
- # Load and configure the ORM. Supports :active_record (default) and
58
- # :mongoid (bson_ext recommended) by default. Other ORMs may be
59
- # available as additional gems.
60
- # ORM name to use. either 'active_record' or 'mongoid'
61
- mattr_accessor :orm
62
-
63
- def self.orm=(orm_name)
64
- @@orm = orm_name
65
- require "devise/orm/#{orm_name}"
66
- #require 'mailboxer'
67
- end
68
49
 
69
50
  def self.setup
70
51
  yield self
71
52
  end
72
53
 
73
- # We have to move this method somewhere else
74
- def self.collect_i18n_missing_keys=(value)
75
- if value
76
- ::I18n.exception_handler = Faalis::I18n::MissingKeyHandler.new
77
- end
78
- end
79
-
80
- # Site Title
81
- mattr_accessor :site_title
82
- @@site_title = 'Faalis'
83
-
84
- mattr_accessor :slug
85
54
 
86
55
 
87
56
  # Override devise layout
@@ -92,25 +61,7 @@ module Faalis
92
61
  Devise::UnlocksController.layout 'faalis/application'
93
62
  Devise::PasswordsController.layout 'faalis/application'
94
63
  end
95
- #Devise.omniauth_path_prefix = ["/en", "/fa"]
96
-
97
- # Dashboard default javascript manifest
98
- mattr_accessor :dashboard_js_manifest
99
- @@dashboard_js_manifest = 'dashboard/application.js'
100
64
 
101
- # Devise options
102
- # Include default devise modules. Others available are:
103
- # :token_authenticatable, :confirmable,
104
- # :lockable, :timeoutable and :omniauthable
105
- mattr_accessor :devise_options
106
- @@devise_options = [:database_authenticatable,
107
- :registerable,
108
- :recoverable,
109
- :rememberable,
110
- :trackable,
111
- :lockable,
112
- :timeoutable,
113
- :validatable]
114
65
 
115
66
  middleware.use Faalis::Middlewares::Locale
116
67
 
@@ -18,5 +18,5 @@
18
18
  # -----------------------------------------------------------------------------
19
19
 
20
20
  module Faalis
21
- VERSION = '2.0.0.rc6'
21
+ VERSION = '2.0.0'
22
22
  end
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: 2.0.0.rc6
4
+ version: 2.0.0
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: 2015-12-13 00:00:00.000000000 Z
12
+ date: 2015-12-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -720,28 +720,6 @@ files:
720
720
  - lib/faalis/extension.rb
721
721
  - lib/faalis/extension/base.rb
722
722
  - lib/faalis/fake_assets.rb
723
- - lib/faalis/generators.rb
724
- - lib/faalis/generators/concerns.rb
725
- - lib/faalis/generators/concerns/allow_query_on.rb
726
- - lib/faalis/generators/concerns/angular.rb
727
- - lib/faalis/generators/concerns/bulk.rb
728
- - lib/faalis/generators/concerns/child.rb
729
- - lib/faalis/generators/concerns/dependency.rb
730
- - lib/faalis/generators/concerns/fieldset.rb
731
- - lib/faalis/generators/concerns/globalize.rb
732
- - lib/faalis/generators/concerns/hstore.rb
733
- - lib/faalis/generators/concerns/input_file.rb
734
- - lib/faalis/generators/concerns/menu.rb
735
- - lib/faalis/generators/concerns/model.rb
736
- - lib/faalis/generators/concerns/parent.rb
737
- - lib/faalis/generators/concerns/render.rb
738
- - lib/faalis/generators/concerns/required.rb
739
- - lib/faalis/generators/concerns/resource_fields.rb
740
- - lib/faalis/generators/concerns/resource_name.rb
741
- - lib/faalis/generators/concerns/tabs.rb
742
- - lib/faalis/generators/concerns/where.rb
743
- - lib/faalis/generators/dashboard_scaffold.rb
744
- - lib/faalis/generators/fields/relation.rb
745
723
  - lib/faalis/i18n.rb
746
724
  - lib/faalis/initialize.rb
747
725
  - lib/faalis/middlewares.rb
@@ -867,9 +845,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
867
845
  version: '2.0'
868
846
  required_rubygems_version: !ruby/object:Gem::Requirement
869
847
  requirements:
870
- - - ">"
848
+ - - ">="
871
849
  - !ruby/object:Gem::Version
872
- version: 1.3.1
850
+ version: '0'
873
851
  requirements: []
874
852
  rubyforge_project:
875
853
  rubygems_version: 2.4.5.1