member plugin list add new

This commit is contained in:
unknown 2012-11-02 18:28:23 +08:00
parent 9110c3e716
commit 2f61b3e0c9
51 changed files with 426 additions and 403 deletions

View File

@ -179,12 +179,23 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
@writing_book = WritingBook.new(params[:writing_book]) @writing_book = WritingBook.new(params[:writing_book])
@writing_book.create_user_id = current_user.id if params[:writing_book][:user_id]
@writing_book.update_user_id = current_user.id @writing_book.create_user_id = params[:writing_book][:user_id]
@writing_book.update_user_id = params[:writing_book][:user_id]
else
@writing_book.create_user_id = current_user.id
@writing_book.update_user_id = current_user.id
end
respond_to do |format| respond_to do |format|
if @writing_book.save if @writing_book.save
format.html { redirect_to(panel_personal_book_back_end_writing_books_url) }
if params[:writing_book][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:writing_book][:user_id],:show_plugin_profile=>'Book')) }
else
format.html { redirect_to(panel_personal_book_back_end_writing_books_url) }
end
format.xml { render :xml => @writing_book, :status => :created, :location => @writing_book } format.xml { render :xml => @writing_book, :status => :created, :location => @writing_book }
else else
format.html { render :action => "new" } format.html { render :action => "new" }

View File

@ -32,8 +32,8 @@ class WritingBook
field :publication_date, :type => Date field :publication_date, :type => Date
field :url field :url
field :note field :note
field :create_user_id field :create_user_id, :type => BSON::ObjectId
field :update_user_id field :update_user_id, :type => BSON::ObjectId
# field :is_top, :type => Boolean, :default => false # field :is_top, :type => Boolean, :default => false
# field :is_hot, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false

View File

@ -48,6 +48,15 @@
<div id="post-body"> <div id="post-body">
<div id="post-body-content" class="clear"> <div id="post-body-content" class="clear">
<% if !params[:user_id].blank? %>
<div class="span6">
<%= t("著作人")%>
<%= User.from_id(params[:user_id]).name rescue ''%>
</div>
<% end %>
<div class="title"> <div class="title">
<%= f.label :year ,t("personal_book.year")%> <%= f.label :year ,t("personal_book.year")%>
<%= select_year((@writing_book.year ? @writing_book.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_book[year]'} ) %> <%= select_year((@writing_book.year ? @writing_book.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_book[year]'} ) %>
@ -218,6 +227,7 @@
<div class="form-actions"> <div class="form-actions">
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= f.submit t('submit'), :class=>'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div> </div>

View File

@ -50,6 +50,9 @@
</tbody> </tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_book_back_end_writing_book_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %>
<div class="form-actions form-fixed pagination-right"> <div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_book_plugin_writing_book_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_book_plugin_writing_book_path, :class => 'btn btn-primary pull-right' %>
<div id="writing_book_pagination" class="paginationFixed"> <div id="writing_book_pagination" class="paginationFixed">

View File

@ -2,7 +2,7 @@ module PersonalBook
OrbitApp.registration "Book",:type=> 'ModuleApp' do OrbitApp.registration "Book",:type=> 'ModuleApp' do
base_url File.expand_path File.dirname(__FILE__) base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/personal_book/plugin/profile" personal_plugin :enable => true,:path=>"panel/personal_book/plugin/profile",:i18n=>'admin.personal_book'
end end

View File

@ -83,12 +83,23 @@ class Panel::PersonalDiploma::BackEnd::DiplomasController < OrbitBackendControll
@diploma = Diploma.new(params[:diploma]) @diploma = Diploma.new(params[:diploma])
@diploma.create_user_id = current_user.id if params[:diploma][:user_id]
@diploma.update_user_id = current_user.id @diploma.create_user_id = params[:diploma][:user_id]
@diploma.update_user_id = params[:diploma][:user_id]
else
@diploma.create_user_id = current_user.id
@diploma.update_user_id = current_user.id
end
respond_to do |format| respond_to do |format|
if @diploma.save if @diploma.save
format.html { redirect_to(panel_personal_diploma_back_end_diplomas_url) }
if params[:diploma][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:diploma][:user_id],:show_plugin_profile=>'Diploma')) }
else
format.html { redirect_to(panel_personal_diploma_back_end_diplomas_url) }
end
format.xml { render :xml => @diploma, :status => :created, :location => @diploma } format.xml { render :xml => @diploma, :status => :created, :location => @diploma }
else else
format.html { render :action => "new" } format.html { render :action => "new" }

View File

@ -24,8 +24,8 @@ class Diploma
field :end_date , :type => Date field :end_date , :type => Date
field :url field :url
field :note field :note
field :create_user_id field :create_user_id, :type => BSON::ObjectId
field :update_user_id field :update_user_id, :type => BSON::ObjectId
# field :is_top, :type => Boolean, :default => false # field :is_top, :type => Boolean, :default => false
# field :is_hot, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false

View File

@ -31,6 +31,15 @@
<div id="post-body"> <div id="post-body">
<div id="post-body-content" class="clear"> <div id="post-body-content" class="clear">
<% if !params[:user_id].blank? %>
<div class="span6">
<%= t("著作人")%>
<%= User.from_id(params[:user_id]).name rescue ''%>
</div>
<% end %>
<div class="title"> <div class="title">
<%= f.label :start_date ,t("personal_diploma.start_date")%> <%= f.label :start_date ,t("personal_diploma.start_date")%>
<%= f.date_select :start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1890, :order => [:year, :month], :discard_day => true }, {:class => 'span1'} %> <%= f.date_select :start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1890, :order => [:year, :month], :discard_day => true }, {:class => 'span1'} %>
@ -121,6 +130,7 @@
<div class="form-actions"> <div class="form-actions">
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= f.submit t('submit'), :class=>'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div> </div>

