infopark_fiona7 1.5.3.2.0 → 1.5.4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +30 -1
  3. data/app/assets/javascripts/fiona7/task_list_command.js +15 -0
  4. data/app/assets/javascripts/fiona7/task_list_dialog.js +100 -0
  5. data/app/assets/javascripts/fiona7/task_list_menu_item.js +30 -0
  6. data/app/assets/javascripts/fiona7/templates.js +106 -0
  7. data/app/assets/javascripts/fiona7/translations.js +136 -0
  8. data/app/assets/javascripts/fiona7_ui.js +10 -110
  9. data/app/assets/javascripts/scrivito_patches/ajax.js +6 -3
  10. data/app/assets/javascripts/scrivito_patches/ajax_error_handling.js +1 -1
  11. data/app/assets/javascripts/scrivito_patches/attribute_serializer.js +2 -2
  12. data/app/assets/javascripts/scrivito_patches/binary_utils.js +1 -1
  13. data/app/assets/javascripts/scrivito_patches/cms_rest_api.js +4 -4
  14. data/app/assets/javascripts/scrivito_patches/models/api/basic_obj.js +1 -1
  15. data/app/assets/javascripts/scrivito_patches/models/obj.js +1 -1
  16. data/app/controllers/fiona7/tasks_controller.rb +30 -0
  17. data/app/helpers/fiona7_override_helper.rb +0 -1
  18. data/app/models/fiona7/task.rb +0 -0
  19. data/app/models/rails_connector/task.rb +19 -0
  20. data/app/views/fiona7/tasks/index.jbuilder +20 -0
  21. data/config/locales/workspace.yml +9 -0
  22. data/config/precedence_routes.rb +2 -0
  23. data/infopark_fiona7.gemspec +3 -2
  24. data/lib/fiona7/attribute_writers/referencelist_as_linklist.rb +1 -1
  25. data/lib/fiona7/attribute_writers/referencelist_as_text.rb +1 -1
  26. data/lib/fiona7/engine.rb +3 -0
  27. data/lib/fiona7/forbidden_obj_classes.rb +17 -0
  28. data/lib/fiona7/tasks/loader.rb +54 -0
  29. data/lib/fiona7/tasks/task.rb +6 -0
  30. data/lib/fiona7/verity_search_engine.rb +1 -1
  31. data/lib/fiona7/version.rb +1 -1
  32. data/lib/fiona7/version_helper.rb +45 -40
  33. data/lib/fiona7/workspace.rb +8 -1
  34. metadata +17 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1d11c7ebae18abd2aee02f9699d5b9bcacc0560
4
- data.tar.gz: 8c32fd876f686b96f5dbfc26735b28aafd393c2e
3
+ metadata.gz: 48f2e2270c1b9a56258e9a46ef13492dcd835805
4
+ data.tar.gz: f8c931d72b8a80bc2da52f3af652736e1e8494c6
5
5
  SHA512:
6
- metadata.gz: 4f29a3c1804781c592e7f8816a3f65d56403fdb65df1da086e5204dcc42f2dc6c69f46a8701a04569546453b20730cdea2ebe03b05851a7d203e387141191681
7
- data.tar.gz: d28cb1f6ce822dae0eb5f73b181e28c611397fd6dc75c4185025cadadaa1ee5d99a49360d1b0d3a490cef707bc583e3b5960eec5d03df049dae3e39a6c150f97
6
+ metadata.gz: 9e5ed06ef8ec90a08b28e7ef26dcede484ad4e6c7a8164ae4bd02d0062447b7af90ab54e5fa03a25f9766a0cb4b6286a068919d20114fe87244737cae2862f36
7
+ data.tar.gz: abc9e5a582f2c4aa46ebce452d923591fd462a4069c862f776cb3804131e3573c966ba9d36eeef4cc25da8dd5dc86bc4577defab72e3d3c0f9eac6f12fddf81b
data/Rakefile CHANGED
@@ -18,8 +18,10 @@ end
18
18
  namespace "package" do
19
19
  desc "Package javascript"
20
20
  task "js" do
21
- puts "Transpiling javascript files"
22
21
  require 'babel/transpiler'
22
+ require 'handlebars_assets'
23
+
24
+ puts "Transpiling javascript files"
23
25
  Dir["app/**/*"].each do |fname|
24
26
  if /\.es6\.js$/ =~ fname
25
27
  nfname = ::File.join(::File.dirname(fname), ::File.basename(fname, '.es6.js') + '.js')
@@ -29,6 +31,33 @@ namespace "package" do
29
31
  end
30
32
  end
31
33
  end
