diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d1465574f..32cfefa9d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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 diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index a57b5f8a5..5c3503718 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -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 diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 6de800efc..251496e30 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -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 @@ -69,7 +73,7 @@ class FilesController < ApplicationController # StoresController#search 将每条文件都查出来,再次进行判断过滤。---> resultSet.to_a.map # 此时内容不多速度还可,但文件增长,每条判断多则进行3-4次表连接。 # 现在还木有思路 药丸 - resultSet = Attachment.where("attachments.container_type IS NOT NULL AND (is_public = 1 OR author_id = #{User.current.id}) AND filename LIKE :like ", like: "%#{keywords}%"). + resultSet = Attachment.where("attachments.container_type IS NOT NULL AND filename LIKE :like ", like: "%#{keywords}%"). reorder("created_on DESC") end diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index 61760f462..0286fcad6 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -382,42 +382,22 @@ class HomeworkAttachController < ApplicationController if User.current.admin? || User.current.member_of_course?(@homework.bid.courses.first) # 打分统计 stars_reates = @homework. rates(:quality) - #stars_reates_count = stars_reates.count == 0 ? 1 : stars_reates.count - #stars_status = stars_reates.select("stars, count(*) as scount").group("stars") - #@stars_status_map = Hash.new(0.0) - #stars_status.each do |star_status| - # percent = (star_status.scount * 1.0/ stars_reates_count) * 100.to_f - # percent_m = format("%.2f", percent) - # @stars_status_map["star#{star_status.stars.to_i}".to_sym] = - # percent_m.to_s + "%" - #end #是否已经进行过评价 temp = HomeworkAttach.find_by_sql("SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = #{@homework.id} AND rater_id = #{User.current.id}").first @m_score = temp.nil? ? 0:temp.stars @has_evaluation = stars_reates.where("rater_id = ?",User.current).count > 0 - #是否开启互评功能 - #@is_evaluation = @homework.bid.is_evaluation == 1 || @homework.bid.is_evaluation == nil - #@limit = 10 #@jours留言 is null条件用以兼容历史数据 @jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC") @cur_page = params[:cur_page] || 1 @cur_type = params[:cur_type] || 5 @jour = paginateHelper @jours,5 - #@feedback_count = @jours.count - #@feedback_pages = Paginator.new @feedback_count, @limit, params['page'] - #@offset ||= @feedback_pages.offset - #@jour = @jours[@offset, @limit] - #@comprehensive_evaluation教师评论 - #@comprehensive_evaluation = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1").order("created_on DESC") + teachers = searchTeacherAndAssistant @course @comprehensive_evaluation = [] teachers.each do|teacher| temp = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1 and user_id = #{teacher.user_id}").order("created_on DESC").first @comprehensive_evaluation << temp if temp end - #@comprehensive_evaluation = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1 and user_id in #{convert_array(teachers)}").order("created_on DESC") - #@anonymous_comments 匿评 - #@anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2").order("created_on DESC") annymous_users = @homework.homework_evaluations.map(&:user) unless annymous_users.nil? || annymous_users.count == 0 @anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2 and user_id in #{convert_array(annymous_users)}").order("created_on DESC") diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index d73b8de3a..0b7cbbb5f 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -843,7 +843,10 @@ class ProjectsController < ApplicationController end def show_projects_score - render :layout => false + respond_to do |format| + format.html { render :layout => "project_base"} + format.js + end end def issue_score_index diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 2a5792e36..94717a4ce 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -163,7 +163,7 @@ class WelcomeController < ApplicationController return 0 elsif url.include?(Setting.host_user.gsub('/','')) - redirect_to(:controller => "users", :action => "index") + #redirect_to(:controller => "users", :action => "index") end diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb index 4f3f401c9..cd7603c65 100644 --- a/app/helpers/files_helper.rb +++ b/app/helpers/files_helper.rb @@ -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 \ No newline at end of file diff --git a/app/helpers/homework_attach_helper.rb b/app/helpers/homework_attach_helper.rb index 750a71f6a..6965eca07 100644 --- a/app/helpers/homework_attach_helper.rb +++ b/app/helpers/homework_attach_helper.rb @@ -60,7 +60,7 @@ module HomeworkAttachHelper memberships = User.current.memberships.all(:conditions => cond) projects = memberships.map(&:project) not_have_project = [] - not_have_project << "<>" + not_have_project << "NO PROJECT" not_have_project << 0 type = [] type << not_have_project diff --git a/app/models/role.rb b/app/models/role.rb index 57fccd53c..f363b52bf 100644 --- a/app/models/role.rb +++ b/app/models/role.rb @@ -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 diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index aadc93fa4..107ee5bba 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -27,8 +27,7 @@ background: #15bccf; color: #fff; text-align: center; - padding-top: 3px; - padding-left: 3px; + padding: 5px !important; } .span_wping a:hover{ background-color:#03a1b3;} @@ -76,7 +75,7 @@ <% end %> <% end %> <% if (User.current.admin?||User.current.id==bid.author_id) %> - <% if bid.open_anonymous_evaluation == 1%> + <% if bid.open_anonymous_evaluation == 1 && bid.homeworks.count >= 2%> <% case bid.comment_status %> <% when 0 %> diff --git a/app/views/bids/_homework_form.html.erb b/app/views/bids/_homework_form.html.erb index cd682deb0..12393c558 100644 --- a/app/views/bids/_homework_form.html.erb +++ b/app/views/bids/_homework_form.html.erb @@ -40,7 +40,7 @@