View File

@ -50,6 +50,9 @@
</tbody> </tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_diploma_back_end_diploma_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %>
<div class="form-actions form-fixed pagination-right"> <div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_diploma_plugin_diploma_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_diploma_plugin_diploma_path, :class => 'btn btn-primary pull-right' %>
<div id="diploma_pagination" class="paginationFixed"> <div id="diploma_pagination" class="paginationFixed">

View File

@ -2,7 +2,7 @@ module PersonalDiploma
OrbitApp.registration "Diploma",:type=> 'ModuleApp' do OrbitApp.registration "Diploma",:type=> 'ModuleApp' do
base_url File.expand_path File.dirname(__FILE__) base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/personal_diploma/plugin/profile" personal_plugin :enable => true,:path=>"panel/personal_diploma/plugin/profile",:i18n=>'admin.personal_diploma'
end end

View File

@ -133,12 +133,23 @@ class Panel::PersonalExperience::BackEnd::ExperiencesController < OrbitBackendCo
@experience = Experience.new(params[:experience]) @experience = Experience.new(params[:experience])
@experience.create_user_id = current_user.id if params[:experience][:user_id]
@experience.update_user_id = current_user.id @experience.create_user_id = params[:experience][:user_id]
@experience.update_user_id = params[:experience][:user_id]
else
@experience.create_user_id = current_user.id
@experience.update_user_id = current_user.id
end
respond_to do |format| respond_to do |format|
if @experience.save if @experience.save
format.html { redirect_to(panel_personal_experience_back_end_experiences_url) }
if params[:experience][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:experience][:user_id],:show_plugin_profile=>'Experience')) }
else
format.html { redirect_to(panel_personal_experience_back_end_experiences_url) }
end
format.xml { render :xml => @experience, :status => :created, :location => @experience } format.xml { render :xml => @experience, :status => :created, :location => @experience }
else else
format.html { render :action => "new" } format.html { render :action => "new" }

View File

@ -24,8 +24,8 @@ class Experience
field :keywords field :keywords
field :url field :url
field :note field :note
field :create_user_id field :create_user_id, :type => BSON::ObjectId
field :update_user_id field :update_user_id, :type => BSON::ObjectId
# field :is_top, :type => Boolean, :default => false # field :is_top, :type => Boolean, :default => false
# field :is_hot, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false

View File

@ -31,6 +31,15 @@
<div id="post-body"> <div id="post-body">
<div id="post-body-content" class="clear"> <div id="post-body-content" class="clear">
<% if !params[:user_id].blank? %>
<div class="span6">
<%= t("著作人")%>
<%= User.from_id(params[:user_id]).name rescue ''%>
</div>
<% end %>
<div class="title"> <div class="title">
<%= f.label :experience_category ,t("personal_experience.experience_category")%> <%= f.label :experience_category ,t("personal_experience.experience_category")%>
<%= f.select :experience_category_id, @experience_categorys.collect {|t| [ t.title, t.id ]} %> <%= f.select :experience_category_id, @experience_categorys.collect {|t| [ t.title, t.id ]} %>
@ -118,6 +127,7 @@
<div class="form-actions"> <div class="form-actions">
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= f.submit t('submit'), :class=>'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div> </div>

View File

@ -51,6 +51,9 @@
</tbody> </tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_experience_back_end_experience_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %>
<div class="form-actions form-fixed pagination-right"> <div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_experience_plugin_experience_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_experience_plugin_experience_path, :class => 'btn btn-primary pull-right' %>
<div id="experience_pagination" class="paginationFixed"> <div id="experience_pagination" class="paginationFixed">

View File

@ -2,7 +2,7 @@ module PersonalExperience
OrbitApp.registration "Experience",:type=> 'ModuleApp' do OrbitApp.registration "Experience",:type=> 'ModuleApp' do
base_url File.expand_path File.dirname(__FILE__) base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/personal_experience/plugin/profile" personal_plugin :enable => true,:path=>"panel/personal_experience/plugin/profile",:i18n=>'admin.personal_experience'
end end

View File

@ -136,9 +136,23 @@ class Panel::PersonalHonor::BackEnd::HonorsController < OrbitBackendController
@honor.create_user_id = current_user.id @honor.create_user_id = current_user.id
@honor.update_user_id = current_user.id @honor.update_user_id = current_user.id
if params[:honor][:user_id]
@honor.create_user_id = params[:honor][:user_id]
@honor.update_user_id = params[:honor][:user_id]
else
@honor.create_user_id = current_user.id
@honor.update_user_id = current_user.id
end
respond_to do |format| respond_to do |format|
if @honor.save if @honor.save
format.html { redirect_to(panel_personal_honor_back_end_honors_url) }
if params[:honor][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:honor][:user_id],:show_plugin_profile=>'Honor')) }
else
format.html { redirect_to(panel_personal_honor_back_end_honors_url) }
end
format.xml { render :xml => @honor, :status => :created, :location => @honor } format.xml { render :xml => @honor, :status => :created, :location => @honor }
else else
format.html { render :action => "new" } format.html { render :action => "new" }

View File

@ -22,8 +22,8 @@ class Honor
field :keywords field :keywords
field :url field :url
field :note field :note
field :create_user_id field :create_user_id, :type => BSON::ObjectId
field :update_user_id field :update_user_id, :type => BSON::ObjectId
# field :is_top, :type => Boolean, :default => false # field :is_top, :type => Boolean, :default => false
# field :is_hot, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false

View File

