Merge remote branch 'remotes/origin/szzh' into guange_dev

This commit is contained in:
guange 2015-03-15 23:10:48 +08:00
commit e798b7242b
15 changed files with 74 additions and 55 deletions

View File

@ -15,7 +15,7 @@ module Mobile
if attachment.nil? if attachment.nil?
raise '未发现客户端!' raise '未发现客户端!'
end end
url = Setting.host_name + "/attachments/download/" + attachment.id.to_s + "/" + attachment.filename url = "http://" + Setting.host_name + "/attachments/download/" + attachment.id.to_s + "/" + attachment.filename
{ {
version: @current_version.version, version: @current_version.version,
url: url, url: url,

View File

@ -20,9 +20,9 @@ class AttachmentsController < ApplicationController
before_filter :find_project, :only => [:show, :download, :thumbnail, :destroy, :delete_homework]#, :except => [:upload, :autocomplete] before_filter :find_project, :only => [:show, :download, :thumbnail, :destroy, :delete_homework]#, :except => [:upload, :autocomplete]
before_filter :file_readable, :read_authorize, :only => [:show, :thumbnail]#Modified by young before_filter :file_readable, :read_authorize, :only => [:show, :thumbnail]#Modified by young
before_filter :delete_authorize, :only => :destroy before_filter :delete_authorize, :only => [:destroy]
before_filter :authorize_global, :only => :upload before_filter :authorize_global, :only => [:upload]
before_filter :authorize_attachment_download1, :only => :download before_filter :authorize_attachment_download1, :only => [:download]
#before_filter :login_without_softapplication, only: [:download] #before_filter :login_without_softapplication, only: [:download]
accept_api_auth :show, :download, :upload accept_api_auth :show, :download, :upload
require 'iconv' require 'iconv'

View File

@ -99,7 +99,7 @@ class MembersController < ApplicationController
@project.members << members @project.members << members
# added by nie # added by nie
@project.project_infos << project_info @project.project_infos << project_info
@project.user_grades << user_grades @project.user_grades << user_grades unless user_grades.first.user_id.nil?
# end # end
end end
if members.present? && members.all? { |m| m.valid? } if members.present? && members.all? { |m| m.valid? }
@ -108,7 +108,11 @@ class MembersController < ApplicationController
end end
end end
if params[:flag] if params[:flag]
flash[:notice] = l(:label_invite_success) unless members.present? && members.all? {|m| m.valid? }
flash[:error] = members.collect {|m| m.errors.full_messages}.flatten.uniq.join(', ')
else
flash[:notice] = l(:label_invite_success)
end
respond_to do |format| respond_to do |format|
format.html { redirect_to invite_members_project_url(@project) } format.html { redirect_to invite_members_project_url(@project) }
end end

View File

@ -1,3 +1,4 @@
#coding=utf-8
class CoursesService class CoursesService
include ApplicationHelper include ApplicationHelper
include CoursesHelper include CoursesHelper
@ -381,7 +382,7 @@ class CoursesService
end end
latest_bid_message = messages.first latest_bid_message = messages.first
unless latest_bid_message.nil? unless latest_bid_message.nil?
latest_course_dynamics << {:type => 4,:time => latest_bid_message.created_on,:message => '最近更新了作业'}#l(:label_recently_updated_message,:locale => current_user.language.nil? ? 'zh':current_user.language)} latest_course_dynamics << {:type => 4,:time => latest_bid_message.created_on,:message => l(:label_recently_updated_message,:locale => current_user.language.nil? ? 'zh':current_user.language)}
end end
#每个作业中学生最后提交的作业 #每个作业中学生最后提交的作业
homeworks = [] homeworks = []
@ -396,7 +397,7 @@ class CoursesService
end end
latest_homework_attach = homeworks.first latest_homework_attach = homeworks.first
unless latest_homework_attach.nil? unless latest_homework_attach.nil?
latest_course_dynamics << {:type => 4,:time => latest_homework_attach.updated_at,:message => '最近更新了作业'}#l(:label_recently_updated_homework,:locale => current_user.language.nil? ? 'zh':current_user.language)} latest_course_dynamics << {:type => 4,:time => latest_homework_attach.updated_at,:message => l(:label_recently_updated_homework,:locale => current_user.language.nil? ? 'zh':current_user.language)}
end end
latest_course_dynamics.sort!{|order,newer| newer[:time] <=> order[:time]} latest_course_dynamics.sort!{|order,newer| newer[:time] <=> order[:time]}
latest_course_dynamic = latest_course_dynamics.first latest_course_dynamic = latest_course_dynamics.first

View File

@ -7,10 +7,10 @@
#scrollsidebar a{ text-decoration:none;} #scrollsidebar a{ text-decoration:none;}
html{ overflow-x:hidden;} html{ overflow-x:hidden;}
.scrollsidebar{ position:absolute;top:1px; right:1px; background:none; } .scrollsidebar{ position:fixed;bottom:1px; right:1px; background:none; }
.side_content{width:154px; height:auto; overflow:hidden; float:left; } .side_content{width:154px; height:auto; overflow:hidden; float:left; }
.side_content .side_list {width:154px;overflow:hidden;} .side_content .side_list {width:154px;overflow:hidden;}
.show_btn{ width:0; height:112px; overflow:hidden; float:left; cursor:pointer;} .show_btn{ width:0; height:112px; overflow:hidden; float:left;margin-top: 200px; cursor:pointer;}
.show_btn span { display:none;} .show_btn span { display:none;}
.close_btn{width:24px;height:24px;cursor:pointer;} .close_btn{width:24px;height:24px;cursor:pointer;}
.side_title,.side_bottom,.close_btn,.show_btn {background:url(/images/sidebar_bg.png) no-repeat; } .side_title,.side_bottom,.close_btn,.show_btn {background:url(/images/sidebar_bg.png) no-repeat; }
@ -89,7 +89,7 @@
closeBtn.bind("click",function(){ closeBtn.bind("click",function(){
sideContent.animate({width: '0px'},"fast"); sideContent.animate({width: '0px'},"fast");
show_btn.stop(true, true).delay(300).animate({ width: '25px'},"fast"); show_btn.stop(true, true).delay(300).animate({ width: '25px'},"fast");
cookiesave('minStatue','true','','',''); cookiesave('minStatue','false','','','');
}); });
//show??? //show???
show_btn.bind("click",function() { show_btn.bind("click",function() {

View File

@ -101,8 +101,8 @@
</div> </div>
<!-- 项目得分 --> <!-- 项目得分 -->
<div class="cl"></div> <div class="cl"></div>
<div class="pr_info_name"> <div class="pr_info_name f1">
<%= link_to @project.name, project_path(@project) %> <%= link_to @project.name, project_path(@project), :style => "color:#3E4040"%>
<% if !@project.is_public? %> <% if !@project.is_public? %>
<span class="img_private"><%= l(:label_private)%></span> <span class="img_private"><%= l(:label_private)%></span>
<% end %> <% end %>
@ -151,7 +151,7 @@
<span class="subnav_num">(<%= @project.issues.count %>)</span><span> <span class="subnav_num">(<%= @project.issues.count %>)</span><span>
<% end %> <% end %>
<% if User.current.member_of?(@project) %> <% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %></span> <%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:16px;margin-top:4px;background:#28be6c;float:right;line-height:20px;" %></span>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>
@ -162,7 +162,7 @@
<span class="subnav_num">(<%= @project.boards.first.topics.count %>)</span> <span class="subnav_num">(<%= @project.boards.first.topics.count %>)</span>
<% end %> <% end %>
<% if User.current.member_of?(@project) %> <% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects',:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:4px;background:#28be6c;float:right;line-height:20px;" %> <%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects',:style => "font-size:12px;color:#fff; padding:0px 3px 3px 3px;height:16px;margin-top:5px;background:#28be6c;float:right;line-height:20px;" %>
<% end %> <% end %>
</div> </div>
<% end%> <% end%>
@ -173,16 +173,14 @@
<span class="subnav_num">(<%= @project.attachments.count %>)</span> <span class="subnav_num">(<%= @project.attachments.count %>)</span>
<% end %> <% end %>
<% if User.current.member_of?(@project) %> <% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_files), project_files_path(@project,:flag => true),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %> <%= link_to "+"+l(:label_upload_files), project_files_path(@project,:flag => true),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:16px;margin-top:4px;background:#28be6c;float:right;line-height:20px;" %>
<% end %> <% end %>
</div> </div>
<% end%> <% end%>
<% unless @project.enabled_modules.where("name = 'repository'").empty? %> <% unless @project.enabled_modules.where("name = 'repository'").empty? || @project.repositories.count == 0 %>
<div class="subNav"> <div class="subNav">
<%= link_to l(:project_module_repository), {:controller => 'repositories', :action => 'show', :id => @project.id}, :style => "color:#3CA5C6" %> <%= link_to l(:project_module_repository), {:controller => 'repositories', :action => 'show', :id => @project.id}, :style => "color:#3CA5C6" %>
<% unless @project.repositories.count == 0 %> <span class="subnav_num">(<%= @project.repositories.count %>)</span>
<span class="subnav_num">(<%= @project.repositories.count %>)</span>
<% end %>
<%# if User.current.member_of?(@project) %> <%# if User.current.member_of?(@project) %>
<%#= link_to "+"+l(:project_module_create_repository), new_project_repository_path(@project),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %> <%#= link_to "+"+l(:project_module_create_repository), new_project_repository_path(@project),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
<%# end %> <%# end %>

View File

@ -1,6 +1,6 @@
<div class="project_r_h"> <div class="project_r_h">
<h2 class="project_h2">邀请加入</h2> <h2 class="project_h2"><%= l(:label_invite_join) %></h2>
</div> </div>
<%#= render_flash_messages %> <%#= render_flash_messages %>
<% <%
@ -20,12 +20,12 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="box_main"> <div class="box_main">
<h3 class="box_h3">邀请Trustie注册用户</h3> <h3 class="box_h3"><%= l(:label_invite_trustie_user) %></h3>
<% if roles.any? %> <% if roles.any? %>
<%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :method => :post}) do |f| %> <%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :method => :post}) do |f| %>
<div class="invi_search"> <div class="invi_search">
<input hidden="hidden" value="true" name="flag"> <input hidden="hidden" value="true" name="flag">
<input id="principal_search" class="invi_search_input fl" type="text" placeholder="输入用户名称搜索好友"> <input id="principal_search" class="invi_search_input fl" type="text" placeholder="输入用户名称搜索好友">
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js',:flag => true) }')" %> <%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js',:flag => true) }')" %>
<div class="cl"></div> <div class="cl"></div>

