Merge branch 'develop' into dev_hjq

Conflicts:
	db/schema.rb
	public/stylesheets/share.css
dev_hjq
ouyangxuhua 10 years ago
commit 7bcf995eaf

@ -39,17 +39,17 @@ class CoursesController < ApplicationController
end end
limit = 15 limit = 15
course_org_ids = OrgCourse.find_by_sql("select distinct organization_id from org_courses where course_id = #{params[:id]}").map(&:organization_id) course_org_ids = OrgCourse.find_by_sql("select distinct organization_id from org_courses where course_id = #{params[:id]}").map(&:organization_id)
@orgs_not_in_course = User.current.organizations.where("organizations.id not in (#{course_org_ids.join(',')}) and organizations.name like ?", condition).page(params[:page].to_i || 1).per(limit) #@orgs_not_in_course = User.current.organizations.where("organizations.id not in (#{course_org_ids.join(',')}) and organizations.name like ?", condition).page(params[:page].to_i || 1).per(limit)
@org_count = User.current.organizations.where("organizations.id not in (#{course_org_ids.join(',')}) and organizations.name like ?", condition).count #@org_count = User.current.organizations.where("organizations.id not in (#{course_org_ids.join(',')}) and organizations.name like ?", condition).count
# if course_org_ids.empty? if course_org_ids.empty?
# @orgs_not_in_course = Organization.where("(is_public or creator_id =?) and name like ?",User.current.id, condition).page((params[:page].to_i || 1)).per(limit) @orgs_not_in_course = User.current.organizations.where("name like ?",condition).page((params[:page].to_i || 1)).per(limit)
# @org_count = Organization.where("is_public = 1 or creator_id =?", User.current.id).where("name like ?", condition).count @org_count = @orgs_not_in_course.count
# else else
# course_org_ids = "(" + course_org_ids.join(',') + ")" course_org_ids = "(" + course_org_ids.join(',') + ")"
# @orgs_not_in_course = Organization.where("id not in #{course_org_ids} and (is_public = 1 or creator_id =?) and name like ?", User.current.id, condition).page((params[:page].to_i || 1)).per(limit) @orgs_not_in_course = User.current.organizations.where("organizations.id not in #{course_org_ids} and organizations.name like ?", condition).page((params[:page].to_i || 1)).per(limit)
# @org_count = Organization.where("id not in #{course_org_ids} and (is_public = 1 or creator_id =?)", User.current.id).where("name like ?", condition).count @org_count = @orgs_not_in_course.empty? ? 0 : @orgs_not_in_course.count
# end end
# @course_count = Project.course_entities.visible.like(params[:name]).page(params[:page]).count @course_count = Project.course_entities.visible.like(params[:name]).page(params[:page]).count
@orgs_page = Paginator.new @org_count, limit,params[:page] @orgs_page = Paginator.new @org_count, limit,params[:page]
@hint_flag = params[:hint_flag] @hint_flag = params[:hint_flag]
#render :json => {:orgs => @orgs_not_in_course, :count => @org_count}.to_json #render :json => {:orgs => @orgs_not_in_course, :count => @org_count}.to_json

@ -230,6 +230,7 @@ class FilesController < ApplicationController
@order = "" @order = ""
@is_remote = false @is_remote = false
if params[:project_id] if params[:project_id]
@page = params[:page] ? params[:page].to_i + 1 : 2
@container_type = 0 @container_type = 0
if params[:sort] if params[:sort]
params[:sort].split(",").each do |sort_type| params[:sort].split(",").each do |sort_type|
@ -827,6 +828,6 @@ class FilesController < ApplicationController
end end
def upload_files_menu def upload_files_menu
p 1
end end
end end

@ -412,6 +412,7 @@ class IssuesController < ApplicationController
if params[:issue_id] if params[:issue_id]
@issue_id = params[:issue_id] @issue_id = params[:issue_id]
end end
@priorities = IssuePriority.active
respond_to do |format| respond_to do |format|
format.js format.js
end end