@ -31,6 +31,15 @@
<div id="post-body"> <div id="post-body">
<div id="post-body-content" class="clear"> <div id="post-body-content" class="clear">
<% if !params[:user_id].blank? %>
<div class="span6">
<%= t("著作人")%>
<%= User.from_id(params[:user_id]).name rescue ''%>
</div>
<% end %>
<div class="title"> <div class="title">
<%= f.label :year ,t("personal_honor.year")%> <%= f.label :year ,t("personal_honor.year")%>
<%= select_year((@honor.year ? @honor.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'honor[year]'} ) %> <%= select_year((@honor.year ? @honor.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'honor[year]'} ) %>
@ -81,6 +90,7 @@
<div class="form-actions"> <div class="form-actions">
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= f.submit t('submit'), :class=>'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div> </div>

View File

@ -51,6 +51,9 @@
</tbody> </tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_honor_back_end_honor_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %>
<div class="form-actions form-fixed pagination-right"> <div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_honor_plugin_honor_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_honor_plugin_honor_path, :class => 'btn btn-primary pull-right' %>
<div id="honor_pagination" class="paginationFixed"> <div id="honor_pagination" class="paginationFixed">

View File

@ -2,7 +2,7 @@ module PersonalHonor
OrbitApp.registration "Honor",:type=> 'ModuleApp' do OrbitApp.registration "Honor",:type=> 'ModuleApp' do
base_url File.expand_path File.dirname(__FILE__) base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/personal_honor/plugin/profile" personal_plugin :enable => true,:path=>"panel/personal_honor/plugin/profile",:i18n=>'admin.personal_honor'
end end

View File

@ -217,13 +217,25 @@ class Panel::PersonalJournal::BackEnd::WritingJournalsController < OrbitBackendC
@writing_journal = WritingJournal.new(params[:writing_journal]) @writing_journal = WritingJournal.new(params[:writing_journal])
@writing_journal.create_user_id = current_user.id if params[:writing_journal][:user_id]
@writing_journal.update_user_id = current_user.id @writing_journal.create_user_id = params[:writing_journal][:user_id]
@writing_journal.update_user_id = params[:writing_journal][:user_id]
else
@writing_journal.create_user_id = current_user.id
@writing_journal.update_user_id = current_user.id
end
respond_to do |format| respond_to do |format|
if @writing_journal.save if @writing_journal.save
format.html { redirect_to(panel_personal_journal_back_end_writing_journals_url) }
format.xml { render :xml => @writing_journal, :status => :created, :location => @writing_journal } if params[:writing_journal][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:writing_journal][:user_id],:show_plugin_profile=>Journal)) }
else
format.html { redirect_to(panel_personal_journal_back_end_writing_journals_url) }
end
format.xml { render :xml => @writing_journal, :status => :created, :location => @writing_journal }
else else
format.html { render :action => "new" } format.html { render :action => "new" }
format.xml { render :xml => @writing_journal.errors, :status => :unprocessable_entity } format.xml { render :xml => @writing_journal.errors, :status => :unprocessable_entity }

View File

@ -26,15 +26,16 @@ class WritingJournal
field :isbn field :isbn
field :vol_no field :vol_no
field :issue_no field :issue_no
field :form_to field :form_to_start
field :form_to_end
field :total_pages field :total_pages
field :keywords field :keywords
field :abstract field :abstract
field :publication_date, :type => Date field :publication_date, :type => Date
field :url field :url
field :note field :note
field :create_user_id field :create_user_id, :type => BSON::ObjectId
field :update_user_id field :update_user_id, :type => BSON::ObjectId
# field :is_top, :type => Boolean, :default => false # field :is_top, :type => Boolean, :default => false
# field :is_hot, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false

View File

