From 95a3831dce645c0258d6cd883b0a02a766647e22 Mon Sep 17 00:00:00 2001 From: Rueshyna Date: Tue, 20 Nov 2012 14:58:15 +0800 Subject: [PATCH 1/7] 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 7dd5c4b7..25754ea5 100644 --- a/app/controllers/desktop/journal_pages_controller.rb +++ b/app/controllers/desktop/journal_pages_controller.rb @@ -35,10 +35,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 a87f2d72..b1d905e8 100644 --- a/app/views/desktop/journal_pages/_form.html.erb +++ b/app/views/desktop/journal_pages/_form.html.erb @@ -7,21 +7,22 @@
Entry Year
-
    +
Language
@@ -136,23 +137,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"%> + +
  • + + +
    + +