From 5006cd2f61c4b74fa63aec9e2991072f21066c6a Mon Sep 17 00:00:00 2001 From: Rueshyna Date: Tue, 20 Nov 2012 14:58:15 +0800 Subject: [PATCH] done add journals function --- .../desktop/journal_pages_controller.rb | 8 +-- .../desktop/journal_pages/_form.html.erb | 50 +++++++++++++++---- 2 files changed, 43 insertions(+), 15 deletions(-) diff --git a/app/controllers/desktop/journal_pages_controller.rb b/app/controllers/desktop/journal_pages_controller.rb index 34ae69b0..661ea1bb 100644 --- a/app/controllers/desktop/journal_pages_controller.rb +++ b/app/controllers/desktop/journal_pages_controller.rb @@ -36,10 +36,10 @@ class Desktop::JournalPagesController < ApplicationController def create if params[:commit].eql?"Save" - if not params[:writing_journal][:publication_date].nil? - params[:writing_journal][:publication_date] = \ - Date.new *(params[:writing_journal][:publication_date].split("/").map{|s| s.to_i}) - end + #if not params[:writing_journal][:publication_date].nil? + # params[:writing_journal][:publication_date] = \ + # Date.new *(params[:writing_journal][:publication_date].split("/").map{|s| s.to_i}) + #end params[:writing_journal][:create_user_id] = current_user.id diff --git a/app/views/desktop/journal_pages/_form.html.erb b/app/views/desktop/journal_pages/_form.html.erb index e321a717..019eb3a9 100644 --- a/app/views/desktop/journal_pages/_form.html.erb +++ b/app/views/desktop/journal_pages/_form.html.erb @@ -8,21 +8,22 @@
Entry Year
-
    +
Language
@@ -137,23 +138,50 @@ -
  • - <%= label_tag("", "Date of Publication", class: "s_grid_2 s_grid") %><%= f.text_field :publication_date, size: "20", value: "2012 / 05 / 01", class: "s_grid_4 s_grid"%> - + +
  • <%= f.text_field :keyword, size: "20", value: "Keywords", class: "s_grid_6 s_grid"%>
  • - <%= f.text_field :tag, size: "20", value: "Tag", class: "s_grid_6 s_grid"%> - +
    <%= f.label :year ,:class => "s_grid_2 s_grid" %>
    +
    <%= select_year((@writing_journal.year ? @writing_journal.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_journal[year]', :class => "s_grid_4 s_grid"} ) %>
  • - <%= label_tag("", "Full Text", class: "s_grid_2 s_grid") %> - <%= f.file_field :writing_journal_files, size: "20", class: "s_grid_4 s_grid"%> +
    <%= f.label :language ,:class => "s_grid_2 s_grid" %>
    + +
  • + +
  • + <%= f.text_field :tag, size: "20", value: "Tag", class: "s_grid_6 s_grid"%> + +
  • + + +
    + +