@ -26,38 +26,6 @@
</div> </div>
</div> </div>
<div id="widget-tags" class="widget-box widget-size-300">
<div class="widget-action clear">
<a class="action"><i title="Setting" class="icon-cog icon-white tip"></i></a>
</div>
<h3 class="widget-title"><i class="icons-tag icons-white"></i><%= f.label :level_type ,t("personal_journal.level_type")%></h3>
<div class="widget-content clear form-horizontal">
<% @level_types.each do |level_type| %>
<%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'writing_journal[journal_level_type_ids][]', level_type.id, @writing_journal.journal_level_type_ids.include?(level_type.id)%>
<%= level_type.title %>
<%= hidden_field_tag 'writing_journal[journal_level_type_ids][]', '' %>
<% end %>
<% end %>
</div>
</div>
<div id="widget-tags" class="widget-box widget-size-300">
<div class="widget-action clear">
<a class="action"><i title="Setting" class="icon-cog icon-white tip"></i></a>
</div>
<h3 class="widget-title"><i class="icons-tag icons-white"></i><%= f.label :author_type ,t("personal_journal.author_type")%></h3>
<div class="widget-content clear form-horizontal">
<% @author_types.each do |author_type| %>
<%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'writing_journal[journal_author_type_ids][]', author_type.id, @writing_journal.journal_author_type_ids.include?(author_type.id)%>
<%= author_type.title %>
<%= hidden_field_tag 'writing_journal[journal_author_type_ids][]', '' %>
<% end %>
<% end %>
</div>
</div>
<div id="widget-tags" class="widget-box widget-size-300"> <div id="widget-tags" class="widget-box widget-size-300">
<div class="widget-action clear"> <div class="widget-action clear">
@ -84,14 +52,23 @@
<div id="post-body"> <div id="post-body">
<div id="post-body-content" class="clear"> <div id="post-body-content" class="clear">
<% if !params[:user_id].blank? %>
<div class="span6">
<%= t("著作人")%>
<%= User.from_id(params[:user_id]).name rescue ''%>
</div>
<% end %>
<div class="span6"> <div class="span6">
<%= f.label :year ,t("personal_journal.year")%> <%= f.label :year ,t("personal_journal.year")%>
<%= 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]'} ) %> <%= 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 => "span6"} ) %>
</div> </div>
<div class="span6"> <div class="span6">
<%= f.label :language, t("personal_journal.language") %> <%= f.label :language, t("personal_journal.language") %>
<%= f.select :language, WritingJournal::LANGUAGE_TYPES, :prompt => 'Select' %> <%= f.select :language, WritingJournal::LANGUAGE_TYPES, :prompt => 'Select', :class => "span6" %>
</div> </div>
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
@ -105,87 +82,142 @@
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_valid_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>"> <div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<div class="title">
<%= f.label :paper_title ,t("personal_journal.paper_title")%>
<%= f.fields_for :paper_title_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'post-title', :value => (@writing_journal.paper_title_translations[locale] rescue nil) %>
<% end %>
</div>
<div class="title"> <%= f.label :paper_title ,t("personal_journal.paper_title")%>
<%= f.label :journal_title ,t("personal_journal.journal_title")%> <%= f.fields_for :paper_title_translations do |f| %>
<%= f.fields_for :journal_title_translations do |f| %> <%= I18nVariable.from_locale(locale) %>
<%= I18nVariable.from_locale(locale) %> <%= f.text_field locale, :class=>'span12', :value => (@writing_journal.paper_title_translations[locale] rescue nil) %>
<%= f.text_field locale, :class=>'post-title', :value => (@writing_journal.journal_title_translations[locale] rescue nil) %> <% end %>
<% end %> <br>
</div>
<div class="title"> <%= f.label :journal_title ,t("personal_journal.journal_title")%>
<%= f.label :authors,t("web_resource.authors") %> <%= f.fields_for :journal_title_translations do |f| %>
<%= f.fields_for :authors_translations do |f| %> <%= I18nVariable.from_locale(locale) %>
<%= I18nVariable.from_locale(locale) %> <%= f.text_field locale, :class=>'span12', :value => (@writing_journal.journal_title_translations[locale] rescue nil) %>
<%= f.text_area locale, :size => "60x3", :value => (@writing_journal.authors_translations[locale] rescue nil) %> <% end %>
<% end %> <br>
</div>
</div> </div>
<% end %> <% end %>
<%= f.label :level_type ,t("personal_journal.level_type")%>
<div class="form-inline">
<ul class="nav nav-pills">
<% @level_types.each_with_index do |level_type, i| %>
<li class="pull-left">
<%= check_box_tag 'writing_journal[journal_level_type_ids][]', level_type.id, @writing_journal.journal_level_type_ids.include?(level_type.id), :id => "field-#{i}" %>
<label for="field-<%= i %>"><%= level_type.title %></label>
<%= hidden_field_tag 'writing_journal[journal_level_type_ids][]', '' %>
</li>
<% end %>
</ul>
</div>
<div class="row">
<div class="span3">
<%= f.label :vol_no, t("personal_journal.vol_no") %>
<%= f.text_field :vol_no %>
</div>
<div class="span3">
<%= f.label :issue_no, t("personal_journal.issue_no") %>
<%= f.text_field :issue_no %>
</div>
<div class="span3">
<%= f.label :form_to, t("personal_journal.form_to") %>
<%= f.text_field :form_to_start, :class=>'span1' %> ~ <%= f.text_field :form_to_end, :class=>'span1' %>
</div>
<div class="span3">
<%= f.label :total_pages, t("personal_journal.total_pages") %>
<%= f.text_field :total_pages %>
</div>
</div>
<div class="row">
<div class="span5">
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<div class="title">
<%= f.label :authors,t("web_resource.authors") %>
<%= f.fields_for :authors_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'span5', :value => (@writing_journal.authors_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<% end %>
</div>
<div class="span7">
<label>&nbsp;</label>
<input type="text" name="" id="" class="span7">
</div>
</div>
</div> </div>
<div class="span7"> <div class="row">
<%= f.label :paper_type ,t("personal_journal.paper_type")%> <div class="span5">
<%= f.select :journal_paper_type_id, @paper_types.collect {|t| [ t.title, t.id ]} %> <%= f.label :author_type ,t("personal_journal.author_type")%>
<div class="form-inline">
<ul class="nav nav-pills">
<% @author_types.each_with_index do |author_type, i | %>
<li class="pull-left">
<%= check_box_tag 'writing_journal[journal_author_type_ids][]', author_type.id, @writing_journal.journal_author_type_ids.include?(author_type.id), :id => "field-#{i}" %>
<label for="field-<%= i %>"><%= author_type.title %></label>
<%= hidden_field_tag 'writing_journal[journal_author_type_ids][]', '' %>
</li>
<% end %>
</ul>
</div>
</div>
<div class="span7">
<%= f.label :paper_type ,t("personal_journal.paper_type")%>
<%= f.select :journal_paper_type_id, @paper_types.collect {|t| [ t.title, t.id ]}, :class => "span7" %>
</div>
</div> </div>
<%= f.label :isbn, t("personal_journal.isbn") %>
<%= f.text_field :isbn , :class => "span12" %>
<br>
<%= f.label :keywords, t("personal_journal.keywords") %>
<%= f.text_field :keywords , :class => "span12" %>
<br>
<div class="title"> <div class="title">
<%= f.label :publication_date ,t("personal_journal.publication_date")%> <%= f.label :publication_date ,t("personal_journal.publication_date")%>
<%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 'span1'} %> <%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 'span1'} %>
</div> </div>
<div class="title"> <%= f.label :url, t("personal_journal.url") %>
<%= f.label :isbn, t("personal_journal.isbn") %> <%= f.text_field :url , :class => "span12" %>
<%= f.text_field :isbn %> <br>
</div>
<div class="title">
<%= f.label :vol_no, t("personal_journal.vol_no") %>
<%= f.text_field :vol_no %>
</div>
<div class="title">
<%= f.label :issue_no, t("personal_journal.issue_no") %>
<%= f.text_field :issue_no %>
</div>
<div class="title">
<%= f.label :form_to, t("personal_journal.form_to") %>
<%= f.text_field :form_to %>
</div>
<div class="title">
<%= f.label :total_pages, t("personal_journal.total_pages") %>
<%= f.text_field :total_pages %>
</div>
<div class="title">
<%= f.label :url, t("personal_journal.url") %>
<%= f.text_field :url %>
</div>
<div class="title">
<%= f.label :keywords, t("personal_journal.keywords") %>
<%= f.text_field :keywords %>
</div>
</div> </div>
<div> <div>
<div id='plugin_files' class="plugin_files_block"> <div id='plugin_files' class="plugin_files_block">
@ -234,6 +266,7 @@
<div class="form-actions"> <div class="form-actions">
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= f.submit t('submit'), :class=>'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div> </div>

