项目动态ajax刷新

This commit is contained in:
huang 2017-02-28 20:50:40 +08:00
parent be1b507354
commit 7804ea69bd
4 changed files with 10 additions and 8 deletions

View File

@ -895,6 +895,8 @@ class ProjectsController < ApplicationController
gitlab_address = Redmine::Configuration['gitlab_address']
gitUrl = gitlab_address.to_s+"/"+@project.owner.to_s+"/"+ rep_identify + "."+"git"
gitUrl = Base64.encode64(gitUrl)
@page = params[:page] ? params[:page].to_i + 1 : 0
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type in ('Issue', 'TrainingTask','Message','News', 'Project', 'Attachment','Commit')", @project).includes(:forge_act).order("updated_at desc").limit(10).offset(@page * 10)
if @training_task.status == 0
params = {:jobName => "#{jobName}", :taskId => "#{taskId}", :step => "#{step}", :gitUrl => "#{gitUrl}"}
uri = URI.parse("http://123.59.135.74:9999/jenkins-exec/api/buildJob")

View File

@ -34,8 +34,9 @@
</ul>
<div class="cl"></div>
</div>
<%= render :partial => "project_activities", :locals => {:forge_acts => @events_pages, :page => 0, :type => @type} %>
<div id="project_act_show_<%= @project.id %>">
<%= render :partial => "project_activities", :locals => {:forge_acts => @events_pages, :page => 0, :type => @type} %>
</div>
</div>
<script>
autoUrl('project_description_code');

View File

@ -1,3 +1,4 @@
$("#training_project_task_status_<%= @training_task.id %>").html('<%= escape_javascript( render :partial => 'training_tasks/action_status', :locals => {:activity => @training_task}) %>');
$("#training_task_details").html('<%= escape_javascript( render :partial => 'training_tasks/training_task_details', :locals => {:activity => @training_task, :project_id => @project.id}) %>');
$("#project_show_training_task_<%= @training_task.project_id %>").html('<%= escape_javascript( render :partial => 'projects/act_training_tasks', :locals => {:activity => @training_task, :user_activity_id => @training_task.id, :project_id => @training_task.project_id}) %>');
//$("#training_project_task_status_<%#= @training_task.id %>").html('<%#= escape_javascript( render :partial => 'training_tasks/action_status', :locals => {:activity => @training_task}) %>');
//$("#training_task_details").html('<%#= escape_javascript( render :partial => 'training_tasks/training_task_details', :locals => {:activity => @training_task, :project_id => @project.id}) %>');
//$("#project_show_training_task_<%#= @training_task.project_id %>").html('<%#= escape_javascript( render :partial => 'projects/act_training_tasks', :locals => {:activity => @training_task, :user_activity_id => @training_task.id, :project_id => @training_task.project_id}) %>');
$("#project_act_show_<%= @project.id %>").html('<%= escape_javascript( render :partial => 'projects/project_activities', :locals => {:forge_acts => @events_pages, :page => 0, :type => @type}) %>');

View File

@ -32,9 +32,7 @@
<%= render :partial => 'task_attachments', :locals => {:training_task => @training_task} %>
</div>
<div class="cl"></div>
<div id="training_project_task_status_<%= @training_task.id %>">
<%= render :partial => "training_tasks/action_status", :locals => {:activity => @training_task} %>
</div>
</div>
<script type="text/javascript">