Updated databundle index and show pages UI. Still in draft
diff --git a/app/views/data_bundles/_form.html.slim b/app/views/data_bundles/_form.html.slim
index f9ed789..1a81cdf 100644
--- a/app/views/data_bundles/_form.html.slim
+++ b/app/views/data_bundles/_form.html.slim
@@ -1,8 +1,14 @@
-- if user_signed_in?
- = form_for @data_bundle, multipart: true do |f|
- .field
- = f.text_field :name
- .field
- = f.file_field :file
- .actions
- = f.submit 'Save', id: 'save_data_bundle'
+.box.box-primary
+ .box-header.with-border
+ h3.box-title New Databundle
+ = form_for @data_bundle, multipart: true, html: {role: 'form'} do |f|
+ .box-body
+ .form-group
+ label for="data_bundle_name" DataBundle name
+ = f.text_field :name, class: 'form-control'
+ .form-group
+ label for="data_bundle_file" File input
+ = f.file_field :file
+ /= f.remote_file_url
+ .box-footer
+ = f.submit 'Save', id: 'save_data_bundle', class: 'btn btn-primary'
diff --git a/app/views/data_bundles/index.html.slim b/app/views/data_bundles/index.html.slim
index 15f184a..56016e3 100644
--- a/app/views/data_bundles/index.html.slim
+++ b/app/views/data_bundles/index.html.slim
@@ -1,23 +1,30 @@
-h1 Listing data_bundles
+.row
+ - if user_signed_in?
+ .col-xs-6
+ .box
+ .box-header
+ h3.box-title Databundles
+ .box-body.table-responsive.no-padding
+ table.table.table-hover
+ tbody
+ tr
+ th Name
+ th Date
+ th Donwload
+ th Links
+ - @data_bundles.each do |data_bundle|
+ tr
+ td
+ = data_bundle.name
+ td
+ = data_bundle.created_at.strftime('%d-%m-%Y %H:%M')
+ td
+ = link_to data_bundle.file_identifier, data_bundle.file.url
+ td
+ = link_to 'Show', data_bundle
+ = link_to 'Edit', edit_data_bundle_path(data_bundle)
+ = link_to 'Destroy', data_bundle, data: {confirm: 'Are you sure?'}, method: :delete
+ .col-xs-5
+ = render partial: 'form'
+ - else
-table
- thead
- tr
- th File
- th User
- th
- th
- th
-
- tbody
- - @data_bundles.each do |data_bundle|
- tr
- td = data_bundle.name
- td = data_bundle.user_id
- td = link_to 'Show', data_bundle
- td = link_to 'Edit', edit_data_bundle_path(data_bundle)
- td = link_to 'Destroy', data_bundle, data: {:confirm => 'Are you sure?'}, :method => :delete
-
-br
-
-= render partial: 'form'
diff --git a/app/views/data_bundles/show.html.slim b/app/views/data_bundles/show.html.slim
index 307718d..b6c82b6 100644
--- a/app/views/data_bundles/show.html.slim
+++ b/app/views/data_bundles/show.html.slim
@@ -2,7 +2,10 @@
p
strong File:
- = @data_bundle.file
+ - unless @input_file_content.nil?
+ = @input_file_content
+ - unless @output_file_content.nil?
+ = @output_file_content
p
strong File:
= @data_bundle.name