This commit is contained in:
z9hang 2015-02-03 16:03:49 +08:00
commit 7e6d4e6215
15 changed files with 94 additions and 63 deletions

View File

@ -254,8 +254,8 @@ class CoursesController < ApplicationController
end
@is_remote = true
@result_count = @results.count
@results = paginateHelper @results
@results = paginateHelper @results, 10
@search_name = q
end
def addgroups
@ -428,7 +428,22 @@ class CoursesController < ApplicationController
# @results = paginateHelper @results@score_sort_by = "desc"
@is_remote = true
@score_sort_by = params[:sort_by] if params[:sort_by]
@search_name = params[:search_name] if params[:search_name]
group_id = params[:group_id]
if !@search_name.nil?
if group_id == '0'
page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
@results = searchmember_by_name(student_homework_score(0,0,0,@score_sort_by), @search_name)
@result_count = @results.count
@results = paginateHelper @results, 10
else
@group = CourseGroup.find(group_id)
@results = searchmember_by_name(student_homework_score(group_id, 0, 0,@score_sort_by),@search_name)
@result_count = @results.count
@results = paginateHelper @results, 10
end
else
if group_id == '0'
page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
@results = student_homework_score(0,page, 10,@score_sort_by)
@ -440,6 +455,8 @@ class CoursesController < ApplicationController
@results = paginateHelper @results, 10
end
end
end
# 显示每个学生的作业评分详情
def show_member_score

View File

@ -20,11 +20,12 @@
class ProjectsController < ApplicationController
layout :select_project_layout
menu_item :overview
menu_item :overview, :only => :show
menu_item :roadmap, :only => :roadmap
menu_item :settings, :only => :settings
menu_item :homework, :only => [:homework, :new_homework]
menu_item :feedback, :only => :feedback
menu_item :share, :only => :share
before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join,
:course, :enterprise_course, :course_enterprise,:view_homework_attaches]

View File

@ -25,22 +25,30 @@ class WelcomeController < ApplicationController
before_filter :entry_select, :only => [:index]
def index
unless params[:project].nil?
@cur_projects = Project.find(params[:project])
# 企业版定制: params[:project]为传过来的参数
unless params[:organization].nil?
@cur_projects = Project.find(params[:organization])
@organization = @cur_projects.enterprise_name
@organization_projects = Project.find_by_sql(["select * from projects where enterprise_name =? ", @organization])
@organization_projects = (current_user.admin? || User.current.member_of?(@cur_projects)) ? Project.where("enterprise_name =? ", @organization) : Project.all_public.where("enterprise_name =? ", @organization)
@e_count = @organization_projects.count
@part_projects = []
# 取十个
@organization_projects.each do |obj|
break if(@organization_projects[10] == obj)
@part_projects << Project.visible.find_by_id("#{obj.id}") unless obj.id.nil?
end
# 不够十个的用最火项目替代
@e_count < 9 ? @part_projects = find_miracle_project( 9 - @e_count, 3,"score desc") : @part_projects
# 配置文件首页定制
@enterprise_page = FirstPage.find_by_page_type('enterprise')
if @enterprise_page.nil?
@enterprise_page = FirstPage.new
@enterprise_page.page_type = 'enterprise'
end
if @e_count < 9
part_count = 9 - @e_count
# @part_projects = find_all_hot_project part_count, order
@part_projects = find_miracle_project(part_count, 3,"score desc")
end
# 主页配置部分结束
end
# end 企业版定制结束
if @first_page.nil? || @first_page.sort_type.nil?
@projects = find_miracle_project(10, 3,"score desc")
else

View File

@ -23,7 +23,7 @@ class Forum < ActiveRecord::Base
acts_as_taggable
scope :by_join_date, order("created_at DESC")
after_create :send_email
#after_create :send_email
def reset_counters!
self.class.reset_counters!(id)
end

View File

