Add show plugin profile action

This commit is contained in:
spen 2014-03-20 15:51:47 +08:00
parent 6386fd00a0
commit b1ae3b6690
3 changed files with 30 additions and 8 deletions

View File

@ -174,8 +174,14 @@ class Panel::PersonalProject::BackEnd::ProjectsController < OrbitBackendControll
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' }
if params[:project][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:project][:user_id],:show_plugin_profile=>"Project")) }
else
format.html { redirect_to(panel_personal_project_back_end_projects_url) }
end
# format.js { render 'toggle_enable' }
format.xml { head :ok }
else
format.html { render :action => "edit" }
@ -193,7 +199,13 @@ class Panel::PersonalProject::BackEnd::ProjectsController < OrbitBackendControll
@project.destroy
respond_to do |format|
format.html { redirect_to(panel_personal_project_back_end_projects_url) }
if params[:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:user_id],:show_plugin_profile=>"Project")) }
else
format.html { redirect_to(panel_personal_project_back_end_projects_url) }
end
# format.xml { head :ok }
format.js
end

View File

@ -1,5 +1,6 @@
<% # encoding: utf-8 %>
<div class="writing_detail">
<table>
<caption> <%= t("module_name.personal_project") %> </caption>
<tbody>
@ -36,18 +37,18 @@
<% end %>
<% if !@project.period_start_date.blank? %>
<tr><th><%= t("personal_project.start_date")%></th><td><%= @project.period_start_date %></td></tr>
<tr><th><%= t("personal_project.start_date")%></th><td><%= @project.period_start_date.strftime("%Y.%m") %></td></tr>
<% end %>
<% if !@project.period_end_date.blank? %>
<tr><th><%= t("personal_project.end_date")%></th><td><%= @project.period_end_date %></td></tr>
<tr><th><%= t("personal_project.end_date")%></th><td><%= @project.period_end_date.strftime("%Y.%m") %></td></tr>
<% end %>
<% if !@project.url.blank? %>
<tr><th><%= t("personal_project.url")%></th><td><%= link_to t(:url), @project.url, {:target => '_blank', :title => @project.url} if !@project.url.blank? %></td></tr>
<% end %>
<tr><th><%= t("personal_project.authors")%></th><td><%= "#{User.from_id(@project.create_user_id).name rescue ''},#{@project.authors rescue ''}"%></td></tr>
<tr><th><%= t("personal_project.authors")%></th><td><%= "#{User.from_id(@project.create_user_id).name rescue ''}"%></td></tr>
<% if @project.project_files.size > 0 %>
<tr><th><%= t("personal_project.file")%></th>
@ -65,3 +66,4 @@
<% end %>
</tbody>
</table>
</div>

View File

@ -41,7 +41,7 @@
</div>
<% end -%>
<table class="table table-condensed table-striped">
<table class="table table-condensed table-striped main-list">
<thead>
<tr>
<% if is_admin? %>
@ -55,7 +55,7 @@
<% @projects.each do |project| %>
<tr class="<%= project.is_hidden ? "checkHide" : "" %>">
<tr id="<%= dom_id project %>" class="<%= project.is_hidden ? "checkHide" : "" %>">
<% if is_admin? %>
<td>
<%= check_box_tag 'to_change[]', project.id.to_s, false, :class => "list-check" %>
@ -64,6 +64,14 @@
<td><%= project.period_start_date.strftime("%Y.%m") %> ~ <%= project.period_end_date.strftime("%Y.%m") %></td>
<td>
<%= link_to project.project_title, panel_personal_project_front_end_project_path(project) %>
<div class="quick-edit">
<ul class="nav nav-pills hide">
<%if at_least_module_manager || project.project_category.cur_user_is_sub_manager_of(:edit)%>
<li><%= link_to t('edit'), edit_panel_personal_project_back_end_project_path(project,:user_id => @user.id) %></li>
<li><%= link_to t(:delete_), panel_personal_project_back_end_project_path(project,:user_id => @user.id), :confirm => t('sure?'), :method => :delete, :remote => true %></li>
<% end -%>
</ul>
</div>
</td>
</tr>