@ -357,7 +357,7 @@ update
@changesets = g.commits(@project.gpid, :ref_name => @rev) @changesets = g.commits(@project.gpid, :ref_name => @rev)
# @changesets = @repository.latest_changesets(@path, @rev) # @changesets = @repository.latest_changesets(@path, @rev)
# @changesets_count = @repository.latest_changesets(@path, @rev).count # @changesets_count = @repository.latest_changesets(@path, @rev).count
@changesets_all_count = @project.gpid.nil? ? 0 : g.commits_total_count(@project.gpid).count @changesets_all_count = @project.gpid.nil? ? 0 : g.project(@project.gpid).commit_count
@changesets_latest_coimmit = @changesets[0] @changesets_latest_coimmit = @changesets[0]
@properties = @repository.properties(@path, @rev) @properties = @repository.properties(@path, @rev)
@repositories = @project.repositories @repositories = @project.repositories

@ -59,6 +59,19 @@ module ApplicationHelper
end end
end end
# 判断组织左侧展开或者隐藏
def is_hide_org_left obj
if obj.nil?
return true
else
if obj.hide == 0
return true
else
return false
end
end
end
# Time 2015-03-24 16:38:05 # Time 2015-03-24 16:38:05
# Author lizanle # Author lizanle
# Description after save后需要进行资源记录的更新 # Description after save后需要进行资源记录的更新
@ -2771,8 +2784,7 @@ int main(int argc, char** argv){
#代码提交数量 #代码提交数量
def changesets_num project def changesets_num project
g = Gitlab.client g = Gitlab.client
project.gpid.nil? ? 0 : g.commits_total_count(project.gpid).count project.gpid.nil? ? 0 : g.project(project.gpid).commit_count
# # commits_total_count(project.gpid)
# project.changesets.count # project.changesets.count
end end
end end

@ -37,7 +37,10 @@
<ul class="mt10"> <ul class="mt10">
<%=labelled_form_for @new_course do |f| %> <%=labelled_form_for @new_course do |f| %>
<input name="copy_course" value="<%=@course.id %>" style="display: none"/> <input name="copy_course" value="<%=@course.id %>" style="display: none"/>
<li class="ml45 mb10"> <a href="javascript:void(0)" class="upimg fl"> <img alt="上传图片" id="avatar_image" src="images/courses/pic_courses.jpg" height="60" width="60"> </a> <!--<a href="javascript:void(0)" class="upbtn fl ml30" onclick="$('#upload_course_logo').click();">上传图片</a>--> <li class="ml45 mb10">
<a href="javascript:void(0)" class="upimg fl">
<%= image_tag(url_to_avatar(@new_course), id: "avatar_image", :width =>"60", :height =>"60",:alt=>"上传图片")%>
</a> <!--<a href="javascript:void(0)" class="upbtn fl ml30" onclick="$('#upload_course_logo').click();">上传图片</a>-->
<!--</span>--> <!--</span>-->
<div class="cl"></div> <div class="cl"></div>
</li> </li>

@ -12,13 +12,14 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="mt15 grey_c lh22"> <div class="mt15 grey_c lh22">
<%= link_to "复制学期", copy_course_course_path(@course.id),:remote=>true, :class => "term_btn fl" %>
<!--<a href="javascript:" class="term_btn fl" onclick="copyTerm();"> <!--<a href="javascript:" class="term_btn fl" onclick="copyTerm();">
复制学期 复制学期
</a>--> </a>-->
<div class="disable_btn fl"> <!--<div class="disable_btn fl">
<span style="display: inline-block">复制学期</span> <span style="display: inline-block">复制学期</span>
<span style="display: inline-block">(开发中...)</span> <span style="display: inline-block">(开发中...)</span>
</div> </div>-->
复制学期将为您创建一个新的课程学期,新学期将继承本学期的相关资源,具体您稍后可以选择。 复制学期将为您创建一个新的课程学期,新学期将继承本学期的相关资源,具体您稍后可以选择。
</div> </div>
<div class="cl"></div> <div class="cl"></div>

@ -1,3 +1,6 @@
if(document.getElementById("popbox02")) {
hideModal("#popbox02");
}
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'copy_course') %>'); $('#ajax-modal').html('<%= escape_javascript(render :partial => 'copy_course') %>');
showModal('ajax-modal', '730px'); showModal('ajax-modal', '730px');
$('#ajax-modal').css('height','530px').css('width','730px'); $('#ajax-modal').css('height','530px').css('width','730px');