View File

@ -1,14 +1,28 @@
<script> <script>
function verifyAddress() { function verifyAddress() {
var email = $('#mail').val(); var email = $.trim($('#mail').val());
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (email == "" || filter.test(email)) { if(email == "")
{
$("#valid_email").html("电子邮件不能为空");
}
else if (filter.test(email)) {
$("#valid_email").html(""); $("#valid_email").html("");
return true;
} }
else else
{ {
$("#valid_email").html("您所填写的电子邮件格式不正确"); $("#valid_email").html("您所填写的电子邮件格式不正确");
} }
return false;
}
function senderEmail(obj)
{
if(verifyAddress())
{
obj.parent().submit();
}
} }
@ -40,10 +54,10 @@
</div> </div>
<%= form_tag('send_mail_to_member', :controller => 'projects',:action => 'send_mail_to_member', method: 'get') do %> <%= form_tag('send_mail_to_member', :controller => 'projects',:action => 'send_mail_to_member', method: 'get') do %>
<span id="valid_email" style="color: #FF0000;"></span> <span id="valid_email" style="color: #FF0000;"></span>
<%= text_field_tag 'mail', '', :class => "fb_item fl", :placeholder => l(:label_input_email), :onblur => "verifyAddress();" %> <%= text_field_tag 'mail', '', :class => "fb_item fl", :placeholder => l(:label_input_email), :onkeyup => "verifyAddress();" %>
<div class="cl"></div> <div class="cl"></div>
<div class="cl"></div> <div class="cl"></div>
<a href="#" class="btn_free" onclick="$(this).parent().submit();"> <a href="#" class="btn_free" onclick="senderEmail($(this));">
<%= l(:label_send_email)%> <%= l(:label_send_email)%>
</a> </a>
<%#= submit_tag '免费发送', :style => "display:block; width:80px; text-align:center; color:#fff; height:26px; padding-top:3px; margin-bottom:10px;" %> <%#= submit_tag '免费发送', :style => "display:block; width:80px; text-align:center; color:#fff; height:26px; padding-top:3px; margin-bottom:10px;" %>