@ -50,10 +50,15 @@ class Mailer < ActionMailer::Base
@forum_url = url_for(:controller => 'forums', :action => 'show', :id => @forum.id)
@issue_author_url = url_for(user_activities_url(@author))
recipients ||= []
mems = memo.self_and_siblings
mems.each do |mem|
recipients << mem.author.mail unless recipients.include? mem.author.mail
end
# if !memo.parent_id.nil?
# mems = memo.self_and_siblings
# mems.each do |mem|
# recipients << mem.author.mail unless recipients.include? mem.author.mail
# end
# else
# recipients << memo.author.mail
# end
recipients << @author.mail
# cc = wiki_content.page.wiki.watcher_recipients - recipients
@memo_url = url_for(forum_memo_url(@forum, (@memo.parent_id.nil? ? @memo : @memo.parent_id)))
@ -98,10 +103,7 @@ class Mailer < ActionMailer::Base
#收件人邮箱
@recipients ||= []
@members.each do |teacher|
@recipients << teacher.user.mail
end
mail :to => @recipients,
:subject => "#{l(:label_your_course)}#{journals_for_message.jour.name}#{l(:label_have_message)} "

View File

@ -47,7 +47,7 @@ class Memo < ActiveRecord::Base
"parent_id",
"replies_count"
after_create :add_author_as_watcher, :reset_counters!, :sendmail#,:be_user_score -- 公共区发帖暂不计入得分
after_create :add_author_as_watcher, :reset_counters! #, :sendmail#,:be_user_score -- 公共区发帖暂不计入得分
# after_update :update_memos_forum
after_destroy :reset_counters!#,:down_user_score -- 公共区发帖暂不计入得分
# after_create :send_notification

View File

@ -1,14 +1,15 @@
<div class="attachments" style="font-weight:normal;">
<% for attachment in attachments %>
<p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<div style="width:65%;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;float: left;">
<span title="<%= attachment.filename%>" id = "attachment_">
<% if options[:length] %>
<%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true,:length => options[:length] -%>
<%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true,:length => options[:length] -%>
<% else %>
<%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
<%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
<% end %>
</span>
</div>
<% if attachment.is_text? %>
<%= link_to image_tag('magnifier.png'),
:controller => 'attachments',
@ -19,8 +20,9 @@
<span title="<%= attachment.description%>">
<%= h(truncate(" - #{attachment.description}", length: options[:length] ? options[:length]:15, omission: '...')) unless attachment.description.blank? %>
</span>
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
<span class="size">(
<%= number_to_human_size attachment.filesize %>)
</span>
<% if options[:deletable] %>
<% if attachment.container_type == 'HomeworkAttach' %>
<%= link_to image_tag('delete.png'), {:controller => 'attachments', :action => 'delete_homework', :id => attachment.id},

View File