@ -123,7 +123,7 @@
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div id="course_list"> <div id="course_list">
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments, :page=>2} %> <%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %>
</div> </div>
</div> </div>
<% html_title(l(:label_attachment_plural)) -%> <% html_title(l(:label_attachment_plural)) -%>

@ -45,8 +45,17 @@
<% end %> <% end %>
<% end %> <% end %>
<ul class="wlist"> <% if project_attachments.count == 10%>
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%> <% if params[:action] == 'search_project' %>
</ul> <!--<ul class="wlist">-->
<!--<%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>-->
<!--</ul>-->
<%=link_to "点击展开更多", search_project_project_files_path({:project_id => project.id, :page => @obj_pages.nil? ? @feedback_pages.page + 1 : @obj_pages.page + 1}.merge(params)),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
<%else%>
<!-- 全站搜索的时候 返回的页码对象是obj_pages,而站内搜索返回的页码对象是feedback_pages -->
<%=link_to "点击展开更多", project_files_path(:project_id => project.id,:page => @page),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
<%end%>
<% end%>

@ -1,5 +1,5 @@
<% if @project %> <% if @project %>
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/upload_project_files_on_navbar',:locals => {:container => @project}) %>'); $('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_project_files',:locals => {:project => @project,:project_attachment_type => 1}) %>');
showModal('ajax-modal', '513px'); showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove(); $('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>"); $('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");

@ -1,6 +1,21 @@
<% if @issue_id %> //issue详情中回复 <% if @issue_id %> //issue详情中回复
$("#reply_div_<%= @issue_id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => Issue.find( @issue_id),:replies_all_i=>0}) %>"); $("#reply_div_<%= @issue_id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => Issue.find( @issue_id),:replies_all_i=>0}) %>");
$("#div_issue_attachment_<%=@issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_attachments', :locals => {:issue => Issue.find( @issue_id)}) %>"); $("#div_issue_attachment_<%=@issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_attachments', :locals => {:issue => Issue.find( @issue_id)}) %>");
$("#issue_edit").replaceWith('<%= escape_javascript(render :partial => 'issues/edit') %>')
sd_create_editor_from_data(<%= @issue.id%>, null, "100%");
issue_desc_editor = KindEditor.create('#issue_description',
{"width":"85%",
"resizeType":0,
"no_label":true,
"at_id":<%= @issue.project_id%>,
"at_type":"Project",
"autoHeightMode":true,
"afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);};if(typeof enableAt ==='function'){enableAt(self, \"<%=@issue.project_id %>\", 'Project');}; this.loadPlugin('autoheight')})",
"emotionsBasePath":'<%= Setting.host_name%>',
"height":300,
"allowFileManager":true,
"uploadJson":"/kindeditor/upload",
"fileManagerJson":"/kindeditor/filemanager"});
// $("#issue_test_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/edit', :locals => {:issue => Issue.find( @issue_id)}) %>"); // $("#issue_test_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/edit', :locals => {:issue => Issue.find( @issue_id)}) %>");
$(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue_id).journals.count %>)') $(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue_id).journals.count %>)')
sd_create_editor_from_data(<%= @issue.id %>, null, "100%"); sd_create_editor_from_data(<%= @issue.id %>, null, "100%");