View File

@ -43,7 +43,7 @@
<tr> <tr>
<td class="font_lighter" > <td class="font_lighter" >
<%= l :label_create_time %>: <%= l :label_create_time %>:
<%= format_time(e.created_at) %> <%= format_time(e.project.created_on) %>
</table> </table>
</td> </td>
</tr> </tr>

View File

@ -101,11 +101,6 @@
<% end %> <% end %>
</span> </span>
</div> </div>
<% end %> <% end %>
<% else %>
<span style="color:#8c8a8a">
&nbsp;&nbsp;&nbsp;
<%= l(:label_tags_no) %>
</span>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -90,8 +90,11 @@ en:
label_send_email: Send label_send_email: Send
label_input_email: Please input email address label_input_email: Please input email address
label_invite_trustie_user: "Invite Trustie registered users" label_invite_trustie_user: "Invite Trustie registered users"
label_invite_trustie_user_tips: "Please enter the Trustie user name"
label_invite_project: "invites you to join the project"
label_invite_success: Successful invitation
label_invite_members: Invite
# #
@ -131,23 +134,23 @@ en:
# #
# 项目得分 # 项目得分
# #
label_projects_score: 项目综合得分 label_projects_score: Project Total Score
label_issue_score: issue得分 label_issue_score: Issue Score
label_issue_number: issue的数量 label_issue_number: issues
label_issue_journal_number: issue的留言数量 label_issue_journal_number: messages of issue
label_news_score: 新闻得分 label_news_score: News Score
label_new_number: 新闻的数量 label_new_number: news
label_file_score: 文档得分 label_file_score: Document Scores
label_file_number: 文档的数量 label_file_number: documents
label_code_submit_score: 代码提交得分 label_code_submit_score: Code Commit Score
label_code_submit_number: 代码提交数量 label_code_submit_number: commit code frequency
label_topic_score: 讨论区得分 label_topic_score: Forum Score
label_topic_number: 讨论区帖子数量 label_topic_number: posts