View File

@ -49,6 +49,9 @@
</tbody> </tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_journal_back_end_writing_journal_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %>
<div class="form-actions form-fixed pagination-right"> <div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_journal_plugin_writing_journal_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_journal_plugin_writing_journal_path, :class => 'btn btn-primary pull-right' %>
<div id="writing_journal_pagination" class="paginationFixed"> <div id="writing_journal_pagination" class="paginationFixed">

View File

@ -2,7 +2,7 @@ module PersonalJournal
OrbitApp.registration "Journal",:type=> 'ModuleApp' do OrbitApp.registration "Journal",:type=> 'ModuleApp' do
base_url File.expand_path File.dirname(__FILE__) base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/personal_journal/plugin/profile" personal_plugin :enable => true,:path=>"panel/personal_journal/plugin/profile",:i18n=>'admin.personal_journal'
end end

View File

@ -90,12 +90,22 @@ class Panel::PersonalLab::BackEnd::LabsController < OrbitBackendController
@lab = Lab.new(params[:lab]) @lab = Lab.new(params[:lab])
@lab.create_user_id = current_user.id if params[:lab][:user_id]
@lab.update_user_id = current_user.id @lab.create_user_id = params[:lab][:user_id]
@lab.update_user_id = params[:lab][:user_id]
else
@lab.create_user_id = current_user.id
@lab.update_user_id = current_user.id
end
respond_to do |format| respond_to do |format|
if @lab.save if @lab.save
format.html { redirect_to(panel_personal_lab_back_end_labs_url) } if params[:lab][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:lab][:user_id],:show_plugin_profile=>'Lab')) }
else
format.html { redirect_to(panel_personal_lab_back_end_labs_url) }
end
format.xml { render :xml => @lab, :status => :created, :location => @lab } format.xml { render :xml => @lab, :status => :created, :location => @lab }
else else
format.html { render :action => "new" } format.html { render :action => "new" }

View File

@ -25,8 +25,8 @@ class Lab
field :facility field :facility
field :url field :url
field :note field :note
field :create_user_id field :create_user_id, :type => BSON::ObjectId
field :update_user_id field :update_user_id, :type => BSON::ObjectId
# field :is_top, :type => Boolean, :default => false # field :is_top, :type => Boolean, :default => false
# field :is_hot, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false

View File

@ -31,6 +31,15 @@
<div id="post-body"> <div id="post-body">
<div id="post-body-content" class="clear"> <div id="post-body-content" class="clear">
<% if !params[:user_id].blank? %>
<div class="span6">
<%= t("著作人")%>
<%= User.from_id(params[:user_id]).name rescue ''%>
</div>
<% end %>
<div class="title"> <div class="title">
<%= f.label :year ,t("personal_lab.year")%> <%= f.label :year ,t("personal_lab.year")%>
<%= select_year((@lab.year ? @lab.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'lab[year]'} ) %> <%= select_year((@lab.year ? @lab.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'lab[year]'} ) %>
@ -176,6 +185,7 @@
<div class="form-actions"> <div class="form-actions">
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= f.submit t('submit'), :class=>'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div> </div>

View File

@ -53,6 +53,9 @@
</tbody> </tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_lab_back_end_lab_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %>
<div class="form-actions form-fixed pagination-right"> <div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_lab_plugin_lab_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_lab_plugin_lab_path, :class => 'btn btn-primary pull-right' %>
<div id="lab_pagination" class="paginationFixed"> <div id="lab_pagination" class="paginationFixed">

View File

@ -2,7 +2,7 @@ module PersonalLab
OrbitApp.registration "Lab",:type=> 'ModuleApp' do OrbitApp.registration "Lab",:type=> 'ModuleApp' do
base_url File.expand_path File.dirname(__FILE__) base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/personal_lab/plugin/profile" personal_plugin :enable => true,:path=>"panel/personal_lab/plugin/profile",:i18n=>'admin.personal_lab'
end end

View File

@ -133,12 +133,23 @@ class Panel::PersonalPatent::BackEnd::WritingPatentsController < OrbitBackendCon
@writing_patent = WritingPatent.new(params[:writing_patent]) @writing_patent = WritingPatent.new(params[:writing_patent])
@writing_patent.create_user_id = current_user.id if params[:writing_patent][:user_id]
@writing_patent.update_user_id = current_user.id @writing_patent.create_user_id = params[:writing_patent][:user_id]
@writing_patent.update_user_id = params[:writing_patent][:user_id]
else
@writing_patent.create_user_id = current_user.id
@writing_patent.update_user_id = current_user.id
end
respond_to do |format| respond_to do |format|
if @writing_patent.save if @writing_patent.save
format.html { redirect_to(panel_personal_patent_back_end_writing_patents_url) }
if params[:writing_patent][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:writing_patent][:user_id],:show_plugin_profile=>'Patent')) }
else
format.html { redirect_to(panel_personal_patent_back_end_writing_patents_url) }
end
format.xml { render :xml => @writing_patent, :status => :created, :location => @writing_patent } format.xml { render :xml => @writing_patent, :status => :created, :location => @writing_patent }
else else
format.html { render :action => "new" } format.html { render :action => "new" }