@ -148,7 +148,7 @@
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %> <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
<div class="mt10"> <div class="mt10">
<% projects = activity.student_work_projects.where("is_leader = 1") %> <% projects = activity.student_work_projects.where("is_leader = 1") %>
<div class="fl mr20 fontGrey3 w80"> <div class="fl mr20 fontGrey3">
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %> 已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -173,7 +173,7 @@
<% time=project.updated_on %> <% time=project.updated_on %>
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
<p><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p> <p><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
<p><%=time_from_now time %>&nbsp;&nbsp;<%=changesets_num project %>提交</p> <p><%=time_from_now time %></p>
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>"> <div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>">
项目名称:<%=project.name %><br /> 项目名称:<%=project.name %><br />
创建者:<%=(User.find project.user_id).show_name %>(组长)<br /> 创建者:<%=(User.find project.user_id).show_name %>(组长)<br />

@ -37,10 +37,10 @@
<% org_activity_field = organization.org_subfields.where('field_type="default" and name="activity" and field_type="default"').first %> <% org_activity_field = organization.org_subfields.where('field_type="default" and name="activity" and field_type="default"').first %>
<% org_course_field = organization.org_subfields.where('field_type="default" and name="course" and field_type="default"').first %> <% org_course_field = organization.org_subfields.where('field_type="default" and name="course" and field_type="default"').first %>
<% org_project_field = organization.org_subfields.where('field_type="default" and name="project" and field_type="default"').first %> <% org_project_field = organization.org_subfields.where('field_type="default" and name="project" and field_type="default"').first %>
<div class="homepageLeftMenuBlock" style="display:<%= org_activity_field.hide == 0?'block':'none' %>;" id="org_subfield_<%= org_activity_field.id %>"> <div class="homepageLeftMenuBlock" style="display:<%= is_hide_org_left(org_activity_field) ? 'block':'none' %>;" id="org_subfield_<%= org_activity_field.id %>">
<%= link_to "动态",organization_path(organization), :class => "homepageMenuText" %> <%= link_to "动态",organization_path(organization), :class => "homepageMenuText" %>
</div> </div>
<div style="display:<%= org_project_field.hide == 0?'block':'none' %>;" id="org_subfield_<%= org_project_field.id %>"> <div style="display:<%= is_hide_org_left(org_project_field) ? 'block':'none' %>;" id="org_subfield_<%= org_project_field.id %>">
<div class="homepageLeftMenuBlock"> <div class="homepageLeftMenuBlock">
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuProjects').slideToggle();">项目</a> <a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuProjects').slideToggle();">项目</a>
<% if User.current.logged? and User.current.admin_of_org?(organization) %> <% if User.current.logged? and User.current.admin_of_org?(organization) %>
@ -54,7 +54,7 @@
</ul> </ul>
</div> </div>
</div> </div>
<div style="display:<%= org_course_field.hide == 0?'block':'none' %>;" id="org_subfield_<%= org_course_field.id %>"> <div style="display:<%= is_hide_org_left(org_course_field) ? 'block':'none' %>;" id="org_subfield_<%= org_course_field.id %>">
<div class="homepageLeftMenuBlock"> <div class="homepageLeftMenuBlock">
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">课程</a> <a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">课程</a>
<% if User.current.logged? and User.current.admin_of_org?(organization) %> <% if User.current.logged? and User.current.admin_of_org?(organization) %>

@ -148,7 +148,7 @@
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %> <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
<div class="mt10"> <div class="mt10">
<% projects = activity.student_work_projects.where("is_leader = 1") %> <% projects = activity.student_work_projects.where("is_leader = 1") %>
<div class="fl mr20 fontGrey3 w80"> <div class="fl mr20 fontGrey3">
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %> 已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -173,7 +173,7 @@
<% time=project.updated_on %> <% time=project.updated_on %>
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
<p><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p> <p><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
<p><%=time_from_now time %>&nbsp;&nbsp;<%=changesets_num project %>提交</p> <p><%=time_from_now time %></p>
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>"> <div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>">
项目名称:<%=project.name %><br /> 项目名称:<%=project.name %><br />
创建者:<%=(User.find project.user_id).show_name %>(组长)<br /> 创建者:<%=(User.find project.user_id).show_name %>(组长)<br />

@ -1,5 +1,3 @@
<div class="boxContainer"> <div class="boxContainer">
<div> <div>
<div class="sendText fl mr10" style="width: auto">发送到</div> <div class="sendText fl mr10" style="width: auto">发送到</div>