View File

@ -95,7 +95,10 @@ zh:
label_input_email: 请输入邮箱地址 label_input_email: 请输入邮箱地址
label_invite_trustie_user: "邀请Trustie注册用户" label_invite_trustie_user: "邀请Trustie注册用户"
label_invite_trustie_user_tips: "请输入用户名称来搜索好友"
label_invite_project: 邀请您加入项目
label_invite_success: 邀请成功
label_invite_members: 邀请用户
# #
# 项目托管平台 # 项目托管平台
# #
@ -146,7 +149,7 @@ zh:
label_file_number: 文档的数量 label_file_number: 文档的数量
label_code_submit_score: 代码提交得分 label_code_submit_score: 代码提交得分
label_code_submit_number: 代码提交数量 label_code_submit_number: 代码提交频率
label_topic_score: 讨论区得分 label_topic_score: 讨论区得分
label_topic_number: 讨论区帖子数量 label_topic_number: 讨论区帖子数量

View File

@ -1714,9 +1714,7 @@ zh:
label_bids_task_list: 作业列表 label_bids_task_list: 作业列表
label_join_course: 加入 label_join_course: 加入
label_invite_project: 邀请您加入项目
label_invite_success: 邀请成功
label_invite_members: 邀请用户
label_exit_course: 退出 label_exit_course: 退出
label_exit_group: 退出当前分班 label_exit_group: 退出当前分班
label_new_join: 加入 label_new_join: 加入
@ -2078,5 +2076,8 @@ zh:
label_recently_updated_courseware: 最近更新了课件 label_recently_updated_courseware: 最近更新了课件
label_no_courses: 您没有参与任何课程,请搜索课程、加入课程,或者创建课程吧! label_no_courses: 您没有参与任何课程,请搜索课程、加入课程,或者创建课程吧!
label_end_time: 截止时间 label_end_time: 截止时间
label_send_email: 确定发送
label_input_email: 请输入邮箱地址
project_module_files: 资源库

