trusty-cms 4.1.0 → 4.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -3
  3. data/Gemfile.lock +98 -98
  4. data/README.md +1 -1
  5. data/Rakefile +7 -7
  6. data/app/assets/javascripts/admin/assets.js +1 -1
  7. data/app/assets/javascripts/rad_social/rad_ajax_form.js +3 -0
  8. data/app/assets/javascripts/rad_social/rad_email.js +0 -1
  9. data/app/assets/javascripts/rad_social/rad_email_form.js +2 -7
  10. data/app/assets/stylesheets/admin/partials/_forms.scss +1 -1
  11. data/app/assets/stylesheets/admin/partials/_messages.scss +7 -2
  12. data/app/assets/stylesheets/admin/partials/_popup.scss +1 -1
  13. data/app/assets/stylesheets/rad_social/rad_screen.scss +0 -4
  14. data/app/controllers/admin/assets_controller.rb +21 -31
  15. data/app/controllers/admin/configuration_controller.rb +9 -11
  16. data/app/controllers/admin/extensions_controller.rb +3 -3
  17. data/app/controllers/admin/layouts_controller.rb +3 -4
  18. data/app/controllers/admin/page_attachments_controller.rb +5 -5
  19. data/app/controllers/admin/page_fields_controller.rb +3 -4
  20. data/app/controllers/admin/page_parts_controller.rb +4 -5
  21. data/app/controllers/admin/pages_controller.rb +55 -56
  22. data/app/controllers/admin/references_controller.rb +1 -1
  23. data/app/controllers/admin/resource_controller.rb +132 -130
  24. data/app/controllers/admin/sites_controller.rb +4 -4
  25. data/app/controllers/admin/snippets_controller.rb +3 -4
  26. data/app/controllers/admin/users_controller.rb +16 -16
  27. data/app/controllers/application_controller.rb +47 -48
  28. data/app/controllers/site_controller.rb +51 -48
  29. data/app/controllers/social_mailer_controller.rb +12 -22
  30. data/app/helpers/admin/configuration_helper.rb +19 -20
  31. data/app/helpers/admin/layouts_helper.rb +0 -1
  32. data/app/helpers/admin/node_helper.rb +27 -24
  33. data/app/helpers/admin/pages_helper.rb +2 -2
  34. data/app/helpers/admin/preferences_helper.rb +0 -1
  35. data/app/helpers/admin/references_helper.rb +9 -10
  36. data/app/helpers/admin/regions_helper.rb +3 -3
  37. data/app/helpers/application_helper.rb +32 -33
  38. data/app/helpers/rad_social_helper.rb +8 -11
  39. data/app/helpers/scoped_helper.rb +1 -3
  40. data/app/helpers/sites_helper.rb +4 -4
  41. data/app/mailers/devise_mailer.rb +3 -4
  42. data/app/mailers/rad_social_mailer.rb +8 -8
  43. data/app/models/asset.rb +62 -63
  44. data/app/models/asset_type.rb +38 -39
  45. data/app/models/deprecated_tags.rb +3 -4
  46. data/app/models/file_not_found_page.rb +1 -3
  47. data/app/models/haml_filter.rb +1 -1
  48. data/app/models/layout.rb +4 -5
  49. data/app/models/legacy_user.rb +2 -2
  50. data/app/models/menu_renderer.rb +16 -18
  51. data/app/models/page.rb +96 -93
  52. data/app/models/page_attachment.rb +1 -2
  53. data/app/models/page_context.rb +11 -12
  54. data/app/models/page_part.rb +3 -4
  55. data/app/models/rails_page.rb +10 -12
  56. data/app/models/site.rb +22 -21
  57. data/app/models/snippet.rb +6 -8
  58. data/app/models/snippet_finder.rb +3 -3
  59. data/app/models/snippet_tags.rb +4 -4
  60. data/app/models/standard_tags.rb +258 -252
  61. data/app/models/status.rb +8 -8
  62. data/app/models/trusty_cms/config.rb +25 -25
  63. data/app/models/trusty_cms/page_response_cache_director.rb +2 -3
  64. data/app/models/user.rb +15 -14
  65. data/app/models/user_action_observer.rb +3 -3
  66. data/app/views/admin/assets/edit.html.haml +0 -9
  67. data/app/views/admin/assets/new.html.haml +0 -3
  68. data/app/views/admin/assets/remove.html.haml +1 -1
  69. data/app/views/admin/layouts/remove.html.haml +4 -3
  70. data/app/views/admin/page_parts/_page_part.html.haml +1 -1
  71. data/app/views/admin/pages/remove.html.haml +2 -1
  72. data/app/views/admin/sites/index.haml +3 -1
  73. data/app/views/admin/snippets/remove.html.haml +5 -4
  74. data/app/views/admin/users/remove.html.haml +2 -2
  75. data/app/views/rad_social_mailer/social_mail_form.html.haml +1 -3
  76. data/app/views/widget/_email_form.html.haml +0 -5
  77. data/bin/rails +4 -4
  78. data/bin/trusty_cms +3 -5
  79. data/config.ru +1 -1
  80. data/config/application.rb +14 -15
  81. data/config/boot.rb +1 -2
  82. data/config/environment.rb +1 -1
  83. data/config/environments/production.rb +0 -1
  84. data/config/environments/test.rb +1 -2
  85. data/config/initializers/devise.rb +1 -1
  86. data/config/initializers/kraken.rb +2 -2
  87. data/config/initializers/tmp.rb +1 -1
  88. data/config/initializers/trusty_cms_config.rb +48 -48
  89. data/config/locales/en.yml +8 -8
  90. data/config/routes.rb +6 -7
  91. data/lib/active_record_extensions/active_record_extensions.rb +1 -2
  92. data/lib/annotatable.rb +3 -5
  93. data/lib/configuration_extensions/configuration_extensions.rb +1 -1
  94. data/lib/inheritable_class_attributes.rb +13 -9
  95. data/lib/login_system.rb +73 -73
  96. data/lib/method_observer.rb +13 -12
  97. data/lib/ostruct.rb +7 -10
  98. data/lib/simpleton.rb +0 -4
  99. data/lib/string_extensions/string_extensions.rb +3 -3
  100. data/lib/symbol_extensions/symbol_extensions.rb +1 -1
  101. data/lib/tasks/database.rake +28 -28
  102. data/lib/tasks/extensions.rake +18 -18
  103. data/lib/tasks/framework.rake +68 -68
  104. data/lib/tasks/radiant_config.rake +4 -4
  105. data/lib/tasks/snippets_extension_tasks.rake +11 -11
  106. data/lib/tasks/translate.rake +14 -14
  107. data/lib/tasks/upgrade_to_devise.rake +1 -1
  108. data/lib/translation_support.rb +22 -22
  109. data/lib/trusty_cms.rb +2 -2
  110. data/lib/trusty_cms/admin_ui.rb +19 -16
  111. data/lib/trusty_cms/admin_ui/region_partials.rb +4 -3
  112. data/lib/trusty_cms/admin_ui/region_set.rb +4 -5
  113. data/lib/trusty_cms/available_locales.rb +2 -4
  114. data/lib/trusty_cms/config/definition.rb +11 -8
  115. data/lib/trusty_cms/engine.rb +13 -14
  116. data/lib/trusty_cms/extension.rb +14 -16
  117. data/lib/trusty_cms/extension_loader.rb +6 -6
  118. data/lib/trusty_cms/extension_migrator.rb +42 -41
  119. data/lib/trusty_cms/extension_path.rb +20 -19
  120. data/lib/trusty_cms/initializer.rb +5 -8
  121. data/lib/trusty_cms/pagination/controller.rb +7 -10
  122. data/lib/trusty_cms/pagination/link_renderer.rb +2 -2
  123. data/lib/trusty_cms/resource_responses.rb +3 -3
  124. data/lib/trusty_cms/setup.rb +130 -132
  125. data/lib/trusty_cms/taggable.rb +19 -22
  126. data/lib/trusty_cms/task_support.rb +9 -6
  127. data/package.json +1 -1
  128. data/public/dispatch.fcgi +1 -1
  129. data/public/dispatch.rb +2 -2
  130. data/script/extension +1 -1
  131. data/script/rails +2 -2
  132. data/spec/dummy/package.json +1 -1
  133. data/spec/dummy/yarn.lock +3 -3
  134. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/core.js +126 -0
  135. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/index.js +4 -0
  136. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/map.js +56 -0
  137. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/seq.js +43 -0
  138. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/string.js +28 -0
  139. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/index.js +36 -0
  140. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/json.js +76 -0
  141. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/options.js +23 -0
  142. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/binary.js +87 -0
  143. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/index.js +157 -0
  144. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/omap.js +142 -0
  145. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/pairs.js +81 -0
  146. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/set.js +114 -0
  147. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/timestamp.js +97 -0
  148. data/spec/spec/dummy/node_modules/yaml/dist/tags/core.js +114 -0
  149. data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/index.js +17 -0
  150. data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/map.js +37 -0
  151. data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/seq.js +34 -0
  152. data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/string.js +40 -0
  153. data/spec/spec/dummy/node_modules/yaml/dist/tags/index.js +62 -0
  154. data/spec/spec/dummy/node_modules/yaml/dist/tags/json.js +60 -0
  155. data/spec/spec/dummy/node_modules/yaml/dist/tags/options.js +35 -0
  156. data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/binary.js +97 -0
  157. data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/index.js +131 -0
  158. data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/omap.js +105 -0
  159. data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/pairs.js +80 -0
  160. data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/set.js +91 -0
  161. data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/timestamp.js +93 -0
  162. data/trusty_cms.gemspec +25 -25
  163. data/vendor/extensions/clipped-extension/lib/clipped_admin_ui.rb +1 -1
  164. data/yarn.lock +7 -7
  165. metadata +7609 -105
  166. data/app/assets/javascripts/rad_social/captcha.js +0 -42
  167. data/app/views/admin/assets/refresh.html.haml +0 -14
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.YAMLOMap = void 0;
7
+
8
+ var _errors = require("../../errors");
9
+
10
+ var _toJSON = _interopRequireDefault(require("../../toJSON"));
11
+
12
+ var _Map = _interopRequireDefault(require("../../schema/Map"));
13
+
14
+ var _Pair = _interopRequireDefault(require("../../schema/Pair"));
15
+
16
+ var _Scalar = _interopRequireDefault(require("../../schema/Scalar"));
17
+
18
+ var _Seq = _interopRequireDefault(require("../../schema/Seq"));
19
+
20
+ var _pairs = require("./pairs");
21
+
22
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
+
24
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
25
+
26
+ class YAMLOMap extends _Seq.default {
27
+ constructor() {
28
+ super();
29
+
30
+ _defineProperty(this, "add", _Map.default.prototype.add.bind(this));
31
+
32
+ _defineProperty(this, "delete", _Map.default.prototype.delete.bind(this));
33
+
34
+ _defineProperty(this, "get", _Map.default.prototype.get.bind(this));
35
+
36
+ _defineProperty(this, "has", _Map.default.prototype.has.bind(this));
37
+
38
+ _defineProperty(this, "set", _Map.default.prototype.set.bind(this));
39
+
40
+ this.tag = YAMLOMap.tag;
41
+ }
42
+
43
+ toJSON(_, ctx) {
44
+ const map = new Map();
45
+ if (ctx && ctx.onCreate) ctx.onCreate(map);
46
+
47
+ for (const pair of this.items) {
48
+ let key, value;
49
+
50
+ if (pair instanceof _Pair.default) {
51
+ key = (0, _toJSON.default)(pair.key, '', ctx);
52
+ value = (0, _toJSON.default)(pair.value, key, ctx);
53
+ } else {
54
+ key = (0, _toJSON.default)(pair, '', ctx);
55
+ }
56
+
57
+ if (map.has(key)) throw new Error('Ordered maps must not include duplicate keys');
58
+ map.set(key, value);
59
+ }
60
+
61
+ return map;
62
+ }
63
+
64
+ }
65
+
66
+ exports.YAMLOMap = YAMLOMap;
67
+
68
+ _defineProperty(YAMLOMap, "tag", 'tag:yaml.org,2002:omap');
69
+
70
+ function parseOMap(doc, cst) {
71
+ const pairs = (0, _pairs.parsePairs)(doc, cst);
72
+ const seenKeys = [];
73
+
74
+ for (const {
75
+ key
76
+ } of pairs.items) {
77
+ if (key instanceof _Scalar.default) {
78
+ if (seenKeys.includes(key.value)) {
79
+ const msg = 'Ordered maps must not include duplicate keys';
80
+ throw new _errors.YAMLSemanticError(cst, msg);
81
+ } else {
82
+ seenKeys.push(key.value);
83
+ }
84
+ }
85
+ }
86
+
87
+ return Object.assign(new YAMLOMap(), pairs);
88
+ }
89
+
90
+ function createOMap(schema, iterable, ctx) {
91
+ const pairs = (0, _pairs.createPairs)(schema, iterable, ctx);
92
+ const omap = new YAMLOMap();
93
+ omap.items = pairs.items;
94
+ return omap;
95
+ }
96
+
97
+ var _default = {
98
+ identify: value => value instanceof Map,
99
+ nodeClass: YAMLOMap,
100
+ default: false,
101
+ tag: 'tag:yaml.org,2002:omap',
102
+ resolve: parseOMap,
103
+ createNode: createOMap
104
+ };
105
+ exports.default = _default;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.parsePairs = parsePairs;
7
+ exports.createPairs = createPairs;
8
+ exports.default = void 0;
9
+
10
+ var _errors = require("../../errors");
11
+
12
+ var _Map = _interopRequireDefault(require("../../schema/Map"));
13
+
14
+ var _Pair = _interopRequireDefault(require("../../schema/Pair"));
15
+
16
+ var _parseSeq = _interopRequireDefault(require("../../schema/parseSeq"));
17
+
18
+ var _Seq = _interopRequireDefault(require("../../schema/Seq"));
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ function parsePairs(doc, cst) {
23
+ const seq = (0, _parseSeq.default)(doc, cst);
24
+
25
+ for (let i = 0; i < seq.items.length; ++i) {
26
+ let item = seq.items[i];
27
+ if (item instanceof _Pair.default) continue;else if (item instanceof _Map.default) {
28
+ if (item.items.length > 1) {
29
+ const msg = 'Each pair must have its own sequence indicator';
30
+ throw new _errors.YAMLSemanticError(cst, msg);
31
+ }
32
+
33
+ const pair = item.items[0] || new _Pair.default();
34
+ if (item.commentBefore) pair.commentBefore = pair.commentBefore ? `${item.commentBefore}\n${pair.commentBefore}` : item.commentBefore;
35
+ if (item.comment) pair.comment = pair.comment ? `${item.comment}\n${pair.comment}` : item.comment;
36
+ item = pair;
37
+ }
38
+ seq.items[i] = item instanceof _Pair.default ? item : new _Pair.default(item);
39
+ }
40
+
41
+ return seq;
42
+ }
43
+
44
+ function createPairs(schema, iterable, ctx) {
45
+ const pairs = new _Seq.default(schema);
46
+ pairs.tag = 'tag:yaml.org,2002:pairs';
47
+
48
+ for (const it of iterable) {
49
+ let key, value;
50
+
51
+ if (Array.isArray(it)) {
52
+ if (it.length === 2) {
53
+ key = it[0];
54
+ value = it[1];
55
+ } else throw new TypeError(`Expected [key, value] tuple: ${it}`);
56
+ } else if (it && it instanceof Object) {
57
+ const keys = Object.keys(it);
58
+
59
+ if (keys.length === 1) {
60
+ key = keys[0];
61
+ value = it[key];
62
+ } else throw new TypeError(`Expected { key: value } tuple: ${it}`);
63
+ } else {
64
+ key = it;
65
+ }
66
+
67
+ const pair = schema.createPair(key, value, ctx);
68
+ pairs.items.push(pair);
69
+ }
70
+
71
+ return pairs;
72
+ }
73
+
74
+ var _default = {
75
+ default: false,
76
+ tag: 'tag:yaml.org,2002:pairs',
77
+ resolve: parsePairs,
78
+ createNode: createPairs
79
+ };
80
+ exports.default = _default;
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.YAMLSet = void 0;
7
+
8
+ var _errors = require("../../errors");
9
+
10
+ var _Map = _interopRequireWildcard(require("../../schema/Map"));
11
+
12
+ var _Pair = _interopRequireDefault(require("../../schema/Pair"));
13
+
14
+ var _parseMap = _interopRequireDefault(require("../../schema/parseMap"));
15
+
16
+ var _Scalar = _interopRequireDefault(require("../../schema/Scalar"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
21
+
22
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
24
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
25
+
26
+ class YAMLSet extends _Map.default {
27
+ constructor() {
28
+ super();
29
+ this.tag = YAMLSet.tag;
30
+ }
31
+
32
+ add(key) {
33
+ const pair = key instanceof _Pair.default ? key : new _Pair.default(key);
34
+ const prev = (0, _Map.findPair)(this.items, pair.key);
35
+ if (!prev) this.items.push(pair);
36
+ }
37
+
38
+ get(key, keepPair) {
39
+ const pair = (0, _Map.findPair)(this.items, key);
40
+ return !keepPair && pair instanceof _Pair.default ? pair.key instanceof _Scalar.default ? pair.key.value : pair.key : pair;
41
+ }
42
+
43
+ set(key, value) {
44
+ if (typeof value !== 'boolean') throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`);
45
+ const prev = (0, _Map.findPair)(this.items, key);
46
+
47
+ if (prev && !value) {
48
+ this.items.splice(this.items.indexOf(prev), 1);
49
+ } else if (!prev && value) {
50
+ this.items.push(new _Pair.default(key));
51
+ }
52
+ }
53
+
54
+ toJSON(_, ctx) {
55
+ return super.toJSON(_, ctx, Set);
56
+ }
57
+
58
+ toString(ctx, onComment, onChompKeep) {
59
+ if (!ctx) return JSON.stringify(this);
60
+ if (this.hasAllNullValues()) return super.toString(ctx, onComment, onChompKeep);else throw new Error('Set items must all have null values');
61
+ }
62
+
63
+ }
64
+
65
+ exports.YAMLSet = YAMLSet;
66
+
67
+ _defineProperty(YAMLSet, "tag", 'tag:yaml.org,2002:set');
68
+
69
+ function parseSet(doc, cst) {
70
+ const map = (0, _parseMap.default)(doc, cst);
71
+ if (!map.hasAllNullValues()) throw new _errors.YAMLSemanticError(cst, 'Set items must all have null values');
72
+ return Object.assign(new YAMLSet(), map);
73
+ }
74
+
75
+ function createSet(schema, iterable, ctx) {
76
+ const set = new YAMLSet();
77
+
78
+ for (const value of iterable) set.items.push(schema.createPair(value, null, ctx));
79
+
80
+ return set;
81
+ }
82
+
83
+ var _default = {
84
+ identify: value => value instanceof Set,
85
+ nodeClass: YAMLSet,
86
+ default: false,
87
+ tag: 'tag:yaml.org,2002:set',
88
+ resolve: parseSet,
89
+ createNode: createSet
90
+ };
91
+ exports.default = _default;
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.timestamp = exports.floatTime = exports.intTime = void 0;
7
+
8
+ var _stringify = require("../../stringify");
9
+
10
+ const parseSexagesimal = (sign, parts) => {
11
+ const n = parts.split(':').reduce((n, p) => n * 60 + Number(p), 0);
12
+ return sign === '-' ? -n : n;
13
+ }; // hhhh:mm:ss.sss
14
+
15
+
16
+ const stringifySexagesimal = ({
17
+ value
18
+ }) => {
19
+ if (isNaN(value) || !isFinite(value)) return (0, _stringify.stringifyNumber)(value);
20
+ let sign = '';
21
+
22
+ if (value < 0) {
23
+ sign = '-';
24
+ value = Math.abs(value);
25
+ }
26
+
27
+ const parts = [value % 60]; // seconds, including ms
28
+
29
+ if (value < 60) {
30
+ parts.unshift(0); // at least one : is required
31
+ } else {
32
+ value = Math.round((value - parts[0]) / 60);
33
+ parts.unshift(value % 60); // minutes
34
+
35
+ if (value >= 60) {
36
+ value = Math.round((value - parts[0]) / 60);
37
+ parts.unshift(value); // hours
38
+ }
39
+ }
40
+
41
+ return sign + parts.map(n => n < 10 ? '0' + String(n) : String(n)).join(':').replace(/000000\d*$/, '') // % 60 may introduce error
42
+ ;
43
+ };
44
+
45
+ const intTime = {
46
+ identify: value => typeof value === 'number',
47
+ default: true,
48
+ tag: 'tag:yaml.org,2002:int',
49
+ format: 'TIME',
50
+ test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,
51
+ resolve: (str, sign, parts) => parseSexagesimal(sign, parts.replace(/_/g, '')),
52
+ stringify: stringifySexagesimal
53
+ };
54
+ exports.intTime = intTime;
55
+ const floatTime = {
56
+ identify: value => typeof value === 'number',
57
+ default: true,
58
+ tag: 'tag:yaml.org,2002:float',
59
+ format: 'TIME',
60
+ test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,
61
+ resolve: (str, sign, parts) => parseSexagesimal(sign, parts.replace(/_/g, '')),
62
+ stringify: stringifySexagesimal
63
+ };
64
+ exports.floatTime = floatTime;
65
+ const timestamp = {
66
+ identify: value => value instanceof Date,
67
+ default: true,
68
+ tag: 'tag:yaml.org,2002:timestamp',
69
+ // If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part
70
+ // may be omitted altogether, resulting in a date format. In such a case, the time part is
71
+ // assumed to be 00:00:00Z (start of day, UTC).
72
+ test: RegExp('^(?:' + '([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})' + // YYYY-Mm-Dd
73
+ '(?:(?:t|T|[ \\t]+)' + // t | T | whitespace
74
+ '([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)' + // Hh:Mm:Ss(.ss)?
75
+ '(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?' + // Z | +5 | -03:30
76
+ ')?' + ')$'),
77
+ resolve: (str, year, month, day, hour, minute, second, millisec, tz) => {
78
+ if (millisec) millisec = (millisec + '00').substr(1, 3);
79
+ let date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec || 0);
80
+
81
+ if (tz && tz !== 'Z') {
82
+ let d = parseSexagesimal(tz[0], tz.slice(1));
83
+ if (Math.abs(d) < 30) d *= 60;
84
+ date -= 60000 * d;
85
+ }
86
+
87
+ return new Date(date);
88
+ },
89
+ stringify: ({
90
+ value
91
+ }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '')
92
+ };
93
+ exports.timestamp = timestamp;
@@ -1,26 +1,27 @@
1
1
  # -*- encoding: utf-8 -*-
2
+
2
3
  require File.expand_path(__FILE__ + '/../lib/trusty_cms.rb')
3
4
  Gem::Specification.new do |s|
4
- s.name = %q{trusty-cms}
5
+ s.name = 'trusty-cms'
5
6
  s.version = TrustyCms::VERSION
6
7
  s.platform = Gem::Platform::RUBY
7
8
 
8
- s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
9
- s.authors = ["TrustyCms CMS dev team"]
10
- s.description = %q{TrustyCms is a simple and powerful publishing system designed for small teams.
9
+ s.required_rubygems_version = Gem::Requirement.new('> 1.3.1') if s.respond_to? :required_rubygems_version=
10
+ s.authors = ['TrustyCms CMS dev team']
11
+ s.description = 'TrustyCms is a simple and powerful publishing system designed for small teams.
11
12
  It is built with Rails and is similar to Textpattern or MovableType, but is
12
- a general purpose content managment system--not merely a blogging engine.}
13
- s.email = %q{saalon@gmail.com}
14
- s.executables = ["trusty_cms"]
15
- s.extra_rdoc_files = ["README.md", "INSTALL.md", "LICENSE.md"]
16
- s.files = Dir['**/*','.gitignore', 'public/.htaccess', 'log/.keep', 'vendor/extensions/.keep']
17
- s.homepage = %q{https://github.com/pgharts/trusty-cms}
18
- s.rdoc_options = ["--title", "TrustyCms -- Content Management You Can Trust", "--line-numbers", "--main", "README", "--exclude", "app", "--exclude", "bin", "--exclude", "config", "--exclude", "db", "--exclude", "features", "--exclude", "lib", "--exclude", "log", "--exclude", "pkg", "--exclude", "public", "--exclude", "script", "--exclude", "spec", "--exclude", "test", "--exclude", "tmp", "--exclude", "vendor"]
19
- s.require_paths = ["lib"]
20
- s.rubygems_version = %q{1.3.7}
21
- s.summary = %q{A no-fluff content management system designed for small teams.}
22
- s.license = %q{MIT}
23
- s.test_files = Dir["spec/**/*"]
13
+ a general purpose content managment system--not merely a blogging engine.'
14
+ s.email = 'saalon@gmail.com'
15
+ s.executables = ['trusty_cms']
16
+ s.extra_rdoc_files = ['README.md', 'INSTALL.md', 'LICENSE.md']
17
+ s.files = Dir['**/*', '.gitignore', 'public/.htaccess', 'log/.keep', 'vendor/extensions/.keep']
18
+ s.homepage = 'https://github.com/pgharts/trusty-cms'
19
+ s.rdoc_options = ['--title', 'TrustyCms -- Content Management You Can Trust', '--line-numbers', '--main', 'README', '--exclude', 'app', '--exclude', 'bin', '--exclude', 'config', '--exclude', 'db', '--exclude', 'features', '--exclude', 'lib', '--exclude', 'log', '--exclude', 'pkg', '--exclude', 'public', '--exclude', 'script', '--exclude', 'spec', '--exclude', 'test', '--exclude', 'tmp', '--exclude', 'vendor']
20
+ s.require_paths = ['lib']
21
+ s.rubygems_version = '1.3.7'
22
+ s.summary = 'A no-fluff content management system designed for small teams.'
23
+ s.license = 'MIT'
24
+ s.test_files = Dir['spec/**/*']
24
25
 
25
26
  s.add_dependency 'acts_as_list', '>= 0.9.5', '< 1.1.0'
26
27
  s.add_dependency 'acts_as_tree', '>= 2.6.1', '< 2.9.0'
@@ -32,22 +33,21 @@ a general purpose content managment system--not merely a blogging engine.}
32
33
  s.add_dependency 'haml-rails', '~> 1.0.0'
33
34
  s.add_dependency 'highline', '>= 1.7.8', '< 2.1.0'
34
35
  s.add_dependency 'kraken-io'
35
- s.add_dependency 'mysql2'
36
36
  s.add_dependency 'mini_racer'
37
+ s.add_dependency 'mysql2'
37
38
  s.add_dependency 'paperclip', '> 5.2'
38
- s.add_dependency 'rack', '~> 2.0.1'
39
+ s.add_dependency 'rack', '>= 2.0.1', '< 2.3.0'
39
40
  s.add_dependency 'rack-cache', '~> 1.7'
40
- s.add_dependency 'rails'
41
- s.add_dependency 'rdoc', '>= 5.1', '< 7.0'
42
41
  s.add_dependency 'radius', '~> 0.7'
43
- s.add_dependency 'RedCloth', '4.3.2'
42
+ s.add_dependency 'rails'
44
43
  s.add_dependency 'rake', '< 13.0'
44
+ s.add_dependency 'rdoc', '>= 5.1', '< 7.0'
45
+ s.add_dependency 'RedCloth', '4.3.2'
45
46
  s.add_dependency 'roadie-rails'
46
47
  s.add_dependency 'sassc-rails'
47
48
  s.add_dependency 'stringex', '>= 2.7.1', '< 2.9.0'
48
- s.add_dependency 'tzinfo', '~> 1.2.3'
49
+ s.add_dependency 'tzinfo', '>= 1.2.3', '< 2.1.0'
49
50
  s.add_dependency 'uglifier', '>= 3.2', '< 5.0'
50
- s.add_dependency 'uuidtools', '~> 2.1.5'
51
- s.add_dependency 'will_paginate', '~> 3.0'
52
-
51
+ s.add_dependency 'uuidtools', '>= 2.1.5', '< 2.3.0'
52
+ s.add_dependency 'will_paginate', '~> 3.0'
53
53
  end
@@ -8,7 +8,7 @@ module ClippedAdminUI
8
8
  def load_default_asset_regions
9
9
  OpenStruct.new.tap do |asset|
10
10
  asset.edit = TrustyCms::AdminUI::RegionSet.new do |edit|
11
- edit.main.concat %w{edit_header edit_form edit_regenerate}
11
+ edit.main.concat %w{edit_header edit_form}
12
12
  edit.form.concat %w{edit_title edit_metadata}
13
13
  end
14
14
  asset.new = asset.edit