@ -5,7 +5,7 @@
<!--<img src="images/homepageImage.jpg" width="50" height="50" alt="个人头像" />--> <!--<img src="images/homepageImage.jpg" width="50" height="50" alt="个人头像" />-->
</div> </div>
<div class="fl"> <div class="fl">
<p class="homepageImageName mb5" style="max-width:88px;"><%= user %></p> <p class="homepageImageName mb5" style="max-width:88px;font-size:16px; color:#484848; margin-left:15px; margin-right:8px; height:21px; float:left;"><%= user %></p>
<span class="homepageImageSex"></span> <span class="homepageImageSex"></span>
<div class="cl"></div> <div class="cl"></div>
<p class="mb8 c_dark f14"> <p class="mb8 c_dark f14">

@ -150,7 +150,7 @@
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1 %> <% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1 %>
<div class="mt10"> <div class="mt10">
<% projects = homework_common.student_work_projects.where("is_leader = 1") %> <% projects = homework_common.student_work_projects.where("is_leader = 1") %>
<div class="fl mr20 fontGrey3 w80"> <div class="fl mr20 fontGrey3">
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %> 已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -174,7 +174,7 @@
<% time=project.updated_on %> <% time=project.updated_on %>
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
<p><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p> <p><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
<p><%=time_from_now time %>&nbsp;&nbsp;<%=changesets_num project %>提交</p> <p><%=time_from_now time %></p>
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=homework_common.id %>"> <div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=homework_common.id %>">
项目名称:<%=project.name %><br /> 项目名称:<%=project.name %><br />
创建者:<%=(User.find project.user_id).show_name %>(组长)<br /> 创建者:<%=(User.find project.user_id).show_name %>(组长)<br />

@ -1,10 +1,3 @@
//var popupHeight = $(".resourceSharePopup").outerHeight(true);
//$(".resourceSharePopup").css("marginTop",-popupHeight/2);
//
//$("#upload_box").css('left','').css('top','');
//$("#upload_box").html('<%#= escape_javascript( render :partial => "resource_share_for_project_popup" ,:locals => {:projects=>@projects,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
//$("#upload_box").css('display','block');
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_project_popup', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>'); $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_project_popup', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
showModal('ajax-modal', '452px'); showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove(); $('#ajax-modal').siblings().remove();

@ -6,6 +6,9 @@
destroyedItem.fadeOut(600,function(){ destroyedItem.fadeOut(600,function(){
destroyedItem.remove(); destroyedItem.remove();
}); });
<% if @jours_count && @jours_count == 0 %>
$("#user_jour_list").css("padding","0px");
<% end %>
<% else %> <% else %>
<% if @bid && @jours_count %> <% if @bid && @jours_count %>
$('#jours_count').html("<%= @jours_count %>"); $('#jours_count').html("<%= @jours_count %>");

@ -1,9 +1,9 @@
class ChangeAttachmentHistory < ActiveRecord::Migration class ChangeAttachmentHistory < ActiveRecord::Migration
def up def up
attachments = Attachment.where("container_type =?", "Version") # attachments = Attachment.where("container_type =?", "Version")
attachments.each do |am| # attachments.each do |am|
am.update_attribute(:container_type, "Project") unless am.nil? # am.update_attribute(:container_type, "Project") unless am.nil?
end # end
end end
def down def down