@ -25,7 +25,7 @@
<div class="st_box">
<ul class="st_box_top" style="margin-left: 17px;">
<% if @subPage_title == l(:label_student_list) %>
<li class="ml358"><%= link_to '作业积分', member_score_sort_course_path(:sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0)) ,:result => members,method: 'get', remote: true%>
<li class="ml358"><%= link_to '作业积分', member_score_sort_course_path(:sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true%>
<% if @score_sort_by == 'desc' %>
<a id="pic" href="#" class= "st_down"></a>
<% else %>

View File

@ -8,7 +8,7 @@
html{ overflow-x:hidden;}
.custom_service p img {display: inline; margin-top:-5px; vertical-align:middle;}
.scrollsidebar{position:absolute; z-index:999; top:150px;}
.scrollsidebar{position:absolute; z-index:999; top:150px;background:none !important;}
.side_content{width:154px; height:auto; overflow:hidden; float:left; }
.side_content .side_list {width:154px;overflow:hidden;}
.show_btn{ width:0; height:112px; overflow:hidden; margin-top:50px; float:left; cursor:pointer;}

View File

@ -5,11 +5,11 @@
<% if @projects.count == 0 %>
<h3><%= l(:label_enterprise_nil) %></h3>
<% else %>
<% @projects.each do |project| %>
<% unless project.enterprise_name.blank? %>
<% @projects.each do |organization| %>
<% unless organization.enterprise_name.blank? %>
<ul>
<li ><img src="/images/organization_logo.jpg" width="30" height="30" alt="#{project.enterprise_name}" />
<%= link_to project.enterprise_name, home_path(:project => project) %></li>
<%= link_to organization.enterprise_name, home_path(:organization => organization) %></li>
</ul>
<% end %>
<% end %>

View File

@ -46,7 +46,7 @@
</a>
</li>
<% else%>
<li class="pollsbtn fl ml10 pollsbtn_grey">
<li class="pollsbtn fl ml10 pollsbtn_grey" style="margin-left: 5px;" >
发布问卷
</li>
<% end%>

View File

@ -158,14 +158,14 @@
<%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px">
<span>
<%= link_to l(:label_find_all_comments), respond_path(e.act_id) %>
</span>
<a class="font_lighter">
<%= l(:label_comments_count, :count => e.act.commit) %>
</a>
</div>
<!--<div style="display: inline-block; float: right; margin-top: 0px">-->
<!--<span>-->
<!--<%#= link_to l(:label_find_all_comments), respond_path(e.act_id) %>-->
<!--</span>-->
<!--<a class="font_lighter">-->
<!--<%#= l(:label_comments_count, :count => e.act.commit) %>-->
<!--</a>-->
<!--</div>-->
</td>
</tr>
<% when 'Journal' %>

View File

@ -48,7 +48,7 @@
<% end %>
<% else %>
<span class="font_welcome_school" style="color: #E8770D">
<%= link_to @organization, options={:action => 'index', :enterprise => @organization}, html_options={ :method => 'get', :style => "color: #E8770D"} %>
<%= @organization %>
</span>
<br/>
<span class="font_welcome_trustie">
@ -87,7 +87,7 @@
<!-- 企业版项目 -->
<% else %>
<% if @e_count == 0 %>
<p id="errorExplanation"><%= l(:label_enterprise_tips) %></p>
<div id="flash_notice" class="flash notice"><%= l(:label_enterprise_tips) %></div>
<% @projects.map do |project| %>
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
<% end %>
@ -95,7 +95,7 @@
<% @organization_projects.map do |project| %>
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
<% end %>
<p id="errorExplanation"><%= l(:label_part_enterprise_tips) %></p>
<div id="flash_notice" class="flash notice"><%= l(:label_part_enterprise_tips) %></div>
<% @part_projects.map do |project| %>
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
<% end %>

View File

@ -39,7 +39,8 @@ module RedmineApp
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Activate observers that should always be running.
config.active_record.observers = :journals_for_message_observer, :message_observer, :issue_observer, :journal_observer, :news_observer, :document_observer, :wiki_content_observer, :comment_observer
config.active_record.observers = :journals_for_message_observer, :message_observer, :issue_observer, :journal_observer, :news_observer,
:document_observer, :wiki_content_observer, :comment_observer, :forum_observer, :memo_observer
config.active_record.store_full_sti_class = true
config.active_record.default_timezone = :local

View File

@ -999,7 +999,7 @@ zh:
label_project_course_unadd: "你还未创建课程,赶快去创建吧!"
label_project_cousre_studentun: "你还未加入任何课程,赶快加入吧!"
#end by huang
label_user_mail_option_selected: "收取选中项目的所有通知..."
label_user_mail_option_selected: "收取选中项目的所有通知"
label_user_mail_option_none: "不收取任何通知"
label_user_mail_option_only_my_events: "只收取我跟踪或参与的项目的通知"
label_user_mail_option_only_assigned: "只收取分配给我的"
@ -2520,9 +2520,9 @@ zh:
# 项目企业模块
label_all_enterprises: 所有企业
label_all_enterprises: 所有组织
label_my_enterprise: 我的企业
label_enterprise_tips: 暂时还没有该企业对应的项目,系统的其它项目您可能会感兴趣!
label_part_enterprise_tips: 您可能对系统的其它项目感兴趣!
label_enterprise_nil: 该模块为最新上线模块,目前还未有项目关联到企业
label_enterprise_tips: 该组织暂时还没创建公开项目,您可能会对系统的其它项目感兴趣!
label_part_enterprise_tips: 您可能对系统的其它项目感兴趣!
label_enterprise_nil: 该模块为最新上线模块,目前还没有创建企业项目
label_enterprises: 组织