From 42c6abe49e0ef63bf51d60befc3ee395cafc480a Mon Sep 17 00:00:00 2001
From: Harry Bomrah <harry@rulingcom.com>
Date: Fri, 11 Jul 2014 21:08:15 +0800
Subject: [PATCH] removed book type and author type key and also some changes
 in the model

---
 app/models/book.rb                             | 2 ++
 app/models/book_author_type.rb                 | 1 -
 app/models/book_type.rb                        | 1 -
 app/views/admin/books/_author_type_qe.html.erb | 6 ------
 app/views/admin/books/_book_type_qe.html.erb   | 6 ------
 app/views/admin/books/_form.html.erb           | 4 ++--
 6 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/app/models/book.rb b/app/models/book.rb
index e3acc54..9cdd445 100644
--- a/app/models/book.rb
+++ b/app/models/book.rb
@@ -20,6 +20,8 @@ class Book
   field :publication_date, type: DateTime
   field :url, type: String
   field :note, type: String
+  field :rss2_id, type: String
+  field :co_authors, type: String
   
   paginates_per 10
 
diff --git a/app/models/book_author_type.rb b/app/models/book_author_type.rb
index 5086709..f1bc363 100644
--- a/app/models/book_author_type.rb
+++ b/app/models/book_author_type.rb
@@ -4,7 +4,6 @@ class BookAuthorType
   include Mongoid::Attributes::Dynamic
   include OrbitCoreLib::ObjectDisable
 
-  field :key, type: String
   field :title, type: String, localize: true
   	
   has_and_belongs_to_many :books
diff --git a/app/models/book_type.rb b/app/models/book_type.rb
index 08f7541..78bb90c 100644
--- a/app/models/book_type.rb
+++ b/app/models/book_type.rb
@@ -4,7 +4,6 @@ class BookType
   include Mongoid::Attributes::Dynamic
   include OrbitCoreLib::ObjectDisable
 
-  field :key, type: String
   field :title, type: String, localize: true
 
   has_many :books
diff --git a/app/views/admin/books/_author_type_qe.html.erb b/app/views/admin/books/_author_type_qe.html.erb
index d4f3eec..97f5463 100644
--- a/app/views/admin/books/_author_type_qe.html.erb
+++ b/app/views/admin/books/_author_type_qe.html.erb
@@ -6,12 +6,6 @@
                 <h3 id="myModalLabe2"><%= (@set_author_type.new_record? ? 'Add 作者型態' : 'Edit 作者型態') %></h3>
             </div>
             <div class="modal-body">
-			
-			<div class="control-group">
-				<label for="http" class="control-label">Key</label>
-				<div class="controls">
-				<%= f.text_field :key %>
-			</div>
 
 			<%= f.fields_for :title_translations do |f| %>
 				<% @site_in_use_locales.each do |locale| %>
diff --git a/app/views/admin/books/_book_type_qe.html.erb b/app/views/admin/books/_book_type_qe.html.erb
index 2eb73c0..82fefa3 100644
--- a/app/views/admin/books/_book_type_qe.html.erb
+++ b/app/views/admin/books/_book_type_qe.html.erb
@@ -7,12 +7,6 @@
                 <h3 id="myModalLabe1"><%= (@set_book_type.new_record? ? 'Add 類別' : 'Edit 類別') %></h3>
             </div>
             <div class="modal-body">
-			
-			<div class="control-group">
-				<label for="http" class="control-label">Key</label>
-				<div class="controls">
-				<%= f.text_field :key %>
-			</div>
 
 			<%= f.fields_for :title_translations do |f| %>
 				<% @site_in_use_locales.each do |locale| %>
diff --git a/app/views/admin/books/_form.html.erb b/app/views/admin/books/_form.html.erb
index ce923f6..20be761 100644
--- a/app/views/admin/books/_form.html.erb
+++ b/app/views/admin/books/_form.html.erb
@@ -126,8 +126,8 @@
       <div class="control-group">
         <label class="control-label muted"><%= t("personal_book.language") %></label>
         <div class="controls">
-			<%= f.radio_button :language, "Chinese" %> <%= t("personal_book.Chinese") %>
-			<%= f.radio_button :language, "English" %> <%= t("personal_book.English") %> 
+			<%= f.radio_button :language, "zh_tw" %> <%= t("personal_book.Chinese") %>
+			<%= f.radio_button :language, "en" %> <%= t("personal_book.English") %> 
         </div>
       </div>