commit
18ea59fc83
@ -1,8 +1,16 @@
|
||||
<% attachments.each_with_index do |attachment,i| %>
|
||||
<div id="attachment_<%= attachment.id%>">
|
||||
<%= link_to_short_attachment attachment, :class => 'link_file_a fl', :download => true -%>
|
||||
<span class="fl">
|
||||
<span title="<%= attachment.filename %>">
|
||||
<%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw360', :download => true -%>
|
||||
</span>
|
||||
</span>
|
||||
<%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) if attachment.id && User.current == attachment.author && status != 2 %>
|
||||
<span class="ml5 fl">(<%= number_to_human_size attachment.filesize %>)</span>
|
||||
<span class="postAttSize">(<%= number_to_human_size attachment.filesize %>)</span>
|
||||
<span class="author" title="<%= attachment.author%>">
|
||||
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>,
|
||||
<%= format_time(attachment.created_on) %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end -%>
|
@ -0,0 +1,115 @@
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".pro_info_p,.proInfoP").mouseover(function(){
|
||||
$(this).children(".pic_edit2").css("display","inline-block");
|
||||
});
|
||||
$(".pro_info_p,.proInfoP").mouseout(function(){
|
||||
$(this).children(".pic_edit2").css("display","none");
|
||||
});
|
||||
$(".pic_edit2").click(function(){
|
||||
$(this).parent().hide();
|
||||
$(this).parent().next().show();
|
||||
});
|
||||
$(".issueEdit").blur(function(){
|
||||
$(this).hide();
|
||||
$(this).prev().show();
|
||||
var editValue = $(this).children("option:selected").text();
|
||||
$(this).prev().children(":first").text(editValue);
|
||||
});
|
||||
function stopPropagation(e) {
|
||||
if (e.stopPropagation)
|
||||
e.stopPropagation();
|
||||
else
|
||||
e.cancelBubble = true;
|
||||
};
|
||||
$(document).bind('click',function(){
|
||||
$('.issueEdit').css('display','none');
|
||||
$('.proInfoP,.pro_info_p').show();
|
||||
});
|
||||
$('.issueEdit,.pic_edit2').bind('click',function(e){
|
||||
stopPropagation(e);
|
||||
});
|
||||
});
|
||||
function remote_function(id) {
|
||||
$(id).submit();
|
||||
}
|
||||
</script>
|
||||
<div class="cl"></div>
|
||||
<div class="proInfoBox2 mb10 mt10">
|
||||
<ul class="fl">
|
||||
<%#= labelled_fields_for :issue, @issue do |f| %>
|
||||
<%#= f.select :status_id, ([["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0])),
|
||||
{:include_blank => false, :selected => @status_id ? @status_id : 0 },
|
||||
{:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit"} %>
|
||||
<%# end %>
|
||||
<%= form_tag({:controller => 'issues', :action => 'update', :issue_id => activity.id, :issue_detail => true, :type => "status"},:remote=>'true', :method => :put, :id=>"issue_query_form_#{activity.id}", :class => 'query_form') do %>
|
||||
<li>
|
||||
<p class="label03"> 状态 : </p>
|
||||
<p class="proInfoP"><span><%= activity.status.name %></span> <a href="javascript:void(0)" class="pic_edit2 ml5"></a></p>
|
||||
<%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]),
|
||||
{:include_blank => false, :selected => @status_id ? @status_id : 0 },
|
||||
{:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit"}
|
||||
)
|
||||
%>
|
||||
</li>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<%= form_tag({:controller => 'issues', :action => 'update', :issue_id => activity.id, :issue_detail => true, :type => "assigned"},:remote=>'true', :method => :put, :id=>"issue_query_assign_form_#{activity.id}", :class => 'query_form') do %>
|
||||
<li>
|
||||
<p class="label03"> 指派 : </p>
|
||||
<span class="pro_info_p">
|
||||
<%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "linkBlue hidden", :style => "max-width:50px; display:inline-block;" %>
|
||||
<a href="javascript:void(0)" class="pic_edit2 ml5" style="vertical-align:top;"></a></span>
|
||||
<%= select( :issue, :user_id, principals_options_for_isuue_list(activity.project),
|
||||
{ :include_blank => false,:selected => @assign_to_id ? @assign_to_id : 0},
|
||||
{:onchange=>"remote_function('#issue_query_assign_form_#{activity.id}');", :id =>"assigned_to_id", :name => "assigned_to_id",:class=>"w70 undis issueEdit"}) %>
|
||||
</li>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<ul class="fl">
|
||||
<%= form_tag({:controller => 'issues', :action => 'update', :issue_id => activity.id, :issue_detail => true, :type => "prior"},:remote=>'true', :method => :put, :id=>"issue_query_prior_form_#{activity.id}", :class => 'query_form') do %>
|
||||
<li>
|
||||
<p class="label03"> 优先级 : </p>
|
||||
<span class="proInfoP" style="width:70px;"><span><%= activity.priority.name %></span> <a href="javascript:void(0)" class="pic_edit2 ml5"></a> </span>
|
||||
<%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]),
|
||||
{:include_blank => false,:selected=>@priority_id ? @priority_id : 0},
|
||||
{:onchange=>"remote_function('#issue_query_prior_form_#{activity.id}');",:id=>"priority_id",:name=>"priority_id",:class=>"w70 undis issueEdit"}) %>
|
||||
</li>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<%= form_tag({:controller => 'issues', :action => 'update', :issue_id => activity.id, :issue_detail => true, :type => "ratio"},:remote=>'true', :method => :put, :id=>"issue_query_done_form_#{activity.id}", :class => 'query_form') do %>
|
||||
<li>
|
||||
<p class="label03"> 完成度 : </p>
|
||||
<span class="proInfoP" style="width:70px;"><span><%= activity.done_ratio %>%</span> <a href="javascript:void(0)" class="pic_edit2 ml5"></a> </span>
|
||||
<%= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }),
|
||||
{:include_blank => false, :selected => @done_ratio ? @done_ratio : 0},
|
||||
{:onchange=>"remote_function('#issue_query_done_form_#{activity.id}');",:id=>"done_ratio",:name=>"done_ratio",:class=>"w70 undis issueEdit"}) %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<ul class="fl ">
|
||||
<li>
|
||||
<p class="label03" style="width:50px;"> 开始 : </p>
|
||||
<p class="proInfoP" style="width:100px;"><span><%= format_date(activity.start_date) %></span></p>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li>
|
||||
<p class="label03" style="width:50px;"> 周期 : </p>
|
||||
<span class="proInfoP" style="width:100px;"><%= l_hours(activity.estimated_hours) %></span> </li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<ul class="fl ml20">
|
||||
<li>
|
||||
<p class="label03"> 计划完成 : </p>
|
||||
<span class="proInfoP" style="width:120px;"><span><%= format_date(activity.due_date)? format_date(activity.due_date) : "--" %></span></span> </li>
|
||||
<div class="cl"></div>
|
||||
<li>
|
||||
<p class="label03"> 目标版本 : </p>
|
||||
<span class="proInfoP" style="width:120px;"><%= (activity.fixed_version ? link_to_user_version(activity.fixed_version) : "--") %> </span> </li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<!--pro_info_box end-->
|
||||
</div>
|
@ -0,0 +1,5 @@
|
||||
class AddIsExcellentToCourse < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :courses, :is_excellent, :integer, :default => false
|
||||
end
|
||||
end
|
@ -0,0 +1,7 @@
|
||||
class AddExcellentCourse < ActiveRecord::Migration
|
||||
def up
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
@ -0,0 +1,17 @@
|
||||
class DefineExcellentCourse < ActiveRecord::Migration
|
||||
def up
|
||||
arr = [302,192,370,394,183,361,117,218,379,178,418,203,342,403,225]
|
||||
for i in 0..arr.length-1
|
||||
begin
|
||||
puts arr[i]
|
||||
course = Course.find(arr[i])
|
||||
course.update_attribute(:is_excellent, true)
|
||||
rescue
|
||||
logger.error("Course is not found!")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddStatusToMessage < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :messages, :status, :integer, :default => false
|
||||
end
|
||||
end
|
@ -0,0 +1,27 @@
|
||||
class AddCommitTime < ActiveRecord::Migration
|
||||
def up
|
||||
add_column :project_scores, :commit_time, :datetime, :default => nil
|
||||
count = ProjectScore.all.count / 30 + 2
|
||||
transaction do
|
||||
for i in 1 ... count do i
|
||||
ProjectScore.page(i).per(30).each do |ps|
|
||||
unless ps.project.nil?
|
||||
unless ps.project.gpid.nil?
|
||||
g = Gitlab.client
|
||||
begin
|
||||
changesets = g.commits(ps.project.gpid)
|
||||
ps.commit_time = changesets[0].created_at
|
||||
ps.save
|
||||
rescue
|
||||
logger.error("The project's rep is not exit!")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
@ -0,0 +1,6 @@
|
||||
class AddExcellentOptionToCourse < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :courses, :excellent_option, :integer, :default => false
|
||||
end
|
||||
end
|
||||
|
@ -0,0 +1,19 @@
|
||||
class DefineExcellentOptionCourse < ActiveRecord::Migration
|
||||
def up
|
||||
arr = [151,122,15,227,139,410,291,224,55,137,414,43,417,52,205,44,216,132,204,258,411,50,
|
||||
419,390,420,133,91,112,202,95,194,34,172,403,177,252,138,352,225,46,279,382,397,286,344,27,175,
|
||||
124,265,88,59,110,72,92,392,413,26,201,94,57,156,393,154,12,262]
|
||||
for i in 0..arr.length-1
|
||||
begin
|
||||
puts arr[i]
|
||||
course = Course.find(arr[i])
|
||||
course.update_attribute(:excellent_option, true)
|
||||
rescue
|
||||
logger.error("Course is not found!")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
Loading…
Reference in new issue