Merge remote-tracking branch 'origin/szzh' into szzh

This commit is contained in:
lizanle 2015-11-03 10:37:21 +08:00
commit 594a1b01ef
21 changed files with 281 additions and 85 deletions

View File

@ -107,7 +107,7 @@ class CoursesController < ApplicationController
courses = Course.visible courses = Course.visible
@courses = paginateHelper courses,10 @courses = paginateHelper courses,10
else else
courses = Course.visible.where("LOWER(name) like '%#{params[:name].to_s.downcase}%'") courses = Course.visible.where("LOWER(name) like '%#{params[:name].to_s.downcase}%'").order("time desc, created_at desc")
@courses = paginateHelper courses,10 @courses = paginateHelper courses,10
end end
@name = params[:name] @name = params[:name]

View File

@ -215,11 +215,11 @@ update
end end
end end
unless @repository.gitlab? # unless @repository.gitlab?
# redirect_to to_gitlab_project_repository_path(@project, @repository) # # redirect_to to_gitlab_project_repository_path(@project, @repository)
render :to_gitlab # render :to_gitlab
return # return
end # end
#if( !User.current.member_of?(@project) || @project.hidden_repo) #if( !User.current.member_of?(@project) || @project.hidden_repo)
@repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty? @repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty?
@ -252,11 +252,10 @@ update
project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
ip = RepositoriesHelper::REPO_IP_ADDRESS ip = RepositoriesHelper::REPO_IP_ADDRESS
gitlab_address = Redmine::Configuration['gitlab_address'] gitlab_address = Redmine::Configuration['gitlab_address']
if @repository.type.to_s=="Repository::Gitlab" if @repository.type.to_s == "Repository::Gitlab"
@repos_url = gitlab_address.to_s+"/"+@project.owner.to_s+"/"+@repository.identifier+"."+"git" @repos_url = gitlab_address.to_s+"/"+@project.owner.to_s+"/"+@repository.identifier+"."+"git"
else else
@repos_url = "http://"+@repository.login.to_s+"_"+@repository.identifier.to_s+"@"+ip.to_s+ @repos_url = "http://"+@repository.login.to_s+"_"+@repository.identifier.to_s+"@"+ip.to_s + @repository.url.slice(project_path_cut, @repository.url.length).to_s
@repository.url.slice(project_path_cut, @repository.url.length).to_s
end end
if @course_tag == 1 if @course_tag == 1
render :action => 'show', :layout => 'base_courses' render :action => 'show', :layout => 'base_courses'

View File

@ -609,6 +609,12 @@ module ApplicationHelper
return @result return @result
end end
# 判断版本库是否初始为gitlab
def rep_is_gitlab?(project)
rep = Repository.where("project_id =? and type =?", project, "Repository::Gitlab")
return rep.blank? ? true :false
end
# 判断当前用户是否为项目管理员 # 判断当前用户是否为项目管理员
def is_project_manager?(user_id, project_id) def is_project_manager?(user_id, project_id)
@result = false @result = false

View File

@ -117,6 +117,22 @@ module ProjectsHelper
end end
end end
# 获取新增gitlab版本库
def rep_gitlab(project)
rep = Repository.where("project_id =? and type =?", project, "Repository::Gitlab")
end
# 获取新项目的版本库地址
def rep_gitlab_url(project)
gitlab_address = Redmine::Configuration['gitlab_address']
url = gitlab_address.to_s+"/"+project.owner.to_s+"/"+project.identifier+"."+"git"
end
# # 获取Forge历史版本库
def rep_forge(project)
rep = Repository.where("project_id =? and type =?", project, "Repository::Git")
end
# Added by young # Added by young
def course_settings_tabs def course_settings_tabs
tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural, :course=>'1'}, tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural, :course=>'1'},

View File

