Conflicts:
	config/locales/zh.yml
This commit is contained in:
sw 2014-11-22 13:52:46 +08:00
commit d788e46546
31 changed files with 191 additions and 104 deletions

View File

@ -234,7 +234,7 @@ class AccountController < ApplicationController
end end
def password_authentication def password_authentication
user = User.try_to_login(params[:username], params[:password]) user, last_login_on = User.try_to_login(params[:username], params[:password])
if user.nil? if user.nil?
invalid_credentials invalid_credentials
@ -244,7 +244,7 @@ class AccountController < ApplicationController
onthefly_creation_failed(user, {:login => user.login, :auth_source_id => user.auth_source_id }) onthefly_creation_failed(user, {:login => user.login, :auth_source_id => user.auth_source_id })
else else
# Valid user # Valid user
successful_authentication(user) successful_authentication(user, last_login_on)
end end
end end
@ -291,7 +291,7 @@ class AccountController < ApplicationController
end end
end end
def successful_authentication(user) def successful_authentication(user, last_login_on)
logger.info "Successful authentication for '#{user.login}' from #{request.remote_ip} at #{Time.now.utc}" logger.info "Successful authentication for '#{user.login}' from #{request.remote_ip} at #{Time.now.utc}"
# Valid user # Valid user
self.logged_user = user self.logged_user = user
@ -304,15 +304,20 @@ class AccountController < ApplicationController
code = /\d*/ code = /\d*/
#根据home_url生产正则表达式 #根据home_url生产正则表达式
eval("code = " + "/^" + home_url.gsub(/\//,"\\\/") + "\\\/*(welcome)?\\\/*(\\\/index\\\/*.*)?\$/") eval("code = " + "/^" + home_url.gsub(/\//,"\\\/") + "\\\/*(welcome)?\\\/*(\\\/index\\\/*.*)?\$/")
if code=~params[:back_url] if code=~params[:back_url] && last_login_on != ''
redirect_to user_activities_path(user) redirect_to user_activities_path(user)
else
if last_login_on == ''
redirect_to my_account_url
else else
#by young #by young
#redirect_back_or_default my_page_path #redirect_back_or_default my_page_path
redirect_back_or_default User.current #sredirect_back_or_default User.current
redirect_to my_account_url
#redirect_to User.current #redirect_to User.current
end end
end end
end
def set_autologin_cookie(user) def set_autologin_cookie(user)
token = Token.create(:user => user, :action => 'autologin') token = Token.create(:user => user, :action => 'autologin')

View File

@ -124,7 +124,7 @@ class ApplicationController < ActionController::Base
else else
# HTTP Basic, either username/password or API key/random # HTTP Basic, either username/password or API key/random
authenticate_with_http_basic do |username, password| authenticate_with_http_basic do |username, password|
user = User.try_to_login(username, password) || User.find_by_api_key(username) user = User.try_to_login(username, password)[0] || User.find_by_api_key(username)
end end
end end
# Switch user if requested by an admin user # Switch user if requested by an admin user
@ -267,6 +267,8 @@ class ApplicationController < ActionController::Base
end end
when "contest" when "contest"
return true return true
when "Course"
allowed = User.current.allowed_to?(:course_attachments_download, @course, :global => false)
else else
return true return true
end end

View File

@ -366,7 +366,7 @@ class AttachmentsController < ApplicationController
end end
rescue NoMethodError rescue NoMethodError
@save_flag = false @save_flag = false
@save_message = [] << l(:error_attachment_empty) @save_message = [] << l(:label_course_empty_select)
respond_to do |format| respond_to do |format|
format.js format.js
end end

View File

@ -37,6 +37,7 @@ class ContestsController < ApplicationController
def index def index
render_404
# @contests = Contest.visible # @contests = Contest.visible
# @contests ||= [] # @contests ||= []
@offset, @limit = api_offset_and_limit(:limit => 10) @offset, @limit = api_offset_and_limit(:limit => 10)

View File

@ -427,6 +427,7 @@ class CoursesController < ApplicationController
end end
def index def index
render_404
@course_type = params[:course_type] @course_type = params[:course_type]
@school_id = params[:school_id] @school_id = params[:school_id]
per_page_option = 10 per_page_option = 10
@ -474,7 +475,7 @@ class CoursesController < ApplicationController
respond_to do |format| respond_to do |format|
format.html { format.html {
render :layout => 'base' # render :layout => 'base'
} }
format.atom { format.atom {
courses = Course.visible.order('created_on DESC').limit(Setting.feeds_limit.to_i).all courses = Course.visible.order('created_on DESC').limit(Setting.feeds_limit.to_i).all

View File

@ -26,13 +26,15 @@ class FilesController < ApplicationController
helper :sort helper :sort
include SortHelper include SortHelper
include FilesHelper
helper :project_score helper :project_score
def show_attachments obj def show_attachments obj
@all_attachments = [] @attachments = []
obj.each do |container| obj.each do |container|
@all_attachments += container.attachments @attachments += container.attachments
end end
@all_attachments = visable_attachemnts(@attachments)
@limit = 10 @limit = 10
@feedback_count = @all_attachments.count @feedback_count = @all_attachments.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page'] @feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@ -48,9 +50,11 @@ class FilesController < ApplicationController
#(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank? #(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
if params[:insite] if params[:insite]
@result = find_public_attache q @result = find_public_attache q
@result = visable_attachemnts @result
@searched_attach = paginateHelper @result,10 @searched_attach = paginateHelper @result,10
else else
@result = find_course_attache q,@course @result = find_course_attache q,@course
@result = visable_attachemnts @result
@searched_attach = paginateHelper @result,10 @searched_attach = paginateHelper @result,10
end end

View File

@ -105,6 +105,7 @@ class ProjectsController < ApplicationController
end end
def index def index
render_404
#调用存储过程更新提交次数 #调用存储过程更新提交次数
#ActiveRecord::Base.connection.execute("CALL sp_project_status_cursor();") #ActiveRecord::Base.connection.execute("CALL sp_project_status_cursor();")
#Modified by nie #Modified by nie
@ -157,7 +158,7 @@ class ProjectsController < ApplicationController
respond_to do |format| respond_to do |format|
format.html { format.html {
render :layout => 'base' # render :layout => 'base'
# scope = Project # scope = Project
# unless params[:closed] # unless params[:closed]
# scope = scope.active # scope = scope.active

View File

@ -295,6 +295,7 @@ class UsersController < ApplicationController
#end #end
def index def index
@status = params[:status] || 1 @status = params[:status] || 1
sort_init 'login', 'asc' sort_init 'login', 'asc'
sort_update %w(login firstname lastname mail admin created_on last_login_on) sort_update %w(login firstname lastname mail admin created_on last_login_on)
@ -352,7 +353,8 @@ class UsersController < ApplicationController
respond_to do |format| respond_to do |format|
format.html { format.html {
@groups = Group.all.sort @groups = Group.all.sort
render :layout => @user_base_tag # render :layout => @user_base_tag
render_404
} }
format.api format.api
end end

View File

@ -1830,12 +1830,11 @@ module ApplicationHelper
main_project_link = link_to l(:label_project_deposit), {:controller => 'welcome', :action => 'index', :host => Setting.project_domain} main_project_link = link_to l(:label_project_deposit), {:controller => 'welcome', :action => 'index', :host => Setting.project_domain}
main_contest_link = link_to l(:label_contest_innovate), {:controller => 'welcome', :action => 'index', :host => Setting.contest_domain} main_contest_link = link_to l(:label_contest_innovate), {:controller => 'welcome', :action => 'index', :host => Setting.contest_domain}
course_all_course_link = link_to l(:label_course_all), {:controller => 'courses', :action => 'index'} # course_all_course_link = link_to l(:label_course_all), {:controller => 'courses', :action => 'index'}
course_teacher_all_link = link_to l(:label_teacher_all), {:controller => 'users', :action => 'index', :role => 'teacher', :host => Setting.course_domain} course_teacher_all_link = link_to l(:label_teacher_all), {:controller => 'users', :action => 'index', :role => 'teacher', :host => Setting.course_domain}
courses_link = link_to l(:label_course_practice), {:controller => 'courses', :action => 'index'} # courses_link = link_to l(:label_course_practice), {:controller => 'courses', :action => 'index'}
projects_link = link_to l(:label_project_deposit), {:controller => 'projects', :action => 'index', :project_type => 0, :host => Setting.project_domain}
users_link = link_to l(:label_software_user), {:controller => 'users', :action => 'index', :host => Setting.user_domain} users_link = link_to l(:label_software_user), {:controller => 'users', :action => 'index', :host => Setting.user_domain}
contest_link = link_to l(:label_contest_innovate), {:controller => 'contests', :action => 'index'} # contest_link = link_to l(:label_contest_innovate), {:controller => 'contests', :action => 'index'}
bids_link = link_to l(:label_requirement_enterprise), {:controller => 'bids', :action => 'index'} bids_link = link_to l(:label_requirement_enterprise), {:controller => 'bids', :action => 'index'}
forum_link = link_to l(:label_project_module_forums), {:controller => "forums", :action => "index"} forum_link = link_to l(:label_project_module_forums), {:controller => "forums", :action => "index"}
stores_link = link_to l(:label_stores_index), {:controller => 'stores', :action=> 'index'} stores_link = link_to l(:label_stores_index), {:controller => 'stores', :action=> 'index'}
@ -1844,7 +1843,7 @@ module ApplicationHelper
#@nav_dispaly_project_label #@nav_dispaly_project_label
nav_list = Array.new nav_list = Array.new
nav_list.push(school_all_school_link) if @nav_dispaly_course_all_label && @show_course == 1 nav_list.push(school_all_school_link) if @nav_dispaly_course_all_label && @show_course == 1
nav_list.push(course_all_course_link) if @nav_dispaly_course_all_label && @show_course == 1 # nav_list.push(course_all_course_link) if @nav_dispaly_course_all_label && @show_course == 1
nav_list.push(course_teacher_all_link) if @nav_dispaly_teacher_all_label && @show_course == 1 nav_list.push(course_teacher_all_link) if @nav_dispaly_teacher_all_label && @show_course == 1
nav_list.push(main_project_link) if @nav_dispaly_main_project_label nav_list.push(main_project_link) if @nav_dispaly_main_project_label
@ -1852,9 +1851,9 @@ module ApplicationHelper
nav_list.push(main_contest_link) if @nav_dispaly_main_contest_label && @show_contest == 1 nav_list.push(main_contest_link) if @nav_dispaly_main_contest_label && @show_contest == 1
nav_list.push(courses_link) if @nav_dispaly_course_label && @show_course == 1 nav_list.push(courses_link) if @nav_dispaly_course_label && @show_course == 1
nav_list.push(projects_link) if @nav_dispaly_project_label # nav_list.push(projects_link) if @nav_dispaly_project_label
nav_list.push(users_link) if @nav_dispaly_user_label nav_list.push(users_link) if @nav_dispaly_user_label
nav_list.push(contest_link) if @nav_dispaly_contest_label && @show_contest == 1 # nav_list.push(contest_link) if @nav_dispaly_contest_label && @show_contest == 1
nav_list.push(bids_link) if @nav_dispaly_bid_label nav_list.push(bids_link) if @nav_dispaly_bid_label
nav_list.push(forum_link) if @nav_dispaly_forum_label nav_list.push(forum_link) if @nav_dispaly_forum_label
nav_list.push(stores_link) if @nav_dispaly_store_all_label nav_list.push(stores_link) if @nav_dispaly_store_all_label

View File

@ -44,10 +44,10 @@ module FilesHelper
File.new(zipfile_name,'w+') File.new(zipfile_name,'w+')
end end
def courses_check_box_tags(name,courses,current_course) def courses_check_box_tags(name,courses,current_course,attachment)
s = '' s = ''
courses.each do |course| courses.each do |course|
if course.id != current_course.id && is_course_teacher(User.current,course) if !(attachment.container_type && attachment.container_id == course.id) && is_course_teacher(User.current,course)
s << "<label>#{ check_box_tag name, course.id, false, :id => nil } #{h course.name}</label><br/>" s << "<label>#{ check_box_tag name, course.id, false, :id => nil } #{h course.name}</label><br/>"
end end
end end
@ -72,5 +72,20 @@ module FilesHelper
result result
end end
def visable_attachemnts attachments
result = []
attachments.each do |attachment|
if attachment.is_public? || attachment.author_id == User.current.id
result << attachment
end
end
result
end
def get_qute_number attachment
if attachment.copy_from.nil?
return 0
end
count = Attachment.find_by_sql("select count(*) from attachments where copy_from = #{attachment.copy_from}")
end
end end

View File

@ -230,8 +230,13 @@ class User < Principal
#选择项目成员时显示的用户信息文字 #选择项目成员时显示的用户信息文字
def userInfo def userInfo
if self.realname.gsub(' ','') == "" || self.realname.nil?
info = self.nickname;
else
info=self.nickname + ' (' + self.realname + ')'; info=self.nickname + ' (' + self.realname + ')';
end end
info
end
###添加留言 fq ###添加留言 fq
def add_jour(user, notes, reference_user_id = 0, options = {}) def add_jour(user, notes, reference_user_id = 0, options = {})
@ -359,8 +364,9 @@ class User < Principal
end end
end end
end end
last_login_on = user.last_login_on.nil? ? '' : user.last_login_on.to_s
user.update_column(:last_login_on, Time.now) if user && !user.new_record? user.update_column(:last_login_on, Time.now) if user && !user.new_record?
user [user, last_login_on]
rescue => text rescue => text
raise text raise text
end end

View File

@ -11,7 +11,7 @@
<body> <body>
<% email = @user.mail.split("@")[1] %> <% email = @user.mail.split("@")[1] %>
<div style="border: 1px solid #c0c0c0 ; width:850px;" > <div style="border: 1px solid #c0c0c0 ; width:850px; margin-top: 10px" >
<h3 style=" padding-bottom: 8px; margin-top:5px; border-bottom: 1px solid #c0c0c0;color:black; "> <h3 style=" padding-bottom: 8px; margin-top:5px; border-bottom: 1px solid #c0c0c0;color:black; ">
<span id = "jihuo" style=" margin-left: 4%;"></span>邮箱激活</h3> <span id = "jihuo" style=" margin-left: 4%;"></span>邮箱激活</h3>
@ -19,9 +19,10 @@
<div style="margin-left:auto; margin-right:auto"> <div style="margin-left:auto; margin-right:auto">
<center> <center>
<div > <div >
<h4 style="font-size: 18px;margin-top: 10px; margin-bottom: 10px;">请在24小时内点击邮件中的链接继续完成注册</h4> <h4 style="font-size: 18px;margin-top: 10px; padding-bottom: 10px;">请在24小时内点击邮件中的链接继续完成注册</h4>
<div class="to-email"> <div class="to-email" style="padding-bottom: 8px; font-size: 14px">
<span class="summary">邮件已发送到邮箱</span> <div class="to-email" style="padding-bottom: 8px; font-size: 14px">
<span >邮件已发送到邮箱</span>
<a href="#" class="f-blue"><%= @user.mail %></a> <a href="#" class="f-blue"><%= @user.mail %></a>
</div> </div>
<p> <p>
@ -33,12 +34,7 @@
padding: 10px 16px; padding: 10px 16px;
line-height: 1.33;" target="_blank">立即查收邮件</a></p> line-height: 1.33;" target="_blank">立即查收邮件</a></p>
<span class="tracking-ad" >
<a href="javascript:void(0);" >没收到邮件?</a>
</span>
<div style = "margin-top: 10px; margin-bottom:10px;">
<span style="font-size: 16px">请先检查是否在垃圾邮件中</span>
</div> </div>

View File

@ -19,7 +19,7 @@
<p><%= f.text_field :login, :size => 25, :required => true %><span id="valid_user_login"></span> <p><%= f.text_field :login, :size => 25, :required => true %><span id="valid_user_login"></span>
<em class="info" style="color: #acaeb1"><%= l(:label_max_number) %></em> <em class="info" style="color: #acaeb1"><%= l(:label_max_number) %></em>
</p> </p>
<p><%= f.password_field :password, :size => 25, :required => true %> <p><%= f.password_field :password, :size => 25, :required => true %><span id="valid_user_password"></span>
<em class="info" style="color: #acaeb1"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em> <em class="info" style="color: #acaeb1"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em>
</p> </p>
<p><%= f.password_field :password_confirmation, :size => 25, :required => true %><span id="valid_password" style="padding-left: 10px;"></span></p> <p><%= f.password_field :password_confirmation, :size => 25, :required => true %><span id="valid_password" style="padding-left: 10px;"></span></p>
@ -56,10 +56,12 @@
<p><%= custom_field_tag_with_label :user, value %></p> <p><%= custom_field_tag_with_label :user, value %></p>
<% end %> <% end %>
</div> </div>
<% password_min_length = Setting.password_min_length %>
<script type="text/javascript"> <script type="text/javascript">
jQuery(document).ready(function () { jQuery(document).ready(function () {
var $login = $('#user_login') var $login = $('#user_login')
var $mail = $('#user_mail') var $mail = $('#user_mail')
var $password = $('#user_password')
var $password_confirmation = $('#user_password_confirmation') var $password_confirmation = $('#user_password_confirmation')
$login.blur(function (event) { $login.blur(function (event) {
if ($(this).is('#user_login')) { if ($(this).is('#user_login')) {
@ -92,11 +94,26 @@
}); });
} }
; ;
});
$password.blur(function () {
var pas1 = document.getElementById("user_password").value;
var password_min_length = <%= password_min_length %>
if (pas1.length >= password_min_length) {
$('#valid_user_password').html('<span class="green">'+ "</span>");
}
else {
$('#valid_user_password').html('<span class="red">' + "<%= l(:setting_password_min_length_limit, :count => password_min_length) %>" + "</span>");
}
}); });
$password_confirmation.blur(function () { $password_confirmation.blur(function () {
var password_min_length = <%= password_min_length %>
var pas1 = document.getElementById("user_password").value; var pas1 = document.getElementById("user_password").value;
var pas2 = document.getElementById("user_password_confirmation").value; var pas2 = document.getElementById("user_password_confirmation").value;
if (pas1 == pas2) { if (pas1.length >= password_min_length && pas1 == pas2 ) {
$('#valid_password').html('<span class="green">' + "<%= l(:setting_password_success) %>"+ "</span>"); $('#valid_password').html('<span class="green">' + "<%= l(:setting_password_success) %>"+ "</span>");
} }
else { else {

View File

@ -19,8 +19,9 @@
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => false, :id => 'message-form'} do |f| %> <%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => false, :id => 'message-form'} do |f| %>
<%= render :partial => 'messages/form', :locals => {:f => f} %> <%= render :partial => 'messages/form', :locals => {:f => f} %>
<p> <p>
<input type="button" onclick="submitCoursesBoard();" class = "whiteButton m3p10 h30" value="<%= l(:button_submit)%>"> <!--<input type="button" onclick="submitCoursesBoard();" class = "ButtonColor m3p10 h30" value="<%= l(:button_submit)%>">-->
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' ,:class => 'whiteButton m3p10' %> <a href="#" onclick="$('#message-form').submit();"class="ButtonColor m3p10"><%= l(:button_submit)%></a>
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' ,:class => 'ButtonColor m3p10' %>
</p> </p>
<% end %> <% end %>
<div id="preview" class="wiki"></div> <div id="preview" class="wiki"></div>

View File

@ -18,6 +18,20 @@
hideModal($("#popbox_upload")); hideModal($("#popbox_upload"));
} }
function presscss(id)
{
if(id == "incourse")
{
$('#incourse').attr("class", "re_schbtn b_dblue");
$('#insite').attr("class", "re_schbtn b_lblue");
}
else
{
$('#incourse').attr("class", "re_schbtn b_lblue");
$('#insite').attr("class", "re_schbtn b_dblue");
}
}
</script> </script>
<div class="container"> <div class="container">
@ -25,8 +39,8 @@
<div class="re_top"> <div class="re_top">
<%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search f_l",:remote=>true) do %> <%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search f_l",:remote=>true) do %>
<%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%> <%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%>
<%= submit_tag "课内搜索", :class => "re_schbtn b_dblue",:name => "incourse"%> <%= submit_tag "课内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onclick => "presscss('incourse')"%>
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite" %> <%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onclick => "presscss('insite')" %>
<% end %> <% end %>
<% if is_course_teacher(User.current,@course) %> <% if is_course_teacher(User.current,@course) %>
<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload()">上传资源</a> <a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload()">上传资源</a>

View File

@ -1,8 +1,8 @@
<% delete_allowed = User.current.allowed_to?(:manage_files, course) %> <% delete_allowed = User.current.allowed_to?(:manage_files, course) %>
<div class="re_con_top"> <div class="re_con_top">
<p class="f_l c_blue f_b f_14">共有&nbsp;<%= User.current.member_of_course?(course) ? all_attachments.count : 0 %>&nbsp;个资源</p> <p class="f_l c_blue f_b f_14">共有&nbsp;<%= all_attachments.count%>&nbsp;个资源</p>
<!-- <p class="f_r"> <p class="f_r" style="color: #808080">
<#% if @order == "asc" %> <!--<#% if @order == "asc" %>
按&nbsp;<#%= link_to "时间",course_files_path(course,:sort=>"created_on:desc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %>&nbsp;/&nbsp; 按&nbsp;<#%= link_to "时间",course_files_path(course,:sort=>"created_on:desc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %>&nbsp;/&nbsp;
<#%= link_to "下载次数",course_files_path(course,:sort=>"downloads:desc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %>&nbsp;/&nbsp; <#%= link_to "下载次数",course_files_path(course,:sort=>"downloads:desc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %>&nbsp;/&nbsp;
<a href="#" class="f_b c_grey">引用次数</a>&nbsp;排序 <a href="#" class="f_b c_grey">引用次数</a>&nbsp;排序
@ -10,32 +10,38 @@
按&nbsp;<#%= link_to "时间",course_files_path(course,:sort=>"created_on:asc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %>&nbsp;/&nbsp; 按&nbsp;<#%= link_to "时间",course_files_path(course,:sort=>"created_on:asc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %>&nbsp;/&nbsp;
<#%= link_to "下载次数",course_files_path(course,:sort=>"downloads:asc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %>&nbsp;/&nbsp; <#%= link_to "下载次数",course_files_path(course,:sort=>"downloads:asc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %>&nbsp;/&nbsp;
<a href="#" class="f_b c_grey">引用次数</a>&nbsp;排序 <a href="#" class="f_b c_grey">引用次数</a>&nbsp;排序
<#% end %> <#% end %>-->
</p>--> 资源列表的多样化排序将在下周上线...
</p>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% curse_attachments.each do |file| %> <% curse_attachments.each do |file| %>
<%if file.is_public == 0 && !User.current.member_of_course?(@course)%>
<%next%>
<%end%>
<div class="re_con_box"> <div class="re_con_box">
<div class=" "> <div class=" ">
<%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %> <%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
<% if is_course_teacher(User.current,@course) %> <% if User.current.logged? %>
<%= link_to "选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true %> <% if is_course_teacher(User.current,@course) && file.author_id == User.current.id %>
<%= link_to "选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true %>
<% if delete_allowed && file.container_id == @course.id && file.container_type == "Course" %>
<span id="is_public_<%= file.id %>"> <span id="is_public_<%= file.id %>">
<%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %> <%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %>
</span> </span>
<% else %> <% else %>
<%= link_to (file.is_public? ? "公开":"私有"),"javascript:void(0)",:class=>"f_l re_open" %> <!-- <#%= link_to (file.is_public? ? "公开":"私有"),"javascript:void(0)",:class=>"f_l re_open" %> -->
<% end %>
<% else %>
<%= link_to "选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true %>
<% end %>
<% else %>
<% end %> <% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class=""> <div class="">
<p class="f_l c_grey02">文件大小:<%= number_to_human_size(file.filesize) %></p> <p class="f_l c_grey02 font">文件大小:<%= number_to_human_size(file.filesize) %></p>
<%= link_to( l(:button_delete), attachment_path(file), <%= link_to( l(:button_delete), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if delete_allowed %> :data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if delete_allowed && file.container_id == @course.id && file.container_type == "Course"%>
<p class="f_r c_grey02" ><%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %>&nbsp;&nbsp;|&nbsp;&nbsp;下载<%= file.downloads %>&nbsp;&nbsp;|&nbsp;&nbsp;引用0 </p> <p class="f_r c_grey02" ><%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %>&nbsp;&nbsp;|&nbsp;&nbsp;下载<%= file.downloads %>&nbsp;&nbsp;<!--|&nbsp;&nbsp;引用<%#=get_qute_number file %>--> </p>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="tag_h"> <div class="tag_h">

View File

@ -1,14 +1,14 @@
<div id="popbox_upload" style="margin-top: -30px;margin-left: -20px;margin-right: -10px;"> <div id="popbox_upload" style="margin-top: -30px;margin-left: -20px;margin-right: -10px;">
<div class="upload_con"> <div class="upload_con">
<div id="error_show"></div>
<h2>将此课件引入我的课程资源库</h2> <h2>将此课件引入我的课程资源库</h2>
<div class="upload_box"> <div class="upload_box">
<div id="error_show" style="color: red;"></div>
<%= form_tag course_attach_relations_path, <%= form_tag course_attach_relations_path,
method: :post, method: :post,
remote: true, remote: true,
id: "relation_file_form" do %> id: "relation_file_form" do %>
<%= hidden_field_tag(:file_id, file.id) %> <%= hidden_field_tag(:file_id, file.id) %>
<%= content_tag('div', courses_check_box_tags('courses[course][]', User.current.courses,course), :id => 'courses')%> <%= content_tag('div', courses_check_box_tags('courses[course][]', User.current.courses,course,file), :id => 'courses')%>
<a id="submit_quote" href="javascript:void(0)" class="upload_btn" onclick="submit_quote();">引&nbsp;&nbsp;用</a><a href="javascript:void(0)" class="upload_btn upload_btn_grey" onclick="closeModal();">取&nbsp;&nbsp;消</a> <a id="submit_quote" href="javascript:void(0)" class="upload_btn" onclick="submit_quote();">引&nbsp;&nbsp;用</a><a href="javascript:void(0)" class="upload_btn upload_btn_grey" onclick="closeModal();">取&nbsp;&nbsp;消</a>
<% end -%> <% end -%>
</div> </div>

View File

@ -56,7 +56,7 @@
<td> <td>
<p class="top-content-list"> <p class="top-content-list">
<%= link_to "主页", home_path %> <%= link_to "主页", home_path %>
> <%= link_to l(:label_course_all), :controller => 'courses', :action => 'index' %> > <a href="http://<%= Setting.host_course%>" class="link_other_item"><%=l(:label_courses_management_platform)%></a>
> <%= link_to @course.name, nil %> > <%= link_to @course.name, nil %>
</p> </p>
</td> </td>

View File

@ -44,7 +44,7 @@
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px"><%= link_to request.host()+"/projects", :controller => 'projects', :action => 'index', :project_type => 0 %></td> <td style="padding-left: 8px"><%= link_to request.host()+"/projects", :controller => 'projects', :action => 'index', :project_type => 0 %></td>
<td><p class="top-content-list"><%=link_to l(:label_home),home_path %> > <%=link_to l(:label_project_deposit),:controller => 'projects', :action => 'index', :project_type => 0 %> > <%=link_to @project, project_path(@project) %></p></td> <td><p class="top-content-list"><%=link_to l(:label_home),home_path %> > <%=link_to @project, project_path(@project) %></p></td>
</tr> </tr>
</table> </table>
</div> </div>

View File

@ -114,7 +114,6 @@
</td> </td>
<td> <td>
<%=link_to "主页", home_path %> > <%=link_to "主页", home_path %> >
<%=link_to "软件创客", :controller => 'users', :action => 'index' %> >
<span><%=link_to @user.name, user_path %></span> <span><%=link_to @user.name, user_path %></span>
</td> </td>
</tr> </tr>

View File

@ -106,7 +106,7 @@
<div> <div>
<!-- 昵称 --> <!-- 昵称 -->
<p style="width:630px;padding-left: 40px;"> <p style="width:630px;padding-left: 40px;">
<%= f.text_field :login, :required => true, :size => 25, :name => "login", :readonly => true %> <%= f.text_field :login, :required => true, :size => 25, :name => "login", :readonly => true, :style => 'border:1px solid #d3d3d3;'%>
<span class='font_lighter'><%= l(:label_max_number) %></span> <span class='font_lighter'><%= l(:label_max_number) %></span>
<br/> <br/>
</p> </p>

View File

@ -1,13 +1,14 @@
<%= link_to '+ 添加标签', 'javascript:void(0);', <%= link_to '+ 添加标签', 'javascript:void(0);',
:class => "yellowBtn f_l", :class => "yellowBtn f_l",
:onclick=>"$('#add_tag_#{obj.id}').slideToggle();" if User.current.logged? %> <!-- $('#put-tag-form-#{obj.class}-#{obj.id}').toggle(); readmore(this); --> :onclick=>"$('#add_tag_#{obj.id}').slideToggle();" if User.current.logged? %> <!-- $('#put-tag-form-#{obj.class}-#{obj.id}').toggle(); readmore(this); -->
<span id="add_tag_<%= obj.id %>" style="display:none; vertical-align: middle;" class="ml10 f_l">
<%= form_for "tag_for_save",:remote=>true,:url => save_tag_path, <%= form_for "tag_for_save",:remote=>true,:url => save_tag_path,
:update => "tags_show", :update => "tags_show",
:complete => '$("#put-tag-form").hide();' do |f| %> :complete => '$("#put-tag-form").hide();' do |f| %>
<span id="add_tag_<%= obj.id %>" style="display:none; vertical-align: middle;" class="ml10 f_l">
<%= f.text_field :name ,:id => "tags_name_#{obj.id}",:size=>"28",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length,:class => "isTxt w90 f_l" %> <%= f.text_field :name ,:id => "tags_name_#{obj.id}",:size=>"28",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length,:class => "isTxt w90 f_l" %>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%> <%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%> <%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<%= f.submit "",:class => "submit f_l" %> <%= f.submit "",:class => "submit f_l" %>
<% end %>
</span> </span>
<% end %>

View File

@ -14,7 +14,7 @@
</span> </span>
<% end %> <% end %>
<% else %> <% else %>
<span style="color:#8c8a8a" class="f_l"> <!-- <span style="color:#8c8a8a" class="f_l">
&nbsp;&nbsp;&nbsp;<%= l(:label_tags_no) %> &nbsp;&nbsp;&nbsp;<#%= l(:label_tags_no) %> -->
</span> </span>
<% end %> <% end %>

View File

@ -7,5 +7,3 @@
<%= link_to l(:label_course_join_student), join_private_courses_courses_path ,:remote => true, :class => 'icon icon-add' %> <%= link_to l(:label_course_join_student), join_private_courses_courses_path ,:remote => true, :class => 'icon icon-add' %>
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
<% end %> <% end %>
<%= link_to l(:label_more), {:controller => 'courses', :action => 'index', :school_id => school_id} %>

View File

@ -160,8 +160,6 @@
<%= link_to(l(:label_newtype_contest), new_contest_contests_path, :class => 'icon icon-add') %> <%= link_to(l(:label_newtype_contest), new_contest_contests_path, :class => 'icon icon-add') %>
<% end %> <% end %>
<% end %> <% end %>
&nbsp;&nbsp;
<%= link_to l(:label_more), {:controller => 'contests', :action => 'index'}, :target => "_blank" %>
</span> </span>
<div class="d-p-projectlist-box"> <div class="d-p-projectlist-box">
<div class="d-p-projectlist"> <div class="d-p-projectlist">
@ -258,7 +256,6 @@
<div id="J_Slide" class="d-p-index-box d-p-index-left"> <div id="J_Slide" class="d-p-index-box d-p-index-left">
<h3 style="margin-left: 5px; color: #e8770d;"><strong><%=l(:label_current_attendingcontest_work)%></strong></h3> <h3 style="margin-left: 5px; color: #e8770d;"><strong><%=l(:label_current_attendingcontest_work)%></strong></h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to l(:label_more_information), {:controller => 'softapplications', :action => 'index'}, :target => "_blank" %></span>
<div class="d-p-projectlist-box"> <div class="d-p-projectlist-box">
<% if Softapplication.count > 0%> <% if Softapplication.count > 0%>
<div class="d-p-projectlist"> <div class="d-p-projectlist">

View File

@ -1,5 +1,4 @@
<% @nav_dispaly_project_label = 1 <% @nav_dispaly_forum_label = 1 %>
@nav_dispaly_forum_label = 1 %>
<%= stylesheet_link_tag 'welcome' %> <%= stylesheet_link_tag 'welcome' %>
<%= javascript_include_tag 'welcome' %> <%= javascript_include_tag 'welcome' %>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
@ -68,12 +67,6 @@
:project_type =>( @project_type||=0)}, :project_type =>( @project_type||=0)},
:class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %> :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
<% end %> <% end %>
&nbsp;&nbsp;
<%= link_to l(:label_more), { :controller => 'projects',
:action => 'index',
:project_type => 0,
:host => Setting.project_domain},
:target => "_blank" %>
</span> </span>
<div class="d-p-projectlist-box"> <div class="d-p-projectlist-box">
<ul class="d-p-projectlist"> <ul class="d-p-projectlist">
@ -118,9 +111,6 @@
<%= l(:lable_user_active)%> <%= l(:lable_user_active)%>
</strong> </strong>
</h3> </h3>
<span style="margin-top: -20px;float: right; display: block;">
<%= link_to l(:label_more), { :controller => 'users', :action => 'index'}, :target => "_blank" %>
</span>
<div class="user-message-box-list" style="margin-top: 10px;"> <div class="user-message-box-list" style="margin-top: 10px;">
<%activities = find_all_activities%> <%activities = find_all_activities%>
<% activities.each do |event| %> <% activities.each do |event| %>

View File

@ -1852,3 +1852,4 @@ en:
label_anonymous_comments: Anonymous comments label_anonymous_comments: Anonymous comments
label_anonymous: Anonymous label_anonymous: Anonymous
label_submit_comments: Submit_comments label_submit_comments: Submit_comments
label_course_empty_select: You have not selected course

View File

@ -396,7 +396,8 @@ zh:
setting_repository_log_display_limit: 在文件变更记录页面上显示的最大修订版本数量 setting_repository_log_display_limit: 在文件变更记录页面上显示的最大修订版本数量
setting_openid: 允许使用OpenID登录和注册 setting_openid: 允许使用OpenID登录和注册
setting_password_min_length: 最短密码长度 setting_password_min_length: 最短密码长度
setting_password_error: 密码不一致 setting_password_min_length_limit: "密码长度至少大于 %{count} 个字符。"
setting_password_error: 密码长度不够或密码不一致
setting_password_success: 密码设置成功 setting_password_success: 密码设置成功
setting_new_project_user_role_id: 非管理员用户新建项目时将被赋予的(在该项目中的)角色 setting_new_project_user_role_id: 非管理员用户新建项目时将被赋予的(在该项目中的)角色
setting_default_projects_modules: 新建项目默认启用的模块 setting_default_projects_modules: 新建项目默认启用的模块
@ -1598,7 +1599,7 @@ zh:
label_tags_user_mail: 用户邮箱: label_tags_user_mail: 用户邮箱:
label_tags_user_name: 用户名: label_tags_user_name: 用户名:
label_tags_numbers: Tag统计 label_tags_numbers: Tag统计
label_max_number: 登录名是在网站中显示的您的公开标识,只能为英文 label_max_number: 登录名是在网站中显示的您的公开标识,只能为英文和数字
label_mail_attention: qq邮箱可能收不到此邮件其他邮箱如果没有收到可能在垃圾邮件中 label_mail_attention: qq邮箱可能收不到此邮件其他邮箱如果没有收到可能在垃圾邮件中
label_mail_attention1: 其中gmail与教育网邮箱的激活邮件有时比较慢请耐心等待。 label_mail_attention1: 其中gmail与教育网邮箱的激活邮件有时比较慢请耐心等待。
label_your_course: 您的课程《 label_your_course: 您的课程《
@ -2203,3 +2204,5 @@ zh:
field_evaluation_num: 匿评分配数量 field_evaluation_num: 匿评分配数量
label_my_score: 我的评分 label_my_score: 我的评分
field_open_anonymous_evaluation: 是否使用匿评 field_open_anonymous_evaluation: 是否使用匿评
field_open_anonymous_evaluation: 是否开启匿评
label_course_empty_select: 尚未选择课程!

View File

@ -0,0 +1,5 @@
class AddColumnCopyfromToAttachment < ActiveRecord::Migration
def change
add_column("attachments","copy_from",:integer)
end
end

View File

@ -1,4 +1,4 @@
body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;} body{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; line-height:1.9 !important; background:#fff !important; font-style:normal !important;}
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,form,span,textarea{ margin:0; padding:0;} div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,form,span,textarea{ margin:0; padding:0;}
div,img,tr,td,textarea{ border:0;} div,img,tr,td,textarea{ border:0;}
table,tr,td{border:0; cellspacing:0; cellpadding:0;} table,tr,td{border:0; cellspacing:0; cellpadding:0;}
@ -12,11 +12,12 @@ a:hover{ text-decoration:underline;}
.b_lblue{ background:#64bdd9 !important;} .b_lblue{ background:#64bdd9 !important;}
.b_dblue{ background:#55a1b9 !important; cursor:pointer !important;} .b_dblue{ background:#55a1b9 !important; cursor:pointer !important;}
.f_b{ font-weight: bold !important;} .f_b{ font-weight: bold !important;}
.c_blue{ color:#64bdd9;} .c_blue{ color:#64bdd9 !important;}
.c_grey{ color:#999999 !important;} .c_grey{ color:#999999 !important;}
.c_grey02{ color:#666666 !important;} .c_grey02{ color:#666666 !important;}
.font{ font-size: 12px;}
.f_14{ font-size:14px ;} .f_14{ font-size:14px ;}
.c_dblue{ color:#3e6d8e;} .c_dblue{ color:#3e6d8e !important;}
.w90{width:90px;} .w90{width:90px;}
.ml10{margin-left:10px;} .ml10{margin-left:10px;}
.ml5{margin-left:5px;} .ml5{margin-left:5px;}
@ -46,15 +47,38 @@ a:hover{ text-decoration:underline;}
text-shadow: none !important; text-shadow: none !important;
} }
a.re_fabu { display:block; width:90px; height:35px; font-size:14px; color:#fff; text-align:center; padding-top:5px; margin:5px; } a.re_fabu { display:block; width:90px; height:35px; font-size:14px; color:#fff; text-align:center; padding-top:5px; margin:5px; }
a:hover.re_fabu{background:#55a1b9;} a:hover.re_fabu{background:#55a1b9 !important;}
/****列表***/ /****列表***/
.re_con{ margin:5px; width:683px;} .re_con{ margin:5px; width:683px;}
.re_con_top{color:#494949; } .re_con_top{color:#494949; }
.re_con_top span{ color:#999999; font-weight:bold;} .re_con_top span{ color:#999999; font-weight:bold;}
a.re_select{ display:block; width:88px; height:22px; background:url(images/pic_select01.png) 0 0 no-repeat; color:#fff; font-weight:bold; margin-left:10px;} a.re_select{
a:hover.re_select{background:url(images/pic_select02.png) 0 0 no-repeat;} display: block;
.re_open{display:block; width:46px; height:22px; background:url(images/pic_open01.png) 0 0 no-repeat; color:#fff; font-weight:bold; margin-left:10px;} height: 22px;
a:hover.re_open{background:url(images/pic_open02.png) 0 0 no-repeat;} border: 1px solid #ff9900;
color: #ff9900;
margin-left: 10px;
padding-left: 10px;
padding-right: 10px;
}
a:hover.re_select{
background: #ff9900;
color: #fff;
text-decoration: none;}
.re_open{
display: block !important;
width: 46px !important;
height: 22px !important;
border: 1px solid #64bdd9 !important;
color: #64bdd9 !important;
margin-left: 10px !important;
}
a:hover.re_open
{
background: #64bdd9;
color: #fff !important;
text-decoration: none !important;
}
a.re_de{ color:#6883b6; margin-left:15px;} a.re_de{ color:#6883b6; margin-left:15px;}
.re_con_box{ border-bottom:1px dashed #dadada; padding:10px 0;} .re_con_box{ border-bottom:1px dashed #dadada; padding:10px 0;}
/****翻页***/ /****翻页***/
@ -76,7 +100,6 @@ a.yellowBtn{ display:inline-block;color:#0d90c3; height:22px;}
margin-top:2px !important; margin-top:2px !important;
margin-left:3px !important; margin-left:3px !important;
border:none !important; border:none !important;
margin-left:0px !important;
box-shadow: none !important; box-shadow: none !important;
padding: 0px !important; padding: 0px !important;
border-radius: 0 !important; border-radius: 0 !important;