View File

@ -25,8 +25,8 @@ class WritingPatent
field :publish_date , :type => Date field :publish_date , :type => Date
field :url field :url
field :note field :note
field :create_user_id field :create_user_id, :type => BSON::ObjectId
field :update_user_id field :update_user_id, :type => BSON::ObjectId
# field :is_top, :type => Boolean, :default => false # field :is_top, :type => Boolean, :default => false
# field :is_hot, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false

View File

@ -31,6 +31,15 @@
<div id="post-body"> <div id="post-body">
<div id="post-body-content" class="clear"> <div id="post-body-content" class="clear">
<% if !params[:user_id].blank? %>
<div class="span6">
<%= t("著作人")%>
<%= User.from_id(params[:user_id]).name rescue ''%>
</div>
<% end %>
<div class="title"> <div class="title">
<%= f.label :year ,t("personal_patent.year")%> <%= f.label :year ,t("personal_patent.year")%>
<%= select_year((@writing_patent.year ? @writing_patent.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_patent[year]'} ) %> <%= select_year((@writing_patent.year ? @writing_patent.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_patent[year]'} ) %>
@ -165,6 +174,7 @@
<div class="form-actions"> <div class="form-actions">
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= f.submit t('submit'), :class=>'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div> </div>

View File

@ -51,6 +51,9 @@
</tbody> </tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_patent_back_end_writing_patent_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %>
<div class="form-actions form-fixed pagination-right"> <div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_patent_plugin_writing_patent_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_patent_plugin_writing_patent_path, :class => 'btn btn-primary pull-right' %>
<div id="writing_patent_pagination" class="paginationFixed"> <div id="writing_patent_pagination" class="paginationFixed">

View File

@ -2,7 +2,7 @@ module PersonalPatent
OrbitApp.registration "Patent",:type=> 'ModuleApp' do OrbitApp.registration "Patent",:type=> 'ModuleApp' do
base_url File.expand_path File.dirname(__FILE__) base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/personal_patent/plugin/profile" personal_plugin :enable => true,:path=>"panel/personal_patent/plugin/profile",:i18n=>'admin.personal_patent'
end end

View File

@ -1,244 +0,0 @@
class Panel::PersonalProject::BackEnd::ProjectsController < OrbitBackendController
include AdminHelper
include OrbitControllerLib::DivisionForDisable
before_filter :authenticate_user!
before_filter :force_order_for_visitor,:only=>[:index,:show]
before_filter :force_order_for_user,:except => [:index,:show]
# before_filter :for_app_manager,:except => [:index,:show]
before_filter :only => [ :new,:create,:edit,:update,:create] do |controller|
controller.get_categorys('ProjectCategory')
end
def index
get_categorys("ProjectCategory",params[:project_project_category_id])
@filter = params[:filter]
new_filter = params[:new_filter]
if @filter && params[:clear]
@filter.delete(params[:type])
elsif @filter && new_filter
if @filter.has_key?(new_filter[:type]) && @filter[new_filter[:type]].include?(new_filter[:id].to_s)
@filter[new_filter[:type]].delete(new_filter[:id].to_s)
elsif @filter.has_key?(new_filter[:type])
@filter[new_filter[:type]] << new_filter[:id].to_s
else
@filter.merge!({new_filter[:type] => [new_filter[:id].to_s]})
end
elsif new_filter
@filter = {new_filter[:type] => [new_filter[:id].to_s]}
end
@project_categorys = get_categories_for_index("ProjectCategory")
@project_category_ids = @project_categorys.collect{|t| t.id.to_s} + [nil]
@projects = (params[:sort] || @filter) ? get_sorted_and_filtered("project",:project_category_id.in => @project_category_ids) : get_viewable("project",:project_category_id.in => @project_category_ids)
get_tags
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @projects }
format.js
end
end
def project_setting
@project_types = ProjectCategory.all
get_tags
@set_project_type = ProjectCategory.new(:display => 'List')
@project_type_url = panel_personal_project_back_end_projects_path
end
def project_category_quick_add
@set_project_type = ProjectCategory.new(:display => 'List')
@project_type_url = panel_personal_project_back_end_projects_path
@set_project_type.id = params[:id]
respond_to do |format|
format.js
end
end
def project_category_quick_edit
@set_project_type = ProjectCategory.find(params[:project_id])
@project_type_url = panel_personal_project_back_end_project_path(@set_project_type)
respond_to do |format|
format.js
end
end
# GET /projects/1
# GET /projects/1.xml
def show
@project = Project.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @project }
end
end
# GET /projects/new
# GET /projects/new.xml
def new
@project = Project.new
@project_categorys = ProjectCategory.all
get_tags
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @project }
end
end
# GET /projects/1/edit
def edit
@project = Project.find(params[:id])
@project_categorys = ProjectCategory.all
get_tags
end
# POST /projects
# POST /projects.xml
def create
if params[:project_category]
@project_category = WritingPatentCategory.new(params[:project_category])
respond_to do |format|
if @project_category.save
format.js { render 'create_project_setting' }
end
end
else
@project_categorys = ProjectCategory.all
get_tags
@project = Project.new(params[:project])
@project.create_user_id = current_user.id
@project.update_user_id = current_user.id
respond_to do |format|
if @project.save
format.html { redirect_to(panel_personal_project_back_end_projects_url) }
format.xml { render :xml => @project, :status => :created, :location => @project }
else
format.html { render :action => "new" }
format.xml { render :xml => @project.errors, :status => :unprocessable_entity }
end
end
end
end
# PUT /projects/1
# PUT /projects/1.xml
def update
if params[:project_category]
@project_category = ProjectCategory.find(params[:id])
respond_to do |format|
if @project_category.update_attributes(params[:project_category])
# format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
format.js { render 'update_project_setting' }
end
end
else
@project = Project.find(params[:id])
@project.update_user_id = current_user.id
params[:project][:tag_ids] ||=[]
respond_to do |format|
if @project.update_attributes(params[:project])
format.html { redirect_to(panel_personal_project_back_end_projects_url) }
# format.js { render 'toggle_enable' }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @project.errors, :status => :unprocessable_entity }
end
end
end
end
# DELETE /projects/1
# DELETE /projects/1.xml
def destroy
@project = Project.find(params[:id])
@project.destroy
respond_to do |format|
format.html { redirect_to(panel_personal_project_back_end_projects_url) }
# format.xml { head :ok }
format.js
end
end
def delete
if params[:ids]
projects = Project.any_in(:_id => params[:ids]).delete_all
end
redirect_to panel_personal_project_back_end_projects_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end
protected
# def get_index_categories(id = nil)
# @bulletin_categorys = []
# if(is_manager? || is_admin?)
# @bulletin_categorys = (id ? BulletinCategory.admin_manager_all.find(id).to_a : BulletinCategory.admin_manager_all)
# elsif is_sub_manager?
# @bulletin_categorys = BulletinCategory.all
# end
# @bulletin_categorys
# end
# def get_categorys(id = nil)
# @project_categorys = []
# if(is_manager? || is_admin?)
# @project_categorys = (id ? Project.admin_manager_all.find(id).to_a : Project.admin_manager_all))
# elsif is_sub_manager?
# @project_categorys = Project.all.authed_for_user(current_user,'edit')
# end
# if @project_categorys.empty? && params[:action] != "index"
# flash[:alert] = t("announcement.error.no_avilb_cate_for_posting")
# redirect_to :action => :index
# end
# end
def get_tags
module_app = ModuleApp.first(:conditions => {:key => 'personal_project'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id})
end
end