@ -2,6 +2,8 @@
$('#pro_st_tbc_03').html('<%= escape_javascript(render :partial => 'projects/settings/new_members') %>'); $('#pro_st_tbc_03').html('<%= escape_javascript(render :partial => 'projects/settings/new_members') %>');
<%elsif @course%> <%elsif @course%>
$('#course_members_setting').html('<%= escape_javascript(render :partial => 'courses/course_members') %>'); $('#course_members_setting').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
$("#teacher_number").html("<%= searchTeacherAndAssistant(@course).count %>")
$("#student_number").html("<%= studentCount(@course) %>");
<%end%> <%end%>
hideOnLoad(); hideOnLoad();

View File

@ -17,7 +17,7 @@
<ul class="setting_left"> <ul class="setting_left">
<li>登录名&nbsp;:&nbsp;<span style="color:red;">*</span></li> <li>登录名&nbsp;:&nbsp;<span style="color:red;">*</span></li>
<li>邮箱&nbsp;:&nbsp;<span style="color:red;">*</span></li> <li>邮箱&nbsp;:&nbsp;<span style="color:red;">*</span></li>
<li>身份&nbsp;:&nbsp;</li> <li>身份&nbsp;:&nbsp;<span style="color:red;">*</span></li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">姓(First Name)&nbsp;:&nbsp;<span style="color:red;">*</span></li> <li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">姓(First Name)&nbsp;:&nbsp;<span style="color:red;">*</span></li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">名(Last Name)&nbsp;:&nbsp;<span style="color:red;">*</span></li> <li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">名(Last Name)&nbsp;:&nbsp;<span style="color:red;">*</span></li>
<li nhname="tag" nh_tag_2="true" style="display:none;">组织名&nbsp;:&nbsp;<span style="color:red;">*</span></li> <li nhname="tag" nh_tag_2="true" style="display:none;">组织名&nbsp;:&nbsp;<span style="color:red;">*</span></li>
@ -34,7 +34,10 @@
<li><%= f.text_field :mail,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210"%></li> <li><%= f.text_field :mail,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210"%></li>
<li> <li>
<select onchange="showtechnical_title(this.value);" name="identity" id="userIdentity" class="location" class="w70" style="height:28px;margin-left:2px;"> <select onchange="showtechnical_title(this.value);" required = true, nh_required="1" name="identity" id="userIdentity" class="location" class="w70" style="height:28px;margin-left:2px;">
<option value="-1">
<%= l(:label_account_identity_choose) %>
</option>
<option value="0"> <option value="0">
<%= l(:label_account_identity_teacher) %> <%= l(:label_account_identity_teacher) %>
</option> </option>
@ -61,6 +64,7 @@
<%= text_field_tag :no, nil, :placeholder => l(:label_account_identity_studentID),:style=>"60px" %></span> <%= text_field_tag :no, nil, :placeholder => l(:label_account_identity_studentID),:style=>"60px" %></span>
<% end %> <% end %>
</span> </span>
<span id="identity_hint" style="display: none"></span>
</li> </li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= f.text_field :lastname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %> <li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= f.text_field :lastname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %>
@ -701,6 +705,11 @@
$("#users_tb_2").click(); $("#users_tb_2").click();
<% end %> <% end %>
$('#my_account_form_link').click(function(e){ $('#my_account_form_link').click(function(e){
if($("#userIdentity").val() == -1 ) {
$("#identity_hint").html('<span style="color:red">请选择身份</span>').show();
e.stopImmediatePropagation();
return;
}
if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话 if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话
$("#hint").html('<span style="color:red">学校必须是从下拉列表中选择的,不能手动修改</span>').show(); $("#hint").html('<span style="color:red">学校必须是从下拉列表中选择的,不能手动修改</span>').show();
e.stopImmediatePropagation(); e.stopImmediatePropagation();

View File

@ -42,8 +42,15 @@
<%# --版本库被设置成私有、module中设置不显示、没有创建版本库 三种情况不显示-- %> <%# --版本库被设置成私有、module中设置不显示、没有创建版本库 三种情况不显示-- %>
<% if visible_repository?(@project) %> <% if visible_repository?(@project) %>
<div class="subNav"> <div class="subNav">
<%= link_to l(:project_module_repository), {:controller => 'repositories', :action => 'show', :id => @project.id, to: 'gitlab'}, :class => "f14 c_blue02" %> <% if rep_is_gitlab?(@project) %>
<%= link_to l(:project_module_repository), {:controller => 'projects', :action => 'settings', :id => @project.id, :tab=>'repositories'}, :class => "f14 c_blue02" %>
<% else %>
<%= link_to l(:project_module_repository), {:controller => 'repositories', :action => 'show', :id => @project.id }, :class => "f14 c_blue02" %>
<% end %>
<a class="subnav_num">(<%= @project.repositories.count %>)</a> <a class="subnav_num">(<%= @project.repositories.count %>)</a>
<% if (User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project)) && rep_is_gitlab?(@project) %>
<%= link_to "+"+l(:project_module_create_repository), url_for(:controller => 'projects', :action => 'settings', :id => @project.id, :tab=>'repositories') , :class => "subnav_green" %>
<% end %>
</div> </div>
<% end %> <% end %>
<!-- more --> <!-- more -->

View File

@ -7,87 +7,80 @@
<%= str = error_messages_for 'repository' %> <%= str = error_messages_for 'repository' %>
<% project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT %> <% project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT %>
<% ip = RepositoriesHelper::REPO_IP_ADDRESS %><!--Added by tanxianbo For formatting project's path--> <% ip = RepositoriesHelper::REPO_IP_ADDRESS %><!--Added by tanxianbo For formatting project's path-->
<%# 新建版本库 %>
<% if @project.repositories.count == 0 || rep_is_gitlab?(@project) %>
<div style="padding-bottom: 40px">
<a href="javascript:viod(0)" class="pic_add fl mr5" onclick="pro_st_show_ku();"></a>
<a href="javascript:viod(0)" class="c_blue fl" onclick="pro_st_show_ku();">
<% course_tag = @project.project_type %>
<% if User.current.allowed_to?(:manage_repository, @project) %>
<!--newrepo_project_repository_path(@project, :course => course_tag) -->
<%= link_to l(:label_repository_new_repos),"#" , :onclick=>"pro_st_show_ku();", :class => 'c_blue fl' %></p>
<% end %>
</a>
<div class="cl"></div>
<%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form',:method=>"post",:autocomplete=>'off'} do |f| %>
<div id="pro_st_edit_ku" class="pro_st_edit_ku">
<ul>
<li style="display: none">
<label class="label02"><%=l(:label_scm)%></label>
<%= select_tag('repository_scm',
options_for_select(["Git"],@repository.class.name.demodulize),
:data => {:remote => true, :method => 'get'}) %>
<% if @repository && ! @repository.class.scm_available %>
<span class="c_grey"><%= l(:text_scm_command_not_available) %></span>
<% end %>
</li>
<li >
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
<label class="label02"><span class="c_red">*</span><%=l(:label_repository_name)%></label>
<%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false,:label=>"", :no_label => true %>
<% unless @repository.identifier_frozen? %>
<span class="c_grey"><%=l(:text_length_between,:min=>1,:max=>254)<<l(:text_project_identifier_info) %></span>
<% end %>
</li>
<div class="cl"></div>
</ul>
<a href="#" onclick="$('#repository-form').submit();" class="blue_btn fl ml38 "><%=l(:lable_project_rep_create) %></a>
<a href="<%= settings_project_path(@project, :tab => 'repositories')%>" class="grey_btn fl ml38 "><%=l(:button_cancel)%></a>
</div><!--pro_st_edit_issues end-->
<% end %>
</div>
<% end %>
<% if @project.repositories.any? %> <% if @project.repositories.any? %>
<%= render :partial => 'projects/settings/rep_gitlab', :locals => {:project => @project, :ip => "ip", :project_path_cut => "project_path_cut" } %>
<%#= render :partial => 'projects/settings/rep_forge', :locals => {:project => @project, :ip => "ip", :project_path_cut => "project_path_cut" } %>
<div class="rep_history_title">历史版本库</div>
<table class="pro_table"> <table class="pro_table">
<tbody> <tbody>
<tr class="pro_table_tit"> <% rep_forge(@project).sort.each do |repository| %>
<td class=" w150"><%= l(:field_identifier) %></td> <tr class="<%= cycle 'pro_table_on_forge', '' %>">
<td class="w150"> <%= l(:field_repository_is_default) %></td> <td class="w150"><span class="rep_history_grey" title="<%= repository.identifier %>">
<td class="w150"><%= l(:label_scm) %> </td> <%= repository.identifier %></span></td>
<td class="w150" ><%= l(:label_repository_path) %> </td> <td class="w150"><span class="rep_history_grey"><%=h repository.scm_name %></span></td>
<td class="w150"> </td>
<td class="w150"> </td>
</tr>
<% @project.repositories.sort.each do |repository| %>
<tr class="<%= cycle 'pro_table_on', '' %>">
<td><a href="javascript:viod(0)" title="<%= repository.identifier %>">
<%= link_to truncate(repository.identifier), ({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => repository.identifier_param} if repository.identifier.present?) %></a></td>
<td> <%= checked_image repository.is_default? %></td>
<td><%=h repository.scm_name %></td>
<%if repository.scm_name=="Git"%> <%if repository.scm_name=="Git"%>
<td style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" title="http://<%= repository.login.to_s %>_<%= repository.identifier.to_s%>@<%= ip %> <td class="w362" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" title="http://<%= repository.login.to_s %>_<%= repository.identifier.to_s%>@<%= ip %>
<%=h repository.url.slice(project_path_cut, repository.url.length) %>"> <%=truncate( 'http://' << repository.login.to_s << '_'<< repository.identifier.to_s << '@'<< ip.to_s << h( repository.url.slice(project_path_cut, repository.url.length)),:length=>20)%></td><!--Modified by tanxianbo--> <%=h repository.url.slice(project_path_cut, repository.url.length) %>">
<span class="rep_history_grey">
<%=truncate( 'http://' << repository.login.to_s << '_'<< repository.identifier.to_s << '@'<< ip.to_s << h( repository.url.slice(project_path_cut, repository.url.length)),:length=>60) %>
</span>
</td><!--Modified by tanxianbo-->
<%else %> <%else %>
<td style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ><%=h truncate(repository.url,:length=>10) %></td> <td class="w360" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ><%=h truncate(repository.url,:length=>10) %></td>
<% end %> <% end %>
<td><a href="javascript:viod(0)" class="c_blue" >
<% if repository.scm_name=="Git"%>
<%if User.current.allowed_to?(:manage_repository, @project) %>
<%= link_to(l(:label_user_plural), committers_repository_path(repository)) %>
<% end %>
<% end %>
</a></td>
<td>
<% if repository.login.to_s==User.current.login.to_s %>
<%= delete_new_link repository_path(repository) %>
<% end %></td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<% else %> <% else %>
<p class="nodata"><%= l(:label_repository_no_data) %></p> <p class="nodata">温馨提示:<%= l(:label_repository_no_data) %></p>
<% end %> <% end %>
<%# 新建版本库 %>
<% if @project.repositories.count == 0 %>
<a href="javascript:viod(0)" class="pic_add fl mr5" onclick="pro_st_show_ku();"></a>
<a href="javascript:viod(0)" class="c_blue fl" onclick="pro_st_show_ku();">
<% course_tag = @project.project_type %>
<% if User.current.allowed_to?(:manage_repository, @project) %>
<!--newrepo_project_repository_path(@project, :course => course_tag) -->
<%= link_to l(:label_repository_new_repos),"#" , :onclick=>"pro_st_show_ku();", :class => 'c_blue fl' %></p>
<% end %>
</a>
<div class="cl"></div>
<%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form',:method=>"post",:autocomplete=>'off'} do |f| %>
<div id="pro_st_edit_ku" class="pro_st_edit_ku">
<ul>
<li >
<label class="label02"><%=l(:label_scm)%></label>
<%= select_tag('repository_scm',
options_for_select(["Git"],@repository.class.name.demodulize),
:data => {:remote => true, :method => 'get'})%>
<% if @repository && ! @repository.class.scm_available %>
<span class="c_grey"><%= l(:text_scm_command_not_available) %></span>
<% end %>
</li>
<li >
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
<label class="label02"><span class="c_red">*</span><%=l(:label_repository_name)%></label>
<%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false,:label=>"", :no_label => true %>
<% unless @repository.identifier_frozen? %>
<span class="c_grey"><%=l(:text_length_between,:min=>1,:max=>254)<<l(:text_project_identifier_info) %></span>
<% end %>
</li>
<div class="cl"></div>
</ul>
<a href="#" onclick="$('#repository-form').submit();" class="blue_btn fl ml110"><%=l(:button_save)%></a>
<a href="<%= settings_project_path(@project, :tab => 'repositories')%>" class="grey_btn fl ml10"><%=l(:button_cancel)%></a>
</div><!--pro_st_edit_issues end-->
<% end %>
<% end %>

View File

@ -0,0 +1,38 @@
<table class="pro_table">
<tbody>
<tr class="pro_table_tit">历史版本</tr>
<tr class="pro_table_tit">
<td class=" w150"><%= l(:field_identifier) %></td>
<td class="w150"> <%= l(:field_repository_is_default) %></td>
<td class="w150"><%= l(:label_scm) %> </td>
<td class="w150" ><%= l(:label_repository_path) %> </td>
<td class="w150"> </td>
<td class="w150"> </td>
</tr>
<% rep_forge(project).sort.each do |repository| %>
<tr class="<%= cycle 'pro_table_on', '' %>">
<td><a href="javascript:viod(0)" title="<%= repository.identifier %>">
<%= link_to truncate(repository.identifier), ({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => repository.identifier_param} if repository.identifier.present?) %></a></td>
<td> <%= checked_image repository.is_default? %></td>
<td><%=h repository.scm_name %></td>
<%if repository.scm_name=="Git"%>
<td style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" title="http://<%= repository.login.to_s %>_<%= repository.identifier.to_s%>@<%= ip %>
<%=h repository.url.slice(project_path_cut, repository.url.length) %>"> <%=truncate( 'http://' << repository.login.to_s << '_'<< repository.identifier.to_s << '@'<< ip.to_s << h( repository.url.slice(project_path_cut, repository.url.length)),:length=>20)%></td><!--Modified by tanxianbo-->
<%else %>
<td style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ><%=h truncate(repository.url,:length=>10) %></td>
<% end %>
<td><a href="javascript:viod(0)" class="c_blue" >
<% if repository.scm_name=="Git"%>
<%if User.current.allowed_to?(:manage_repository, @project) %>
<%= link_to(l(:label_user_plural), committers_repository_path(repository)) %>
<% end %>
<% end %>
</a></td>
<td>
<% if repository.login.to_s==User.current.login.to_s %>
<%= delete_new_link repository_path(repository) %>
<% end %></td>
</tr>
<% end %>
</tbody>
</table>

View File

@ -0,0 +1,26 @@
<% rep_gitlab(project).sort.each do |repository| %>
<table class="pro_table">
<tbody>
<tr class="pro_table_tit">
<td class=" w150"><%= l(:field_identifier) %></td>
<td class="w150"><%= l(:label_scm) %> </td>
<td class="w362" ><%= l(:label_repository_path) %> </td>
</tr>
<tr class="<%= cycle 'pro_table_on', '' %>">
<td><a href="javascript:viod(0)" title="<%= repository.identifier %>">
<%= link_to truncate(repository.identifier), ({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => repository.identifier_param} if repository.identifier.present?) %></a>
</td>
<td><%=h repository.scm_name %></td>
<%if repository.scm_name=="Gitlab"%>
<td style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" title="<%= rep_gitlab_url(project) %>">
<%=truncate(rep_gitlab_url(project), :length => 360) %>
</td>
<%else %>
<td style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ><%=h truncate(repository.url,:length=>10) %></td>
<% end %>
</tr>
<% end %>
</tbody>
</table>

View File

@ -18,13 +18,13 @@
<div class=" mt10"> <div class=" mt10">
<%= link_to("导入作业", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true) unless edit_mode%> <%= link_to("导入作业", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true) unless edit_mode%>
<div class="calendar_div fl"> <div class="calendar_div fl">
<input type="text" name="homework_common[publish_time]" id="homework_publish_time" placeholder="发布日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.publish_time%>" >
<%= calendar_for('homework_publish_time')%>
</div>
<div class="calendar_div fl ml10">
<input type="text" name="homework_common[end_time]" id="homework_end_time" placeholder="截止日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.end_time%>" > <input type="text" name="homework_common[end_time]" id="homework_end_time" placeholder="截止日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.end_time%>" >
<%= calendar_for('homework_end_time')%> <%= calendar_for('homework_end_time')%>
</div> </div>
<div class="calendar_div fl ml10">
<input type="text" name="homework_common[publish_time]" id="homework_publish_time" placeholder="发布日期(可选)" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.publish_time%>" >
<%= calendar_for('homework_publish_time')%>
</div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<p id="homework_end_time_span" class="c_red mt5"></p> <p id="homework_end_time_span" class="c_red mt5"></p>

View File

@ -145,6 +145,7 @@
var id; //资源id var id; //资源id
var sendType; //发送到课程 1 发送到项目 2 var sendType; //发送到课程 1 发送到项目 2
var lastSendType; //保存上次发送的发送类型 var lastSendType; //保存上次发送的发送类型
var last_op
$("#resources_list").mousedown(function(e) { $("#resources_list").mousedown(function(e) {
//如果是右键的话 //如果是右键的话
if (3 == e.which) { if (3 == e.which) {
@ -179,6 +180,28 @@
last_line = line; last_line = line;
} }
}); });
//鼠标经过时,背景颜色设为灰色
$("#resources_list").mouseover(function(e){
pageX = e.clientX;
pageY = e.clientY;
var ele = document.elementFromPoint(pageX,pageY);
line = $(ele).parent();
if(last_op != null){
last_op.children().css("background-color", 'white');
restore();
last_op == null;
}
//如果当前的tag是li那么还要li的父级元素
if(line.get(0).tagName === 'LI'){
line = line.parent();
}
//将当前的元素的所有子元素的背景色改为蓝色
line.children().css("background-color", '#e1e1e1');
//将当前元素赋给 上一个对象 保存起来。
last_op = line;
});
//元素包含关系计算 //元素包含关系计算
var contains = function(root, el) { var contains = function(root, el) {
if (root.compareDocumentPosition) if (root.compareDocumentPosition)

View File

@ -200,7 +200,7 @@ zh:
label_subject_empty: 主题不能为空 label_subject_empty: 主题不能为空
label_no_data: 没有任何数据可供显示 label_no_data: 没有任何数据可供显示
label_repository_no_data: 您还没有创建版本库,每个项目只允许创建一个版本库! label_repository_no_data: 每个项目只能创建一个版本库!
# 项目、课程、用户公用 # 项目、课程、用户公用
label_settings: 配置 label_settings: 配置
label_information_plural: 信息 label_information_plural: 信息

View File

@ -88,6 +88,8 @@ zh:
project_module_files: 资源库 project_module_files: 资源库
project_module_repository: 版本库 project_module_repository: 版本库
project_module_create_repository: 创建版本库 project_module_create_repository: 创建版本库
project_gitlab_create_repository: 新版本库
label_project_more: 更多 label_project_more: 更多
project_module_news: 新闻 project_module_news: 新闻
@ -112,6 +114,7 @@ zh:
label_project_overview: "项目简介" label_project_overview: "项目简介"
label_expend_information: 展开更多信息 label_expend_information: 展开更多信息
label_project_create: "新建了项目" label_project_create: "新建了项目"
lable_project_rep_create: 创建
# #
# 项目托管平台 # 项目托管平台

View File

@ -0,0 +1,8 @@
class DropOrganization < ActiveRecord::Migration
def up
drop_table :organizations
end
def down
end
end

View File

@ -0,0 +1,18 @@
class CreateOrganization < ActiveRecord::Migration
def up
create_table :organizations do |t|
t.string :name
t.text :description
t.integer :creator_id
t.integer :home_id
t.string :domain
t.boolean :is_public
t.timestamps
end
end
def down
drop_table :organizations
end
end

View File

@ -0,0 +1,14 @@
class CreateOrgMembers < ActiveRecord::Migration
def up
create_table :org_members do |t|
t.integer :user_id
t.integer :organization_id
t.string :role
end
end
def down
drop_table :org_members
end
end

View File

@ -0,0 +1,22 @@
#coding=utf-8
namespace :rep_fault do
desc "update fault rep"
task :rep_update => :environment do
Project.all.each do |project|
if project.repositories.count > 0
unless Repository.where("project_id =? and type = ?",project, "Repository::Gitlab").blank?
project.repositories.each do |repository|
repository.update_attributes(:is_default => false)
end
end
end
end
end
desc "update ossean's data"
task :update_type => :environment do
repository = Repository.find(400)
repository.update_attributes(:type => "Repository::Git")
end
end

View File

@ -553,6 +553,7 @@ a:hover.member_btn{ background:#329cbd;}
.pro_table tr td{ height:30px;} .pro_table tr td{ height:30px;}
.pro_table_tit{ text-align:center; font-weight:bold;} .pro_table_tit{ text-align:center; font-weight:bold;}
.pro_table_on{ background:#f0fbff; } .pro_table_on{ background:#f0fbff; }
.pro_table_on_forge{ background: #EAEAEA; }
.pro_st_edit_issues{ display:none; margin-top:20px;} .pro_st_edit_issues{ display:none; margin-top:20px;}
.pro_st_edit_issues ul li{ margin-bottom:10px;} .pro_st_edit_issues ul li{ margin-bottom:10px;}
.pro_st_edit_ban{ display:none; margin-top:20px;} .pro_st_edit_ban{ display:none; margin-top:20px;}

View File

@ -71,6 +71,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.ml45{ margin-left:45px;} .ml45{ margin-left:45px;}
.ml55{ margin-left:55px;} .ml55{ margin-left:55px;}
.ml30{ margin-left:30px;} .ml30{ margin-left:30px;}
.ml38{ margin-left:38px;}
.ml60{ margin-left:60px;} .ml60{ margin-left:60px;}
.ml80{ margin-left:80px;} .ml80{ margin-left:80px;}
.ml90{ margin-left:90px;} .ml90{ margin-left:90px;}
@ -133,6 +134,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.w265{ width: 265px;} .w265{ width: 265px;}
.w270{ width: 270px;} .w270{ width: 270px;}
.w350 {width:350px;} .w350 {width:350px;}
.w362 {width:362px;}
.w430{ width:470px;} .w430{ width:470px;}
.w520{ width:520px;} .w520{ width:520px;}
.w543{ width:543px;} .w543{ width:543px;}

View File

@ -275,4 +275,13 @@ li.commit .commit-row-info a {
} }
li.commit .commit-row-info .committed_ago { li.commit .commit-row-info .committed_ago {
display: inline-block; display: inline-block;
}
.rep_history_title{
font-weight: bold;
font-size: 13px;
color: #7F7F7F;
padding-bottom: 10px;
}
.rep_history_grey{
color: #7F7F7F;
} }