faalis 1.0.0.alpha0 → 1.0.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +44 -22
  3. data/Rakefile +1 -0
  4. data/app/assets/javascripts/faalis/angular-manifest.js +1 -0
  5. data/app/assets/javascripts/faalis/dashboard/app.js +4 -3
  6. data/app/assets/javascripts/faalis/dashboard/application.js.erb +0 -1
  7. data/app/assets/javascripts/faalis/dashboard/functions.js.erb +5 -7
  8. data/app/assets/javascripts/faalis/dashboard/init.js +1 -2
  9. data/app/assets/javascripts/faalis/dashboard/modules/fields/datetime.js +5 -3
  10. data/app/assets/javascripts/faalis/dashboard/modules/fields/image.js +46 -105
  11. data/app/assets/javascripts/faalis/dashboard/modules/services/upload_service.js +17 -0
  12. data/app/assets/javascripts/faalis/dashboard/variables.js.erb +1 -1
  13. data/app/assets/javascripts/faalis/{locale → locales}/en.json +0 -0
  14. data/app/assets/javascripts/faalis/{locale → locales}/fa.json +0 -0
  15. data/app/assets/javascripts/faalis/locales/translations.fa.js +4 -0
  16. data/app/assets/locale/templates.fa.pot +275 -0
  17. data/app/assets/locale/templates.pot +0 -8
  18. data/app/controllers/faalis/#api_controller.rb# +51 -0
  19. data/app/controllers/faalis/#dashboard_controller.rb# +65 -0
  20. data/app/controllers/faalis/application_controller.rb +9 -10
  21. data/app/controllers/faalis/dashboard_controller.rb +2 -2
  22. data/app/models/faalis/user.rb +11 -11
  23. data/app/models/faalis/user/auth_definitions.rb +2 -14
  24. data/app/models/faalis/user/mongoid_fields.rb +0 -1
  25. data/app/views/angularjs_templates/fields/datetime/datetime.html +7 -1
  26. data/app/views/angularjs_templates/fields/image/image.html +1 -1
  27. data/app/views/angularjs_templates/index.html +1 -6
  28. data/app/views/angularjs_templates/modules.html +1 -1
  29. data/app/views/devise/registrations/new.html.erb +5 -1
  30. data/app/views/devise/sessions/new.html.erb +17 -16
  31. data/app/views/devise/shared/_links.erb +8 -6
  32. data/app/views/layouts/faalis/application.html.erb +0 -4
  33. data/app/views/layouts/faalis/dashboard.html.erb +2 -2
  34. data/app/views/layouts/faalis/simple.html.erb +18 -20
  35. data/config/locales/fa/LC_MESSAGES/faalis.mo +0 -0
  36. data/config/locales/fa/faalis.edit.mo +0 -0
  37. data/config/locales/fa/faalis.edit.po +104 -0
  38. data/config/locales/fa/faalis.mo +0 -0
  39. data/config/locales/fa/faalis.po +29 -108
  40. data/{app/controllers/faalis/#1.sh# → config/locales/fa/faalis.po.time_stamp} +0 -0
  41. data/config/locales/faalis.pot +10 -88
  42. data/config/routes.rb +16 -3
  43. data/lib/faalis.rb +1 -0
  44. data/lib/faalis/discovery/permissions.rb +10 -3
  45. data/lib/faalis/engine.rb +21 -0
  46. data/lib/faalis/generators/concerns.rb +2 -0
  47. data/lib/faalis/generators/concerns/allow_query_on.rb +8 -12
  48. data/lib/faalis/generators/concerns/angular.rb +4 -5
  49. data/lib/faalis/generators/concerns/child.rb +31 -0
  50. data/lib/faalis/generators/concerns/fieldset.rb +2 -2
  51. data/lib/faalis/generators/concerns/globalize.rb +14 -0
  52. data/lib/faalis/generators/concerns/hstore.rb +19 -0
  53. data/lib/faalis/generators/concerns/model.rb +3 -3
  54. data/lib/faalis/generators/concerns/parent.rb +4 -6
  55. data/lib/faalis/generators/concerns/required.rb +2 -1
  56. data/lib/faalis/generators/concerns/resource_name.rb +1 -0
  57. data/lib/faalis/generators/concerns/tabs.rb +4 -7
  58. data/lib/faalis/generators/concerns/where.rb +1 -3
  59. data/lib/faalis/generators/dashboard_scaffold.rb +2 -0
  60. data/lib/faalis/generators/fields/#relation.rb# +61 -0
  61. data/lib/faalis/i18n.rb +6 -1
  62. data/lib/faalis/middlewares.rb +1 -0
  63. data/lib/faalis/middlewares/locale.rb +29 -0
  64. data/lib/faalis/route.rb +12 -19
  65. data/lib/faalis/version.rb +1 -1
  66. data/lib/generators/faalis/install_all_generator.rb +5 -3
  67. data/lib/generators/faalis/install_generator.rb +4 -0
  68. data/lib/generators/faalis/js/install_i18n_generator.rb +1 -1
  69. data/lib/generators/faalis/scaffold_generator.rb +72 -25
  70. data/lib/generators/faalis/templates/i18n/Gruntfile.js.erb +2 -2
  71. data/lib/generators/faalis/templates/i18n/fa.js +2 -2
  72. data/lib/generators/faalis/templates/js/list_view/details.html.erb +26 -3
  73. data/lib/generators/faalis/templates/views/create.json.jbuilder.erb +2 -1
  74. data/lib/generators/faalis/templates/views/index.json.jbuilder.erb +4 -2
  75. data/lib/generators/faalis/templates/views/show.json.jbuilder.erb +2 -1
  76. data/lib/generators/faalis/templates/views/update.json.jbuilder.erb +2 -1
  77. data/lib/tasks/faalis_tasks.rake +25 -27
  78. data/lib/tasks/grunt/Gruntfile.js +2 -2
  79. data/lib/tasks/sync.rake +3 -4
  80. metadata +43 -90
  81. data/app/assets/javascripts/faalis/dashboard/modules/list-view.js +0 -341
  82. data/app/assets/javascripts/faalis/dashboard/modules/modules.js +0 -75
  83. data/app/assets/javascripts/faalis/dashboard/modules/nav.js.erb +0 -78
  84. data/app/assets/stylesheets/faalis/base.css.scss +0 -334
  85. data/app/assets/stylesheets/faalis/dashboard/dashboard.css.scss +0 -246
  86. data/app/assets/stylesheets/faalis/dashboard/list_view.css.scss +0 -169
  87. data/app/assets/stylesheets/faalis/dashboard/ltr/application.css +0 -29
  88. data/app/assets/stylesheets/faalis/dashboard/ltr/base.css.scss.erb +0 -33
  89. data/app/assets/stylesheets/faalis/dashboard/ltr/buttons.css.scss.erb +0 -55
  90. data/app/assets/stylesheets/faalis/dashboard/ltr/direction.css.scss +0 -38
  91. data/app/assets/stylesheets/faalis/dashboard/ltr/foundation_and_overrides.css.scss +0 -1261
  92. data/app/assets/stylesheets/faalis/dashboard/ltr/time.css.scss +0 -58
  93. data/app/assets/stylesheets/faalis/dashboard/rtl/application.css +0 -27
  94. data/app/assets/stylesheets/faalis/dashboard/rtl/base.css.scss.erb +0 -35
  95. data/app/assets/stylesheets/faalis/dashboard/rtl/buttons.css.scss.erb +0 -45
  96. data/app/assets/stylesheets/faalis/dashboard/rtl/direction.css.scss +0 -37
  97. data/app/assets/stylesheets/faalis/dashboard/rtl/foundation_and_overrides.css.scss +0 -1264
  98. data/app/assets/stylesheets/faalis/dashboard/share/time.css.scss +0 -57
  99. data/app/assets/stylesheets/faalis/dashboard/sidebar.css.scss +0 -93
  100. data/app/assets/stylesheets/faalis/devise.css.scss +0 -34
  101. data/app/assets/stylesheets/faalis/groups.css +0 -4
  102. data/app/assets/stylesheets/faalis/home.css.scss +0 -14
  103. data/app/assets/stylesheets/faalis/ltr/application.css +0 -20
  104. data/app/assets/stylesheets/faalis/ltr/buttons.css.scss.erb +0 -45
  105. data/app/assets/stylesheets/faalis/ltr/foundation_and_overrides.scss +0 -1258
  106. data/app/assets/stylesheets/faalis/mixins.css.scss +0 -15
  107. data/app/assets/stylesheets/faalis/rtl/application.css +0 -20
  108. data/app/assets/stylesheets/faalis/rtl/buttons.css.scss.erb +0 -50
  109. data/app/assets/stylesheets/faalis/rtl/foundation_and_overrides.css.scss +0 -1264
  110. data/app/assets/stylesheets/faalis/users.css +0 -4
  111. data/app/assets/stylesheets/faalis/variables.css.scss +0 -102
  112. data/app/controllers/faalis/api/v1/workflows_controller.rb +0 -18
  113. data/app/views/angularjs_templates/list-view/index.html +0 -82
  114. data/app/views/faalis/api/v1/workflows/index.json.jbuilder +0 -5
  115. data/app/workflows/faalis/administration_workflow.rb +0 -7
  116. data/spec/dummy/log/development.log +0 -0
  117. data/spec/dummy/log/test.log +0 -15
  118. data/spec/dummy/tmp/ember-rails/ember-data.js +0 -10204
  119. data/spec/dummy/tmp/ember-rails/ember.js +0 -36991
  120. data/spec/factories/faalis_workflows.rb +0 -7
  121. data/spec/models/faalis/workflow_spec.rb +0 -7
@@ -1,75 +0,0 @@
1
- // Module module :P
2
- var Modules = angular.module("Modules", ["ngRoute", "ngAnimate"]);
3
-
4
- // This controller is responsible to parse modules and load them
5
- Modules.controller("ModulesController", ["$location", "$scope", "$controller", "UserPermissions", function($location, $scope, $controller, User){
6
- var that = this;
7
- this.modules = _.filter(DModules, function(module){
8
-
9
- // Check if current module should be appear in side bar
10
- if (module.sidemenu === true) {
11
-
12
- // If module is a sidebar module, it have to have a controller which
13
- // represent the submenu. Name of the controller should be like:
14
- // ```javascript
15
- /// <modulename>MenuController
16
- ///```
17
- var menu_items = $controller(camelCase(module.resource) + "MenuController", {$scope: $scope}).menu_items;
18
- module.menu_items = [];
19
-
20
- // Iterate over submenu items
21
- _.each(menu_items, function(menu) {
22
- // If menu item provided a permission attribute we have to check user permission for that
23
- if ("permission" in menu){
24
- if ((!("action" in menu.permission)) || (!("model" in menu.permission))) {
25
- console.log("Button permission should be an object and has 'action' and 'model' keys");
26
- throw "Button permission should be an object and has 'name' and 'model' keys";
27
- }
28
- // Check if user can pass the permission
29
- if (User.can(menu.permission.action, menu.permission.model)) {
30
- console.debug("You have " + menu.permission.action + " permission on " + menu.permission.model);
31
- module.menu_items.push(menu);
32
- }
33
- else {
34
- console.debug("User don't have " + menu.permission.action + " permission on " + menu.permission.model);
35
- }
36
- }
37
- else {
38
- // Add item to submenu item list
39
- module.menu_items.push(menu);
40
- }
41
- });
42
- // Close the submenu section
43
- module.show_menu = false;
44
- }
45
- return module.sidemenu || false;
46
- });
47
-
48
- // Event handler on menu click
49
- this.on_click = function(url){
50
- $location.path(url);
51
- };
52
-
53
- // Event handler of click on menu itself
54
- this.view_menu = function(module) {
55
- _.each(this.modules, function(x){
56
- if (x !== module) {
57
- x.show_menu = false;
58
- }
59
- });
60
- module.show_menu = !module.show_menu;
61
- };
62
- }]);
63
-
64
- // Animations of slide effect
65
- Modules.animation(".slide", function(){
66
- return {
67
- leave: function(elem, done){
68
- $(elem).slideUp(700, done);
69
- },
70
- enter: function(elem, done){
71
- $(elem).slideDown(700, done);
72
- return function(cancelled){};
73
- }
74
- };
75
- });
@@ -1,78 +0,0 @@
1
- var Nav = angular.module("Navigation", ["ngAnimate"]);
2
-
3
- Nav.controller("NavigationController", ["$location", "gettext", "$interval", function($location, gettext, $interval){
4
-
5
- this.menu_items = [
6
- {
7
- title: gettext("Messages"),
8
- icon: "fa fa-comments",
9
- url: "/conversations/inbox"
10
- },
11
- {
12
- title: gettext("Languages"),
13
- icon: "fa fa-flag",
14
- items: [
15
- <% ::I18n.available_locales.each do |locale| %>
16
- {
17
- url: '<%= "/#{locale.to_s}/#{Faalis::Engine.dashboard_namespace.to_s}/" %>',
18
- title: "<%=locale %>"
19
- },
20
- <% end %>
21
- ]
22
- },
23
- {
24
- title: gettext("User"),
25
- icon: "fa fa-user",
26
- items: [
27
- {
28
- title: gettext("Logout"),
29
- icon: "fa fa-power-off",
30
- url: "/users/sign_out",
31
- method: "delete"
32
- },
33
- {
34
- title: gettext("Change Password"),
35
- icon: "fa fa-exchange",
36
- url: "/users/password/edit"
37
- },
38
- {
39
- title: gettext("Profile"),
40
- icon: "fa fa-pencil",
41
- url: "#/auth/profile/edit"
42
- }
43
- ]
44
- }
45
- ];
46
-
47
- this.on_click = function(menu_item){
48
- if ("url" in menu_item) {
49
- $location.path(menu_item.url);
50
- return;
51
- }
52
- this.menu_clicked = false;
53
- var that = this;
54
- $interval(function(){
55
- that.menu_clicked = false;
56
- }, 5000, 1);
57
- if ("items" in menu_item) {
58
- this.submenu_items = menu_item.items;
59
- this.menu_clicked = true;
60
-
61
- }
62
- };
63
- this.view_menu = function(module) {
64
- module.show_menu = !module.show_menu;
65
- };
66
- }]);
67
-
68
- Nav.animation(".subnav", function(){
69
- return {
70
- leave: function(elem, done){
71
- $("#subnav").slideUp(700, done);
72
- },
73
- enter: function(elem, done){
74
- $("#subnav").slideDown(700, done);
75
- return function(cancelled){};
76
- }
77
- };
78
- });
@@ -1,334 +0,0 @@
1
- //@import 'foundation_and_overrides';
2
- //@import "foundation";
3
- //@import "foundation/components/global";
4
- //@import "foundation/components/alert-boxes";
5
- @import "faalis/variables";
6
- @import "faalis/mixins";
7
-
8
- table{
9
- th{
10
- text-align: center !important;
11
- margin: 0;
12
- }
13
- width: 90%;
14
- margin-left: auto;
15
- margin-right: auto;
16
- }
17
-
18
- .warning{
19
- text-shadow:1px 2px 2px 1px black;
20
- }
21
-
22
- .error{
23
- text-shadow:1px 2px 2px 1px black;
24
- }
25
-
26
- .vertical {
27
- list-style: none;
28
- li {
29
- display: inline;
30
- }
31
- }
32
-
33
- .inline{
34
- display:inline;
35
- }
36
-
37
- .justify{
38
- text-align:justify;
39
- }
40
-
41
-
42
- .header {
43
- Background: $headerbg;
44
- height: $headerHeight;
45
- }
46
-
47
- footer {
48
- Background: $darkbg;
49
- width:100%;
50
- min-height:60px;
51
- position:relative;
52
- margin: 0 auto;
53
- color: $lightgray;
54
-
55
- &.plain {
56
- background: none;
57
- div {
58
- padding: 5px;
59
- }
60
- }
61
-
62
- div{
63
- padding:20px 60px;
64
- font-size:14px;
65
- a{
66
- color:$lightgray;
67
- }
68
- }
69
- }
70
-
71
- fieldset {
72
- border-radius: $border-radius;
73
- background: #fff;
74
-
75
- legend {
76
- color: $darkgray;
77
- padding: 10px 10px 20px 10px;
78
- background: none;
79
- }
80
- .row {
81
- padding-bottom: 20px;
82
-
83
- }
84
-
85
- }
86
-
87
- .form {
88
- line-height:25px;
89
- img {
90
- padding :5px;
91
- }
92
- .submit{
93
- text-align:center;
94
- }
95
- }
96
-
97
-
98
-
99
- .table {
100
- background: white;
101
- border-radius: $border-radius;
102
- -webkit-font-smoothing: antialiased;
103
- width: auto;
104
- overflow: auto;
105
- display: block;
106
- th {
107
-
108
- }
109
- }
110
-
111
- .clearmargin {
112
- margin-left: 0 !important;
113
- margin-right: 0 !important;
114
- }
115
-
116
- .clearpadding {
117
- padding-left: 0 !important;
118
- padding-right: 0 !important;
119
- }
120
-
121
- .pointer {
122
- cursor: pointer;
123
- }
124
-
125
- .delete-icon {
126
- color: $alizarin;
127
- }
128
-
129
- #flash {
130
- padding: 10px 5px;
131
- border-radius: $border-radius;
132
- margin: 10px auto;
133
- display: none;
134
- cursor: pointer;
135
- &.error {
136
- background: $alizarin;
137
- border: 1px solid darken($alizarin, 5%);
138
- color: white;
139
- }
140
- &.warning {
141
- background: $sun_flower;
142
- border: 1px solid darken($sun_flower, 5%);
143
- color: white;
144
-
145
- }
146
- &.success {
147
- background: $emerald;
148
- border: 1px solid darken($emerald, 5%);
149
- color: white;
150
-
151
- }
152
- }
153
-
154
-
155
- .search-bar{
156
- margin-top: 10px;
157
- input[type="search"]{
158
- border-top-left-radius:5px;
159
- border-bottom-left-radius:5px !important;
160
- }
161
-
162
- button[type="submit"]{
163
- border-top-right-radius:5px !important;
164
- border-bottom-right-radius:5px;
165
- }
166
- }
167
-
168
-
169
- #mainloader {
170
- .text {
171
- margin: 20% auto;
172
- width:40%;
173
- text-align: center;
174
- color: #4f4f4f;
175
- h5 { color: #4f4f4f;}
176
- }
177
- }
178
-
179
-
180
- .red {
181
- background-color: $alizarin;
182
- color: white;
183
- }
184
-
185
- .green {
186
- background-color: $emerald;
187
- color: white;
188
-
189
- }
190
-
191
- .yellow {
192
- background-color: $sun_flower;
193
- color: white;
194
- }
195
-
196
- .blue {
197
- background-color: $peter_river;
198
- color: white;
199
- }
200
- .lightgray {
201
- background-color: $lightgray;
202
- }
203
- .lightergray {
204
- background-color: $lightergray;
205
- }
206
- .rounded {
207
- border-radius: $border-radius;
208
- }
209
-
210
- .text-4x {
211
- font-size: 4em;
212
- }
213
- .text-2x {
214
- font-size: 2em;
215
- }
216
-
217
- .elabel {
218
- font-weight: 500;
219
- text-align: center;
220
- text-decoration: none;
221
- line-height: 1;
222
- white-space: nowrap;
223
- display: inline-block;
224
- position: relative;
225
- padding: 0.1875em 0.625em 0.25em;
226
- font-size: 0.75em;
227
- }
228
-
229
- .debug_dump {
230
- margin: 10px auto;
231
- width: 80%;
232
- padding: 15px;
233
- background: #efefef;
234
- border: 1px #dfdfdf solid;
235
-
236
- }
237
-
238
- input {
239
- &.has-error {
240
- border: 1px solid $alizarin;
241
- &:focus {border: 1px solid $alizarin;}
242
- }
243
- }
244
-
245
- .progressbar {
246
- width: 100%;
247
- height: 3px;
248
- background: #eee;
249
- border: 1px solid #e0e0e0;
250
- text-align: center;
251
- font-size: 12px;
252
- color: $darkgray;
253
-
254
- .filler {
255
- position: absolute;
256
- top: 0px;
257
- float: left;
258
- left: 0;
259
- height: 100%;
260
- }
261
-
262
- }
263
-
264
- .progressbar-container {
265
- padding-top: 20px;
266
- }
267
- .text-error {
268
- color: $alizarin;
269
- }
270
- .inline {
271
- display: inline;
272
- }
273
-
274
- small.error {
275
- margin-top: 1em !important;
276
- border-radius: 3px;
277
- }
278
-
279
- .relation_links {
280
- span {
281
- font-size: 0.8em;
282
- padding: 2px 5px;
283
- color: $darkgray;
284
- cursor: pointer;
285
- opacity: 0.4;
286
- @include transition(opacity 300ms linear 0ms);
287
- &:hover {
288
- opacity: 1;
289
- @include transition(opacity 300ms linear 0ms);
290
- }
291
- a {
292
- opacity: 0.4;
293
- @include transition(opacity 300ms linear 0ms);
294
- &:hover {
295
- opacity: 1;
296
- @include transition(opacity 300ms linear 0ms);
297
- }
298
- .btntitle {
299
- padding: 0;
300
- }
301
-
302
- }
303
- }
304
-
305
- }
306
-
307
- .extra_links {
308
- .option_item {
309
- font-size: 0.7em;
310
- color: $darkgray;
311
- cursor: pointer;
312
- a {
313
- padding: 2px 4px;
314
- .btntitle {
315
- padding: 0;
316
- }
317
-
318
- }
319
- }
320
-
321
- }
322
-
323
- .helptext {
324
- font-size: 0.6em;
325
- color: $lightgray;
326
- }
327
-
328
- .single-form {
329
- padding-top: 5em;
330
- min-height: 35em;
331
- fieldset {
332
- height: 20em;
333
- }
334
- }