34
+ puts "Processing handlebars templates"
35
+ templates = []
36
+ template_namespace = 'ScrivitoHandlebarsTemplates'
37
+
38
+ Dir["app/assets/javascripts/fiona7/templates/**/*"].each do |fname|
39
+ if /\.hbs$/ =~ fname
40
+ puts "Compiling #{fname}"
41
+ template_name = fname.sub(/.*javascripts\/fiona7\/templates\//, '').sub(/\.hbs$/, '').dump
42
+ precompiled = HandlebarsAssets::Handlebars.precompile(File.read(fname))
43
+ template = "Handlebars.template(#{precompiled})"
44
+
45
+ templates << <<-TEMPLATE
46
+ (function() {
47
+ this.#{template_namespace} || (this.#{template_namespace} = {});
48
+ this.#{template_namespace}[#{template_name}] = #{template};
49
+ return this.#{template_namespace}[#{template_name}];
50
+ }).call(this);
51
+ TEMPLATE
52
+ end
53
+ end
54
+
55
+ puts "Writing app/assets/javascripts/fiona7/templates.js"
56
+ File.open('app/assets/javascripts/fiona7/templates.js', 'w') do |f|
57
+ templates.each do |t|
58
+ f.write(t)
59
+ end
60
+ end
32
61
  end
33
62
  end
34
63
 
@@ -0,0 +1,15 @@
1
+ (function() {
2
+ _.extend(scrivito, {
3
+ task_list_command: function() {
4
+ return scrivito.command.create_instance({
5
+ id: 'fiona7.task_list',
6
+ title: scrivito.t('commands.task_list.title'),
7
+ icon: '&#xf06f;',
8
+
9
+ execute: function() {
10
+ scrivito.task_list_dialog.open();
11
+ }
12
+ });
13
+ }
14
+ });
15
+ }());
@@ -0,0 +1,100 @@
1
+ (function() {
2
+ var dialog, promise, transferred;
3
+
4
+ _.extend(scrivito, {
5
+ task_list_dialog: {
6
+ open: function() {
7
+ promise = $.Deferred();
8
+ transferred = [];
9
+ dialog = $(scrivito.template.render('task_list_dialog')).appendTo($('#scrivito_editing'));
10
+
11
+ load_task_list();
12
+
13
+ scrivito.dialog.open_and_adjust_without_transition(dialog);
14
+ return scrivito.withDialogBehaviour(dialog, promise, {escape: close});
15
+ }
16
+ }
17
+ });
18
+
19
+ var fetch_task_list = function(mode) {
20
+ var base_url = window.location.protocol + '//' + window.location.host + '/__scrivito/';
21
+ var path = 'tasks';
22
+
23
+ // the other option is 'all'
24
+ mode = mode || 'user';
25
+
26
+ return $.ajax(base_url + path, {
27
+ type: 'GET',
28
+ data: {mode: mode},
29
+ dataType: 'json',
30
+ cache: false
31
+ });
32
+ };
33
+
34
+ var load_task_list = function(mode) {
35
+ var objs;
36
+
37
+ render(mode);
38
+
39
+ fetch_task_list(mode).then(function(result, text_status, xhr) {
40
+ var tasks = result.tasks;
41
+
42
+ _.each(tasks, function(task) {
43
+ task.obj_data = task.obj;
44
+ task.obj = scrivito.obj.create_instance(task.obj);
45
+ task.last_changed = string_date_to_function(task.last_changed);
46
+ });
47
+
48
+ render(mode, tasks);
49
+ });
50
+ };
51
+
52
+ var string_date_to_function = function(string_date) {
53
+ return function() {
54
+ return scrivito.parseDate(string_date);
55
+ };
56
+ };
57
+
58
+ var render = function(mode, tasks) {
59
+ mode = mode || 'user';
60
+
61
+ dialog.html(scrivito.template.render('task_list_dialog/content', {
62
+ title: scrivito.t('task_list_dialog.title.' + mode),
63
+ tasks: tasks,
64
+ is_loaded: !!tasks,
65
+ mode_button: scrivito.t('task_list_dialog.mode_toggle.' + mode)
66
+ }));
67
+
68
+ // on click go to page
69
+ dialog.find('[data-scrivito-obj-id]').on('click', function() {
70
+ var obj_id = $(this).attr('data-scrivito-obj-id');
71
+ var task = _.find(tasks || [], function(task) { return task.obj.id() === obj_id; });
72
+ scrivito.open_obj(task.obj);
73
+ return false;
74
+ });
75
+
76
+ scrivito.updateAutoHeightFor(dialog.find('.scrivito_changes_dialog_content'));
77
+
78
+ dialog.find('.scrivito_cancel').on('click', close);
79
+
80
+ // TODO: sortable
81
+
82
+ // TODO: my/all changes
83
+ // mine/all changes toggle
84
+ dialog.find('.fiona7_toggle_task_list_type').on('click', function() {
85
+
86
+ if (mode == 'all') {
87
+ load_task_list('user');
88
+ } else {
89
+ load_task_list('all');
90
+ }
91
+ });
92
+ };
93
+
94
+ var close = function() {
95
+ scrivito.dialog.close_without_transition(dialog);
96
+ promise.resolve(transferred);
97
+ return false;
98
+ };
99
+
100
+ }());
@@ -0,0 +1,30 @@
1
+ (function() {
2
+ /*
3
+ var template = function() {
4
+ return '<li id="fiona7_task_list" class="scrivito_menu_item fiona7_task_list"><span title="' + scrivito.t('commands.task_list.title') + '"><i class="scrivito_icon">&#xf06f;</i> ' + scrivito.t('commands.task_list.title') + '</span></li>';
5
+ };
6
+ */
7
+
8
+ _.extend(scrivito, {
9
+ task_list_menu_item: {
10
+ init: function() {
11
+ scrivito.menu_bar.register_item_renderer(function(menu_bar) {
12
+ var workspace_select = menu_bar.find('#scrivito_workspace_select');
13
+ var changes = menu_bar.find('#scrivito_sdk_workspace_changes');
14
+ var command = scrivito.task_list_command();
15
+
16
+ changes.after(scrivito.template.render('task_list_menu_item', {
17
+ title: command.title,
18
+ icon: command.icon
19
+ }));
20
+ workspace_select.on('click', '#fiona7_task_list', function() {
21
+ command.execute();
22
+ });
23
+
24
+
25
+ });
26
+
27
+ }
28
+ }
29
+ })
30
+ }());
@@ -0,0 +1,106 @@
1
+ (function() {
2
+ this.ScrivitoHandlebarsTemplates || (this.ScrivitoHandlebarsTemplates = {});
3
+ this.ScrivitoHandlebarsTemplates["task_list_dialog/content"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) {
4
+ var stack1;
5
+
6
+ return " <table class=\"scrivito_changes_table\">\n"
7
+ + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.tasks : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
8
+ + "\n <tbody>\n"
9
+ + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.tasks : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.program(7, data, 0),"data":data})) != null ? stack1 : "")
10
+ + " </tbody>\n </table>\n";
11
+ },"2":function(container,depth0,helpers,partials,data) {
12
+ return " <thead>\n <tr>\n <th>\n <span>\n "
13
+ + container.escapeExpression((helpers.translate || (depth0 && depth0.translate) || helpers.helperMissing).call(depth0 != null ? depth0 : {},"task_list_dialog.user_login",{"name":"translate","hash":{},"data":data}))
14
+ + "\n </span>\n </th>\n <th>\n <span>\n "
15
+ + container.escapeExpression((helpers.translate || (depth0 && depth0.translate) || helpers.helperMissing).call(depth0 != null ? depth0 : {},"task_list_dialog.group_name",{"name":"translate","hash":{},"data":data}))
16
+ + "\n </span>\n </th>\n <th>\n <span>\n "
17
+ + container.escapeExpression((helpers.translate || (depth0 && depth0.translate) || helpers.helperMissing).call(depth0 != null ? depth0 : {},"changes_dialog.description_for_editor",{"name":"translate","hash":{},"data":data}))
18
+ + "\n </span>\n </th>\n <th>\n <span>\n "
19
+ + container.escapeExpression((helpers.translate || (depth0 && depth0.translate) || helpers.helperMissing).call(depth0 != null ? depth0 : {},"changes_dialog.obj_class",{"name":"translate","hash":{},"data":data}))
20
+ + "\n </span>\n </th>\n <th>\n <span>\n "
21
+ + container.escapeExpression((helpers.translate || (depth0 && depth0.translate) || helpers.helperMissing).call(depth0 != null ? depth0 : {},"task_list_dialog.comment",{"name":"translate","hash":{},"data":data}))
22
+ + "\n </span>\n </th>\n <th>\n <span>\n "
23
+ + container.escapeExpression((helpers.translate || (depth0 && depth0.translate) || helpers.helperMissing).call(depth0 != null ? depth0 : {},"changes_dialog.last_changed",{"name":"translate","hash":{},"data":data}))
24
+ + "\n </span>\n </th>\n </tr>\n </thead>\n";
25
+ },"4":function(container,depth0,helpers,partials,data) {
26
+ var stack1;
27
+
28
+ return " "
29
+ + ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.tasks : depth0),{"name":"each","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
30
+ + "\n";
31
+ },"5":function(container,depth0,helpers,partials,data) {
32
+ return container.escapeExpression((helpers.render || (depth0 && depth0.render) || helpers.helperMissing).call(depth0 != null ? depth0 : {},"task_list_dialog/row",depth0,{"name":"render","hash":{},"data":data}));
33
+ },"7":function(container,depth0,helpers,partials,data) {
34
+ return " <tr>\n <td class=\"scrivito_empty_result\" colspan=\"5\">"
35
+ + container.escapeExpression((helpers.translate || (depth0 && depth0.translate) || helpers.helperMissing).call(depth0 != null ? depth0 : {},"task_list_dialog.empty",{"name":"translate","hash":{},"data":data}))
36
+ + "</td>\n </tr>\n";
37
+ },"9":function(container,depth0,helpers,partials,data) {
38
+ return " <tr><td colspan=\"5\"><i class=\"scrivito_icon scrivito_spinning\">&#xf023;</i></td></tr>\n";
39
+ },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
40
+ var stack1, helper;
41
+
42
+ return "<div class=\"scrivito_changes_dialog_content scrivito_auto_height\">\n <div class=\"scrivito_modal_header\">\n <h3>\n <i class=\"scrivito_icon\">&#xf06f;</i> "
43
+ + container.escapeExpression(((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"title","hash":{},"data":data}) : helper)))
44
+ + "\n </h3>\n </div>\n\n <div class=\"scrivito_modal_body scrivito_auto_height\">\n"
45
+ + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.is_loaded : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(9, data, 0),"data":data})) != null ? stack1 : "")
46
+ + " </div>\n</div>\n\n<div class=\"scrivito_modal_footer\">\n <a href=\"#\" class=\"scrivito_button scrivito_left fiona7_toggle_task_list_type\">\n "
47
+ + container.escapeExpression(((helper = (helper = helpers.mode_button || (depth0 != null ? depth0.mode_button : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"mode_button","hash":{},"data":data}) : helper)))
48
+ + "\n </a>\n <a href=\"#\" class=\"scrivito_button scrivito_cancel scrivito_green\">"
49
+ + container.escapeExpression((helpers.translate || (depth0 && depth0.translate) || helpers.helperMissing).call(depth0 != null ? depth0 : {},"done",{"name":"translate","hash":{},"data":data}))
50
+ + "</a>\n</div>\n";
51
+ },"useData":true});
52
+ return this.ScrivitoHandlebarsTemplates["task_list_dialog/content"];
53
+ }).call(this);
54
+ (function() {
55
+ this.ScrivitoHandlebarsTemplates || (this.ScrivitoHandlebarsTemplates = {});
56
+ this.ScrivitoHandlebarsTemplates["task_list_dialog/row"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
57
+ var stack1, helper;
58
+
59
+ return "<tr title=\""
60
+ + container.escapeExpression(((helper = (helper = helpers.tooltip || (depth0 != null ? depth0.tooltip : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"tooltip","hash":{},"data":data}) : helper)))
61
+ + "\" data-scrivito-obj-id=\""
62
+ + container.escapeExpression(((helper = (helper = helpers.obj_id || (depth0 != null ? depth0.obj_id : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"obj_id","hash":{},"data":data}) : helper)))
63
+ + "\">\n <td>\n <span>\n "
64
+ + container.escapeExpression(((helper = (helper = helpers.user_login || (depth0 != null ? depth0.user_login : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"user_login","hash":{},"data":data}) : helper)))
65
+ + "\n </span>\n </td>\n\n <td>\n <span>\n "
66
+ + container.escapeExpression(((helper = (helper = helpers.group_name || (depth0 != null ? depth0.group_name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"group_name","hash":{},"data":data}) : helper)))
67
+ + "\n </span>\n </td>\n\n <td><span class=\"scrivito_title\">"
68
+ + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? depth0.obj_data : depth0)) != null ? stack1.description_for_editor : stack1), depth0))
69
+ + "</span>\n <td><span class=\"scrivito_obj_class\">"
70
+ + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? depth0.obj_data : depth0)) != null ? stack1.obj_class : stack1), depth0))
71
+ + "</span></td>\n\n <td>\n <span>\n "
72
+ + container.escapeExpression(((helper = (helper = helpers.comment || (depth0 != null ? depth0.comment : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"comment","hash":{},"data":data}) : helper)))
73
+ + "\n </span>\n </td>\n\n <td>\n <span>\n <time datetime=\""
74
+ + container.escapeExpression(((helper = (helper = helpers.last_changed || (depth0 != null ? depth0.last_changed : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"last_changed","hash":{},"data":data}) : helper)))
75
+ + "\" title=\""
76
+ + container.escapeExpression((helpers.localize_date || (depth0 && depth0.localize_date) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.last_changed : depth0),{"name":"localize_date","hash":{},"data":data}))
77
+ + "\">\n "
78
+ + container.escapeExpression((helpers.localizeDateRelative || (depth0 && depth0.localizeDateRelative) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.last_changed : depth0),{"name":"localizeDateRelative","hash":{},"data":data}))
79
+ + "\n </time>\n </span>\n </td>\n</tr>\n";
80
+ },"useData":true});
81
+ return this.ScrivitoHandlebarsTemplates["task_list_dialog/row"];
82
+ }).call(this);
83
+ (function() {
84
+ this.ScrivitoHandlebarsTemplates || (this.ScrivitoHandlebarsTemplates = {});
85
+ this.ScrivitoHandlebarsTemplates["task_list_dialog"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
86
+ return "<div class=\"scrivito_changes_overview scrivito_modal_large adjust_dialog\" >\n <div class=\"scrivito_changes_dialog_content scrivito_auto_height\"></div>\n <div class=\"scrivito_modal_footer\">\n <a href=\"#\" class=\"scrivito_button scrivito_cancel scrivito_green\">"
87
+ + container.escapeExpression((helpers.translate || (depth0 && depth0.translate) || helpers.helperMissing).call(depth0 != null ? depth0 : {},"done",{"name":"translate","hash":{},"data":data}))
88
+ + "</a>\n </div>\n</div>\n";
89
+ },"useData":true});
90
+ return this.ScrivitoHandlebarsTemplates["task_list_dialog"];
91
+ }).call(this);
92
+ (function() {
93
+ this.ScrivitoHandlebarsTemplates || (this.ScrivitoHandlebarsTemplates = {});
94
+ this.ScrivitoHandlebarsTemplates["task_list_menu_item"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
95
+ var stack1, helper;
96
+
97
+ return "<li id=\"fiona7_task_list\" class=\"scrivito_menu_item fiona7_task_list\">\n<span title=\""
98
+ + container.escapeExpression(((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"title","hash":{},"data":data}) : helper)))
99
+ + "\"><i class=\"scrivito_icon\">"
100
+ + ((stack1 = ((helper = (helper = helpers.icon || (depth0 != null ? depth0.icon : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"icon","hash":{},"data":data}) : helper))) != null ? stack1 : "")
101
+ + "</i> "
102
+ + container.escapeExpression(((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"title","hash":{},"data":data}) : helper)))
103
+ + " </span>\n</li>\n";
104
+ },"useData":true});
105
+ return this.ScrivitoHandlebarsTemplates["task_list_menu_item"];
106
+ }).call(this);
@@ -0,0 +1,136 @@
1
+ (function() {
2
+ $.i18n().load({
3
+ 'commands.release_obj.title': 'Seite freigeben',
4
+ 'commands.release_obj.not_modified_obj': 'Diese Seite wurde nicht geändert. Daher gibt es nichts zu freigeben.',
5
+ 'commands.release_obj.dialog.title': 'Änderungen an dieser Seite veröffentlichen?',
6
+ 'commands.release_obj.dialog.description': 'Eine Arbeitsversion zu veröffentlichen ist endgültig. Dieser Vorgang kann nicht rückgängig gemacht werden.',
7
+ 'commands.release_obj.dialog.placeholder': 'Bitte Kommentar eintragen',
8
+ 'commands.release_obj.dialog.confirm': 'Freigeben',
9
+ 'commands.release_obj.failed': 'Freigabe fehlgeschlagen',
10
+
11
+ 'commands.edit_obj.title': 'Workflow starten',
12
+ 'commands.edit_obj.dialog.title': 'Workflow starten?',
13
+ 'commands.edit_obj.dialog.description': 'Es wird eine neue Arbeitsversion erstellt.',
14
+ 'commands.edit_obj.dialog.placeholder': 'Bitte Kommentar eintragen',
15
+ 'commands.edit_obj.dialog.confirm': 'Starten',
16
+ 'commands.edit_obj.failed': 'Workflow fehlgeschlagen',
17
+
18
+ 'commands.forward_obj.title': 'Seite weiterleiten',
19
+ 'commands.forward_obj.dialog.title': 'Seite weiterleiten?',
20
+ 'commands.forward_obj.dialog.description': 'Die Arbeitsversion wird an einen weiteren Bearbeiter weitergeleitet. Dieser Vorgang kann nicht rückgängig gemacht werden.',
21
+ 'commands.forward_obj.dialog.placeholder': 'Bitte Kommentar eintragen',
22
+ 'commands.forward_obj.dialog.confirm': 'Weiterleiten',
23
+ 'commands.forward_obj.failed': 'Weiterleitung fehlgeschlagen',
24
+
25
+ 'commands.reject_obj.title': 'Seite ablehnen',
26
+ 'commands.reject_obj.dialog.title': 'Seite ablehnen?',
27
+ 'commands.reject_obj.dialog.description': 'Die Arbeitsversion wird abgelehnt. Dieser Vorgang kann nicht rückgängig gemacht werden.',
28
+ 'commands.reject_obj.dialog.placeholder': 'Bitte Kommentar eintragen',
29
+ 'commands.reject_obj.dialog.confirm': 'Ablehnen',
30
+ 'commands.reject_obj.failed': 'Ablehnung fehlgeschlagen',
31
+
32
+ 'commands.sign_obj.title': 'Seite abzeichnen',
33
+ 'commands.sign_obj.dialog.title': 'Seite abzeichnen?',
34
+ 'commands.sign_obj.dialog.description': 'Die eingereichte Version wird abgezeichnet. Dieser Vorgang kann nicht rückgängig gemacht werden.',
35
+ 'commands.sign_obj.dialog.placeholder': 'Bitte Kommentar eintragen',
36
+ 'commands.sign_obj.dialog.confirm': 'Abzeichnen',
37
+ 'commands.sign_obj.failed': 'Abzeichnung fehlgeschlagen',
38
+
39
+ 'commands.commit_obj.title': 'Seite einreichen',
40
+ 'commands.commit_obj.dialog.title': 'Seite einreichen?',
41
+ 'commands.commit_obj.dialog.description': 'Die Arbeitsversion wird eingereicht. Dieser Vorgang kann nicht rückgängig gemacht werden.',
42
+ 'commands.commit_obj.dialog.placeholder': 'Bitte Kommentar eintragen',
43
+ 'commands.commit_obj.dialog.confirm': 'Einreichen',
44
+ 'commands.commit_obj.failed': 'Einreichung fehlgeschlagen',
45
+
46
+ 'commands.take_obj.title': 'Seite übernehmen',
47
+ 'commands.take_obj.dialog.title': 'Seite übernehmen?',
48
+ 'commands.take_obj.dialog.description': 'Die Arbeitsversion wird übernommen. Dieser Vorgang kann nicht rückgängig gemacht werden.',
49
+ 'commands.take_obj.dialog.placeholder': 'Bitte Kommentar eintragen',
50
+ 'commands.take_obj.dialog.confirm': 'Übernehmen',
51
+ 'commands.take_obj.failed': 'Übernahme fehlgeschlagen',
52
+
53
+ 'editing_disabled.workflow': 'Die Datei unterliegt einem Workflow und kann nicht direkt bearbeitet werden.',
54
+ 'editing_disabled.permissions': 'Ihnen fehlen die Rechte um die Datei zu bearbeiten'
55
+ }, 'de');
56
+
57
+ $.i18n().load({
58
+ 'commands.release_obj.title': 'Release page',
59
+ 'commands.release_obj.not_modified_obj': 'This resource has not been modified. Therefore, nothing can be released.',
60
+ 'commands.release_obj.dialog.title': 'Release this page?',
61
+ 'commands.release_obj.dialog.description': 'Releasing an edited page is final. This operation cannot be reverted.',
62
+ 'commands.release_obj.dialog.placeholder': 'Comment',
63
+ 'commands.release_obj.dialog.confirm': 'Release',
64
+ 'commands.release_obj.failed': 'Release failed',
65
+
66
+ 'commands.edit_obj.title': 'Start a workflow',
67
+ 'commands.edit_obj.dialog.title': 'Start a workflow for this page?',
68
+ 'commands.edit_obj.dialog.description': 'A new version of this page will be created.',
69
+ 'commands.edit_obj.dialog.placeholder': 'Comment',
70
+ 'commands.edit_obj.dialog.confirm': 'Start a workflow',
71
+ 'commands.edit_obj.failed': 'Workflow failed',
72
+
73
+ 'commands.forward_obj.title': 'Forward page',
74
+ 'commands.forward_obj.dialog.title': 'Forward this page?',
75
+ 'commands.forward_obj.dialog.description': 'Forward and edited page is final. This operation cannot be reverted.',
76
+ 'commands.forward_obj.dialog.placeholder': 'Comment',
77
+ 'commands.forward_obj.dialog.confirm': 'Forward',
78
+ 'commands.forward_obj.failed': 'Forward failed',
79
+
80
+ 'commands.reject_obj.title': 'Reject page',
81
+ 'commands.reject_obj.dialog.title': 'Reject this page?',
82
+ 'commands.reject_obj.dialog.description': 'Current page will be rejected. This operation cannot be reverted.',
83
+ 'commands.reject_obj.dialog.placeholder': 'Comment',
84
+ 'commands.reject_obj.dialog.confirm': 'Reject',
85
+ 'commands.reject_obj.failed': 'Reject failed',
86
+
87
+ 'commands.sign_obj.title': 'Sign page',
88
+ 'commands.sign_obj.dialog.title': 'Sign this page?',
89
+ 'commands.sign_obj.dialog.description': 'Committed page will be signed. This operation cannot be reverted.',
90
+ 'commands.sign_obj.dialog.placeholder': 'Comment',
91
+ 'commands.sign_obj.dialog.confirm': 'Sign',
92
+ 'commands.sign_obj.failed': 'Signing failed',
93
+
94
+ 'commands.commit_obj.title': 'Commit page',
95
+ 'commands.commit_obj.dialog.title': 'Commit this page?',
96
+ 'commands.commit_obj.dialog.description': 'Die Arbeitsversion wird eingereicht. Dieser Vorgang kann nicht rückgängig gemacht werden.',
97
+ 'commands.commit_obj.dialog.placeholder': 'Comment',
98
+ 'commands.commit_obj.dialog.confirm': 'Commit',
99
+ 'commands.commit_obj.failed': 'Commit failed',
100
+
101
+ 'commands.take_obj.title': 'Take page',
102
+ 'commands.take_obj.dialog.title': 'Tage this page?',
103
+ 'commands.take_obj.dialog.description': 'Die Arbeitsversion wird übernommen. Dieser Vorgang kann nicht rückgängig gemacht werden.',
104
+ 'commands.take_obj.dialog.placeholder': 'Comment',
105
+ 'commands.take_obj.dialog.confirm': 'Take',
106
+ 'commands.take_obj.failed': 'Take failed',
107
+
108
+ 'editing_disabled.workflow': 'The current page belongs to a workflow and cannot be edited directly.',
109
+ 'editing_disabled.permissions': 'You do not have the permissions required to edit this page.'
110
+ }, 'en');
111
+
112
+ $.i18n().load({
113
+ 'commands.task_list.title': 'Aufgaben anzeigen',
114
+ 'task_list_dialog.title.all': 'Aufgaben anzeigen: alle Aufgaben',
115
+ 'task_list_dialog.title.user': 'Aufgaben anzeigen: meine Aufgaben',
116
+ 'task_list_dialog.mode_toggle.all': 'Meine Aufgaben anzeigen',
117
+ 'task_list_dialog.mode_toggle.user': 'Alle Aufgaben anzeigen',
118
+ 'task_list_dialog.user_login': 'Benutzer',
119
+ 'task_list_dialog.group_name': 'Gruppe',
120
+ 'task_list_dialog.comment': 'Kommentar',
121
+ 'task_list_dialog.empty': 'Keine Aufgaben'
122
+ }, 'de');
123
+
124
+ $.i18n().load({
125
+ 'commands.task_list.title': 'Task list',
126
+ 'task_list_dialog.title.all': 'Task list: All tasks',
127
+ 'task_list_dialog.title.user': 'Task list: My tasks',
128
+ 'task_list_dialog.mode_toggle.all': 'Show only my tasks',
129
+ 'task_list_dialog.mode_toggle.user': 'Show all tasks',
130
+ 'task_list_dialog.user_login': 'User',
131
+ 'task_list_dialog.group_name': 'Receiving group',
132
+ 'task_list_dialog.comment': 'Comment',
133
+ 'task_list_dialog.empty': 'No taks'
134
+ }, 'en');
135
+
136
+ }());
@@ -8,6 +8,11 @@
8
8
  //= require scrivito_patches/cms_rest_api
