card 1.19.3 → 1.19.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/VERSION +1 -1
- data/card.gemspec +1 -3
- data/db/migrate_core_cards/20160914132636_fix_mod_files.rb +25 -0
- data/lib/card.rb +0 -2
- data/lib/card/content/diff.rb +3 -4
- data/lib/card/format/error.rb +1 -1
- data/mod/admin/set/self/admin.rb +2 -2
- data/mod/admin/set/self/trash.rb +9 -3
- data/mod/basic_types/set/type/html.rb +1 -1
- data/mod/bootstrap/set/all/bootstrap/layout.rb +58 -0
- data/mod/bootstrap/spec/set/all/bootstrap/layout_spec.rb +32 -0
- data/mod/carrierwave/lib/carrier_wave/cardmount.rb +0 -2
- data/mod/carrierwave/set/abstract/attachment/upload_cache.rb +2 -1
- data/mod/core/set/all/stages.rb +6 -4
- data/mod/history/lib/card/act.rb +8 -7
- data/mod/history/set/all/history.rb +10 -8
- data/mod/machines/set/abstract/script.rb +1 -1
- data/mod/machines/set/type/css.rb +1 -1
- data/mod/pointer/set/abstract/01_pointer.rb +1 -1
- data/mod/standard/file/credit_image/image-icon.png +0 -0
- data/mod/standard/file/credit_image/image-large.png +0 -0
- data/mod/standard/file/credit_image/image-medium.png +0 -0
- data/mod/standard/file/credit_image/image-small.png +0 -0
- data/mod/standard/file/favicon/image-icon.png +0 -0
- data/mod/standard/file/favicon/image-large.png +0 -0
- data/mod/standard/file/favicon/image-medium.png +0 -0
- data/mod/standard/file/favicon/image-small.png +0 -0
- data/mod/standard/file/logo/image-icon.png +0 -0
- data/mod/standard/file/logo/image-large.png +0 -0
- data/mod/standard/file/logo/image-medium.png +0 -0
- data/mod/standard/file/logo/image-small.png +0 -0
- data/mod/standard/set/self/recent.rb +2 -2
- data/spec/lib/card/diff_spec.rb +9 -9
- metadata +19 -156
- data/vendor/carrierwave/.gitignore +0 -19
- data/vendor/carrierwave/.rubocop.yml +0 -262
- data/vendor/carrierwave/.travis.yml +0 -58
- data/vendor/carrierwave/CHANGELOG.md +0 -81
- data/vendor/carrierwave/CONTRIBUTING.md +0 -37
- data/vendor/carrierwave/Gemfile +0 -5
- data/vendor/carrierwave/README.md +0 -995
- data/vendor/carrierwave/Rakefile +0 -26
- data/vendor/carrierwave/carrierwave.gemspec +0 -45
- data/vendor/carrierwave/cucumber.yml +0 -2
- data/vendor/carrierwave/features/caching.feature +0 -28
- data/vendor/carrierwave/features/download.feature +0 -20
- data/vendor/carrierwave/features/file_storage.feature +0 -37
- data/vendor/carrierwave/features/file_storage_overridden_filename.feature +0 -38
- data/vendor/carrierwave/features/file_storage_overridden_store_dir.feature +0 -38
- data/vendor/carrierwave/features/file_storage_reversing_processor.feature +0 -43
- data/vendor/carrierwave/features/fixtures/bork.txt +0 -1
- data/vendor/carrierwave/features/fixtures/monkey.txt +0 -1
- data/vendor/carrierwave/features/fixtures/upcased_bork.txt +0 -1
- data/vendor/carrierwave/features/mount_activerecord.feature +0 -46
- data/vendor/carrierwave/features/step_definitions/activerecord_steps.rb +0 -20
- data/vendor/carrierwave/features/step_definitions/caching_steps.rb +0 -12
- data/vendor/carrierwave/features/step_definitions/datamapper_steps.rb +0 -27
- data/vendor/carrierwave/features/step_definitions/download_steps.rb +0 -8
- data/vendor/carrierwave/features/step_definitions/file_steps.rb +0 -51
- data/vendor/carrierwave/features/step_definitions/general_steps.rb +0 -102
- data/vendor/carrierwave/features/step_definitions/mount_steps.rb +0 -17
- data/vendor/carrierwave/features/step_definitions/store_steps.rb +0 -16
- data/vendor/carrierwave/features/support/activerecord.rb +0 -18
- data/vendor/carrierwave/features/support/env.rb +0 -19
- data/vendor/carrierwave/features/versions_basics.feature +0 -50
- data/vendor/carrierwave/features/versions_caching_from_versions.feature +0 -32
- data/vendor/carrierwave/features/versions_nested_versions.feature +0 -70
- data/vendor/carrierwave/features/versions_overridden_filename.feature +0 -51
- data/vendor/carrierwave/features/versions_overriden_store_dir.feature +0 -41
- data/vendor/carrierwave/gemfiles/rails-4-0-stable.gemfile +0 -5
- data/vendor/carrierwave/gemfiles/rails-4-1-stable.gemfile +0 -5
- data/vendor/carrierwave/gemfiles/rails-4-2-stable.gemfile +0 -5
- data/vendor/carrierwave/gemfiles/rails-master.gemfile +0 -11
- data/vendor/carrierwave/lib/carrierwave.rb +0 -93
- data/vendor/carrierwave/lib/carrierwave/compatibility/paperclip.rb +0 -103
- data/vendor/carrierwave/lib/carrierwave/error.rb +0 -8
- data/vendor/carrierwave/lib/carrierwave/locale/cs.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/de.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/el.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/en.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/es.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/fr-CA.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/fr.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/id.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/ja.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/nb.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/nl.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/pl.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/pt-BR.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/pt-PT.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/ru.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/sk.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/tr.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/zh-CN.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/zh-TW.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/mount.rb +0 -444
- data/vendor/carrierwave/lib/carrierwave/mounter.rb +0 -163
- data/vendor/carrierwave/lib/carrierwave/orm/activerecord.rb +0 -103
- data/vendor/carrierwave/lib/carrierwave/processing.rb +0 -2
- data/vendor/carrierwave/lib/carrierwave/processing/mini_magick.rb +0 -328
- data/vendor/carrierwave/lib/carrierwave/processing/rmagick.rb +0 -379
- data/vendor/carrierwave/lib/carrierwave/sanitized_file.rb +0 -348
- data/vendor/carrierwave/lib/carrierwave/storage.rb +0 -2
- data/vendor/carrierwave/lib/carrierwave/storage/abstract.rb +0 -43
- data/vendor/carrierwave/lib/carrierwave/storage/file.rb +0 -118
- data/vendor/carrierwave/lib/carrierwave/storage/fog.rb +0 -462
- data/vendor/carrierwave/lib/carrierwave/test/matchers.rb +0 -394
- data/vendor/carrierwave/lib/carrierwave/uploader.rb +0 -67
- data/vendor/carrierwave/lib/carrierwave/uploader/cache.rb +0 -207
- data/vendor/carrierwave/lib/carrierwave/uploader/callbacks.rb +0 -33
- data/vendor/carrierwave/lib/carrierwave/uploader/configuration.rb +0 -203
- data/vendor/carrierwave/lib/carrierwave/uploader/content_type_blacklist.rb +0 -48
- data/vendor/carrierwave/lib/carrierwave/uploader/content_type_whitelist.rb +0 -48
- data/vendor/carrierwave/lib/carrierwave/uploader/default_url.rb +0 -17
- data/vendor/carrierwave/lib/carrierwave/uploader/download.rb +0 -92
- data/vendor/carrierwave/lib/carrierwave/uploader/extension_blacklist.rb +0 -51
- data/vendor/carrierwave/lib/carrierwave/uploader/extension_whitelist.rb +0 -51
- data/vendor/carrierwave/lib/carrierwave/uploader/file_size.rb +0 -41
- data/vendor/carrierwave/lib/carrierwave/uploader/magic_mime_blacklist.rb +0 -94
- data/vendor/carrierwave/lib/carrierwave/uploader/magic_mime_whitelist.rb +0 -94
- data/vendor/carrierwave/lib/carrierwave/uploader/mountable.rb +0 -38
- data/vendor/carrierwave/lib/carrierwave/uploader/processing.rb +0 -88
- data/vendor/carrierwave/lib/carrierwave/uploader/proxy.rb +0 -86
- data/vendor/carrierwave/lib/carrierwave/uploader/remove.rb +0 -21
- data/vendor/carrierwave/lib/carrierwave/uploader/serialization.rb +0 -28
- data/vendor/carrierwave/lib/carrierwave/uploader/store.rb +0 -93
- data/vendor/carrierwave/lib/carrierwave/uploader/url.rb +0 -41
- data/vendor/carrierwave/lib/carrierwave/uploader/versions.rb +0 -295
- data/vendor/carrierwave/lib/carrierwave/utilities.rb +0 -6
- data/vendor/carrierwave/lib/carrierwave/utilities/uri.rb +0 -21
- data/vendor/carrierwave/lib/carrierwave/validations/active_model.rb +0 -78
- data/vendor/carrierwave/lib/carrierwave/version.rb +0 -3
- data/vendor/carrierwave/lib/generators/templates/uploader.rb +0 -49
- data/vendor/carrierwave/lib/generators/uploader_generator.rb +0 -7
- data/vendor/carrierwave/script/console +0 -10
- data/vendor/carrierwave/script/destroy +0 -14
- data/vendor/carrierwave/script/generate +0 -14
- data/vendor/carrierwave/spec/compatibility/paperclip_spec.rb +0 -138
- data/vendor/carrierwave/spec/fixtures/Uppercase.jpg +0 -1
- data/vendor/carrierwave/spec/fixtures/bork.ttxt +0 -1
- data/vendor/carrierwave/spec/fixtures/bork.txt +0 -1
- data/vendor/carrierwave/spec/fixtures/bork.txtt +0 -1
- data/vendor/carrierwave/spec/fixtures/case.JPG +0 -1
- data/vendor/carrierwave/spec/fixtures/landscape.jpg +0 -0
- data/vendor/carrierwave/spec/fixtures/multi_page.pdf +0 -0
- data/vendor/carrierwave/spec/fixtures/new.jpeg +0 -1
- data/vendor/carrierwave/spec/fixtures/new.txt +0 -1
- data/vendor/carrierwave/spec/fixtures/old.jpeg +0 -1
- data/vendor/carrierwave/spec/fixtures/old.txt +0 -1
- data/vendor/carrierwave/spec/fixtures/portrait.jpg +0 -0
- data/vendor/carrierwave/spec/fixtures/ruby.gif +0 -0
- data/vendor/carrierwave/spec/fixtures/sponsored.doc +0 -1
- data/vendor/carrierwave/spec/fixtures/test+.jpg +0 -1
- data/vendor/carrierwave/spec/fixtures/test.jpeg +0 -1
- data/vendor/carrierwave/spec/fixtures/test.jpg +0 -1
- data/vendor/carrierwave/spec/generators/uploader_generator_spec.rb +0 -19
- data/vendor/carrierwave/spec/mount_multiple_spec.rb +0 -913
- data/vendor/carrierwave/spec/mount_single_spec.rb +0 -793
- data/vendor/carrierwave/spec/orm/activerecord_spec.rb +0 -1556
- data/vendor/carrierwave/spec/processing/mini_magick_spec.rb +0 -210
- data/vendor/carrierwave/spec/processing/rmagick_spec.rb +0 -250
- data/vendor/carrierwave/spec/sanitized_file_spec.rb +0 -805
- data/vendor/carrierwave/spec/spec_helper.rb +0 -105
- data/vendor/carrierwave/spec/storage/file_spec.rb +0 -82
- data/vendor/carrierwave/spec/storage/fog_credentials.rb +0 -46
- data/vendor/carrierwave/spec/storage/fog_helper.rb +0 -428
- data/vendor/carrierwave/spec/storage/fog_spec.rb +0 -48
- data/vendor/carrierwave/spec/support/activerecord.rb +0 -31
- data/vendor/carrierwave/spec/support/file_utils_helper.rb +0 -15
- data/vendor/carrierwave/spec/uploader/cache_spec.rb +0 -324
- data/vendor/carrierwave/spec/uploader/callback_spec.rb +0 -30
- data/vendor/carrierwave/spec/uploader/configuration_spec.rb +0 -133
- data/vendor/carrierwave/spec/uploader/content_type_blacklist_spec.rb +0 -61
- data/vendor/carrierwave/spec/uploader/content_type_whitelist_spec.rb +0 -63
- data/vendor/carrierwave/spec/uploader/default_url_spec.rb +0 -77
- data/vendor/carrierwave/spec/uploader/download_spec.rb +0 -204
- data/vendor/carrierwave/spec/uploader/extension_blacklist_spec.rb +0 -112
- data/vendor/carrierwave/spec/uploader/extension_whitelist_spec.rb +0 -102
- data/vendor/carrierwave/spec/uploader/file_size_spec.rb +0 -52
- data/vendor/carrierwave/spec/uploader/mountable_spec.rb +0 -26
- data/vendor/carrierwave/spec/uploader/overrides_spec.rb +0 -71
- data/vendor/carrierwave/spec/uploader/paths_spec.rb +0 -18
- data/vendor/carrierwave/spec/uploader/processing_spec.rb +0 -159
- data/vendor/carrierwave/spec/uploader/proxy_spec.rb +0 -79
- data/vendor/carrierwave/spec/uploader/remove_spec.rb +0 -71
- data/vendor/carrierwave/spec/uploader/store_spec.rb +0 -400
- data/vendor/carrierwave/spec/uploader/url_spec.rb +0 -273
- data/vendor/carrierwave/spec/uploader/versions_spec.rb +0 -633
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2438311a0c0d3270f1d65eb41fbe38914740135f
|
4
|
+
data.tar.gz: 75fa9bdbf0fd463f171b47875624bb96025b50c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bec0abeaa624791be2ba54a2709fd6c3d75f39b07c53f758e7464c75ede3573eb84c16c048be5f3843141f9e4d715d5744004f3009c6a935c370d405fd4f02fe
|
7
|
+
data.tar.gz: 49c9dcec44ea2e97f112e14c8e5f7c1b7281fb07445172c2b7b3eda79cba2ea67116dc1a32b133039387050674b4c6cf8b96087f700066126fafe3e8b36ac8bd
|
data/.yardopts
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.19.
|
1
|
+
1.19.4
|
data/card.gemspec
CHANGED
@@ -38,9 +38,7 @@ Gem::Specification.new do |s|
|
|
38
38
|
[
|
39
39
|
["smartname", "0.3.1"],
|
40
40
|
["uuid", "~> 2.3"],
|
41
|
-
|
42
|
-
# load it here as gem
|
43
|
-
# ["carrierwave", "<= 0.11.0"],
|
41
|
+
["carrierwave", "1.0.0.beta"],
|
44
42
|
["htmlentities", "~> 4.3"],
|
45
43
|
["mini_magick", "~> 4.2"],
|
46
44
|
# recaptcha 0.4.0 is last version that doesn't require ruby 2.0
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
class FixModFiles < Card::Migration::Core
|
4
|
+
def up
|
5
|
+
Card.search(type: "image").each do |card|
|
6
|
+
next unless card.coded?
|
7
|
+
next unless card.content.include?("05_standard") ||
|
8
|
+
card.content.include?("06_bootstrap")
|
9
|
+
new_content = card.content.sub("05_standard", "standard")
|
10
|
+
.sub("06_bootstrap", "bootstrap")
|
11
|
+
card.update_column :db_content, new_content
|
12
|
+
|
13
|
+
update_history card
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def update_history card
|
18
|
+
card.actions.each do |action|
|
19
|
+
next unless (content_change = action.change(:db_content))
|
20
|
+
new_value = content_change.value.gsub("05_standard", "standard")
|
21
|
+
.gsub("06_bootstrap", "bootstrap")
|
22
|
+
content_change.update_column :value, new_value
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/card.rb
CHANGED
data/lib/card/content/diff.rb
CHANGED
@@ -32,11 +32,10 @@ class Card
|
|
32
32
|
# :raw = escape html tags and compare everything
|
33
33
|
#
|
34
34
|
# summary: {length: <number> , joint: <string> }
|
35
|
-
|
36
35
|
def initialize old_version, new_version, opts={}
|
37
36
|
@result = Result.new opts[:summary]
|
38
37
|
if new_version
|
39
|
-
lcs_opts = lcs_opts_for_format opts[:
|
38
|
+
lcs_opts = lcs_opts_for_format opts[:diff_format]
|
40
39
|
LCS.new(lcs_opts).run(old_version, new_version, @result)
|
41
40
|
end
|
42
41
|
end
|
@@ -51,9 +50,9 @@ class Card
|
|
51
50
|
|
52
51
|
private
|
53
52
|
|
54
|
-
def lcs_opts_for_format
|
53
|
+
def lcs_opts_for_format diff_format
|
55
54
|
opts = {}
|
56
|
-
case
|
55
|
+
case diff_format
|
57
56
|
when :html
|
58
57
|
opts[:exclude] = /^</
|
59
58
|
when :text
|
data/lib/card/format/error.rb
CHANGED
@@ -9,7 +9,7 @@ class Card
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def debug_error e, view
|
12
|
-
Rails.logger.info "
|
12
|
+
Rails.logger.info "#{rendering_error e, view}:\n" \
|
13
13
|
"#{e.class} : #{e.message}"
|
14
14
|
debug = Card[:debugger]
|
15
15
|
raise e if debug && debug.content == "on"
|
data/mod/admin/set/self/admin.rb
CHANGED
@@ -51,11 +51,11 @@ format :html do
|
|
51
51
|
stats = [
|
52
52
|
{ title: "solid cache",
|
53
53
|
count: solid_cache_count, unit: " cards",
|
54
|
-
link_text: "clear cache",
|
54
|
+
link_text: "clear solid cache",
|
55
55
|
task: "clear_solid_cache" },
|
56
56
|
{ title: "machine cache",
|
57
57
|
count: machine_cache_count, unit: " cards",
|
58
|
-
link_text: "clear cache",
|
58
|
+
link_text: "clear machine cache",
|
59
59
|
task: "clear_machine_cache" }
|
60
60
|
]
|
61
61
|
return stats unless Card.config.view_cache
|
data/mod/admin/set/self/trash.rb
CHANGED
@@ -17,7 +17,7 @@ format :html do
|
|
17
17
|
card.name,
|
18
18
|
"#{time_ago_in_words(card.updated_at)} ago",
|
19
19
|
Card[card.updater_id].name,
|
20
|
-
restore_link(card)
|
20
|
+
"#{history_link(card)} | #{restore_link(card)}"
|
21
21
|
]
|
22
22
|
end
|
23
23
|
|
@@ -40,10 +40,16 @@ format :html do
|
|
40
40
|
content_tag :p, button
|
41
41
|
end
|
42
42
|
|
43
|
+
def history_link trashed_card
|
44
|
+
card_link trashed_card, path_opts: { view: :history, look_in_trash: true },
|
45
|
+
text: "history"
|
46
|
+
end
|
47
|
+
|
43
48
|
def restore_link trashed_card
|
44
49
|
before_delete = trashed_card.actions[-2]
|
45
|
-
link_path = path
|
46
|
-
|
50
|
+
link_path = path id: trashed_card.id, look_in_trash: true, action: :update,
|
51
|
+
view: :open, restore: trashed_card.id,
|
52
|
+
action_ids: [before_delete], success: { id: "~#{card.id}" }
|
47
53
|
link_to "restore", link_path, method: :post, rel: "nofollow",
|
48
54
|
remote: true, class: "slotter"
|
49
55
|
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
|
2
|
+
format :html do
|
3
|
+
# generate bootstrap column layout
|
4
|
+
# @example
|
5
|
+
# layout container: true, fluid: true, class: "hidden" do
|
6
|
+
# row 6, 6, class: "unicorn"
|
7
|
+
# column "horn",
|
8
|
+
# column "rainbow", class: "colorful"
|
9
|
+
# end
|
10
|
+
# end
|
11
|
+
# @example
|
12
|
+
# layout do
|
13
|
+
# row 3, 3, 4, 2, class: "unicorn" do
|
14
|
+
# [ "horn", "body", "tail", "rainbow"]
|
15
|
+
# end
|
16
|
+
# row 6, 6, ["unicorn", "rainbow"], class: "horn"
|
17
|
+
# end
|
18
|
+
def layout opts={}
|
19
|
+
@rows = "".html_safe
|
20
|
+
yield
|
21
|
+
opts.delete(:container) ? container(@rows, opts) : @rows
|
22
|
+
end
|
23
|
+
|
24
|
+
def container content, opts={}
|
25
|
+
add_class opts, opts.delete(:fluid) ? "container-fluid" : "container"
|
26
|
+
content_tag :div, content, opts
|
27
|
+
end
|
28
|
+
|
29
|
+
def row *args
|
30
|
+
opts, cols, @col_widths = process_row_args args
|
31
|
+
@rows ||= "".html_safe
|
32
|
+
@columns = "".html_safe
|
33
|
+
cols ||= yield
|
34
|
+
cols.each { |col_content| column(col_content) } if cols.is_a? Array
|
35
|
+
add_class opts, "row"
|
36
|
+
@rows << content_tag(:div, @columns, opts)
|
37
|
+
end
|
38
|
+
|
39
|
+
def process_row_args args
|
40
|
+
opts = args.last.is_a?(Hash) ? args.pop : {}
|
41
|
+
cols = args.last.is_a?(Array) && args.pop
|
42
|
+
[opts, cols, check_col_widths(args)]
|
43
|
+
end
|
44
|
+
|
45
|
+
def check_col_widths args
|
46
|
+
raise Error, "bad argument" unless args.all? { |a| a.is_a? Fixnum }
|
47
|
+
total_width = args.inject(0) { |a, e| a + e }
|
48
|
+
raise Error, "column widths must sum up to 12" unless total_width == 12
|
49
|
+
args
|
50
|
+
end
|
51
|
+
|
52
|
+
# default column width type is for medium devices (col-md-)
|
53
|
+
def column content, opts={}
|
54
|
+
@columns ||= "".html_safe
|
55
|
+
add_class opts, "col-md-#{@col_widths.shift}"
|
56
|
+
@columns << content_tag(:div, content.html_safe, opts)
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
describe Card::Set::All::Bootstrap::Layout do
|
2
|
+
describe "layout dsl" do
|
3
|
+
subject { Card["A"].format(:html) }
|
4
|
+
it "creates correct layout with column array" do
|
5
|
+
layout = subject.layout container: true, fluid: true do
|
6
|
+
subject.row 6, 4, 2, class: "six-times-six" do
|
7
|
+
["first column", "second column", "third column"]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
assert_view_select layout, 'div[class="container-fluid"]' do
|
11
|
+
assert_select 'div[class="six-times-six row"]' do
|
12
|
+
assert_select 'div[class="col-md-6"]', text: "first column"
|
13
|
+
assert_select 'div[class="col-md-4"]', text: "second column"
|
14
|
+
assert_select 'div[class="col-md-2"]', text: "third column"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
it "creates correct layout with column calls" do
|
20
|
+
layout = subject.layout do
|
21
|
+
subject.row 8, 4, class: "six-times-six" do
|
22
|
+
subject.column "first column"
|
23
|
+
subject.column "second column", class: "extra-class"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
assert_view_select layout, 'div[class="six-times-six row"]' do
|
27
|
+
assert_select 'div[class="col-md-8"]', text: "first column"
|
28
|
+
assert_select 'div[class="extra-class col-md-4"]', text: "second column"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -60,7 +60,8 @@ end
|
|
60
60
|
|
61
61
|
# used for uploads for new cards until the new card is created
|
62
62
|
def upload_cache_card
|
63
|
-
@upload_cache_card ||=
|
63
|
+
@upload_cache_card ||=
|
64
|
+
Card["new_#{attachment_name}".to_sym] || Card[:new_file]
|
64
65
|
end
|
65
66
|
|
66
67
|
def preliminary_upload?
|
data/mod/core/set/all/stages.rb
CHANGED
data/mod/history/lib/card/act.rb
CHANGED
@@ -53,16 +53,17 @@ class Card
|
|
53
53
|
# all actions that current user has permission to view
|
54
54
|
# @return [Array of Actions]
|
55
55
|
def all_viewable
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
"card_actions.
|
60
|
-
"cards.id is not null", # ditto
|
56
|
+
card_join = "JOIN cards ON cards.id = card_actions.card_id"
|
57
|
+
action_conditions = [
|
58
|
+
"card_acts.id = card_act_id",
|
59
|
+
"card_actions.card_id is not null",
|
61
60
|
"draft is not true",
|
62
|
-
|
61
|
+
Query::SqlStatement.new.permission_conditions("cards")
|
63
62
|
].compact.join " AND "
|
64
63
|
|
65
|
-
|
64
|
+
viewable_actions =
|
65
|
+
Action.joins(card_join).where(action_conditions).to_sql
|
66
|
+
where("card_id is not null AND EXISTS (#{viewable_actions})")
|
66
67
|
end
|
67
68
|
end
|
68
69
|
|
@@ -233,7 +233,7 @@ format :html do
|
|
233
233
|
end
|
234
234
|
|
235
235
|
view :act_header do |_args|
|
236
|
-
%(<h5
|
236
|
+
%(<h5 class="act-header">#{card_link card}</h5>)
|
237
237
|
end
|
238
238
|
|
239
239
|
view :act_metadata do |args|
|
@@ -283,10 +283,9 @@ format :html do
|
|
283
283
|
= glyphicon 'plus-sign', (action.green? ? 'added-mark' : 'diff-invisible')
|
284
284
|
= wrap_diff :name, name_diff
|
285
285
|
= wrap_diff :type, type_diff
|
286
|
-
-if content_diff
|
286
|
+
-if content_diff && action_view == :summary
|
287
287
|
= glyphicon 'arrow-right', 'arrow'
|
288
|
-
|
289
|
-
= wrap_diff :content, content_diff
|
288
|
+
= wrap_diff :content, content_diff
|
290
289
|
-if content_diff and action_view == :expanded
|
291
290
|
.expanded
|
292
291
|
= wrap_diff :content, content_diff
|
@@ -326,9 +325,12 @@ format :html do
|
|
326
325
|
end
|
327
326
|
|
328
327
|
def content_diff action, action_view, hide_diff
|
329
|
-
action.new_content? &&
|
330
|
-
|
331
|
-
|
328
|
+
diff = action.new_content? &&
|
329
|
+
action.card.format.render_content_changes(
|
330
|
+
action: action, diff_type: action_view, hide_diff: hide_diff
|
331
|
+
)
|
332
|
+
return "<i>empty</i>" unless diff.present?
|
333
|
+
diff
|
332
334
|
end
|
333
335
|
|
334
336
|
def wrap_diff field, content, extra_class=nil
|
@@ -412,7 +414,7 @@ format :html do
|
|
412
414
|
end
|
413
415
|
|
414
416
|
def diff_args
|
415
|
-
{
|
417
|
+
{ diff_format: :text }
|
416
418
|
end
|
417
419
|
|
418
420
|
def has_edits?
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -16,8 +16,8 @@ format :html do
|
|
16
16
|
acts = Act.all_viewable.order(id: :desc).page(page).per(ACTS_PER_PAGE)
|
17
17
|
acts.map do |act|
|
18
18
|
if (act_card = act.card)
|
19
|
-
|
20
|
-
format.render_act
|
19
|
+
act_view_args = args.merge(act: act, act_context: :absolute)
|
20
|
+
act_card.format(:html).render_act act_view_args
|
21
21
|
else
|
22
22
|
Rails.logger.info "bad data, act: #{act}"
|
23
23
|
""
|
data/spec/lib/card/diff_spec.rb
CHANGED
@@ -64,7 +64,7 @@ describe Card::Content::Diff do
|
|
64
64
|
|
65
65
|
describe "summary" do
|
66
66
|
before(:all) do
|
67
|
-
@opts = {
|
67
|
+
@opts = { diff_format: :html }
|
68
68
|
end
|
69
69
|
|
70
70
|
it "omits unchanged text" do
|
@@ -118,7 +118,7 @@ describe Card::Content::Diff do
|
|
118
118
|
it "removes html tags" do
|
119
119
|
a = "<a>A</a>"
|
120
120
|
b = "<b>B</b>"
|
121
|
-
expect(summary a, b,
|
121
|
+
expect(summary a, b, diff_format: :html).to eq(
|
122
122
|
"#{del 'A'}#{ins 'B'}"
|
123
123
|
)
|
124
124
|
end
|
@@ -126,7 +126,7 @@ describe Card::Content::Diff do
|
|
126
126
|
it "with html tags in raw format" do
|
127
127
|
a = "<a>1</a>"
|
128
128
|
b = "<b>1</b>"
|
129
|
-
expect(summary a, b,
|
129
|
+
expect(summary a, b, diff_format: :raw).to eq(
|
130
130
|
"#{del(tag 'a')}#{ins(tag 'b')}...#{del(tag '/a')}#{ins(tag '/b')}"
|
131
131
|
)
|
132
132
|
end
|
@@ -134,7 +134,7 @@ describe Card::Content::Diff do
|
|
134
134
|
|
135
135
|
context "html format" do
|
136
136
|
before(:all) do
|
137
|
-
@opts = {
|
137
|
+
@opts = { diff_format: :html }
|
138
138
|
end
|
139
139
|
|
140
140
|
it "doesn't change a text without changes" do
|
@@ -164,7 +164,7 @@ describe Card::Content::Diff do
|
|
164
164
|
|
165
165
|
context "text format" do
|
166
166
|
before(:all) do
|
167
|
-
@opts = {
|
167
|
+
@opts = { diff_format: :text }
|
168
168
|
end
|
169
169
|
|
170
170
|
it "removes html" do
|
@@ -172,19 +172,19 @@ describe Card::Content::Diff do
|
|
172
172
|
end
|
173
173
|
|
174
174
|
it "compares complete links" do
|
175
|
-
diff = Card::Content::Diff.complete("[[A]]\n[[B]]", "[[A]]\n[[C]]",
|
175
|
+
diff = Card::Content::Diff.complete("[[A]]\n[[B]]", "[[A]]\n[[C]]", diff_format: :html)
|
176
176
|
expect(diff).to eq("[[A]]\n#{del '[[B]]'}#{ins '[[C]]'}")
|
177
177
|
end
|
178
178
|
|
179
179
|
it "compares complete nests" do
|
180
|
-
diff = Card::Content::Diff.complete("{{A}}\n{{B}}", "{{A}}\n{{C}}",
|
180
|
+
diff = Card::Content::Diff.complete("{{A}}\n{{B}}", "{{A}}\n{{C}}", diff_format: :html)
|
181
181
|
expect(diff).to eq("{{A}}\n#{del '{{B}}'}#{ins '{{C}}'}")
|
182
182
|
end
|
183
183
|
end
|
184
184
|
|
185
185
|
context "raw format" do
|
186
186
|
before(:all) do
|
187
|
-
@opts = {
|
187
|
+
@opts = { diff_format: :raw }
|
188
188
|
end
|
189
189
|
|
190
190
|
it "excapes html" do
|
@@ -198,7 +198,7 @@ describe Card::Content::Diff do
|
|
198
198
|
|
199
199
|
context "pointer format" do
|
200
200
|
before(:all) do
|
201
|
-
@opts = {
|
201
|
+
@opts = { diff_format: :pointer }
|
202
202
|
end
|
203
203
|
|
204
204
|
it "removes square brackets" do
|