From 2bbd1365700c36a7849b2e67c0d8fcbc102c36f7 Mon Sep 17 00:00:00 2001 From: Eric Tsai Date: Wed, 5 Feb 2020 15:12:50 +0800 Subject: [PATCH] add :edit view --- app/views/admin/activities/_form.html.erb | 148 ++++++++++++++++++++++ app/views/admin/activities/edit.html.erb | 5 + 2 files changed, 153 insertions(+) create mode 100644 app/views/admin/activities/_form.html.erb create mode 100644 app/views/admin/activities/edit.html.erb diff --git a/app/views/admin/activities/_form.html.erb b/app/views/admin/activities/_form.html.erb new file mode 100644 index 0000000..068bcad --- /dev/null +++ b/app/views/admin/activities/_form.html.erb @@ -0,0 +1,148 @@ +<% # encoding: utf-8 %> +<% content_for :page_specific_css do %> + <%= stylesheet_link_tag "lib/main-forms" %> + <%= stylesheet_link_tag "lib/main-list" %> + <%= stylesheet_link_tag "lib/main-form-col2" %> +<% end %> +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "lib/module-area" %> + <%= javascript_include_tag "lib/bootstrap-datetimepicker.js" %> + <%= javascript_include_tag "lib/bootstrap-typeahead.js" %> + <%= javascript_include_tag "lib/datetimepicker/date.time.picker.js" %> + <%= javascript_include_tag "lib/datetimepicker/datetimepicker" %> +<% end %> + + +
+ + + + + + +
+ + <% @site_in_use_locales.each_with_index do |locale, i| %> + +
"> + + +
+ +
+ <%= f.fields_for :activity_name_translations do |f| %> + <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_activity.activity_name"), value: (@activity.activity_name_translations[locale] rescue nil) %> + <% end %> +
+
+ + +
+ +
+ <%= f.fields_for :activity_organizer_translations do |f| %> + <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_activity.activity_organizer"), value: (@activity.activity_organizer_translations[locale] rescue nil) %> + <% end %> +
+
+ + +
+ +
+ <%= f.fields_for :activity_area_translations do |f| %> + <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_activity.activity_area"), value: (@activity.activity_area_translations[locale] rescue nil) %> + <% end %> +
+
+
+ <% end %> +
+ + + + + + +
+ + +
+ + +
+ +
+ <%= select_year((@activity.year ? @activity.year.to_i : DateTime.now.year), {:start_year => (DateTime.now.year+5), :end_year => 1930}, {:name => 'activity[year]',:class => 'span1'} ) %> +
+
+ + +
+ +
+ <%= f.datetime_picker :publish_date, :no_label => true,:format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD", :value => @activity.activity_end_date, :new_record => @activity.new_record? %> +
+
+ + +
+ +
+ <%= f.datetime_picker :publication_date, :no_label => true,:format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD", :value => @activity.activity_end_date, :new_record => @activity.new_record? %> +
+
+ + +
+ +
+ <%= f.text_area :note, rows: 2, class: "ckeditor input-block-level" %> +
+
+ +
+ + +
+ + +
+ +
+ +
+
+ +
+
+ + + +
+ + +
+ + <%= f.submit t('submit'), class: 'btn btn-primary' %> + <%= link_to t('cancel'), get_go_back, :class=>"btn" %> +
diff --git a/app/views/admin/activities/edit.html.erb b/app/views/admin/activities/edit.html.erb new file mode 100644 index 0000000..2fa22d3 --- /dev/null +++ b/app/views/admin/activities/edit.html.erb @@ -0,0 +1,5 @@ +<%= form_for @activity, url: admin_book_path(@activity), html: { class: "form-horizontal main-forms previewable" } do |f| %> +
+ <%= render partial: 'form', locals: {f: f} %> +
+<% end %>