View File

@ -133,12 +133,23 @@ class Panel::PersonalProject::BackEnd::ProjectsController < OrbitBackendControll
@project = Project.new(params[:project]) @project = Project.new(params[:project])
@project.create_user_id = current_user.id if params[:project][:user_id]
@project.update_user_id = current_user.id @project.create_user_id = params[:project][:user_id]
@project.update_user_id = params[:project][:user_id]
else
@project.create_user_id = current_user.id
@project.update_user_id = current_user.id
end
respond_to do |format| respond_to do |format|
if @project.save if @project.save
format.html { redirect_to(panel_personal_project_back_end_projects_url) }
if params[:project][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:project][:user_id],:show_plugin_profile=>'Research Project')) }
else
format.html { redirect_to(panel_personal_project_back_end_projects_url) }
end
format.xml { render :xml => @project, :status => :created, :location => @project } format.xml { render :xml => @project, :status => :created, :location => @project }
else else
format.html { render :action => "new" } format.html { render :action => "new" }

View File

@ -27,8 +27,8 @@ class Project
field :period_end_date, :type => Date field :period_end_date, :type => Date
field :url field :url
field :note field :note
field :create_user_id field :create_user_id, :type => BSON::ObjectId
field :update_user_id field :update_user_id, :type => BSON::ObjectId
# field :is_top, :type => Boolean, :default => false # field :is_top, :type => Boolean, :default => false
# field :is_hot, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false

View File

@ -31,6 +31,15 @@
<div id="post-body"> <div id="post-body">
<div id="post-body-content" class="clear"> <div id="post-body-content" class="clear">
<% if !params[:user_id].blank? %>
<div class="span6">
<%= t("著作人")%>
<%= User.from_id(params[:user_id]).name rescue ''%>
</div>
<% end %>
<div class="title"> <div class="title">
<%= f.label :year ,t("personal_project.year")%> <%= f.label :year ,t("personal_project.year")%>
<%= select_year((@project.year ? @project.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'project[year]'} ) %> <%= select_year((@project.year ? @project.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'project[year]'} ) %>
@ -181,6 +190,7 @@
<div class="form-actions"> <div class="form-actions">
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= f.submit t('submit'), :class=>'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div> </div>

View File

@ -51,6 +51,9 @@
</tbody> </tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_project_back_end_project_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %>
<div class="form-actions form-fixed pagination-right"> <div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_project_plugin_project_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_project_plugin_project_path, :class => 'btn btn-primary pull-right' %>
<div id="project_pagination" class="paginationFixed"> <div id="project_pagination" class="paginationFixed">

View File

@ -2,7 +2,7 @@ module PersonalProject
OrbitApp.registration "Research Project",:type=> 'ModuleApp' do OrbitApp.registration "Research Project",:type=> 'ModuleApp' do
base_url File.expand_path File.dirname(__FILE__) base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/personal_project/plugin/profile" personal_plugin :enable => true,:path=>"panel/personal_project/plugin/profile",:i18n=>'admin.personal_project'
end end

View File

@ -77,12 +77,23 @@ class Panel::PersonalResearch::BackEnd::ResearchsController < OrbitBackendContro
@research = Research.new(params[:research]) @research = Research.new(params[:research])
@research.create_user_id = current_user.id if params[:research][:user_id]
@research.update_user_id = current_user.id @research.create_user_id = params[:research][:user_id]
@research.update_user_id = params[:research][:user_id]
else
@research.create_user_id = current_user.id
@research.update_user_id = current_user.id
end
respond_to do |format| respond_to do |format|
if @research.save if @research.save
format.html { redirect_to(panel_personal_research_back_end_researchs_url) }
if params[:research][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:research][:user_id],:show_plugin_profile=>'Research')) }
else
format.html { redirect_to(panel_personal_research_back_end_researchs_url) }
end
format.xml { render :xml => @research, :status => :created, :location => @research } format.xml { render :xml => @research, :status => :created, :location => @research }
else else
format.html { render :action => "new" } format.html { render :action => "new" }