<%= f.select :is_evaluation, is_evaluation_option %>

-

+

<%= f.select :proportion, proportion_option %>

diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index 036289b0a..23f7070b2 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -22,7 +22,7 @@ <%= link_to "留言", get_homework_jours_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%> (<%= @jours_count %>) -

  • +
  • <%= link_to "作品打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), class: "tb_all" unless @bid.homeworks.empty? %>
  • diff --git a/app/views/courses/_homework_form.html.erb b/app/views/courses/_homework_form.html.erb index 8ce6be3fe..2d20ecf07 100644 --- a/app/views/courses/_homework_form.html.erb +++ b/app/views/courses/_homework_form.html.erb @@ -45,7 +45,7 @@

    <%= f.select :is_evaluation, is_evaluation_option %>

    -

    +

    <%= f.select :proportion, proportion_option %>

    diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index 49747ae11..04ce917c8 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -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"); + } + } +

    @@ -25,8 +39,8 @@
    <%= 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) %> 上传资源 diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb index fa22c404d..b8d0ad098 100644 --- a/app/views/files/_course_list.html.erb +++ b/app/views/files/_course_list.html.erb @@ -1,8 +1,8 @@ <% delete_allowed = User.current.allowed_to?(:manage_files, course) %>
    -

    共有 <%= User.current.member_of_course?(course) ? all_attachments.count : 0 %> 个资源

    - + <#% end %>--> + 资源列表的多样化排序将在下周上线... +

    <% curse_attachments.each do |file| %> - <%if file.is_public == 0 && !User.current.member_of_course?(@course)%> - <%next%> - <%end%>
    <%= 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) %> - <%= link_to "选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true %> + <% 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" %> <%= 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 %> <% 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 %>
    -

    文件大小:<%= number_to_human_size(file.filesize) %>

    +

    文件大小:<%= number_to_human_size(file.filesize) %>

    <%= 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 && file.container_id == @course.id && file.container_type == "Course"%> -

    <%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %>  |  下载<%= file.downloads %>  |  引用0

    +

    <%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %>  |  下载<%= file.downloads %>  

    diff --git a/app/views/files/_show_quote_resource.html.erb b/app/views/files/_show_quote_resource.html.erb index ef907f40f..58b0edda0 100644 --- a/app/views/files/_show_quote_resource.html.erb +++ b/app/views/files/_show_quote_resource.html.erb @@ -1,8 +1,8 @@
    -

    将此课件引入我的课程资源库

    +
    <%= form_tag course_attach_relations_path, method: :post, remote: true, diff --git a/app/views/homework_attach/_homework.html.erb b/app/views/homework_attach/_homework.html.erb index c4be4777c..b821e2495 100644 --- a/app/views/homework_attach/_homework.html.erb +++ b/app/views/homework_attach/_homework.html.erb @@ -51,7 +51,7 @@ <% if is_my_homework %> <% if @bid.comment_status == 0 %> -
  • +
  • <%= link_to l(:button_edit), edit_homework_attach_path(homework) %> <% if homework.user == User.current || User.current.admin? %> diff --git a/app/views/homework_attach/new.html.erb b/app/views/homework_attach/new.html.erb index a1e5028dc..5a512c800 100644 --- a/app/views/homework_attach/new.html.erb +++ b/app/views/homework_attach/new.html.erb @@ -2,11 +2,11 @@
    @@ -55,13 +72,14 @@

    -

    diff --git a/app/views/homework_attach/show.html.erb b/app/views/homework_attach/show.html.erb index 5f631c26a..d2f096bae 100644 --- a/app/views/homework_attach/show.html.erb +++ b/app/views/homework_attach/show.html.erb @@ -1,175 +1,2 @@ -<%= render :partial => 'layouts/base_homework_attach', :locals => {:homework_attach => @homework} %> - -<% is_student = is_cur_course_student @homework.bid.courses.first %> -<% is_teacher = is_course_teacher User.current,@homework.bid.courses.first %> -

    <%= notice %>

    -
    - - - - - - - - - - - - - - - - - - - - -
    作业基础信息<%=@count %>
    - 发布人员:<%= link_to @homework.user, user_path(@homework.user)%> - - 所属任务:<%= link_to(@homework.bid.name, course_for_bid_path(@homework.bid))%> -
    - 作业下载: - <% if @is_evaluation || is_teacher%> - <% options = {:author => true } %> - <%= render :partial => 'app_link', :locals => {:attachments => @homework.attachments, :options => options} %> - <% else %> - <%= l(:label_cant_download) %> - <% end %> - - 参与人员: - <% @homework.users.each do |homework_user| %> - <%= link_to homework_user, user_path(homework_user)%> - <% if @homework.users.count > 1 && homework_user != @homework.users.last %> -
                     - <% end %> - <% end %> -
    平均评分: - <%= render :partial => 'show_score', :locals => {:stars => @totle_score} %> - 发布时间:<%=format_time @homework.created_at %>
    - - -
    -
    - -
    - - - - - - - - - - - -
    作业描述:
    -
    - <% if @homework.description != nil && @homework.description != "" %> - <%= @homework.description %> - <% else %> -
    - 该作业无任何描述! -
    - <% end %> -
    -
    - - -
    -
    - -
    -
    - 作业得分: -
    -
    -
    -
    得分比例
    -
    - <% 100.step(20,-20) do |star| %> -
    -
    -
    -
    -
    -
    - <%= @stars_status_map["star#{(star/20).to_s}".to_sym] %> -
    - <% end %> -
    -
    -
    -
    最终得分
    -
    - <%= @totle_score %>分 -
    -
    - <%= render :partial => 'show_score', :locals => {:stars => @totle_score} %> -
    -
    -
    -
    打分总人数
    -
    - - <%= @homework.raters(:quality).count%> - -
    -
    -
    -
    -
    - - -
    - <%= render :partial => 'comprehensive_evaluation', :locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework, :teaher_score => @teaher_score} %> -
    - -
    - - -<% if !users_for_homework(@homework).include?(User.current) %> -
    -
    作业评论:
    - <% if is_student %> - <% if @is_evaluation %> - <% if @has_evaluation %> -
    - <%= l(:lable_has_evaluation)%> -
    - <% else %> - <%= render :partial => 'evaluation', :locals => {:homework => @homework} %> - <% end %> - <% else %> -
    - <%= l(:lable_close_evaluation)%> -
    - <% end %> - <% end %> -
    -<% end %> - -<% if !is_teacher %> - -
    - <%= render :partial => 'addjour', :locals => {:homework_attach => @homework, :sta => 0, :is_comprehensive_evaluation => nil} %> -
    -<% end %> - - - -
    - <%= render :partial => 'showjour', :locals => {:jour => @jour,:homework => @homework} %> -
    - -
    -
    +<%= stylesheet_link_tag 'css', :media => 'all' %> +<%= render :partial => "show"%> \ No newline at end of file diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 86f48fbd7..6de46d2fe 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -24,7 +24,7 @@ - +<%= render :partial => 'courses/course_ad' %>
    diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb index b3336fb46..c3028c8f1 100644 --- a/app/views/layouts/base_homework.html.erb +++ b/app/views/layouts/base_homework.html.erb @@ -21,6 +21,18 @@ <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> + + <% course = @bid.courses.first %> @@ -106,8 +118,8 @@ <% if (User.current.admin?||User.current.id==@bid.author_id) %> - <% if @bid.open_anonymous_evaluation == 1%> - + <% if @bid.open_anonymous_evaluation == 1 && @bid.homeworks.count >= 2%> + <% case @bid.comment_status %> <% when 0 %> <%= link_to '启动匿评', alert_anonymous_comment_bid_path(@bid), id: "#{@bid.id}_start_anonymous_comment", remote: true, disable_with: '加载中...' %> @@ -149,31 +161,30 @@
    -
    - - - - - - +
    - - <%= l(:label_attachment) %> : - -
    - <% if @bid.attachments.any?%> + <% unless @bid.attachments.empty? %> +
    + + + + + + - - - - - -
    + + <%= l(:label_attachment) %> : + +
    <% options = {:author => true,:deletable => (@bid.author.id == User.current.id || User.current.admin? ? true : false),:wrap => true,:length => 7} %> <%= render :partial => 'attachments/links', :locals => {:attachments => @bid.attachments, :options => options} %> - <% end %> -
    -
    +
    +
    + <% end%>
    diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 5222b466f..0330b65e4 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -8,8 +8,12 @@ <%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
    -
    <%= link_to image_tag(url_to_avatar(@memo.author), :class => "avatar"), user_path(@memo.author) %>
    -

    <%=link_to @memo.author.name, user_path(@memo.author) %>

    +
    + <%= link_to image_tag(url_to_avatar(@memo.author), :class => "avatar"), user_path(@memo.author) %> +
    +

    + <%=link_to @memo.author.name, user_path(@memo.author) %> +

    @@ -55,7 +59,8 @@
    - <%= label_tag l(:field_subject) %>: <%=h @memo.subject %> + <%= label_tag l(:field_subject) %>: + <%=h @memo.subject %>
    <%= textAreailizable(@memo,:content) %> @@ -67,7 +72,9 @@

    -
    <%= authoring @memo.created_at, @memo.author %>
    +
    + <%= authoring @memo.created_at, @memo.author %> +

    diff --git a/app/views/projects/show_projects_score.html.erb b/app/views/projects/show_projects_score.html.erb index 7f3f05cce..836e0a05c 100644 --- a/app/views/projects/show_projects_score.html.erb +++ b/app/views/projects/show_projects_score.html.erb @@ -66,6 +66,6 @@
    - <%= render :partial => 'projects/project_score_index', :locals => {:index => 0 } %> + <%= render :partial => 'projects/project_score_index', :locals => {:index => 0,:project => @project } %>
    <% end %> \ No newline at end of file diff --git a/app/views/tags/_tag_add.html.erb b/app/views/tags/_tag_add.html.erb index 14f2dc965..0b59015f2 100644 --- a/app/views/tags/_tag_add.html.erb +++ b/app/views/tags/_tag_add.html.erb @@ -1,13 +1,14 @@ <%= link_to '+ 添加标签', 'javascript:void(0);', :class => "yellowBtn f_l", :onclick=>"$('#add_tag_#{obj.id}').slideToggle();" if User.current.logged? %> - \ No newline at end of file diff --git a/app/views/tags/_tag_list.html.erb b/app/views/tags/_tag_list.html.erb index c815d71f8..549ed1751 100644 --- a/app/views/tags/_tag_list.html.erb +++ b/app/views/tags/_tag_list.html.erb @@ -14,7 +14,7 @@ <% end %> <% else %> - -    <%= l(:label_tags_no) %> - + + <% end %> \ No newline at end of file diff --git a/app/views/welcome/_more_course.html.erb b/app/views/welcome/_more_course.html.erb index 8d0f1564c..2c8d92719 100644 --- a/app/views/welcome/_more_course.html.erb +++ b/app/views/welcome/_more_course.html.erb @@ -1,8 +1,6 @@ <% if User.current.logged?%> - <% if User.current.user_extensions.identity == 0 %> <%= link_to(l(:label_course_new), {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_course,nil, :global => true) %> - <% end %>      <%= link_to l(:label_course_join_student), join_private_courses_courses_path ,:remote => true, :class => 'icon icon-add' %>      diff --git a/config/locales/en.yml b/config/locales/en.yml index 94272b1fd..22b0df023 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1851,4 +1851,5 @@ en: label_teacher_comments: Teacher comments label_anonymous_comments: Anonymous comments label_anonymous: Anonymous - label_submit_comments: Submit_comments \ No newline at end of file + label_submit_comments: Submit_comments + label_course_empty_select: You have not selected course! \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 3f4267b76..7d6cc85b2 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2203,4 +2203,5 @@ zh: label_submit_comments: 提交评论 field_evaluation_num: 匿评分配数量 label_my_score: 我的评分 - field_open_anonymous_evaluation: 是否开启匿评 + field_open_anonymous_evaluation: 是否使用匿评 + label_course_empty_select: 尚未选择课程! diff --git a/db/schema.rb b/db/schema.rb index 2e664eaa7..973e2afbe 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20141119011439) do +ActiveRecord::Schema.define(:version => 20141120091234) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -52,6 +52,7 @@ ActiveRecord::Schema.define(:version => 20141119011439) do t.string "disk_directory" t.integer "attachtype", :default => 1 t.integer "is_public", :default => 1 + t.integer "copy_from" end add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id" diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 1b1580d8c..8d60c06a2 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -2202,7 +2202,7 @@ button.tab-right { padding-bottom: 2px; text-align: center; border: 1px solid #15BCCF; - border-bottom: 0px solid #15BCCF; + border-bottom: 1px solid #15BCCF; color:#606060; font-weight:bold; diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index 2eb401dfd..b85b6ae73 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -1,5 +1,5 @@ /* CSS Document */ -body{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; line-height:1.9; background:#fff; font-style:normal;} +body{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; background:#fff; font-style:normal;} div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span,textarea{ margin:0; padding:0;} div,img,tr,td,textarea{ border:0;} table,tr,td{border:0; cellspacing:0; cellpadding:0;} @@ -15,7 +15,7 @@ a:hover{ text-decoration:underline;} /* TAB 切换效果 */ .tb_{ background-color: #eaeaea; height:40px; } .tb_ ul{height:40px; } -.tb_ li{float:left;height:35px;width: 90px;cursor:pointer; font-size:14px; padding-top:5px; text-align:center; } +.tb_ li{float:left;height:30px;width: 90px;cursor:pointer; font-size:14px; padding-top:10px; text-align:center; } a.tb_all{ margin-left:235px; font-size:12px; display:block; height:23px; padding-top:4px; width:90px; color:#7a7a7a; border:1px solid #cbcbcb; background:#fff; text-align: center;} a:hover.tb_all{ background:#eaeaea; text-decoration:none;} @@ -38,13 +38,13 @@ a:hover.tb_all{ background:#eaeaea; text-decoration:none;} .pic_head a{ text-align:center; width:42px; overflow:hidden;text-overflow:ellipsis; white-space:nowrap;} .pic_head img{ border:1px solid #fff;} .pic_head img:hover{border:1px solid #15bccf;} -.dis ul li.wname a{ width:260px; font-size:14px; color:#595959; padding:20px 0 0 15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;} -.dis ul li.wdown a{padding-top:22px; color:#3d7ec2; margin-right:35px;} -.wscore{ padding-top:22px; color:#888888; width:96px;} +.dis ul li.wname a{ width:260px; font-size:14px; color:#595959; padding:25px 0 0 15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;} +.dis ul li.wdown a{padding-top:25px; color:#3d7ec2; margin-right:35px;} +.wscore{ padding-top:25px; color:#888888; width:96px;} .dis ul li.wping{margin-left:12px; } -.dis ul li.wping a{ margin-top:18px; margin-bottom:3px; width:43px; height:23px; background:#15bccf; color:#fff; text-align:center; padding-top:3px;} +.dis ul li.wping a{ margin-top:18px; margin-bottom:3px; width:43px; height:23px; background:#15bccf; color:#fff; text-align:center; padding-top:8px;} .dis ul li.wping a:hover{ background-color:#03a1b3;} -ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; } +ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px;line-height: 1.9; } .wlist span{ border:1px solid #15bccf; padding:0 5px; margin-left:3px;} .wlist a{ border:1px solid #15bccf; padding:0 5px; margin-left:3px;} .wlist a:hover{ background:#15bccf; color:#fff; text-decoration:none;} @@ -84,7 +84,7 @@ a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;} .ping_star span a:hover{background:url(images/star.png) -24px 0 no-repeat;} .ping_con textarea{ height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;} a.ping_sub{ float:right; height:22px; width:60px; margin-right:20px; background:#15bccf; color:#fff; text-align:center;} -a.ping_sub1{ float:right; height:22px; width:60px; background:#15bccf; color:#fff; text-align:center;} +a.ping_sub1{ float:right; height:22px; width:60px; background:#15bccf; color:#fff; text-align:center;line-height: 1.9;} a:hover.ping_sub{ background:#14a8b9;} .recall{ border-top:1px solid #CCC; padding:5px 0;} .recall_head{ float:left;} @@ -92,7 +92,7 @@ a:hover.ping_sub{ background:#14a8b9;} .recall_head img{ height:30px; width:30px;} .recall_head a:hover{border:1px solid #15bccf;} .recall_head img:hover{border:1px solid #15bccf;} -.recall_con{ float:left;color:#777777;max-width: 530px;width: 90%; margin-left:10px; } +.recall_con{ float:left;color:#777777;max-width: 530px;width: 80%; margin-left:10px; } .recall_con a{ color:#15bccf; } .ping_list{ margin-top:15px;} @@ -128,7 +128,7 @@ a:hover.ping_sub{ background:#14a8b9;} .w430{ width:430px;} .w350{ width:350px;} -.w620{ width:580px; height:160px; border:1px solid #CCC;} +.w620{ width:580px; height:160px; border:1px solid #CCC !important; padding-left: 3px !important;} .bo{height:26px; border:1px solid #CCC !important; padding: 0 !important;} a.tijiao{ height:28px !important; display:block !important; width:80px !important; color:#fff !important; background:#15bccf !important; text-align:center !important; padding-top:4px !important; float:left !important; margin-right:10px !important;} a:hover.tijiao{ background:#0f99a9 !important;} diff --git a/public/stylesheets/nyan.css b/public/stylesheets/nyan.css index 50a1de7c4..1ef7c8dd7 100644 --- a/public/stylesheets/nyan.css +++ b/public/stylesheets/nyan.css @@ -649,14 +649,14 @@ input[class='nyan-clean-gray']:active, .nyan-clean-gray:active { } .tools a:visited { - color: #fffbff; + color: #116699; text-decoration: none; padding: 3px 5px 0px 5px; width: 100px; } .tools a:hover { - color: #fffbff; + color: white; padding: 3px 3px 0px 20px; width: 88px; text-decoration: none; diff --git a/public/stylesheets/resource.css b/public/stylesheets/resource.css index 1046429be..86ff85825 100644 --- a/public/stylesheets/resource.css +++ b/public/stylesheets/resource.css @@ -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; diff --git a/public/themes/redpenny-master/stylesheets/application.css b/public/themes/redpenny-master/stylesheets/application.css index f683607cf..e10c5a91b 100644 --- a/public/themes/redpenny-master/stylesheets/application.css +++ b/public/themes/redpenny-master/stylesheets/application.css @@ -498,7 +498,7 @@ color: #000000; #sidebar a,#sidebar a.selected { display:inline-block; - padding:4px 4px 4px 21px !important; + padding:4px 4px 4px 21px; transition:all .2s linear; -moz-transition:all .2s linear; -o-transition:all .2s linear; @@ -1641,7 +1641,7 @@ div.left_wf a { #sidebar a, #sidebar a.selected{ display: inline-block; - padding: 0px !important; + padding: 0px; transition: all 0.2s linear 0s; }