Merge branch 'cxt_course' of https://git.trustie.net/jacknudt/trustieforge into cxt_course
Conflicts: app/views/layouts/_project_info.html.erbcxt_course
commit
76063b0911
@ -1,5 +1,5 @@
|
||||
<% if User.current.logged? && User.current.id == @user.id %>
|
||||
<%= form_for @article, :url =>{:controller=>'blog_comments',:action => 'update',:user_id=>@user.id , :blog_id => @article.id, :is_homepage => params[:is_homepage]},:method=>'PUT',
|
||||
<%= form_for @article, :url =>{:controller=>'blog_comments',:action => 'update',:user_id=>@user.id , :blog_id => @article.id, :is_homepage => params[:is_homepage],:in_act => params[:in_act]},:method=>'PUT',
|
||||
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
|
||||
<%= render :partial => 'blog_comments/edit', :locals => {:f => f, :article => @article, :edit_mode => true, :user => @user} %>
|
||||
<% 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', :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', :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', :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', :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,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
|
@ -0,0 +1,17 @@
|
||||
class ExcellentCourse < 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,19 @@
|
||||
class ExcellentOptionCourse < 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
|
@ -0,0 +1,17 @@
|
||||
class ExcellentCourseSe < 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,19 @@
|
||||
class ExcellentOptionSe < 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
|
@ -0,0 +1,20 @@
|
||||
class UpdateJournalForMessage < ActiveRecord::Migration
|
||||
def up
|
||||
journals = JournalsForMessage.where("m_parent_id is null and jour_type ='Principal' ")
|
||||
count = journals.count / 30 + 2
|
||||
transaction do
|
||||
for i in 1 ... count do i
|
||||
journals.page(i).per(30).each do |jour|
|
||||
act = UserActivity.where("act_type='JournalsForMessage' and act_id = #{jour.id}").first
|
||||
unless act.nil?
|
||||
jour.updated_on = act.updated_at
|
||||
jour.save
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddIsCopyToCourse < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :courses, :is_copy, :integer, :default => 0
|
||||
end
|
||||
end
|
Loading…
Reference in new issue