View File

@ -22,8 +22,8 @@ class Research
field :keywords field :keywords
field :url field :url
field :note field :note
field :create_user_id field :create_user_id, :type => BSON::ObjectId
field :update_user_id field :update_user_id, :type => BSON::ObjectId
# field :is_top, :type => Boolean, :default => false # field :is_top, :type => Boolean, :default => false
# field :is_hot, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false

View File

@ -31,6 +31,15 @@
<div id="post-body"> <div id="post-body">
<div id="post-body-content" class="clear"> <div id="post-body-content" class="clear">
<% if !params[:user_id].blank? %>
<div class="span6">
<%= t("著作人")%>
<%= User.from_id(params[:user_id]).name rescue ''%>
</div>
<% end %>
<div class="title"> <div class="title">
<%= f.label :year ,t("personal_research.year")%> <%= f.label :year ,t("personal_research.year")%>
<%= select_year((@research.year ? @research.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'research[year]'} ) %> <%= select_year((@research.year ? @research.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'research[year]'} ) %>
@ -155,6 +164,7 @@
<div class="form-actions"> <div class="form-actions">
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= f.submit t('submit'), :class=>'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div> </div>

View File

@ -50,6 +50,9 @@
</tbody> </tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_research_back_end_research_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %>
<div class="form-actions form-fixed pagination-right"> <div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_research_plugin_research_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_research_plugin_research_path, :class => 'btn btn-primary pull-right' %>
<div id="research_pagination" class="paginationFixed"> <div id="research_pagination" class="paginationFixed">

View File

@ -2,7 +2,7 @@ module PersonalResearch
OrbitApp.registration "Research",:type=> 'ModuleApp' do OrbitApp.registration "Research",:type=> 'ModuleApp' do
base_url File.expand_path File.dirname(__FILE__) base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/personal_research/plugin/profile" personal_plugin :enable => true,:path=>"panel/personal_research/plugin/profile",:i18n=>'admin.personal_research'
end end

View File

@ -179,12 +179,23 @@ class Panel::PersonalSeminar::BackEnd::WritingSeminarsController < OrbitBackendC
@writing_seminar = WritingSeminar.new(params[:writing_seminar]) @writing_seminar = WritingSeminar.new(params[:writing_seminar])
@writing_seminar.create_user_id = current_user.id if params[:writing_seminar][:user_id]
@writing_seminar.update_user_id = current_user.id @writing_seminar.create_user_id = params[:writing_seminar][:user_id]
@writing_seminar.update_user_id = params[:writing_seminar][:user_id]
else
@writing_seminar.create_user_id = current_user.id
@writing_seminar.update_user_id = current_user.id
end
respond_to do |format| respond_to do |format|
if @writing_seminar.save if @writing_seminar.save
format.html { redirect_to(panel_personal_seminar_back_end_writing_seminars_url) }
if params[:writing_seminar][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:writing_seminar][:user_id],:show_plugin_profile=>'Seminar')) }
else
format.html { redirect_to(panel_personal_seminar_back_end_writing_seminars_url) }
end
format.xml { render :xml => @writing_seminar, :status => :created, :location => @writing_seminar } format.xml { render :xml => @writing_seminar, :status => :created, :location => @writing_seminar }
else else
format.html { render :action => "new" } format.html { render :action => "new" }

View File

@ -31,8 +31,8 @@ class WritingSeminar
field :publication_date, :type => Date field :publication_date, :type => Date
field :url field :url
field :note field :note
field :create_user_id field :create_user_id, :type => BSON::ObjectId
field :update_user_id field :update_user_id, :type => BSON::ObjectId
# field :is_top, :type => Boolean, :default => false # field :is_top, :type => Boolean, :default => false
# field :is_hot, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false

View File

@ -64,6 +64,15 @@
<div id="post-body"> <div id="post-body">
<div id="post-body-content" class="clear"> <div id="post-body-content" class="clear">
<% if !params[:user_id].blank? %>
<div class="span6">
<%= t("著作人")%>
<%= User.from_id(params[:user_id]).name rescue ''%>
</div>
<% end %>
<div class="title"> <div class="title">
<%= f.label :year ,t("personal_seminar.year")%> <%= f.label :year ,t("personal_seminar.year")%>
<%= select_year((@writing_seminar.year ? @writing_seminar.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_seminar[year]'} ) %> <%= select_year((@writing_seminar.year ? @writing_seminar.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_seminar[year]'} ) %>
@ -220,6 +229,7 @@
<div class="form-actions"> <div class="form-actions">
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= f.submit t('submit'), :class=>'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div> </div>

View File

@ -51,6 +51,9 @@
</tbody> </tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_seminar_back_end_writing_seminar_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %>
<div class="form-actions form-fixed pagination-right"> <div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_seminar_plugin_writing_seminar_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_seminar_plugin_writing_seminar_path, :class => 'btn btn-primary pull-right' %>
<div id="writing_seminar_pagination" class="paginationFixed"> <div id="writing_seminar_pagination" class="paginationFixed">

View File

@ -2,7 +2,7 @@ module PersonalSeminar
OrbitApp.registration "Seminar",:type=> 'ModuleApp' do OrbitApp.registration "Seminar",:type=> 'ModuleApp' do
base_url File.expand_path File.dirname(__FILE__) base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/personal_seminar/plugin/profile" personal_plugin :enable => true,:path=>"panel/personal_seminar/plugin/profile",:i18n=>'admin.personal_seminar'
end end