card-mod-export 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +14 -0
  3. data/set/abstract/export.rb +31 -0
  4. metadata +75 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 47c8c5e149fc8d6cb8dcca50dcdeacc1c1b8b939635e704001cdd25ca807b056
4
+ data.tar.gz: 35d50175938f1c8abeebceedf6925893484d9f49386733977001a46456c8df53
5
+ SHA512:
6
+ metadata.gz: bae0892342edb0c8b26c1550f381a52614fa0d93b40099ef5243a1538d798e753beb2e9641aab1f37d276368d781a6f29c2b0bc7f2b0cca5ac00cebcf5d1de82
7
+ data.tar.gz: 624ea7642e8e6b7ddad488ed0cae2ccff20ee399f4c26edfe989f4155bd621529e4182bf7b1252d564b6ece1983cf096f85537df3b89900a4c5d4ba1264f5db3
data/README.md ADDED
@@ -0,0 +1,14 @@
1
+ <!--
2
+ # @title README - mod: export
3
+ -->
4
+
5
+ # Export mod
6
+
7
+ Supports adding export links to search cards.
8
+
9
+ NOTE: this mod does not provide any additional search mechanisms or views in export
10
+ formats; it's just for the links.
11
+
12
+ Employ by using `include_set Abstract::Export`. This will provide an `:export_links` view,
13
+ which will include export links for each format returned by `#export_formats` (which
14
+ defaults to `:csv` and `:json`).
@@ -0,0 +1,31 @@
1
+ format :html do
2
+ def export_formats
3
+ [:csv, :json]
4
+ end
5
+
6
+ view :export_links, cache: :never do
7
+ return "" if export_formats.blank?
8
+
9
+ wrap_with :div, class: "export-links py-3" do
10
+ "Export: #{export_format_links}"
11
+ end
12
+ end
13
+
14
+ view :filtered_results do
15
+ class_up "card-slot", "_filter-result-slot"
16
+
17
+ wrap { [render_core, render_export_links] }
18
+ end
19
+
20
+ def export_format_links
21
+ export_formats.map { |format| export_format_link format }.join " / "
22
+ end
23
+
24
+ def export_format_link format
25
+ link_to_card card, format, path: export_link_path(format)
26
+ end
27
+
28
+ def export_link_path format
29
+ { format: format }
30
+ end
31
+ end
metadata ADDED
@@ -0,0 +1,75 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: card-mod-export
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ platform: ruby
6
+ authors:
7
+ - Philipp Kühl
8
+ - Ethan McCutchen
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2021-10-26 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: card
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: card-mod-search
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ description: ''
43
+ email:
44
+ - info@decko.org
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - README.md
50
+ - set/abstract/export.rb
51
+ homepage: http://decko.org
52
+ licenses:
53
+ - GPL-3.0
54
+ metadata:
55
+ card-mod: export
56
+ post_install_message:
57
+ rdoc_options: []
58
+ require_paths:
59
+ - lib
60
+ required_ruby_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: '2.5'
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ requirements: []
71
+ rubygems_version: 3.2.28
72
+ signing_key:
73
+ specification_version: 4
74
+ summary: export
75
+ test_files: []