summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/generic_files/_form.html.haml7
-rw-r--r--app/views/generic_files/_form_core.html.haml7
-rw-r--r--app/views/generic_files/_index_core.html.haml14
-rw-r--r--app/views/generic_files/edit.html.haml3
-rw-r--r--app/views/generic_files/index.html.haml6
-rw-r--r--app/views/generic_files/new.html.haml3
-rw-r--r--app/views/generic_files/show.html.haml20
7 files changed, 60 insertions, 0 deletions
diff --git a/app/views/generic_files/_form.html.haml b/app/views/generic_files/_form.html.haml
new file mode 100644
index 0000000..8912daa
--- /dev/null
+++ b/app/views/generic_files/_form.html.haml
@@ -0,0 +1,7 @@
+= simple_form_for([@parent, @generic_file]) do |f|
+ = f.error_notification
+
+ = render "form_core", :f => f
+
+ .form-actions
+ = f.button :submit, conditional_t('generic_files.form.submit')
diff --git a/app/views/generic_files/_form_core.html.haml b/app/views/generic_files/_form_core.html.haml
new file mode 100644
index 0000000..b0e8889
--- /dev/null
+++ b/app/views/generic_files/_form_core.html.haml
@@ -0,0 +1,7 @@
+.inputs
+ - if @generic_file.new_record?
+ = f.input :file, :label => t('generic_files.form.file.label'), :hint => conditional_hint('generic_files.form.file.hint')
+ - else
+ = f.input :file_type, :label => t('generic_files.form.file_type.label'), :hint => conditional_hint('generic_files.form.file_type.hint'), :disabled => true
+ = f.input :name, :label => t('generic_files.form.name.label'), :hint => conditional_hint('generic_files.form.name.hint')
+ = f.input :category, :label => t('generic_files.form.category.label'), :collection => GenericFile::CATEGORIES, :hint => conditional_hint('generic_files.form.category.hint'), :include_blank => false
diff --git a/app/views/generic_files/_index_core.html.haml b/app/views/generic_files/_index_core.html.haml
new file mode 100644
index 0000000..5fa66f7
--- /dev/null
+++ b/app/views/generic_files/_index_core.html.haml
@@ -0,0 +1,14 @@
+%table.table.table-striped
+ %tr
+ %th= t('generic_files.index.category')
+ %th= t('generic_files.index.name')
+ %th= t('generic_files.index.file_type')
+
+ - for generic_file in generic_files
+ %tr
+ %td= generic_file.category
+ %td= generic_file.name
+ %td= generic_file.file_type
+
+
+ =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => generic_file.owner, :child => generic_file} \ No newline at end of file
diff --git a/app/views/generic_files/edit.html.haml b/app/views/generic_files/edit.html.haml
new file mode 100644
index 0000000..b59dd2b
--- /dev/null
+++ b/app/views/generic_files/edit.html.haml
@@ -0,0 +1,3 @@
+- content_for :title, t("generic_files.edit.page_title")
+
+= render "form" \ No newline at end of file
diff --git a/app/views/generic_files/index.html.haml b/app/views/generic_files/index.html.haml
new file mode 100644
index 0000000..b3c489e
--- /dev/null
+++ b/app/views/generic_files/index.html.haml
@@ -0,0 +1,6 @@
+- content_for :title, t("generic_files.index.page_title")
+
+- if @generic_files && @generic_files.count > 0
+ = render "index_core", :generic_files => @generic_files
+
+= render :partial => 'shared/create_link', :locals => {:parent => @parent, :child_class => GenericFile} \ No newline at end of file
diff --git a/app/views/generic_files/new.html.haml b/app/views/generic_files/new.html.haml
new file mode 100644
index 0000000..05af0da
--- /dev/null
+++ b/app/views/generic_files/new.html.haml
@@ -0,0 +1,3 @@
+- content_for :title, t("generic_files.new.page_title")
+
+= render "form" \ No newline at end of file
diff --git a/app/views/generic_files/show.html.haml b/app/views/generic_files/show.html.haml
new file mode 100644
index 0000000..b375dfc
--- /dev/null
+++ b/app/views/generic_files/show.html.haml
@@ -0,0 +1,20 @@
+- content_for :title, t("generic_files.show.page_title")
+
+%p
+ %strong= t('generic_files.show.category') + ":"
+ = @generic_file.category
+
+%p
+ %strong= t('generic_files.show.name') + ":"
+ = @generic_file.name
+
+%p
+ %strong= t('generic_files.show.file_type') + ":"
+ = @generic_file.file_type
+
+%p
+ %strong= t('generic_files.show.file_size') + ":"
+ = number_to_human_size(@generic_file.file_size)
+
+
+= render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @parent, :child => @generic_file } \ No newline at end of file