add data can select member
This commit is contained in:
parent
369e0317e0
commit
2b9ea7b265
|
@ -23,14 +23,50 @@ class Admin::PatentsController < OrbitMemberController
|
|||
end
|
||||
|
||||
def create
|
||||
@member = MemberProfile.find(patent_params['member_profile_id']) rescue nil
|
||||
@patent = Patent.new(patent_params)
|
||||
@patent.save
|
||||
if params[:desktop] == "true"
|
||||
render json: {"data" => get_paper_list}.to_json
|
||||
else
|
||||
|
||||
if !patent_params['member_profile_id'].blank?
|
||||
|
||||
@member = MemberProfile.find(patent_params['member_profile_id']) rescue nil
|
||||
@patent = Patent.new(patent_params)
|
||||
@patent.save
|
||||
|
||||
if params[:desktop] == "true"
|
||||
render json: {"data" => get_paper_list}.to_json
|
||||
else
|
||||
redirect_to params['referer_url']
|
||||
end
|
||||
|
||||
elsif !params[:author_members].blank?
|
||||
|
||||
params[:author_members].each do |author_member|
|
||||
|
||||
patent_params['member_profile_id'] = author_member
|
||||
@patent = Patent.new(patent_params)
|
||||
@patent.save
|
||||
|
||||
if params[:desktop] == "true"
|
||||
render json: {"data" => get_paper_list}.to_json
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
redirect_to params['referer_url']
|
||||
|
||||
else
|
||||
|
||||
patent_params['member_profile_id'] = User.find(current_user.id).member_profile_id
|
||||
|
||||
@patent = Patent.new(patent_params)
|
||||
@patent.save
|
||||
|
||||
if params[:desktop] == "true"
|
||||
render json: {"data" => get_paper_list}.to_json
|
||||
end
|
||||
|
||||
redirect_to params['referer_url']
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
|
|
|
@ -60,7 +60,7 @@ class Patent
|
|||
pd_data = []
|
||||
fields_to_show.collect do |t|
|
||||
if t == "patent_title"
|
||||
pd_data << { "data_title" => "<a href='#{OrbitHelper.url_to_plugin_show(p.to_param,'personal_patent')}'>#{p.send(t)}" }
|
||||
pd_data << { "data_title" => "<a href='#{OrbitHelper.url_to_plugin_show(p.to_param,'personal_patent')}' target='_blank'>#{p.send(t)}" }
|
||||
else
|
||||
pd_data << { "data_title" => p.send(t) }
|
||||
end
|
||||
|
|
|
@ -114,14 +114,27 @@
|
|||
<!-- Basic Module -->
|
||||
<div class="tab-pane fade in active" id="basic">
|
||||
|
||||
<% if !@member.nil? %>
|
||||
|
||||
<div class="control-group big-group">
|
||||
<label class="control-label muted"><%= t("personal_plugins.author") %></label>
|
||||
<div class="controls">
|
||||
<%= @member.name rescue ''%>
|
||||
<%= f.hidden_field :member_profile_id, :value => @member.id if !@member.nil? %>
|
||||
<%= f.hidden_field :member_profile_id, :value => @member.id %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% else %>
|
||||
|
||||
<div class="control-group big-group">
|
||||
<label class="control-label muted"><%= t("personal_plugins.author") %></label>
|
||||
<div class="controls">
|
||||
<%= render partial: 'admin/member_selects/email_selection_box', locals: {field: 'author_members[]', email_members:[]} %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
<!-- year -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_patent.year") %></label>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<% @patents.each do |patent| %>
|
||||
<tr id="<%= dom_id patent %>" class="<%= patent.is_hidden ? "checkHide" : "" %>">
|
||||
<td><%= patent.publish_date.strftime("%Y.%m") %></td>
|
||||
<td><%= patent.publish_date.strftime("%Y.%m") rescue "" %></td>
|
||||
<td>
|
||||
<%= link_to patent.patent_title, OrbitHelper.url_to_plugin_show(patent.to_param,'personal_patent').to_s, target: "blank"%>
|
||||
<div class="quick-edit">
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
<div class="bottomnav clearfix">
|
||||
<div class="action pull-right">
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t(:new_), new_admin_patent_path, :class => 'btn btn-primary' %>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), admin_patent_setting_path, :class => 'btn btn-primary pull-right' %>
|
||||
</div>
|
||||
<div class="pagination pagination-centered">
|
||||
|
|
Loading…
Reference in New Issue