aboutsummaryrefslogtreecommitdiff
path: root/app/views/exports
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2024-03-13 18:03:43 +0100
committerMiquel Sabaté Solà <msabate@suse.com>2024-03-13 18:03:43 +0100
commita7791635aa98f012d35f97c3c5288494bbb28e38 (patch)
treebad987e6b4d10ad2f7cd02e40658d464907595ee /app/views/exports
downloadoperum-a7791635aa98f012d35f97c3c5288494bbb28e38.tar.gz
operum-a7791635aa98f012d35f97c3c5288494bbb28e38.zip
Initial commit
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to 'app/views/exports')
-rw-r--r--app/views/exports/new.html.erb14
-rw-r--r--app/views/exports/show.csv.erb1
-rw-r--r--app/views/exports/show.uoc.erb7
3 files changed, 22 insertions, 0 deletions
diff --git a/app/views/exports/new.html.erb b/app/views/exports/new.html.erb
new file mode 100644
index 0000000..73481a7
--- /dev/null
+++ b/app/views/exports/new.html.erb
@@ -0,0 +1,14 @@
+<div class="notice"><b><%= I18n.t('searches.export.note') %></b>: <%= I18n.t('searches.export.note-msg') %>.</div>
+
+<div data-controller="export">
+ <div id="errors"></div>
+
+ <input type="hidden" data-export-target="id" value="<%= @search.id %>" />
+
+ <select id="export-select-format" data-action="export#change">
+ <option selected="selected" value="csv">CSV</option>
+ <option value="uoc">UOC</option>
+ </select>
+
+ <a id="export-format-button" class="button" href="#">Export</a>
+</div>
diff --git a/app/views/exports/show.csv.erb b/app/views/exports/show.csv.erb
new file mode 100644
index 0000000..43c7b82
--- /dev/null
+++ b/app/views/exports/show.csv.erb
@@ -0,0 +1 @@
+<%= CsvExporter.new(things: @results).export.html_safe %>
diff --git a/app/views/exports/show.uoc.erb b/app/views/exports/show.uoc.erb
new file mode 100644
index 0000000..b8f73b1
--- /dev/null
+++ b/app/views/exports/show.uoc.erb
@@ -0,0 +1,7 @@
+\chapter{<%= I18n.t('searches.export.chapter') %>}
+
+{\setlength{\parskip}{-0.3cm}
+
+<%= UocExporter.new(things: @results.order(:authors)).export %>
+
+}