diff --git a/app/controllers/personal_writings_controller.rb b/app/controllers/personal_writings_controller.rb
index 2f257be..735274a 100644
--- a/app/controllers/personal_writings_controller.rb
+++ b/app/controllers/personal_writings_controller.rb
@@ -4,8 +4,9 @@ class PersonalWritingsController < ApplicationController
writing_list = writings.collect do |writing|
{
"year" => writing.year,
+ "month" => writing.month,
"writing_title" => writing.writing_title,
- "location" => writing.location,
+ "other" => writing.other,
"member" => (writing.member_profile.name rescue ""),
"link_to_show" => OrbitHelper.url_to_show(writing.to_param)
}
@@ -15,8 +16,9 @@ class PersonalWritingsController < ApplicationController
"extras" => {
"widget-title" => t("module_name.personal_writing"),
"th_year" => t('personal_writing.year'),
+ "th_month" => t('personal_writing.month'),
"th_writing_title" => t('module_name.personal_writing'),
- "th_location" => t('personal_writing.location'),
+ "th_other" => t('personal_writing.other'),
"th_member" => t('users.name'),
"th_detail" => t('detail')
},
@@ -29,16 +31,10 @@ class PersonalWritingsController < ApplicationController
plugin = Writing.where(:is_hidden=>false).find_by(uid: params[:uid])
fields_to_show = [
"year",
+ "month",
"writing_title",
- "location",
- "participating_professor",
- "participating_student",
- "research_direction",
- "facility",
- "keywords",
- "extension_no",
+ "other",
"url",
- "note",
"file"
]
diff --git a/app/helpers/admin/personal_writings_helper.rb b/app/helpers/admin/personal_writings_helper.rb
index f21ec39..6bf3781 100644
--- a/app/helpers/admin/personal_writings_helper.rb
+++ b/app/helpers/admin/personal_writings_helper.rb
@@ -51,39 +51,13 @@ module Admin::PersonalWritingsHelper
rescue
value = {"zh_tw" => val}
end
- writing.location_translations = value
+ writing.other_translations = value
when 6
- value = {"en" => val}
- when 7
- begin
- value["zh_tw"] = val
- rescue
- value = {"zh_tw" => val}
- end
- writing.participating_professor_translations = value
- when 8
- value = {"en" => val}
- when 9
- begin
- value["zh_tw"] = val
- rescue
- value = {"zh_tw" => val}
- end
- writing.participating_student_translations = value
- when 10
writing.year = val
- when 11
- writing.extension_no = val
- when 12
- writing.research_direction = val
- when 13
- writing.facility = val
- when 14
+ when 7
+ writing.month = val
+ when 8
writing.url = val
- when 15
- writing.keywords = val
- when 16
- writing.note = val
end
end
writing.member_profile = mp
diff --git a/app/models/writing.rb b/app/models/writing.rb
index c568139..efba74b 100644
--- a/app/models/writing.rb
+++ b/app/models/writing.rb
@@ -3,22 +3,14 @@ class Writing
include Mongoid::Timestamps
include OrbitModel::Status
include Slug
-
+ include OrbitCategory::Categorizable
belongs_to :member_profile
field :writing_title, :as=>:slug_title, localize: true
- field :location, localize: true
- field :participating_professor, localize: true
- field :participating_student, localize: true
-
+ field :other, localize: true
+ field :month
field :year
- field :language
- field :keywords
- field :extension_no
- field :research_direction
- field :facility
field :url
- field :note
field :create_user_id, :type => BSON::ObjectId
field :update_user_id, :type => BSON::ObjectId
@@ -45,8 +37,10 @@ class Writing
fields_to_show = [
"year",
+ "month",
"writing_title",
- "location"
+ "other",
+ "url"
]
fields_to_remove = []
diff --git a/app/views/admin/writings/_form.html.erb b/app/views/admin/writings/_form.html.erb
index ff50bbc..23de51c 100644
--- a/app/views/admin/writings/_form.html.erb
+++ b/app/views/admin/writings/_form.html.erb
@@ -3,13 +3,14 @@
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
+
+
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/file-type" %>
<%= javascript_include_tag "lib/module-area" %>
<% end %>
-
@@ -231,11 +192,11 @@
$('.main-forms').find('.add-on').tooltip().end().on('click', '.trigger, .delete_file, .remove_existing_record', function() {
if($(this).hasClass('trigger')) {
var new_id = $(this).prev().attr('value');
- var old_id = new RegExp("new_lab_files", "g");
+ var old_id = new RegExp("new_writing_files", "g");
var on = $('.language-nav li.active').index();
var le = $(this).parent('.add-btn').prev('.add-target').children('.start-line').length;
$(this).prev().attr('value', parseInt(new_id) + 1);
- $(this).parent().siblings('.add-target').append(("<%= escape_javascript(add_attribute 'form_file', f, :lab_files) %>").replace(old_id, new_id));
+ $(this).parent().siblings('.add-target').append(("<%= escape_javascript(add_attribute 'form_file', f, :writing_files) %>").replace(old_id, new_id));
$(this).parent('.add-btn').prev('.add-target').children('.start-line').eq(le).children('.input-append').find('.tab-content').each(function() {
$(this).children('.tab-pane').eq(on).addClass('in active').siblings().removeClass('in active');
});
@@ -249,4 +210,18 @@
}
}
});
+ $(document).ready(function(){
+ $('.help_btn').click(function(){
+ $('#show_help_modal').modal('show');
+ return false;
+ });
+ $('#show_help_modal .close').off("click").on('click',function(){
+ $('#show_help_modal').modal('hide');
+ return false;
+ });
+ $('#show_help_modal .modal-footer button').off("click").on('click',function(){
+ $('#show_help_modal').modal('hide');
+ return false;
+ });
+ })
\ No newline at end of file
diff --git a/app/views/admin/writings/_writing.html.erb b/app/views/admin/writings/_writing.html.erb
index 2ccb3e7..38f9e2e 100644
--- a/app/views/admin/writings/_writing.html.erb
+++ b/app/views/admin/writings/_writing.html.erb
@@ -1,6 +1,8 @@
<% @writings.each do |writing| %>
">
+ <%= writing.category.title rescue "" %> |
<%= writing.year %> |
+ <%= writing.month %> |
<%= link_to writing.writing_title, OrbitHelper.url_to_plugin_show(writing.to_param,'personal_writing'), target: "blank"%>
@@ -10,7 +12,6 @@
|
- <%= writing.location %> |
<%= writing.member_profile.name rescue "" %> |
<% end %>
\ No newline at end of file
diff --git a/app/views/admin/writings/edit.html.erb b/app/views/admin/writings/edit.html.erb
index e893704..1033424 100644
--- a/app/views/admin/writings/edit.html.erb
+++ b/app/views/admin/writings/edit.html.erb
@@ -1,4 +1,4 @@
-<%= form_for @writing, url:'/admin/labs/'+@writing.id.to_s, html: {class: "form-horizontal main-forms previewable"} do |f| %>
+<%= form_for @writing, url:'/admin/writings/'+@writing.id.to_s, html: {class: "form-horizontal main-forms previewable"} do |f| %>
diff --git a/app/views/admin/writings/frontend_setting.html.erb b/app/views/admin/writings/frontend_setting.html.erb
index da2a886..9a78e9c 100644
--- a/app/views/admin/writings/frontend_setting.html.erb
+++ b/app/views/admin/writings/frontend_setting.html.erb
@@ -3,7 +3,7 @@
<%= stylesheet_link_tag "lib/main-list" %>
<% end %>
-<%= form_for(:lab_intro, :url => update_frontend_setting_admin_labs_path, :method => "post", html: {class: "form-horizontal main-forms previewable"} ) do |f| %>
+<%= form_for(:writing_intro, :url => update_frontend_setting_admin_writings_path, :method => "post", html: {class: "form-horizontal main-forms previewable"} ) do |f| %>