@ -5,6 +5,8 @@ module Trustie
module Gitlab module Gitlab
module ManageMember module ManageMember
attr :g
include Helper
def self.included(base) def self.included(base)
base.class_eval { base.class_eval {
before_create :add_gitlab_member before_create :add_gitlab_member

@ -2,6 +2,9 @@
Copyright (C) 2006-2013 Jean-Philippe Lang Copyright (C) 2006-2013 Jean-Philippe Lang
Modified by Jianfeng Tao, to upload one avatar for user*/ Modified by Jianfeng Tao, to upload one avatar for user*/
(function(){
function addFile(inputEl, file, eagerUpload) { function addFile(inputEl, file, eagerUpload) {
var fileSpan = $('#avatar_file'); var fileSpan = $('#avatar_file');
@ -109,7 +112,7 @@ function uploadBlob(blob, uploadUrl, source_type,source_id, options) {
}); });
} }
function addInputAvatar(inputEl) { window.addInputAvatar = function(inputEl) {
// var clearedFileInput = $(inputEl).clone().val(''); // var clearedFileInput = $(inputEl).clone().val('');
if (inputEl.files) { if (inputEl.files) {
@ -129,7 +132,6 @@ function addInputAvatar(inputEl) {
//clearedFileInput.insertAfter('#avatars_fields'); //clearedFileInput.insertAfter('#avatars_fields');
} }
function uploadAndAttachFiles(files, inputEl) { function uploadAndAttachFiles(files, inputEl) {
var maxFileSize = $(inputEl).data('max-file-size'); var maxFileSize = $(inputEl).data('max-file-size');
@ -170,8 +172,10 @@ function uploadAndTypeFiles(files, inputEl) {
} }
} }
function handleFileDropEvent(e) {
function handleFileDropEvent(e) {
$(this).removeClass('fileover'); $(this).removeClass('fileover');
blockEventPropagation(e); blockEventPropagation(e);
@ -191,6 +195,7 @@ function dragOutHandler(e) {
} }
function setupFileDrop() { function setupFileDrop() {
console.log("setupFileDrop");
$('#avatar_image').on('click', function(){ $('#avatar_image').on('click', function(){
console.log("click"); console.log("click");
}); });
@ -209,3 +214,5 @@ function setupFileDrop() {
} }
$(document).ready(setupFileDrop); $(document).ready(setupFileDrop);
})();

@ -66,16 +66,22 @@ h4{ font-size:14px; color:#3b3b3b;}
.ml15{ margin-left:15px;} .ml15{ margin-left:15px;}
.ml16{ margin-left: 16px;} .ml16{ margin-left: 16px;}
.ml20{ margin-left:20px;} .ml20{ margin-left:20px;}
.ml30{margin-left:30px !important;}
.ml35{margin-left: 35px;} .ml35{margin-left: 35px;}
.ml40{ margin-left:40px;} .ml40{ margin-left:40px;}
.ml45{ margin-left:45px;} .ml45{ margin-left:45px;}
.ml48{ margin-left:48px;}
.ml53{margin-left:53px;}
.ml55{ margin-left:55px;} .ml55{ margin-left:55px;}
.ml58{margin-left:58px;}
.ml30{ margin-left:30px;} .ml30{ margin-left:30px;}
.ml38{ margin-left:38px;} .ml38{ margin-left:38px;}
.ml60{ margin-left:60px;} .ml60{ margin-left:60px;}
.ml160 {margin-left:160px;} .ml160 {margin-left:160px;}
.ml80{ margin-left:80px;} .ml80{ margin-left:80px;}
.ml85{margin-left:85px;}
.ml90{ margin-left:90px;} .ml90{ margin-left:90px;}
.ml95{margin-left:95px;}
.ml100{ margin-left:100px;} .ml100{ margin-left:100px;}
.ml110{ margin-left:110px;} .ml110{ margin-left:110px;}
.ml125 { margin-left:125px;} .ml125 { margin-left:125px;}
@ -161,6 +167,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.h70{ height:70px;} .h70{ height:70px;}
.h150{ height:150px;} .h150{ height:150px;}
.p10 {padding-left:10px; padding-right:10px;} .p10 {padding-left:10px; padding-right:10px;}
.mw400 {max-width: 400px;}
/* Font & background Color */ /* Font & background Color */
a.b_grey{ background: #F5F5F5;} a.b_grey{ background: #F5F5F5;}
@ -295,6 +302,7 @@ a:hover.bgreen_n_btn{background:#08a384;}
.blue_btn_cir{ background:#3498db; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;} .blue_btn_cir{ background:#3498db; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;}
.orange_btn_cir{ background:#e67e22; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;} .orange_btn_cir{ background:#e67e22; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;}
.bgreen_btn_cir{ background:#1abc9c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;} .bgreen_btn_cir{ background:#1abc9c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;}
.grey_border{border:1px solid #dddddd !important; }
/* commonpic */ /* commonpic */
.pic_date{ display:block; background:url(../images/new_project/public_icon.png) -31px 0 no-repeat; width:16px; height:15px; float:left;} .pic_date{ display:block; background:url(../images/new_project/public_icon.png) -31px 0 no-repeat; width:16px; height:15px; float:left;}
.pic_add{ display:block; background:url(../images/new_project/public_icon.png) -31px -273px no-repeat; width:16px; height:15px; float:left;} .pic_add{ display:block; background:url(../images/new_project/public_icon.png) -31px -273px no-repeat; width:16px; height:15px; float:left;}
@ -497,7 +505,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-
.homepageFollowCancel {background:url(../images/homepage_icon.png) -178px -8px no-repeat; width:20px; height:20px; position:absolute; right:9px; top:9px;} .homepageFollowCancel {background:url(../images/homepage_icon.png) -178px -8px no-repeat; width:20px; height:20px; position:absolute; right:9px; top:9px;}
.homepageEditProfile {width:16px; height:16px; border-radius:2px; background-color:#888888; position:absolute; right:5px; bottom:5px; font-size:12px; filter:alpha(opacity=50); -moz-opacity:0.5; opacity: 0.5;} .homepageEditProfile {width:16px; height:16px; border-radius:2px; background-color:#888888; position:absolute; right:5px; bottom:5px; font-size:12px; filter:alpha(opacity=50); -moz-opacity:0.5; opacity: 0.5;}
.homepageEditProfileIcon {background:url(../images/homepage_icon.png) -14px -37px no-repeat; width:16px; height:16px; display:block;} .homepageEditProfileIcon {background:url(../images/homepage_icon.png) -14px -37px no-repeat; width:16px; height:16px; display:block;}
.homepageImageName {font-size:16px; color:#484848; margin-left:15px; margin-right:8px; height:25px; float:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} .homepageImageName {font-size:16px; color:#484848; margin-left:15px; margin-right:8px; height:25px; float:left;}
.homepageImageSex {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;} .homepageImageSex {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;}
.homepageImageSex2 {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -150px no-repeat; float:left;} .homepageImageSex2 {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -150px no-repeat; float:left;}
.homepageSignature {font-size:12px; color:#888888; margin-left:15px; margin-top:10px; margin-bottom:12px; width:208px;} .homepageSignature {font-size:12px; color:#888888; margin-left:15px; margin-top:10px; margin-bottom:12px; width:208px;}
@ -665,6 +673,9 @@ a.loginChooseTab {color:#484848; height:30px; display:block;}
.referenceTypeActive {background-color:#269ac9; color:#ffffff !important;} .referenceTypeActive {background-color:#269ac9; color:#ffffff !important;}
a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;} a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;}
/*复制课程弹窗*/
.copyCoursePopup {width:750px !important; height:auto !important; border:3px solid #269ac9 !important; padding-left:16px !important; padding-right:16px !important; padding-bottom:16px !important; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-375px; z-index:1000;}
/*底部*/ /*底部*/
#Footer{background-color:#ffffff; margin-bottom:10px; padding-bottom:15px; color:#666666;} #Footer{background-color:#ffffff; margin-bottom:10px; padding-bottom:15px; color:#666666;}
.footerAboutContainer {width:auto; border-bottom:1px solid #efefef;} .footerAboutContainer {width:auto; border-bottom:1px solid #efefef;}
@ -959,12 +970,37 @@ span.at a{color:#269ac9;text-decoration: none;}
.sectionContent li:hover {background-color:#cccccc;} .sectionContent li:hover {background-color:#cccccc;}
.sectionContent span {width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block; height:20px; vertical-align:top;} .sectionContent span {width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block; height:20px; vertical-align:top;}
.orgDirection {width:392px; background-color:#f1f1f1; height:30px; vertical-align:middle; line-height:30px; color:#585858; padding-left:10px;} .orgDirection {width:392px; background-color:#f1f1f1; height:30px; vertical-align:middle; line-height:30px; color:#585858; padding-left:10px;}
.orgSendSearch {border:1px solid #dddddd; outline:none; width:262px; height:22px; padding-left:10px; float:left;}
/*新课程、项目资源库*/ /*新课程、项目资源库*/
.reCon{ margin:5px; width:710px;} .reCon{ margin:5px; width:710px;}
.reTop{width:710px; height:40px; background:#eaeaea; padding:5px;} .reTop{width:710px; height:40px; background:#eaeaea; padding:5px;}
.researchBox { width:240px; height:24px; border:1px solid #dddddd; color:#666666; outline:none;} .researchBox { width:240px; height:24px; border:1px solid #dddddd; color:#666666; outline:none;}
.blueBtn{ width:60px; height:26px; color:#FFF; border:none; background-color:#269ac9; cursor:pointer; padding-left:0px; text-align:center;} .blueBtn{ width:60px; height:26px; color:#FFF; border:none; background-color:#269ac9; cursor:pointer; padding-left:0px; text-align:center;}
.blueBtn:hover {background-color:#298fbd;} .blueBtn:hover {background-color:#298fbd;}
/*文本描述展开高度*/ /*文本描述展开高度*/
.maxh360 {max-height: 810px;} .maxh360 {max-height: 810px;}
.lh18 { line-height: 18px;} .lh18 { line-height: 18px;}
/*151228样式更新*/
.menuSetting {background:url(../images/hwork_icon.png) -5px -132px no-repeat; display:inline-block; width:20px; height:20px;}
.boxShadow {box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);}
a.greyBtn{ display:inline-block; background:#f2f3f3; padding:0px 5px; height:20px; border:1px solid #d3d3d3; color:#888888; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
a:hover.greyBtn{border:1px solid #888888; }
a.blueBtn{ display:inline-block; background:#269ac9; padding:0px 5px; height:20px; border:1px solid #269ac9; color:#ffffff; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
a.blueBtn:hover {background-color:#298fbd;}
a.cancelBtn{ display:inline-block; background:#c1c1c1; padding:0px 5px; height:20px; border:1px solid #d3d3d3; color:#ffffff; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
a.cancelBtn:hover {background:#888888;}
a.userFollow{ display:inline-block; width:55px; height:20px; border:1px solid #d3d3d3; color:#888888; background:#f2f3f3 url(../images/homepage_icon2.png) -9px -6px no-repeat; padding-left:25px; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
a:hover.userFollow{border:1px solid #888888; }
a.userCancel{ display:inline-block; width:55px; height:20px; border:1px solid #d3d3d3; color:#888888; background:#f2f3f3 url(../images/homepage_icon2.png) -177px -6px no-repeat; padding-left:25px; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
a:hover.userCancel{border:1px solid #888888; }
.pAbsolute {position:absolute; z-index:999;}
.userAvatarWrap {width:50px; height:50px; position:relative; border:1px solid #cbcbcb; padding: 2px;}
.userAvatarWrap:hover {border:1px solid #269ac9;}
.mr27 {margin-right:27px;}
.userCard {width:208px; border:1px solid #dddddd; background-color:#ffffff; margin-top:10px; padding:15px; top:-176px; left:-95px; position:absolute; z-index:999; display:none;}
.userCard font {display:block; border-width:8px; position:absolute; bottom:-16px; left:110px; border-style:solid dashed dashed dashed; border-color:#FFF transparent transparent transparent; font-size:0; line-height:0;}
.userCard em {display:block; border-width:8px; position:absolute; bottom:-17px; left:110px; border-style:solid dashed dashed dashed; border-color:#eaeaea transparent transparent transparent; font-size:0; line-height:0;}
.userCardM {width:201px; height:20px; border:1px solid #dddddd; resize:none;}
.resourceCopy {padding:0px; margin:0px; width:12px; height:12px; display:inline-block;}

Loading…
Cancel
Save