9
9
  //= require scrivito_patches/obj_serializer
10
10
  //= require scrivito_patches/binary_utils
11
+ //= require fiona7/translations
12
+ //= require fiona7/templates
13
+ //= require fiona7/task_list_dialog
14
+ //= require fiona7/task_list_command
15
+ //= require fiona7/task_list_menu_item
11
16
  //= require_self
12
17
 
13
18
  (function() {
@@ -15,6 +20,10 @@
15
20
  var _ = window._;
16
21
  var $ = window.$;
17
22
 
23
+ scrivito.gui.on('open', function() {
24
+ scrivito.task_list_menu_item.init();
25
+ });
26
+
18
27
  var original_create_instance = scrivito.child_list_element.create_instance;
19
28
 
20
29
  /* patch the create page command to not create incomprehensible paths */
@@ -41,6 +50,7 @@
41
50
  icon: icon,
42
51
  color: 'green',
43
52
  accept_button_text: scrivito.t('commands.'+action+'_obj.dialog.confirm'),
53
+ allow_blank: true,
44
54
  accept_button_color: 'green'
45
55
  });
46
56
  };
@@ -102,116 +112,6 @@
102
112
  return deferred;
103
113
  };
104
114
 
105
- $.i18n().load({
106
- 'commands.release_obj.title': 'Seite freigeben',
107
- 'commands.release_obj.not_modified_obj': 'Diese Seite wurde nicht geändert. Daher gibt es nichts zu freigeben.',
108
- 'commands.release_obj.dialog.title': 'Änderungen an dieser Seite veröffentlichen?',
109
- 'commands.release_obj.dialog.description': 'Eine Arbeitsversion zu veröffentlichen ist endgültig. Dieser Vorgang kann nicht rückgängig gemacht werden.',
110
- 'commands.release_obj.dialog.placeholder': 'Bitte Kommentar eintragen',
111
- 'commands.release_obj.dialog.confirm': 'Freigeben',
112
- 'commands.release_obj.failed': 'Freigabe fehlgeschlagen',
113
-
114
- 'commands.edit_obj.title': 'Workflow starten',
115
- 'commands.edit_obj.dialog.title': 'Workflow starten?',
116
- 'commands.edit_obj.dialog.description': 'Es wird eine neue Arbeitsversion erstellt.',
117
- 'commands.edit_obj.dialog.placeholder': 'Bitte Kommentar eintragen',
118
- 'commands.edit_obj.dialog.confirm': 'Starten',
119
- 'commands.edit_obj.failed': 'Workflow fehlgeschlagen',
120
-
121
- 'commands.forward_obj.title': 'Seite weiterleiten',
122
- 'commands.forward_obj.dialog.title': 'Seite weiterleiten?',
123
- 'commands.forward_obj.dialog.description': 'Die Arbeitsversion wird an einen weiteren Bearbeiter weitergeleitet. Dieser Vorgang kann nicht rückgängig gemacht werden.',
124
- 'commands.forward_obj.dialog.placeholder': 'Bitte Kommentar eintragen',
125
- 'commands.forward_obj.dialog.confirm': 'Weiterleiten',
126
- 'commands.forward_obj.failed': 'Weiterleitung fehlgeschlagen',
127
-
128
- 'commands.reject_obj.title': 'Seite ablehnen',
129
- 'commands.reject_obj.dialog.title': 'Seite ablehnen?',
130
- 'commands.reject_obj.dialog.description': 'Die Arbeitsversion wird abgelehnt. Dieser Vorgang kann nicht rückgängig gemacht werden.',
131
- 'commands.reject_obj.dialog.placeholder': 'Bitte Kommentar eintragen',
132
- 'commands.reject_obj.dialog.confirm': 'Ablehnen',
133
- 'commands.reject_obj.failed': 'Ablehnung fehlgeschlagen',
134
-
135
- 'commands.sign_obj.title': 'Seite abzeichnen',
136
- 'commands.sign_obj.dialog.title': 'Seite abzeichnen?',
137
- 'commands.sign_obj.dialog.description': 'Die eingereichte Version wird abgezeichnet. Dieser Vorgang kann nicht rückgängig gemacht werden.',
138
- 'commands.sign_obj.dialog.placeholder': 'Bitte Kommentar eintragen',
139
- 'commands.sign_obj.dialog.confirm': 'Abzeichnen',
140
- 'commands.sign_obj.failed': 'Abzeichnung fehlgeschlagen',
141
-
142
- 'commands.commit_obj.title': 'Seite einreichen',
143
- 'commands.commit_obj.dialog.title': 'Seite einreichen?',
144
- 'commands.commit_obj.dialog.description': 'Die Arbeitsversion wird eingereicht. Dieser Vorgang kann nicht rückgängig gemacht werden.',
145
- 'commands.commit_obj.dialog.placeholder': 'Bitte Kommentar eintragen',
146
- 'commands.commit_obj.dialog.confirm': 'Einreichen',
147
- 'commands.commit_obj.failed': 'Einreichung fehlgeschlagen',
148
-
149
- 'commands.take_obj.title': 'Seite übernehmen',
150
- 'commands.take_obj.dialog.title': 'Seite übernehmen?',
151
- 'commands.take_obj.dialog.description': 'Die Arbeitsversion wird übernommen. Dieser Vorgang kann nicht rückgängig gemacht werden.',
152
- 'commands.take_obj.dialog.placeholder': 'Bitte Kommentar eintragen',
153
- 'commands.take_obj.dialog.confirm': 'Übernehmen',
154
- 'commands.take_obj.failed': 'Übernahme fehlgeschlagen',
155
-
156
- 'editing_disabled.workflow': 'Die Datei unterliegt einem Workflow und kann nicht direkt bearbeitet werden.',
157
- 'editing_disabled.permissions': 'Ihnen fehlen die Rechte um die Datei zu bearbeiten'
158
- }, 'de');
159
-
160
- $.i18n().load({
161
- 'commands.release_obj.title': 'Release page',
162
- 'commands.release_obj.not_modified_obj': 'This resource has not been modified. Therefore, nothing can be released.',
163
- 'commands.release_obj.dialog.title': 'Release this page?',
164
- 'commands.release_obj.dialog.description': 'Releasing an edited page is final. This operation cannot be reverted.',
165
- 'commands.release_obj.dialog.placeholder': 'Comment',
166
- 'commands.release_obj.dialog.confirm': 'Release',
167
- 'commands.release_obj.failed': 'Release failed',
168
-
169
- 'commands.edit_obj.title': 'Start a workflow',
170
- 'commands.edit_obj.dialog.title': 'Start a workflow for this page?',
171
- 'commands.edit_obj.dialog.description': 'A new version of this page will be created.',
172
- 'commands.edit_obj.dialog.placeholder': 'Comment',
173
- 'commands.edit_obj.dialog.confirm': 'Start a workflow',
174
- 'commands.edit_obj.failed': 'Workflow failed',
175
-
176
- 'commands.forward_obj.title': 'Forward page',
177
- 'commands.forward_obj.dialog.title': 'Forward this page?',
178
- 'commands.forward_obj.dialog.description': 'Forward and edited page is final. This operation cannot be reverted.',
179
- 'commands.forward_obj.dialog.placeholder': 'Comment',
180
- 'commands.forward_obj.dialog.confirm': 'Forward',
181
- 'commands.forward_obj.failed': 'Forward failed',
182
-
183
- 'commands.reject_obj.title': 'Reject page',
184
- 'commands.reject_obj.dialog.title': 'Reject this page?',
185
- 'commands.reject_obj.dialog.description': 'Current page will be rejected. This operation cannot be reverted.',
186
- 'commands.reject_obj.dialog.placeholder': 'Comment',
187
- 'commands.reject_obj.dialog.confirm': 'Reject',
188
- 'commands.reject_obj.failed': 'Reject failed',
189
-
190
- 'commands.sign_obj.title': 'Sign page',
191
- 'commands.sign_obj.dialog.title': 'Sign this page?',
192
- 'commands.sign_obj.dialog.description': 'Committed page will be signed. This operation cannot be reverted.',
193
- 'commands.sign_obj.dialog.placeholder': 'Comment',
194
- 'commands.sign_obj.dialog.confirm': 'Sign',
195
- 'commands.sign_obj.failed': 'Signing failed',
196
-
197
- 'commands.commit_obj.title': 'Commit page',
198
- 'commands.commit_obj.dialog.title': 'Commit this page?',
199
- 'commands.commit_obj.dialog.description': 'Die Arbeitsversion wird eingereicht. Dieser Vorgang kann nicht rückgängig gemacht werden.',
200
- 'commands.commit_obj.dialog.placeholder': 'Comment',
201
- 'commands.commit_obj.dialog.confirm': 'Commit',
202
- 'commands.commit_obj.failed': 'Commit failed',
203
-
204
- 'commands.take_obj.title': 'Take page',
205
- 'commands.take_obj.dialog.title': 'Tage this page?',
206
- 'commands.take_obj.dialog.description': 'Die Arbeitsversion wird übernommen. Dieser Vorgang kann nicht rückgängig gemacht werden.',
207
- 'commands.take_obj.dialog.placeholder': 'Comment',
208
- 'commands.take_obj.dialog.confirm': 'Take',
209
- 'commands.take_obj.failed': 'Take failed',
210
-
211
- 'editing_disabled.workflow': 'The current page belongs to a workflow and cannot be edited directly.',
212
- 'editing_disabled.permissions': 'You do not have the permissions required to edit this page.'
213
- }, 'en');
214
-
215
115
  var dialog_icons = {
216
116
  "edit": "&#xf03d;",
217
117
  "forward": "&#xf086;",
@@ -31,7 +31,10 @@
31
31
 
32
32
  for (k in objParams) {
33
33
  if (objParams.hasOwnProperty(k)) {
34
- result = scrivito.BinaryUtils.isFile(objParams[k]) || scrivito.BinaryUtils.isBlob(objParams[k]) || scrivito.BinaryUtils.isBlobWithName(objParams[k]);
34
+ result = objParams[k] && (scrivito.BinaryUtils.isFile(objParams[k]) ||
35
+ scrivito.BinaryUtils.isBlob(objParams[k]) ||
36
+ scrivito.BinaryUtils.isBlobWithName(objParams[k])
37
+ );
35
38
  if (result) {
36
39
  return result;
37
40
  }
@@ -69,7 +72,7 @@
69
72
  fd.append("obj[" + attr + "][" + w + "][" + widgetAttr + "]", widgetValue);
70
73
  } else if (scrivito.BinaryUtils.isBlobWithName(widgetValue)) {
71
74
  fd.append("obj[" + attr + "][" + w + "][" + widgetAttr + "]", widgetValue.blob_to_upload, widgetValue.filename);
72
- } else if (typeof value === 'object') {
75
+ } else if (value && typeof value === 'object') {
73
76
  // blob/copy rename
74
77
  for (l in widgetValue) {
75
78
  if (widgetValue.hasOwnProperty(l)) {
@@ -93,7 +96,7 @@
93
96
  fd.append("obj[" + attr + "]", value);
94
97
  } else if (scrivito.BinaryUtils.isBlobWithName(value)) {
95
98
  fd.append("obj[" + attr + "]", value.blob_to_upload, value.filename);
96
- } else if (typeof value === 'object') {
99
+ } else if (value && typeof value === 'object') {
97
100
  // blob/copy rename
98
101
  for (l in value) {
99
102
  if (value.hasOwnProperty(l)) {
@@ -6,7 +6,7 @@
6
6
  var message = undefined;
7
7
 
8
8
  // -- PATCH BEGINS HERE --
9
- if (typeof error === 'object' && error.message) {
9
+ if (error && typeof error === 'object' && error.message) {
10
10
  scrivito.alertDialog(error.message);
11
11
  } else {
12
12
  message = scrivito.t('ajax_error.communication');
@@ -115,7 +115,7 @@
115
115
  }
116
116
  } else if (scrivito.BinaryUtils.isFile(value) || scrivito.BinaryUtils.isBlob(value)) {
117
117
  return value;
118
- } else if (typeof value === 'object' && value.id_to_copy) {
118
+ } else if (value && typeof value === 'object' && value.id_to_copy) {
119
119
  return value;
120
120
  } else {
121
121
  invalidAttributeValue(value, name, 'A Binary.');
@@ -244,7 +244,7 @@
244
244
  }
245
245
 
246
246
  function isValidReference(value) {
247
- return _.isString(value) || value instanceof scrivito.BasicObj;
247
+ return _.isString(value) || _.isNumber(value) || value instanceof scrivito.BasicObj;
248
248
  }
249
249
 
250
250
  function isValidReferencelistValue(value) {
@@ -26,7 +26,7 @@
26
26
 
27
27
  // -- PATCH BEGINS HERE --
28
28
  isBlobWithName: function isBlobWithName(obj) {
29
- return typeof obj === 'object' && this.isBlob(obj.blob_to_upload);
29
+ return obj && typeof obj === 'object' && this.isBlob(obj.blob_to_upload);
30
30
  }
31
31
  };
32
32
  })();
@@ -230,7 +230,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
230
230
  // if params[k] is an array
231
231
  if (objParams[k].pop) {
232
232
  // file uploads require form data
233
- result = scrivito.BinaryUtils.isFile(objParams[k][1]) || scrivito.BinaryUtils.isBlob(objParams[k][1]) || scrivito.BinaryUtils.isBlobWithName(objParams[k][1]);
233
+ result = objParams[k][1] && (scrivito.BinaryUtils.isFile(objParams[k][1]) || scrivito.BinaryUtils.isBlob(objParams[k][1]) || scrivito.BinaryUtils.isBlobWithName(objParams[k][1]));
234
234
  if (result) {
235
235
  return result;
236
236
  }
@@ -290,7 +290,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
290
290
  var attr = _step2.value;
291
291
 
292
292
  // attr is a [type, value] pair
293
- if (typeof objParams[attr] === 'object' && objParams[attr].pop) {
293
+ if (objParams[attr] && typeof objParams[attr] === 'object' && objParams[attr].pop) {
294
294
  var _objParams$attr = _slicedToArray(objParams[attr], 2);
295
295
 
296
296
  var type = _objParams$attr[0];
@@ -309,7 +309,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
309
309
  } else if (scrivito.BinaryUtils.isBlobWithName(value)) {
310
310
  fd.append('params[obj][' + attr + '][]', type);
311
311
  fd.append('params[obj][' + attr + '][]', value.blob_to_upload, value.filename);
312
- } else if (typeof value === 'object') {
312
+ } else if (value && typeof value === 'object') {
313
313
  // blob/copy rename
314
314
  fd.append('params[obj][' + attr + '[]', type);
315
315
  var _iteratorNormalCompletion3 = true;
@@ -380,7 +380,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
380
380
  } else if (scrivito.BinaryUtils.isBlobWithName(widgetValue)) {
381
381
  fd.append('params[obj][' + attr + '][' + widgetId + '][' + widgetAttr + '][]', widgetAttrType);
382
382
  fd.append('params[obj][' + attr + '][' + widgetId + '][' + widgetAttr + '][]', widgetValue.blob_to_upload, widgetValue.filename);
383
- } else if (typeof widgetValue === 'object') {
383
+ } else if (widgetValue && typeof widgetValue === 'object') {
384
384
  // blob/copy rename
385
385
  fd.append('params[obj][' + attr + '][' + widgetId + '][' + widgetAttr + '][]', widgetAttrType);
386
386
  var _iteratorNormalCompletion6 = true;
@@ -126,7 +126,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== 'function'
126
126
  var path = typeof page.provided_path === 'function' && page.provided_path();
127
127
  if (path) {
128
128
  var blobName = undefined;
129
- if (typeof serializedAttributes.blob === 'object') {
129
+ if (serializedAttributes.blob && typeof serializedAttributes.blob === 'object') {
130
130
  blobName = serializedAttributes.blob.name || serializedAttributes.blob.filename;
131
131
  } else {
132
132
  blobName = undefined;
@@ -202,7 +202,7 @@
202
202
  var page = scrivito.application_document().page();
203
203
  var path = (typeof page.provided_path === 'function') && page.provided_path();
204
204
  var blobName;
205
- if (typeof serialized_attrs.blob === 'object') {
205
+ if (serialized_attrs.blob && typeof serialized_attrs.blob === 'object') {
206
206
  blobName = serialized_attrs.blob.name || serialized_attrs.blob.filename;
207
207
  }
208
208
  if (path) {
@@ -0,0 +1,30 @@
1
+ require 'fiona7/tasks/loader'
2
+
3
+ module Fiona7
4
+ class TasksController < ActionController::Base
5
+ def index
6
+ @details_view = self.details_view_lambda
7
+ @tasks = Fiona7::Tasks::Loader.new(self.user_name).call
8
+ end
9
+
10
+ protected
11
+ def user_name
12
+ if params[:mode] == 'user'
13
+ rsession.user_name
14
+ else
15
+ nil
16
+ end
17
+ end
18
+
19
+
20
+ def details_view_lambda
21
+ lambda do |obj|
22
+ begin
23
+ lookup_context.find(obj.details_view_path).present?
24
+ rescue ActionView::MissingTemplate
25
+ false
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -32,7 +32,6 @@ module Fiona7OverrideHelper
32
32
  tt = lambda {|action|
33
33
  I18n.t(:"fiona7.workflow.#{action}", locale: locale)
34
34
  }
35
- # TODO: add translation
36
35
  html = <<-EOHTML
37
36
  <div class="btn-group workflow dropdown">
38
37
  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
File without changes
@@ -0,0 +1,19 @@
1
+ module RailsConnector
2
+ class Task < AbstractModel
3
+ self.primary_key = "task_id"
4
+
5
+ def full_task_type
6
+ case task_type
7
+ when 'E'
8
+ 'edit'
9
+ when 'S'
10
+ 'sign'
11
+ end
12
+ end
13
+
14
+ def time_stamp_date
15
+ value = self.time_stamp
16
+ RailsConnector::DateAttribute.parse(value) unless value.nil?
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,20 @@
1
+ json.tasks @tasks do |task|
2
+ json.user_login task.user_login
3
+ json.group_name task.group_name
4
+ json.last_changed task.obj.last_changed.to_iso
5
+ json.id task.id
6
+ json.obj_id task.obj.id
7
+ json.comment task.comment
8
+
9
+ json.obj do
10
+ json.id task.obj.id
11
+ json.obj_class task.obj.obj_class
12
+ json.description_for_editor task.obj.description_for_editor
13
+ json.modification task.obj.modification
14
+ json.is_binary task.obj.binary?
15
+ json.has_children task.obj.children.any?
16
+ json.has_conflict task.obj.has_conflict?
17
+ json.has_details_view @details_view[task.obj]
18
+ json.parent_path task.obj.parent_path
19
+ end
20
+ end
@@ -0,0 +1,9 @@
1
+ de:
2
+ fiona7:
3
+ workspace:
4
+ rtc: 'Arbeitskopie'
5
+
6
+ en:
7
+ fiona7:
8
+ workspace:
9
+ rtc: 'Working copy'
@@ -24,6 +24,8 @@ Fiona7::Engine.routes.draw do
24
24
 
25
25
 
26
26
  get '/__scrivito/objs/:id/release/preview(.:format)', to: 'fiona7/release#preview', as: :fiona7_release_preview
27
+
28
+ get '/__scrivito/tasks', to: 'fiona7/tasks#index', as: :fiona7_tasks
27
29
  end
28
30
 
29
31
  Scrivito::SdkEngine.routes.draw do
@@ -15,11 +15,12 @@ Gem::Specification.new do |s|
15
15
  s.description = "scrivito-compatible interface for classic Fiona"
16
16
 
17
17
  s.files = Dir["{app,config,db,lib}/**/*", "Rakefile", "README.md", "infopark_fiona7.gemspec"].reject do |f|
18
- /^app\/assets.*\.es6\.js$/ =~ f
18
+ /^app\/assets.*\.es6\.js$/ =~ f ||
19
+ /^app\/assets.*\.hbs$/ =~ f
19
20
  end.sort
20
21
 
21
22
  s.add_dependency "rails", "~> 4.2.2"
22
- s.add_dependency "scrivito", "= 1.5.3"
23
+ s.add_dependency "scrivito", "= 1.5.4"
23
24
  s.add_dependency "scrivito_sdk"
24
25
  s.add_dependency "scrivito_editors"
25
26
  s.add_dependency "infopark_fiona_connector", "= 7.0.1.beta2"
@@ -5,7 +5,7 @@ module Fiona7
5
5
  class ReferencelistAsLinklist < AttributeWriter
6
6
  def call(value, claimed_type=nil)
7
7
  # FIXME: use a repository to improve performance
8
- ids = value || []
8
+ ids = (value || []).map(&:to_s)
9
9
  if ids.empty?
10
10
  self.obj.set(self.attr_name, [])
11
11
  else
@@ -5,7 +5,7 @@ module Fiona7
5
5
  module AttributeWriters
6
6
  class ReferencelistAsText < AttributeWriter
7
7
  def call(value, claimed_type=nil)
8
- ids = value || []
8
+ ids = (value || []).map(&:to_s)
9
9
  self.obj.set(self.attr_name, Helpers::JsonSerializer.new.call(ids))
10
10
  end
11
11
  end
@@ -55,6 +55,9 @@ require 'fiona7/scrivito_user'
55
55
 
56
56
  require 'fiona7/type_synchronizer'
57
57
 
58
+ require 'fiona7/tasks/task'
59
+ require 'fiona7/tasks/loader'
60
+
58
61
 
59
62
  require 'fiona7/naive_search_engine'
60
63
  require 'fiona7/verity_search_engine'
@@ -0,0 +1,17 @@
1
+ require 'fiona7/obj_class_name_mangler'
2
+
3
+ module Fiona7
4
+ class ForbiddenObjClasses
5
+ SYSTEM_CLASSES = ['X_Generic', 'X_Image', 'X_Container'].freeze
6
+
7
+ def call
8
+ # NOTE: to_s handles shadow classes properly
9
+ widget_classes = Scrivito.models.widgets.map(&:to_s)
10
+ widget_obj_classes = widget_classes.map do |obj_class|
11
+ Fiona7::ObjClassNameMangler.new(obj_class).mangle
12
+ end
13
+
14
+ SYSTEM_CLASSES + widget_obj_classes
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,54 @@
1
+ require 'fiona7/forbidden_obj_classes'
2
+ require 'fiona7/tasks/task'
3
+
4
+ module Fiona7
5
+ module Tasks
6
+ class Loader
7
+ def initialize(user_name=nil, forbidden_classes=Fiona7::ForbiddenObjClasses.new.call)
8
+ self.user_name = user_name
9
+ self.forbidden_classes = forbidden_classes
10
+ end
11
+
12
+ def call
13
+ raw_tasks = RailsConnector::Task.where(self.user_login_condition).joins(
14
+ "INNER JOIN #{Fiona7::EditedObj.table_name} objs ON objs.obj_id = #{RailsConnector::Task.table_name}.obj_id"
15
+ ).where(
16
+ "objs.obj_class NOT IN (?)", self.forbidden_classes
17
+ ).order("#{RailsConnector::Task.table_name}.time_stamp DESC")
18
+
19
+ objs = nil
20
+ Scrivito::Workspace.find('rtc').as_current do
21
+ objs = Hash[
22
+ Scrivito::BasicObj.find(raw_tasks.map(&:obj_id)).map {|obj|
23
+ [obj.id.to_i, obj]
24
+ }
25
+ ]
26
+ end
27
+
28
+ real_tasks = raw_tasks.map do |raw_task|
29
+ if obj = objs[raw_task.obj_id]
30
+ Fiona7::Tasks::Task.new(
31
+ raw_task.task_id, obj, raw_task.full_task_type,
32
+ raw_task.title, raw_task.user_login, raw_task.group_name,
33
+ raw_task.time_stamp_date, raw_task.task_comment
34
+ )
35
+ end
36
+ end
37
+
38
+ # NOTE: this will cause to hide tasks which do not have
39
+ # a valid scrivito obj assigned
40
+ real_tasks.compact
41
+ end
42
+
43
+ protected
44
+ attr_accessor :user_name, :forbidden_classes
45
+ def user_login_condition
46
+ if self.user_name
47
+ {user_login: self.user_name}
48
+ else
49
+ {}
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,6 @@
1
+ module Fiona7
2
+ module Tasks
3
+ class Task < Struct.new(:id, :obj, :type, :title, :user_login, :group_name, :timestamp, :comment)
4
+ end
5
+ end
6
+ end
@@ -139,7 +139,7 @@ module Fiona7
139
139
  if [:objClass, :obj_id, :permalink, :lastChanged, :name].include?(field)
140
140
  fields = [field.to_s]
141
141
  else
142
- fields = Fiona7::AttributeNamesFromQueries.new(field.to_s, @query).attributes || Fiona7::AttributeNamesFromCms.new(field.to_s).attributes || [field.to_s]
142
+ fields = (Fiona7::AttributeNamesFromQueries.new(field.to_s, @query).attributes || Fiona7::AttributeNamesFromCms.new(field.to_s).attributes).presence || [field.to_s]
143
143
  # NOTE: verity does not like more than 94 fields in its queries
144
144
  # so to be safe we limit the number of fields to 80
145
145
  fields = fields[0, 80]
@@ -1,3 +1,3 @@
1
1
  module Fiona7
2
- VERSION = "1.5.3.2.0"
2
+ VERSION = "1.5.4.3.0"
3
3
  end
@@ -5,60 +5,65 @@ require 'digest/sha1'
5
5
 
6
6
  module Fiona7
7
7
  class VersionHelper
8
- attr_reader :revision_id, :content_state_id, :base_revision_id, :base_content_state_id
8
+ attr_reader :workspace_id, :revision_id, :content_state_id, :base_revision_id, :base_content_state_id
9
9
  def initialize(workspace_id)
10
- @workspace_id = workspace_id.to_sym
11
- if @workspace_id == :published
12
- @revision_id =
13
- @content_state_id =
14
- @base_revision_id =
15
- @base_content_state_id = published_revision_id
10
+ self.workspace_id = workspace_id.to_sym
11
+
12
+ if self.workspace_id == :published
13
+ self.compute_for_published
16
14
  else
17
- @revision_id =
18
- @content_state_id = rtc_revision_id
19
- @base_revision_id =
20
- @base_content_state_id = "f" * 40 #published_revision_id
15
+ self.compute_for_rtc
21
16
  end
22
17
  end
23
18
 
24
19
  protected
25
- def published_revision_id
26
- return @published_revision_id if @published_revision_id
27
- klass = ReleasedObj
28
- # only one query executed
29
- query = ReleasedObj.select('max(last_changed), count(*)').to_sql
30
- last_changed, obj_count = *ReleasedObj.connection.execute(query).first
31
- revision_id = Digest::SHA1.hexdigest("published:#{last_changed}:#{obj_count}").sub(/^./, 'f')
32
- # tag the revision as published
33
- revision_id[0] = 'f'
20
+ attr_writer :workspace_id, :revision_id, :content_state_id, :base_revision_id, :base_content_state_id
21
+
22
+ def compute_for_published
23
+ # NOTE: with this implementation
24
+ #
25
+ # released content changed => revision change
26
+ #
27
+ # but not neccessarily
28
+ #
29
+ # revision change => released content changed
30
+ #
31
+ query = Fiona7::WriteObj.select('max(last_changed), count(*)').where('is_released = 1 AND is_edited = 0').to_sql
32
+ last_changed, obj_count = *Fiona7::WriteObj.connection.execute(query).first
34
33
 
35
- #begin
36
- # raise
37
- #rescue => e
38
- # Rails.logger.debug(e.backtrace.join("\n"))
39
- #end
34
+ # tag + padding + obj_count (hex) + last changed
35
+ revision_id = "f" + ('0' * 17) + ("%08x" % obj_count.to_i) + last_changed.to_s
40
36
 
41
- @published_revision_id = revision_id
37
+ @revision_id =
38
+ @content_state_id =
39
+ @base_revision_id =
40
+ @base_content_state_id = revision_id
42
41
  end
43
42
 
44
- def rtc_revision_id
45
- return @rtc_revision_id if @rtc_revision_id
46
- klass = EditedObj
43
+ def compute_for_rtc
44
+ first_query = Fiona7::WriteObj.select('1, count(*), max(last_changed), NULL').to_sql
45
+ second_query= Fiona7::WriteObj.select("obj_id, is_released, last_changed, attr_values").order("last_changed DESC").limit(23).to_sql
46
+ third_query = Fiona7::WriteObj.select('1, count(*), max(last_changed), NULL').where('is_released = 1 AND is_edited = 0').to_sql
47
+ union_query = "SELECT * FROM ( #{first_query} ) QUERY1 UNION ALL SELECT * FROM ( #{second_query} ) QUERY2 UNION ALL SELECT * FROM ( #{third_query} ) QUERY3"
47
48
 
48
- first_query = klass.select("obj_id, count(*), last_changed, attr_values").to_sql
49
- # NOTE: the hidden assumption here is that no more than 23 object have been changed in the last second
50
- second_query= klass.select("obj_id, is_released, last_changed, attr_values").order("last_changed DESC").limit(23).to_sql
51
- union_query = "SELECT * FROM ( #{first_query} ) QUERY1 UNION ALL SELECT * FROM ( #{second_query} ) QUERY2"
52
49
  # only one query executed
53
- results = EditedObj.connection.execute(union_query).to_a
54
- obj_count = results.shift[1]
55
- changed = results
50
+ results = Fiona7::WriteObj.connection.execute(union_query).to_a
51
+ _, obj_count, last_changed= *results.shift
52
+ _, pobj_count, plast_changed= *results.pop
53
+ changed_contents = results
54
+
55
+ content_digest = Digest::SHA1.hexdigest("#{changed_contents}")[0,17]
56
+
57
+ # tag + content digest + obj_count (hex) + last changed
58
+ rtc_version_id = "b" + content_digest + ("%08x" % obj_count.to_i) + last_changed.to_s
59
+ # tag + padding + obj_count (hex) + last changed
60
+ published_version_id = "f" + ('0' * 17) + ("%08x" % pobj_count.to_i) + plast_changed.to_s
56
61
 
57
- revision_id = Digest::SHA1.hexdigest("rtc:#{changed}:#{obj_count}")
62
+ @revision_id =
63
+ @content_state_id = rtc_version_id
58
64
 
59
- # tag the revision as edited/rtc
60
- revision_id[0] = 'b'
61
- @rtc_revision_id = revision_id
65
+ @base_revision_id =
66
+ @base_content_state_id = published_version_id
62
67
  end
63
68
 
64
69
  end
@@ -26,7 +26,8 @@ module Fiona7
26
26
 
27
27
  def title
28
28
  if self.id == :rtc
29
- 'Arbeitskopie'
29
+
30
+ self.localized_title
30
31
  else
31
32
  nil
32
33
  end
@@ -74,5 +75,11 @@ module Fiona7
74
75
 
75
76
  protected
76
77
  attr_reader :version_helper
78
+ def localized_title
79
+ locale = Scrivito::Configuration.ui_locale || I18n.locale
80
+ I18n.t(:"fiona7.workspace.rtc", locale: locale)
81
+ rescue
82
+ 'Arbeitskopie '
83
+ end
77
84
  end
78
85
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infopark_fiona7
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.3.2.0
4
+ version: 1.5.4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomasz Przedmojski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-23 00:00:00.000000000 Z
11
+ date: 2016-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 1.5.3
33
+ version: 1.5.4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 1.5.3
40
+ version: 1.5.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: scrivito_sdk
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -134,6 +134,11 @@ files:
134
134
  - app/assets/images/fiona7-logo.png
135
135
  - app/assets/images/fiona7-marker.png
136
136
  - app/assets/javascripts/fiona7.js
137
+ - app/assets/javascripts/fiona7/task_list_command.js
138
+ - app/assets/javascripts/fiona7/task_list_dialog.js
139
+ - app/assets/javascripts/fiona7/task_list_menu_item.js
140
+ - app/assets/javascripts/fiona7/templates.js
141
+ - app/assets/javascripts/fiona7/translations.js
137
142
  - app/assets/javascripts/fiona7_ui.js
138
143
  - app/assets/javascripts/scrivito_patches/ajax.js
139
144
  - app/assets/javascripts/scrivito_patches/ajax_error_handling.js
@@ -153,6 +158,7 @@ files:
153
158
  - app/controllers/fiona7/default_scrivito_cms_controller.rb
154
159
  - app/controllers/fiona7/release_controller.rb
155
160
  - app/controllers/fiona7/sessions_controller.rb
161
+ - app/controllers/fiona7/tasks_controller.rb
156
162
  - app/controllers/fiona7/workflow_controller.rb
157
163
  - app/controllers/fiona7_login_page_controller.rb
158
164
  - app/controllers/scrivito/cms_dispatch_controller.rb
@@ -164,12 +170,15 @@ files:
164
170
  - app/models/fiona7/edited_obj.rb
165
171
  - app/models/fiona7/internal_released_obj.rb
166
172
  - app/models/fiona7/released_obj.rb
173
+ - app/models/fiona7/task.rb
167
174
  - app/models/fiona7/write_obj.rb
168
175
  - app/models/fiona7_login_page.rb
176
+ - app/models/rails_connector/task.rb
169
177
  - app/models/x_container.rb
170
178
  - app/models/x_generic.rb
171
179
  - app/models/x_image.rb
172
180
  - app/views/fiona7/release/preview.html.erb
181
+ - app/views/fiona7/tasks/index.jbuilder
173
182
  - app/views/fiona7_login_page/index.html.erb
174
183
  - app/views/layouts/fiona7_login_page_layout.html.erb
175
184
  - app/views/scrivito/ui/index.html.erb
@@ -180,6 +189,7 @@ files:
180
189
  - config/locales/permissions.yml
181
190
  - config/locales/release.yml
182
191
  - config/locales/workflow.yml
192
+ - config/locales/workspace.yml
183
193
  - config/precedence_routes.rb
184
194
  - infopark_fiona7.gemspec
185
195
  - lib/fiona7/access_permission_check.rb
@@ -255,6 +265,7 @@ files:
255
265
  - lib/fiona7/facet_builder.rb
256
266
  - lib/fiona7/fiona_connector_patches/basic_obj.rb
257
267
  - lib/fiona7/fiona_connector_patches/cms_accessible.rb
268
+ - lib/fiona7/forbidden_obj_classes.rb
258
269
  - lib/fiona7/in_editable_view.rb
259
270
  - lib/fiona7/initializer.rb
260
271
  - lib/fiona7/json/obj_decorator.rb
@@ -311,6 +322,8 @@ files:
311
322
  - lib/fiona7/shadow_classes.rb
312
323
  - lib/fiona7/super_object_finder.rb
313
324
  - lib/fiona7/table_switcher.rb
325
+ - lib/fiona7/tasks/loader.rb
326
+ - lib/fiona7/tasks/task.rb
314
327
  - lib/fiona7/tools/attribute_remover.rb
315
328
  - lib/fiona7/type_loader.rb
316
329
  - lib/fiona7/type_register.rb