BIN
public/images/jiantou1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -55,7 +55,7 @@ a:hover.info_foot_num{ color:#2390b2;}
/*左侧导航*/ /*左侧导航*/
.subNavBox{width:222px; background:#fff;margin:10px 10px 0 0;} .subNavBox{width:222px; background:#fff;margin:10px 10px 0 0;}
.subNav{border-bottom:solid 1px #e5e3da;cursor:pointer;font-weight:bold;font-size:14px;color:#3ca5c6;line-height:28px;padding-left:10px;background-color:#fff;} .subNav{border-bottom:solid 1px #e5e3da;cursor:pointer;font-weight:bold;font-size:14px;color:#3ca5c6;line-height:28px;padding-left:10px;background-color:#fff;}
.subNav_jiantou{background:url(../images/jiantou1.jpg) no-repeat;background-position:95% 50%; background-color:#fff;} .subNav_jiantou{background:url(/images/jiantou1.jpg) no-repeat;background-position:95% 50%; background-color:#fff;}
.subNav_jiantou:hover{color:#0781b4; } .subNav_jiantou:hover{color:#0781b4; }
.currentDd{color:#0781b4; } .currentDd{color:#0781b4; }
.currentDt{background-color:#fff; } .currentDt{background-color:#fff; }
@ -100,7 +100,7 @@ a:hover.more{ color:#64bdd9;}
.box_close{ display:block; float:right; width:16px; height:16px; background:url(../images/img_floatbox.png) 0 0 no-repeat;} .box_close{ display:block; float:right; width:16px; height:16px; background:url(../images/img_floatbox.png) 0 0 no-repeat;}
.box_close:hover{background:url(../images/img_floatbox.png) -22px 0 no-repeat;} .box_close:hover{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}
/*邮件邀请*/ /*邮件邀请*/
.box_main{ width:345px; margin:0 auto;padding-left:40px;} .box_main{ width:345px; margin:0 auto;padding-left:28px;}
.box_h3{ color:#15bccf; text-align:center; font-size:16px;margin-right:40px;} .box_h3{ color:#15bccf; text-align:center; font-size:16px;margin-right:40px;}
.box_p{ color:#404040; margin-bottom:5px;} .box_p{ color:#404040; margin-bottom:5px;}
.fb_item{ color:#919191; border:1px solid #919191; height:28px; margin-bottom:10px; padding-left:5px; width:290px;} .fb_item{ color:#919191; border:1px solid #919191; height:28px; margin-bottom:10px; padding-left:5px; width:290px;}