Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
Conflicts: config/locales/zh.yml
This commit is contained in:
commit
d788e46546
|
@ -234,7 +234,7 @@ class AccountController < ApplicationController
|
|||
end
|
||||
|
||||
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?
|
||||
invalid_credentials
|
||||
|
@ -244,7 +244,7 @@ class AccountController < ApplicationController
|
|||
onthefly_creation_failed(user, {:login => user.login, :auth_source_id => user.auth_source_id })
|
||||
else
|
||||
# Valid user
|
||||
successful_authentication(user)
|
||||
successful_authentication(user, last_login_on)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -291,7 +291,7 @@ class AccountController < ApplicationController
|
|||
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}"
|
||||
# Valid user
|
||||
self.logged_user = user
|
||||
|
@ -304,13 +304,18 @@ class AccountController < ApplicationController
|
|||
code = /\d*/
|
||||
#根据home_url生产正则表达式
|
||||
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)
|
||||
else
|
||||
if last_login_on == ''
|
||||
redirect_to my_account_url
|
||||
else
|
||||
#by young
|
||||
#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
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ class ApplicationController < ActionController::Base
|
|||
else
|
||||
# HTTP Basic, either username/password or API key/random
|
||||
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
|
||||
# Switch user if requested by an admin user
|
||||
|
@ -267,6 +267,8 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
when "contest"
|
||||
return true
|
||||
when "Course"
|
||||
allowed = User.current.allowed_to?(:course_attachments_download, @course, :global => false)
|
||||
else
|
||||
return true
|
||||
end
|
||||
|
|
|
@ -76,7 +76,7 @@ class AttachmentsController < ApplicationController
|
|||
candown = User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1)
|
||||
elsif (@attachment.container.has_attribute?(:course) ||@attachment.container.has_attribute?(:course_id) ) && @attachment.container.course
|
||||
course = @attachment.container.course
|
||||
candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1)
|
||||
candown = User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1)
|
||||
elsif @attachment.container.is_a?(Course)
|
||||
course = @attachment.container
|
||||
candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1)
|
||||
|
@ -366,7 +366,7 @@ class AttachmentsController < ApplicationController
|
|||
end
|
||||
rescue NoMethodError
|
||||
@save_flag = false
|
||||
@save_message = [] << l(:error_attachment_empty)
|
||||
@save_message = [] << l(:label_course_empty_select)
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
|
|
@ -37,6 +37,7 @@ class ContestsController < ApplicationController
|
|||
|
||||
|
||||
def index
|
||||
render_404
|
||||
# @contests = Contest.visible
|
||||
# @contests ||= []
|
||||
@offset, @limit = api_offset_and_limit(:limit => 10)
|
||||
|
|
|
@ -427,6 +427,7 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
|
||||
def index
|
||||
render_404
|
||||
@course_type = params[:course_type]
|
||||
@school_id = params[:school_id]
|
||||
per_page_option = 10
|
||||
|
@ -474,7 +475,7 @@ class CoursesController < ApplicationController
|
|||
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
render :layout => 'base'
|
||||
# render :layout => 'base'
|
||||
}
|
||||
format.atom {
|
||||
courses = Course.visible.order('created_on DESC').limit(Setting.feeds_limit.to_i).all
|
||||
|
|
|
@ -26,13 +26,15 @@ class FilesController < ApplicationController
|
|||
|
||||
helper :sort
|
||||
include SortHelper
|
||||
include FilesHelper
|
||||
helper :project_score
|
||||
|
||||
def show_attachments obj
|
||||
@all_attachments = []
|
||||
@attachments = []
|
||||
obj.each do |container|
|
||||
@all_attachments += container.attachments
|
||||
@attachments += container.attachments
|
||||
end
|
||||
@all_attachments = visable_attachemnts(@attachments)
|
||||
@limit = 10
|
||||
@feedback_count = @all_attachments.count
|
||||
@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?
|
||||
if params[:insite]
|
||||
@result = find_public_attache q
|
||||
@result = visable_attachemnts @result
|
||||
@searched_attach = paginateHelper @result,10
|
||||
else
|
||||
@result = find_course_attache q,@course
|
||||
@result = visable_attachemnts @result
|
||||
@searched_attach = paginateHelper @result,10
|
||||
end
|
||||
|
||||
|
|
|
@ -105,6 +105,7 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
|
||||
def index
|
||||
render_404
|
||||
#调用存储过程更新提交次数
|
||||
#ActiveRecord::Base.connection.execute("CALL sp_project_status_cursor();")
|
||||
#Modified by nie
|
||||
|
@ -156,8 +157,8 @@ class ProjectsController < ApplicationController
|
|||
|
||||
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
render :layout => 'base'
|
||||
format.html {
|
||||
# render :layout => 'base'
|
||||
# scope = Project
|
||||
# unless params[:closed]
|
||||
# scope = scope.active
|
||||
|
|
|
@ -295,6 +295,7 @@ class UsersController < ApplicationController
|
|||
|
||||
#end
|
||||
def index
|
||||
|
||||
@status = params[:status] || 1
|
||||
sort_init 'login', 'asc'
|
||||
sort_update %w(login firstname lastname mail admin created_on last_login_on)
|
||||
|
@ -352,7 +353,8 @@ class UsersController < ApplicationController
|
|||
respond_to do |format|
|
||||
format.html {
|
||||
@groups = Group.all.sort
|
||||
render :layout => @user_base_tag
|
||||
# render :layout => @user_base_tag
|
||||
render_404
|
||||
}
|
||||
format.api
|
||||
end
|
||||
|
|
|
@ -1830,12 +1830,11 @@ module ApplicationHelper
|
|||
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}
|
||||
|
||||
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}
|
||||
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}
|
||||
# courses_link = link_to l(:label_course_practice), {:controller => 'courses', :action => 'index'}
|
||||
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'}
|
||||
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'}
|
||||
|
@ -1844,7 +1843,7 @@ module ApplicationHelper
|
|||
#@nav_dispaly_project_label
|
||||
nav_list = Array.new
|
||||
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(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(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(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(forum_link) if @nav_dispaly_forum_label
|
||||
nav_list.push(stores_link) if @nav_dispaly_store_all_label
|
||||
|
|
|
@ -44,10 +44,10 @@ module FilesHelper
|
|||
File.new(zipfile_name,'w+')
|
||||
end
|
||||
|
||||
def courses_check_box_tags(name,courses,current_course)
|
||||
def courses_check_box_tags(name,courses,current_course,attachment)
|
||||
s = ''
|
||||
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/>"
|
||||
end
|
||||
end
|
||||
|
@ -72,5 +72,20 @@ module FilesHelper
|
|||
result
|
||||
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
|
|
@ -161,7 +161,7 @@ class Role < ActiveRecord::Base
|
|||
if action.is_a? Hash
|
||||
allowed_actions.include? "#{action[:controller]}/#{action[:action]}"
|
||||
else
|
||||
allowed_permissions.include? action
|
||||
allowed_permissions.include? action
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -230,7 +230,12 @@ class User < Principal
|
|||
|
||||
#选择项目成员时显示的用户信息文字
|
||||
def userInfo
|
||||
info=self.nickname + ' (' + self.realname + ')';
|
||||
if self.realname.gsub(' ','') == "" || self.realname.nil?
|
||||
info = self.nickname;
|
||||
else
|
||||
info=self.nickname + ' (' + self.realname + ')';
|
||||
end
|
||||
info
|
||||
end
|
||||
|
||||
###添加留言 fq
|
||||
|
@ -359,8 +364,9 @@ class User < Principal
|
|||
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
|
||||
[user, last_login_on]
|
||||
rescue => text
|
||||
raise text
|
||||
end
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<body>
|
||||
<% 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; ">
|
||||
<span id = "jihuo" style=" margin-left: 4%;"></span>邮箱激活</h3>
|
||||
|
@ -19,9 +19,10 @@
|
|||
<div style="margin-left:auto; margin-right:auto">
|
||||
<center>
|
||||
<div >
|
||||
<h4 style="font-size: 18px;margin-top: 10px; margin-bottom: 10px;">请在24小时内点击邮件中的链接继续完成注册</h4>
|
||||
<div class="to-email">
|
||||
<span class="summary">邮件已发送到邮箱</span>
|
||||
<h4 style="font-size: 18px;margin-top: 10px; padding-bottom: 10px;">请在24小时内点击邮件中的链接继续完成注册</h4>
|
||||
<div class="to-email" style="padding-bottom: 8px; font-size: 14px">
|
||||
<div class="to-email" style="padding-bottom: 8px; font-size: 14px">
|
||||
<span >邮件已发送到邮箱</span>
|
||||
<a href="#" class="f-blue"><%= @user.mail %></a>
|
||||
</div>
|
||||
<p>
|
||||
|
@ -33,12 +34,7 @@
|
|||
padding: 10px 16px;
|
||||
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>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<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>
|
||||
</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>
|
||||
</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>
|
||||
<% end %>
|
||||
</div>
|
||||
<% password_min_length = Setting.password_min_length %>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function () {
|
||||
var $login = $('#user_login')
|
||||
var $mail = $('#user_mail')
|
||||
var $password = $('#user_password')
|
||||
var $password_confirmation = $('#user_password_confirmation')
|
||||
$login.blur(function (event) {
|
||||
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 () {
|
||||
var password_min_length = <%= password_min_length %>
|
||||
var pas1 = document.getElementById("user_password").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>");
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -19,8 +19,9 @@
|
|||
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => false, :id => 'message-form'} do |f| %>
|
||||
<%= render :partial => 'messages/form', :locals => {:f => f} %>
|
||||
<p>
|
||||
<input type="button" onclick="submitCoursesBoard();" class = "whiteButton m3p10 h30" value="<%= l(:button_submit)%>">
|
||||
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' ,:class => 'whiteButton m3p10' %>
|
||||
<!--<input type="button" onclick="submitCoursesBoard();" class = "ButtonColor m3p10 h30" value="<%= l(:button_submit)%>">-->
|
||||
<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>
|
||||
<% end %>
|
||||
<div id="preview" class="wiki"></div>
|
||||
|
|
|
@ -18,6 +18,20 @@
|
|||
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>
|
||||
|
||||
<div class="container">
|
||||
|
@ -25,8 +39,8 @@
|
|||
<div class="re_top">
|
||||
<%= 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"%>
|
||||
<%= submit_tag "课内搜索", :class => "re_schbtn b_dblue",:name => "incourse"%>
|
||||
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite" %>
|
||||
<%= submit_tag "课内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onclick => "presscss('incourse')"%>
|
||||
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onclick => "presscss('insite')" %>
|
||||
<% end %>
|
||||
<% if is_course_teacher(User.current,@course) %>
|
||||
<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload()">上传资源</a>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<% delete_allowed = User.current.allowed_to?(:manage_files, course) %>
|
||||
<div class="re_con_top">
|
||||
<p class="f_l c_blue f_b f_14">共有 <%= User.current.member_of_course?(course) ? all_attachments.count : 0 %> 个资源</p>
|
||||
<!-- <p class="f_r">
|
||||
<#% if @order == "asc" %>
|
||||
<p class="f_l c_blue f_b f_14">共有 <%= all_attachments.count%> 个资源</p>
|
||||
<p class="f_r" style="color: #808080">
|
||||
<!--<#% if @order == "asc" %>
|
||||
按 <#%= 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"} %> /
|
||||
<#%= 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"} %> /
|
||||
<a href="#" class="f_b c_grey">引用次数</a> 排序
|
||||
|
@ -10,32 +10,38 @@
|
|||
按 <#%= 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"} %> /
|
||||
<#%= 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"} %> /
|
||||
<a href="#" class="f_b c_grey">引用次数</a> 排序
|
||||
<#% end %>
|
||||
</p>-->
|
||||
<#% end %>-->
|
||||
资源列表的多样化排序将在下周上线...
|
||||
</p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% 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=" ">
|
||||
<%= 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" %>
|
||||
<% if is_course_teacher(User.current,@course) %>
|
||||
<%= link_to "选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true %>
|
||||
<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 %>
|
||||
</span>
|
||||
<%= 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 User.current.logged? %>
|
||||
<% 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 %>">
|
||||
<%= 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>
|
||||
<% else %>
|
||||
<!-- <#%= 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 %>
|
||||
<%= link_to (file.is_public? ? "公开":"私有"),"javascript:void(0)",:class=>"f_l re_open" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<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),
|
||||
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if delete_allowed %>
|
||||
<p class="f_r c_grey02" ><%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %> | 下载<%= file.downloads %> | 引用0 </p>
|
||||
: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) %> | 下载<%= file.downloads %> <!--| 引用<%#=get_qute_number file %>--> </p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="tag_h">
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<div id="popbox_upload" style="margin-top: -30px;margin-left: -20px;margin-right: -10px;">
|
||||
<div class="upload_con">
|
||||
<div id="error_show"></div>
|
||||
<h2>将此课件引入我的课程资源库</h2>
|
||||
<div class="upload_box">
|
||||
<div id="error_show" style="color: red;"></div>
|
||||
<%= form_tag course_attach_relations_path,
|
||||
method: :post,
|
||||
remote: true,
|
||||
id: "relation_file_form" do %>
|
||||
<%= 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();">引 用</a><a href="javascript:void(0)" class="upload_btn upload_btn_grey" onclick="closeModal();">取 消</a>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
<td>
|
||||
<p class="top-content-list">
|
||||
<%= 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 %>
|
||||
</p>
|
||||
</td>
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<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>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -113,8 +113,7 @@
|
|||
<%=link_to request.host()+"/users" ,:controller => 'users', :action => 'index' %>
|
||||
</td>
|
||||
<td>
|
||||
<%=link_to "主页", home_path %> >
|
||||
<%=link_to "软件创客", :controller => 'users', :action => 'index' %> >
|
||||
<%=link_to "主页", home_path %> >
|
||||
<span><%=link_to @user.name, user_path %></span>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
<div>
|
||||
<!-- 昵称 -->
|
||||
<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>
|
||||
<br/>
|
||||
</p>
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
<%= link_to '+ 添加标签', 'javascript:void(0);',
|
||||
:class => "yellowBtn f_l",
|
||||
: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,
|
||||
:update => "tags_show",
|
||||
:complete => '$("#put-tag-form").hide();' do |f| %>
|
||||
<%= 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_flag,:value=> object_flag,:style=>"display:none"%>
|
||||
<%= f.submit "",:class => "submit f_l" %>
|
||||
<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 :object_id,:value=> obj.id,:style=>"display:none"%>
|
||||
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
|
||||
<%= f.submit "",:class => "submit f_l" %>
|
||||
</span>
|
||||
<% end %>
|
||||
</span>
|
|
@ -14,7 +14,7 @@
|
|||
</span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<span style="color:#8c8a8a" class="f_l">
|
||||
<%= l(:label_tags_no) %>
|
||||
</span>
|
||||
<!-- <span style="color:#8c8a8a" class="f_l">
|
||||
<#%= l(:label_tags_no) %> -->
|
||||
</span>
|
||||
<% end %>
|
|
@ -7,5 +7,3 @@
|
|||
<%= link_to l(:label_course_join_student), join_private_courses_courses_path ,:remote => true, :class => 'icon icon-add' %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<%= link_to l(:label_more), {:controller => 'courses', :action => 'index', :school_id => school_id} %>
|
|
@ -160,8 +160,6 @@
|
|||
<%= link_to(l(:label_newtype_contest), new_contest_contests_path, :class => 'icon icon-add') %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to l(:label_more), {:controller => 'contests', :action => 'index'}, :target => "_blank" %>
|
||||
</span>
|
||||
<div class="d-p-projectlist-box">
|
||||
<div class="d-p-projectlist">
|
||||
|
@ -258,7 +256,6 @@
|
|||
|
||||
<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>
|
||||
<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">
|
||||
<% if Softapplication.count > 0%>
|
||||
<div class="d-p-projectlist">
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<% @nav_dispaly_project_label = 1
|
||||
@nav_dispaly_forum_label = 1 %>
|
||||
<% @nav_dispaly_forum_label = 1 %>
|
||||
<%= stylesheet_link_tag 'welcome' %>
|
||||
<%= javascript_include_tag 'welcome' %>
|
||||
<script type="text/javascript" language="javascript">
|
||||
|
@ -68,12 +67,6 @@
|
|||
:project_type =>( @project_type||=0)},
|
||||
:class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to l(:label_more), { :controller => 'projects',
|
||||
:action => 'index',
|
||||
:project_type => 0,
|
||||
:host => Setting.project_domain},
|
||||
:target => "_blank" %>
|
||||
</span>
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
|
@ -118,9 +111,6 @@
|
|||
<%= l(:lable_user_active)%>
|
||||
</strong>
|
||||
</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;">
|
||||
<%activities = find_all_activities%>
|
||||
<% activities.each do |event| %>
|
||||
|
|
|
@ -1851,4 +1851,5 @@ en:
|
|||
label_teacher_comments: Teacher comments
|
||||
label_anonymous_comments: Anonymous comments
|
||||
label_anonymous: Anonymous
|
||||
label_submit_comments: Submit_comments
|
||||
label_submit_comments: Submit_comments
|
||||
label_course_empty_select: You have not selected course!
|
|
@ -396,7 +396,8 @@ zh:
|
|||
setting_repository_log_display_limit: 在文件变更记录页面上显示的最大修订版本数量
|
||||
setting_openid: 允许使用OpenID登录和注册
|
||||
setting_password_min_length: 最短密码长度
|
||||
setting_password_error: 密码不一致
|
||||
setting_password_min_length_limit: "密码长度至少大于 %{count} 个字符。"
|
||||
setting_password_error: 密码长度不够或密码不一致
|
||||
setting_password_success: 密码设置成功
|
||||
setting_new_project_user_role_id: 非管理员用户新建项目时将被赋予的(在该项目中的)角色
|
||||
setting_default_projects_modules: 新建项目默认启用的模块
|
||||
|
@ -1598,7 +1599,7 @@ zh:
|
|||
label_tags_user_mail: 用户邮箱:
|
||||
label_tags_user_name: 用户名:
|
||||
label_tags_numbers: Tag统计:
|
||||
label_max_number: 登录名是在网站中显示的您的公开标识,只能为英文。
|
||||
label_max_number: 登录名是在网站中显示的您的公开标识,只能为英文和数字。
|
||||
label_mail_attention: qq邮箱可能收不到此邮件,其他邮箱如果没有收到可能在垃圾邮件中,
|
||||
label_mail_attention1: 其中gmail与教育网邮箱的激活邮件有时比较慢,请耐心等待。
|
||||
label_your_course: 您的课程《
|
||||
|
@ -2203,3 +2204,5 @@ zh:
|
|||
field_evaluation_num: 匿评分配数量
|
||||
label_my_score: 我的评分
|
||||
field_open_anonymous_evaluation: 是否使用匿评
|
||||
field_open_anonymous_evaluation: 是否开启匿评
|
||||
label_course_empty_select: 尚未选择课程!
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddColumnCopyfromToAttachment < ActiveRecord::Migration
|
||||
def change
|
||||
add_column("attachments","copy_from",:integer)
|
||||
end
|
||||
end
|
|
@ -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,img,tr,td,textarea{ border: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_dblue{ background:#55a1b9 !important; cursor:pointer !important;}
|
||||
.f_b{ font-weight: bold !important;}
|
||||
.c_blue{ color:#64bdd9;}
|
||||
.c_blue{ color:#64bdd9 !important;}
|
||||
.c_grey{ color:#999999 !important;}
|
||||
.c_grey02{ color:#666666 !important;}
|
||||
.font{ font-size: 12px;}
|
||||
.f_14{ font-size:14px ;}
|
||||
.c_dblue{ color:#3e6d8e;}
|
||||
.c_dblue{ color:#3e6d8e !important;}
|
||||
.w90{width:90px;}
|
||||
.ml10{margin-left:10px;}
|
||||
.ml5{margin-left:5px;}
|
||||
|
@ -46,15 +47,38 @@ a:hover{ text-decoration:underline;}
|
|||
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:hover.re_fabu{background:#55a1b9;}
|
||||
a:hover.re_fabu{background:#55a1b9 !important;}
|
||||
/****列表***/
|
||||
.re_con{ margin:5px; width:683px;}
|
||||
.re_con_top{color:#494949; }
|
||||
.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:hover.re_select{background:url(images/pic_select02.png) 0 0 no-repeat;}
|
||||
.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;}
|
||||
a:hover.re_open{background:url(images/pic_open02.png) 0 0 no-repeat;}
|
||||
a.re_select{
|
||||
display: block;
|
||||
height: 22px;
|
||||
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;}
|
||||
.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-left:3px !important;
|
||||
border:none !important;
|
||||
margin-left:0px !important;
|
||||
box-shadow: none !important;
|
||||
padding: 0px !important;
|
||||
border-radius: 0 !important;
|
||||
|
|
Loading…
Reference in New Issue