diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index c7aa42b9e..e1e99447d 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -548,7 +548,8 @@ class AdminController < ApplicationController #作业 def homework - @homework = HomeworkCommon.order('end_time desc') + #@homework = HomeworkCommon.order('end_time desc') + @homework = HomeworkCommon.order( 'created_at desc ') @homework = paginateHelper @homework,30 @page = (params['page'] || 1).to_i - 1 respond_to do |format| diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 81e4d7bfb..dd86d6ccd 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -43,7 +43,7 @@ class OrganizationsController < ApplicationController def edit # @organization = Organization.find(params[:id]) begin - @organization = Organization.where("id =?", params[:id]) + @organization = Organization.where("id =?", params[:id]) ensure render_404 end @@ -63,7 +63,7 @@ class OrganizationsController < ApplicationController @organization.description = params[:organization][:description] @organization.is_public = params[:organization][:is_public] @organization.allow_guest_download = params[:organization][:allow_guest_download] == '1' ? 1 : 0 - @organization.show_mode = params[:show_mode] + @organization.show_mode = 0 @organization.creator_id = User.current.id member = OrgMember.new(:user_id => User.current.id) @@ -76,19 +76,42 @@ class OrganizationsController < ApplicationController def show # 组织新类型 show_mode:判断标准 1为新类型,0为旧 - if @organization.show_mode == 1 && params[:org_subfield_id].nil? && params[:type] .nil? + if @organization.show_mode == 1 && params[:org_subfield_id].nil? && params[:list] .nil? if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) @subfield_content = @organization.org_subfields.order("priority") + @organization = Organization.find(params[:id]) + # 统计访问量 + @organization.update_column(:visits, @organization.visits.to_i + 1) + + # @org_subfield = OrgSubfield.find(params[:org_subfield_id]) + # @org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0 + # @org_acts = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{@org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{@org_subfield.id})").order('updated_at desc').page(params[:page] || 1).per(10) + + shield_project_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Project'").map(&:shield_id) + shield_course_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Course'").map(&:shield_id) + project_ids = (@organization.projects.map(&:id)-shield_project_ids) << 0 + course_ids = (@organization.courses.map(&:id)-shield_course_ids) << 0 + course_types = "('Message','News','HomeworkCommon','Poll','Course')" + @project_acts = get_project_activities_org @organization, project_ids + @course_acts = get_course_activities_org @organization, course_ids + #@org_acts = OrgActivity.where("container_id =? and container_type =?",@organization.id, 'Organization').order('updated_at desc') + #@project_acts = OrgActivity.where("(container_id =? and container_type =?) " + + # "or (container_type ='Project' and org_act_type in ('Issue','Message') and container_id in (#{project_ids.join(',')})) ", + # @organization.id, 'Organization').order('updated_at desc').limit(8) + + #@course_acts = OrgActivity.where("(container_id =? and container_type =?) " + + # "or (container_type ='Course' and org_act_type in #{course_types} and container_id in (#{course_ids.join(',')}))", + # @organization.id, 'Organization').order('updated_at desc').limit(8) + + + # 项目两种动态 - @project_acts = get_project_activities_org @organization - @project_issue_acts = get_project_issue_activities_org @organization - @project_message_acts = get_project_message_activities_org @organization - # 磕碜动态 + #@project_acts = get_project_activities_org @organization + + # 课程动态 #@project_acts_issues = get_project_activities_org @organization - @course_acts = get_course_activities_org @organization - @course_acts_homework = get_course_homework_activities_org @organization - @course_acts_message = get_course_message_activities_org @organization - @course_acts_news = get_course_news_activities_org @organization + #@course_acts = get_course_activities_org @organization + render :layout => 'base_org_newstyle' else render_403 @@ -97,7 +120,7 @@ class OrganizationsController < ApplicationController if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) @organization = Organization.find(params[:id]) # 统计访问量 - @organization.update_attribute(:visits, @organization.visits.to_i + 1) + @organization.update_column(:visits, @organization.visits.to_i + 1) if params[:org_subfield_id] @org_subfield = OrgSubfield.find(params[:org_subfield_id]) @org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0 @@ -162,10 +185,10 @@ class OrganizationsController < ApplicationController end # 获取整过项目的动态 - def get_project_activities_org org - project_ids = org.projects.map{|project| project.id}.join(",") + def get_project_activities_org org, project_ids unless project_ids.blank? - project_acts = OrgActivity.find_by_sql("SELECT * FROM org_activities where container_id in (#{project_ids}) and container_type = 'project' order by updated_at desc limit 8;") + project_acts = OrgActivity.find_by_sql("SELECT * FROM org_activities where container_id in (#{project_ids.join(',')}) and container_type = 'project' + and org_act_type in ('Message', 'Issue') order by updated_at desc limit 8;") else project_acts = nil end @@ -173,10 +196,10 @@ class OrganizationsController < ApplicationController end # 获取整过课程的动态 - def get_course_activities_org org - course_ids = org.courses.map{|course| course.id}.join(",") + def get_course_activities_org org, course_ids unless course_ids.blank? - project_acts = OrgActivity.find_by_sql("SELECT * FROM org_activities where container_id in (#{course_ids}) and container_type = 'course' order by updated_at desc limit 8;") + project_acts = OrgActivity.find_by_sql("SELECT * FROM org_activities where container_id in (#{course_ids.join(',')}) and container_type = 'course' + and org_act_type in ('HomeworkCommon', 'Poll', 'Message', 'News', 'Course') order by updated_at desc limit 8;") else project_acts = nil end @@ -225,9 +248,13 @@ class OrganizationsController < ApplicationController #@organization.name = params[:organization][:name] @organization.save respond_to do |format| + if @organization.show_mode == 1 + format.html { redirect_to organization_path(@organization)} + else format.html { redirect_to setting_organization_path(@organization)} end end + end def check_uniq @check = false; diff --git a/app/views/admin/homework.html.erb b/app/views/admin/homework.html.erb index e21307485..a3a64b316 100644 --- a/app/views/admin/homework.html.erb +++ b/app/views/admin/homework.html.erb @@ -22,7 +22,7 @@ 提交作品数 - 提交截止日期 + 作业发布日期 @@ -37,9 +37,11 @@ <%=link_to(homework.try(:name), student_work_index_path(:homework => homework.id))%> + <% if homework.course %> <%= link_to(homework.course.name, course_path(homework.course.id)) %> + <% end %> <%= homework.try(:user)%><% else %><%=homework.try(:user).try(:realname) %><% end %>'> <% if homework.try(:user).try(:realname) == ' '%> <%= link_to(homework.try(:user), user_path(homework.user_id)) %> @@ -51,7 +53,7 @@ <%=link_to(StudentWork.where('homework_common_id=?',homework.id).count, student_work_index_path(:homework => homework.id))%> - <%=format_date(homework.end_time) %> + <%=format_date( homework.created_at ) %> <% end %> diff --git a/app/views/admin/organization.html.erb b/app/views/admin/organization.html.erb index 02b897f80..6fde09ede 100644 --- a/app/views/admin/organization.html.erb +++ b/app/views/admin/organization.html.erb @@ -24,7 +24,8 @@ "> - <%= link_to org.name,home_path(:organization => org.id) %> + <%#= link_to org.name,home_path(:organization => org.id) %> + <%= link_to org.name, organization_path(org) %> diff --git a/app/views/layouts/base_org_newstyle.html.erb b/app/views/layouts/base_org_newstyle.html.erb index 442bb7b60..2bb3975cf 100644 --- a/app/views/layouts/base_org_newstyle.html.erb +++ b/app/views/layouts/base_org_newstyle.html.erb @@ -65,7 +65,7 @@
- + <%# 登录 %> <%= render :partial => 'organizations/org_logined_header' %>
@@ -87,7 +87,7 @@ <% else %> <% if field.field_type == "Post" && field.hide == 0 %> <%= field.name %> - <% elsif field.field_type == "Resource" && field.hide == 0%> + <% elsif field.field_type == "Resource" && field.hide == 0 %> <%= field.name %> <% end %> <% end %> @@ -100,7 +100,6 @@
@@ -112,56 +111,41 @@ <% when 'course' %>
<% if field.status == 0 %> -
-

课程动态

- <% if @course_acts.nil? %> - - <% else %> -
-
    - <% unless @course_acts_homework.nil? %> -
  • - <% @course_acts_homework.each do |act| %> - <%= render :partial => 'org_new_course_homework', :locals => {:activity => HomeworkCommon.find(act.org_act_id),:user_activity_id =>act.id, :course_activity => 0} %> - <% end %> -
  • - <% end %> - <% unless @course_acts_message.nil? %> -
  • - <% @course_acts_message.each do |act| %> - <%= render :partial => 'org_new_course_message', :locals => {:activity => Message.find(act.org_act_id), :user_activity_id =>act.id} %> - <% end %> -
  • - <% end %> - <% unless @course_acts_news.nil? %> -
  • - <% @course_acts_news.each do |act| %> - <%= render :partial => 'org_new_course_news', :locals => {:activity => News.find(act.org_act_id), :user_activity_id =>act.id} %> - <% end %> -
  • - <% end %> +
    +

    课程动态

    + <% if @course_acts.blank? %> +
    -
-
-
- <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> -
- <% end %> - - -
+ <%= link_to "More", organization_path(@organization, :list =>1), :class => "more-btn-center mt30" , :target => "_blank" %> +
+ <% else %> +
+
    + <% unless @course_acts.nil? %> + <%= render :partial => 'organizations/org_new_course_pic', :locals => {:activities => @course_acts.first(3)} %> + <% end %> +
    + <%= link_to "More", organization_path(@organization, :list =>1), :class => "more-btn-center mt30" , :target => "_blank" %> +
    +
+
+ <% end %> +
<% else %>

课程动态

- <% if @course_acts.nil? %> + <% if @course_acts.blank? %> +
+ <%= link_to "More", organization_path(@organization, :list =>1), :class => "more-btn-center mt30" , :target => "_blank" %> +
<% else %>
<%= render :partial => 'organizations/org_new_course_act_list', :locals =>{:activities => @course_acts, :field => field, :organization => @organization} %>
- <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> + <%= link_to "More", organization_path(@organization, :list =>1), :class => "more-btn-center mt30" , :target => "_blank" %>
<% end %> @@ -174,8 +158,11 @@ <% if field.status == 0 %>

项目动态

- <% if @project_acts.nil? %> + <% if @project_acts.blank? %> +
+ <%= link_to "More", organization_path(@organization, :list =>1), :class => "more-btn-center mt30" , :target => "_blank" %> +
<% else %>
    @@ -183,7 +170,7 @@ <%= render :partial => 'organizations/org_new_project_pic', :locals => {:activities => @project_acts.first(3)} %> <% end %>
    - <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> + <%= link_to "More", organization_path(@organization, :list =>1), :class => "more-btn-center mt30" , :target => "_blank" %>
@@ -193,15 +180,18 @@ <% else %>

项目动态

- <% if @project_acts.nil? %> + <% if @project_acts.blank? %> +
+ <%= link_to "More", organization_path(@organization, :list =>1), :class => "more-btn-center mt30" , :target => "_blank" %> +
<% else %>
<%= render :partial => 'organizations/org_new_project_act_list', :locals =>{:activities => @project_acts, :field => field, :organization => @organization} %>
- <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> + <%= link_to "More", organization_path(@organization, :list =>1), :class => "more-btn-center mt30" , :target => "_blank" %>
<% end %> @@ -211,24 +201,49 @@ <% end %> <% else %> <% if field.field_type == "Post" %> <%# 讨论类型 %> - <% message_ats = get_message_org(@organization.id, field.id) %> - <% ids = field.org_document_comments.map{|o| o.id}.join(",") %> + <% org_subfield = OrgSubfield.find(field.id) %> + <% org_subfield_ids = org_subfield.org_document_comments.map(&:id) << 0 %> + <% org_acts = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{org_subfield.id})").order('updated_at desc') %> + <%# message_ats = get_message_org(@organization.id, field.id) %> + <%# ids = field.org_document_comments.map{|o| o.id}.join(",") %>
<% if field.status == 0 %>

<%= field.name %>

- <% if message_ats.blank? %> + <% if org_acts.blank? %> +
+ <% if !field.subfield_subdomain_dir.nil? %> + <% if !request.local? and Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", @organization.id).map(&:subname).include?(request.subdomain) %> + <%= link_to "More", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "more-btn-center mt30" , :target => "_blank" %> + <% else %> + <%= link_to "More", show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "more-btn-center mt30" , :target => "_blank" %> + <% end %> + <% else %> + <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> + <% end %> + + <%#= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> +
<% else %>
    - <% message_ats.first(3).each do |act| %> + <% org_acts.first(3).each do |act| %> <%= render :partial => 'organizations/org_new_forum_pic', :locals => {:activity => act, :field => field, :organization => @organization} %> <% end %>
- <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> + <% if !field.subfield_subdomain_dir.nil? %> + <% if !request.local? and Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", @organization.id).map(&:subname).include?(request.subdomain) %> + <%= link_to "More", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "more-btn-center mt30" , :target => "_blank" %> + <% else %> + <%= link_to "More", show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "more-btn-center mt30" , :target => "_blank" %> + <% end %> + <% else %> + <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> + <% end %> + <%#= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %>
<% end %> @@ -236,18 +251,37 @@
<% else %>
-

<%= field.name %>

- <% if message_ats.blank? %> +

<%= field.name %>

+ <% if org_acts.blank? %> +
+ <% if !field.subfield_subdomain_dir.nil? %> + <% if !request.local? and Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", @organization.id).map(&:subname).include?(request.subdomain) %> + <%= link_to "More", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "more-btn-center mt30" , :target => "_blank" %> + <% else %> + <%= link_to "More", show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "more-btn-center mt30" , :target => "_blank" %> + <% end %> + <% else %> + <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> + <% end %> +
<% else %>
- <% message_ats.each do |act| %> + <% org_acts.each do |act| %> <%= render :partial => 'organizations/org_new_forum_list', :locals => {:activity => act, :field => field, :organization => @organization} %> <% end %>
- <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> + <% if !field.subfield_subdomain_dir.nil? %> + <% if !request.local? and Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", @organization.id).map(&:subname).include?(request.subdomain) %> + <%= link_to "More", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "more-btn-center mt30" , :target => "_blank" %> + <% else %> + <%= link_to "More", show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "more-btn-center mt30" , :target => "_blank" %> + <% end %> + <% else %> + <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> + <% end %>
<% end %> @@ -262,6 +296,18 @@

<%= field.name %>

<% if org_attachs.blank? %> +
+ <% if !field.subfield_subdomain_dir.nil? %> + <% if !request.local? and Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", @organization.id).map(&:subname).include?(request.subdomain) %> + <%= link_to "More", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "more-btn-center mt30", :target => "_blank" %> + <% else %> + <%= link_to "More", show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "more-btn-center mt30", :target => "_blank" %> + <% end %> + <% else %> + <%= link_to "More", org_subfield_files_path(field), :class => "more-btn-center mt30", :target => "_blank" %> + <% end %> + <%#= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> +
<% else %>
<%= render :partial => 'organizations/org_new_resource', :locals => {:org_attachs => org_attachs} %> @@ -269,7 +315,16 @@
- <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %> + <% if !field.subfield_subdomain_dir.nil? %> + <% if !request.local? and Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", @organization.id).map(&:subname).include?(request.subdomain) %> + <%= link_to "More", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "more-btn-center mt30", :target => "_blank" %> + <% else %> + <%= link_to "More", show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "more-btn-center mt30", :target => "_blank" %> + <% end %> + <% else %> + <%= link_to "More", org_subfield_files_path(field), :class => "more-btn-center mt30", :target => "_blank" %> + <% end %> + <%#= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %>
<% end %> diff --git a/app/views/organizations/_org_logined_header.html.erb b/app/views/organizations/_org_logined_header.html.erb index fa4c228a1..75ec7106a 100644 --- a/app/views/organizations/_org_logined_header.html.erb +++ b/app/views/organizations/_org_logined_header.html.erb @@ -24,7 +24,7 @@
<% else %> <% end %> diff --git a/app/views/organizations/_org_new_course_act_list.html.erb b/app/views/organizations/_org_new_course_act_list.html.erb index 18a1e6662..8dceeb6cb 100644 --- a/app/views/organizations/_org_new_course_act_list.html.erb +++ b/app/views/organizations/_org_new_course_act_list.html.erb @@ -4,8 +4,8 @@
<%= link_to image_tag(url_to_avatar(activity.user),:width => "40", :height => "40"), user_path(activity.user), :class => "fl user-img" %> -
- <%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %> +
+ <%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "fl note-title" %> <%#= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>

发布时间:<%= format_date activity.updated_at %> 作者:<%= activity.try(:user).try(:realname).nil? ? activity.try(:user).try(:login) : activity.try(:user).try(:realname) %> @@ -18,11 +18,11 @@

<%= link_to image_tag(url_to_avatar(activity.author),:width => "40", :height => "40"), user_path(activity.author), :class => "fl user-img" %> -
+
<% if activity.parent_id.nil? %> - <%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "fl ziyuan-title" %> + <%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "fl note-title" %> <% else %> - <%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "fl ziyuan-title" %> + <%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "fl note-title" %> <% end %> <%#= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>

发布时间:<%= format_date activity.updated_on %> @@ -34,13 +34,45 @@ <% elsif act.org_act_type == "News" %> <% activity = News.find(act.org_act_id) %>

- <%= link_to image_tag(url_to_avatar(activity.creator),:width => "40", :height => "40"), user_path(activity.creator), :class => "fl user-img" %> + <%= link_to image_tag(url_to_avatar(activity.author),:width => "40", :height => "40"), user_path(activity.author), :class => "fl user-img" %> -
- <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %> -

发布时间:<%= format_date activity.updated_at %> - 作者:<%= activity.try(:creator).try(:realname).nil? ? activity.try(:creator).try(:login) : activity.try(:creator).try(:realname) %> - <%= activity.children.count %>

+
+ <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl note-title" %> +

发布时间:<%= format_date activity.created_on %> + 作者:<%= activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname) %> + <%= activity.comments.count %>

+
+
+ <% elsif act.org_act_type == "Poll" %> + <% activity = Poll.find(act.org_act_id) %> + <% has_commit = has_commit_poll?(activity.id ,User.current)%> + <% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%> + <% if ( activity.polls_status==2) %> +
+ <%= link_to image_tag(url_to_avatar(activity.user),:width => "40", :height => "40"), user_path(activity.user), :class => "fl user-img" %> + +
+ <% if has_commit %> + <%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "fl note-title" %> + <% else %> + <%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s, :target => '_blank', :class => "fl note-title" %> + <% end %> +

发布时间:<%= format_date activity.published_at %> + 作者:<%= activity.try(:user).try(:realname).nil? ? activity.try(:user) : activity.try(:user).try(:realname) %> + 0

+
+
+ <% end %> + <% elsif act.org_act_type == "Course" %> + <% activity = Course.find(act.org_act_id) %> +
+ <%= link_to image_tag(url_to_avatar(activity.teacher),:width => "40", :height => "40"), user_path(activity.teacher), :class => "fl user-img" %> + +
+ <%= link_to activity.name.to_s, course_url_in_org(activity.id), :target => '_blank', :class => "fl note-title" %> +

发布时间:<%= format_date activity.created_at %> + 作者:<%= activity.try(:teacher).try(:realname).nil? ? activity.try(:teacher) : activity.try(:teacher).try(:realname) %> + 0

<% end %> diff --git a/app/views/organizations/_org_new_course_homework.html.erb b/app/views/organizations/_org_new_course_homework.html.erb index 3de4c0293..7d6a4ac5e 100644 --- a/app/views/organizations/_org_new_course_homework.html.erb +++ b/app/views/organizations/_org_new_course_homework.html.erb @@ -2,16 +2,18 @@
<% iamge_path = get_image_path_from_content(activity.description) %> <% if iamge_path.nil? %> - # + <%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), student_work_index_url_in_org(activity.id), :target => "_blank" %> + <% else %> - + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), student_work_index_url_in_org(activity.id), :target => "_blank" %> + <% end %>
<%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank' %>
- <%= activity.user.realname.nil? ? activity.user : activity.user.realname %> + <%=link_to activity.try(:user).try(:realname).nil? ? activity.try(:user).try(:login) : activity.try(:user).try(:realname), user_path(activity.user), :class=>"publisher-name fl", :target => "_blank" %>

<%= format_date activity.updated_at %>

<%= activity.journals_for_messages.count %>
diff --git a/app/views/organizations/_org_new_course_message.html.erb b/app/views/organizations/_org_new_course_message.html.erb index 3877276ce..5e586bb28 100644 --- a/app/views/organizations/_org_new_course_message.html.erb +++ b/app/views/organizations/_org_new_course_message.html.erb @@ -2,9 +2,9 @@
<% iamge_path = get_image_path_from_content(activity.content) %> <% if iamge_path.nil? %> - # + <%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank" %> <% else %> - + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank" %> <% end %>
@@ -15,7 +15,7 @@ <% end %>
- <%= activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname) %> + <%=link_to activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname), user_path(activity.author), :class=>"publisher-name fl", :target => "_blank" %>

<%= format_date activity.updated_on %>

<%= activity.children.count %>
diff --git a/app/views/organizations/_org_new_course_news.html.erb b/app/views/organizations/_org_new_course_news.html.erb index ae2d03cbf..72b147ac3 100644 --- a/app/views/organizations/_org_new_course_news.html.erb +++ b/app/views/organizations/_org_new_course_news.html.erb @@ -2,16 +2,17 @@
<% iamge_path = get_image_path_from_content(activity.description) %> <% if iamge_path.nil? %> - # + <%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), news_url_in_org(activity.id), :target => "_blank" %> + <% else %> - + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), news_url_in_org(activity.id), :target => "_blank" %> <% end %>
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank' %>
- <%= activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname) %> + <%=link_to activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname), user_path(activity.author), :class=>"publisher-name fl", :target => "_blank" %>

<%= format_date activity.created_on %>

<%= activity.comments.count %>
diff --git a/app/views/organizations/_org_new_course_pic.html.erb b/app/views/organizations/_org_new_course_pic.html.erb new file mode 100644 index 000000000..15a9c4582 --- /dev/null +++ b/app/views/organizations/_org_new_course_pic.html.erb @@ -0,0 +1,107 @@ +<% activities.each do |act| %> + <% if act.org_act_type == "HomeworkCommon" %> + <% activity = HomeworkCommon.find(act.org_act_id) %> +
  • + +
    + <% iamge_path = get_image_path_from_content(activity.description) %> + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), student_work_index_url_in_org(activity.id), :target => "_blank" %> + + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), student_work_index_url_in_org(activity.id), :target => "_blank" %> + + <% end %> +
    +
    + <%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank' %> +
    +
    + +
  • + <% elsif act.org_act_type == "Message" %> + <% activity = Message.find(act.org_act_id) %> +
  • + +
    + <% iamge_path = get_image_path_from_content(activity.content) %> + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank" %> + <% end %> +
    +
    + <% if activity.parent_id.nil? %> + <%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %> + <% else %> + <%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %> + <% end %> +
    +
    + +
  • + <% elsif act.org_act_type == "News" %> + <% activity = News.find(act.org_act_id) %> +
  • + +
    + <% iamge_path = get_image_path_from_content(activity.description) %> + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), news_url_in_org(activity.id), :target => "_blank" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), news_url_in_org(activity.id), :target => "_blank" %> + <% end %> +
    +
    + <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank' %> +
    +
    + +
  • + <% elsif act.org_act_type == "Poll" %> + <% activity = Poll.find(act.org_act_id) %> + <% has_commit = has_commit_poll?(activity.id ,User.current)%> + <% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%> + <% if ( activity.polls_status==2) %> +
  • + +
    + <% iamge_path = get_image_path_from_content(activity.polls_description) %> + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), news_url_in_org(activity.id), :target => "_blank" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), news_url_in_org(activity.id), :target => "_blank" %> + <% end %> +
    +
    + <% if has_commit %> + <%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank' %> + <% else %> + <%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s, :target => '_blank' %> + <% end %> +
    +
    + +
  • + <% end %> + <% end %> + +<% end %> + diff --git a/app/views/organizations/_org_new_forum_list.html.erb b/app/views/organizations/_org_new_forum_list.html.erb index a8e531b50..fff7eae5f 100644 --- a/app/views/organizations/_org_new_forum_list.html.erb +++ b/app/views/organizations/_org_new_forum_list.html.erb @@ -1,14 +1,74 @@ - +<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %> + <% document = activity.org_act %> + <% org_subfield_id = params[:org_subfield_id] %> + <% flag = 2 %>
    - <%= link_to image_tag(url_to_avatar(activity.creator),:width => "40", :height => "40"), user_path(activity.creator), :class => "fl user-img" %> - -
    - <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %> -

    发布时间:<%= format_date activity.updated_at %> - 作者:<%= activity.try(:creator).try(:realname).nil? ? activity.try(:creator).try(:login) : activity.try(:creator).try(:realname) %> - <%= activity.children.count %>

    + <%= link_to image_tag(url_to_avatar(document.creator),:width => "40", :height => "40"), user_path(document.creator), :class => "fl user-img" %> +
    + <%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "fl note-title" %> +

    发布时间:<%= format_date document.created_at %> + 作者:<%= document.try(:creator).try(:realname).nil? ? document.try(:creator).try(:login) : document.try(:creator).try(:realname) %> + <%= document.children.count %>

    +
    +<% elsif activity.container_type == 'OrgSubfield' %> + <% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %> + <% message = Message.find(activity.org_act_id) %> + <% if message.board.org_subfield_id %> +
    + <%= link_to image_tag(url_to_avatar(message.author),:width => "40", :height => "40"), user_path(message.author), :class => "fl user-img" %> + +
    + <% if message.parent_id.nil? %> + <%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "fl note-title" %> + <% else %> + <%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "fl note-title" %> + <% end %> + <%#= link_to activity.title.to_s, organization_path(@organization, :org_subfield_id => field.id), :target => '_blank', :class => "fl note-title" %> + <%#= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %> +

    发布时间:<%= format_date message.created_on %> + 作者:<%= message.try(:author).try(:realname).nil? ? message.try(:author).try(:login) : message.try(:author).try(:realname) %> + <%= message.children.count %>

    +
    +
    + <% else %> +
    + <%= link_to image_tag(url_to_avatar(message.author),:width => "40", :height => "40"), user_path(message.author), :class => "fl user-img" %> + +
    + <% if message.parent_id.nil? %> + <%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :target => '_blank', :class => "fl note-title" %> + <% else %> + <%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "fl note-title" %> + <% end %> + <%#= link_to activity.title.to_s, organization_path(@organization, :org_subfield_id => field.id), :target => '_blank', :class => "fl note-title" %> + <%#= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %> +

    发布时间:<%= format_date message.updated_at %> + 作者:<%= message.try(:author).try(:realname).nil? ? message.try(:author).try(:login) : message.try(:author).try(:realname) %> + <%= message.children.count %>

    +
    +
    + <% end %> + <% end %> + <% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %> + <% news = News.find(activity.org_act_id) %> +
    + <%= link_to image_tag(url_to_avatar(news.author),:width => "40", :height => "40"), user_path(news.author), :class => "fl user-img" %> + +
    + <%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "fl note-title" %> + <%#= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %> +

    发布时间:<%= format_date news.created_on %> + 作者:<%= news.try(:author).try(:realname).nil? ? news.try(:author).try(:login) : news.try(:author).try(:realname) %> + <%= news.comments.count %>

    +
    +
    + <% end %> +<% end %> + + + + -
    diff --git a/app/views/organizations/_org_new_forum_pic.html.erb b/app/views/organizations/_org_new_forum_pic.html.erb index c4fd061a5..8ef7c9a8f 100644 --- a/app/views/organizations/_org_new_forum_pic.html.erb +++ b/app/views/organizations/_org_new_forum_pic.html.erb @@ -1,23 +1,123 @@ -
  • - -
    - <% iamge_path = get_image_path_from_content(activity.content) %> - <% if iamge_path.nil? %> - # - <% else %> - - <% end %> -
    -
    - <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank' %> -
    -
    - -
  • +<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %> + <% document = activity.org_act %> + <% org_subfield_id = params[:org_subfield_id] %> + <% flag = 2 %> +
  • + +
    + <% iamge_path = get_image_path_from_content(document.content) %> + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %> + <% end %> +
    +
    <%#= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %> + <%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank' %> +
    +
    + +
  • +<% elsif activity.container_type == 'OrgSubfield' %> + <% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %> + <% message = Message.find(activity.org_act_id) %> + <% if message.board.org_subfield_id %> +
  • + +
    + <% if message.parent_id.nil? %> + <% content = message.content%> + <% else %> + <% content = message.parent.content%> + <% end %> + <% iamge_path = get_image_path_from_content(content) %> + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), board_message_url_in_org(message.board.id,message.id), :target => "_blank" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), board_message_url_in_org(message.board.id,message.id), :target => "_blank" %> + <% end %> +
    +
    + <% if message.parent_id.nil? %> + <%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank' %> + <% else %> + <%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank'%> + <% end %> + <%#= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %> + <%#= link_to document.subject, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %> +
    +
    + +
  • + <% else %> +
  • + +
    + <% if message.parent_id.nil? %> + <% content = message.content%> + <% else %> + <% content = message.parent.content%> + <% end %> + <% iamge_path = get_image_path_from_content(content) %> + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), board_message_path(message.board,activity), :target => "_blank" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), board_message_path(message.board,activity), :target => "_blank" %> + <% end %> +
    +
    + <% if message.parent_id.nil? %> + <%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :class=> "postGrey" + %> + <% else %> + <%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :class=> "postGrey" + %> + <% end %> + + <%#= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %> + <%#= link_to document.subject, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %> +
    +
    + +
  • + <% end %> + <% end %> + <% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %> + <% news = News.find(activity.org_act_id) %> +
  • + +
    + <% iamge_path = get_image_path_from_content(news.description) %> + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), news_path(news), :target => "_blank" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), news_path(news), :target => "_blank" %> + <% end %> +
    +
    <%#= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %> + <%= link_to news.title.to_s, news_path(news), :target => '_blank' %> +
    +
    + +
  • + <% end %> +<% end %> diff --git a/app/views/organizations/_org_new_project_act_list.html.erb b/app/views/organizations/_org_new_project_act_list.html.erb index b3754024f..278972b1a 100644 --- a/app/views/organizations/_org_new_project_act_list.html.erb +++ b/app/views/organizations/_org_new_project_act_list.html.erb @@ -4,8 +4,8 @@
    <%= link_to image_tag(url_to_avatar(activity.author),:width => "40", :height => "40"), user_path(activity.author), :class => "fl user-img" %> -
    - <%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %> +
    + <%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank', :class => "fl note-title" %> <%#= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %> <%#= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>

    发布时间:<%= format_date activity.updated_on %> @@ -19,11 +19,11 @@

    <%= link_to image_tag(url_to_avatar(activity.author),:width => "40", :height => "40"), user_path(activity.author), :class => "fl user-img" %> -
    +
    <% if activity.parent_id.nil? %> - <%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "fl ziyuan-title" %> + <%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "fl note-title" %> <% else %> - <%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "fl ziyuan-title" %> + <%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "fl note-title" %> <% end %> <%#= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>

    发布时间:<%= format_date activity.updated_on %> @@ -35,13 +35,13 @@ <% elsif act.org_act_type == "News" %> <% activity = News.find(act.org_act_id) %>

    - <%= link_to image_tag(url_to_avatar(activity.creator),:width => "40", :height => "40"), user_path(activity.creator), :class => "fl user-img" %> + <%= link_to image_tag(url_to_avatar(activity.author),:width => "40", :height => "40"), user_path(activity.author), :class => "fl user-img" %> -
    - <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %> -

    发布时间:<%= format_date activity.updated_at %> - 作者:<%= activity.try(:creator).try(:realname).nil? ? activity.try(:creator).try(:login) : activity.try(:creator).try(:realname) %> - <%= activity.children.count %>

    +
    + <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl note-title" %> +

    发布时间:<%= format_date activity.created_on %> + 作者:<%= activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname) %> + <%= activity.comments.count %>

    <% end %> diff --git a/app/views/organizations/_org_new_project_pic.html.erb b/app/views/organizations/_org_new_project_pic.html.erb index aa91659ce..3adc77433 100644 --- a/app/views/organizations/_org_new_project_pic.html.erb +++ b/app/views/organizations/_org_new_project_pic.html.erb @@ -7,16 +7,16 @@
    <% iamge_path = get_image_path_from_content(activity.description) %> <% if iamge_path.nil? %> - # + <%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), issue_url_in_org(activity.id), :target => "_blank" %> <% else %> - + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), issue_url_in_org(activity.id), :target => "_blank" %> <% end %>
    <%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank' %>
    - <%= activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname) %> + <%=link_to activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname), user_path(activity.author), :class=>"publisher-name fl", :target => "_blank" %>

    <%= format_date activity.updated_on %>

    <%= activity.journals.count %>
    @@ -29,9 +29,9 @@
    <% iamge_path = get_image_path_from_content(activity.content) %> <% if iamge_path.nil? %> - # + <%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank" %> <% else %> - + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank" %> <% end %>
    @@ -42,7 +42,7 @@ <% end %>
    - <%= activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname) %> + <%=link_to activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname), user_path(activity.author), :class=>"publisher-name fl", :target => "_blank" %>

    <%= format_date activity.updated_on %>

    <%= activity.children.count %>
    @@ -55,16 +55,16 @@
    <% iamge_path = get_image_path_from_content(activity.description) %> <% if iamge_path.nil? %> - # + <%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), news_url_in_org(activity.id), :target => "_blank" %> <% else %> - + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), news_url_in_org(activity.id), :target => "_blank" %> <% end %>
    <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank' %>
    - <%= activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname) %> + <%=link_to activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname), user_path(activity.author), :class=>"publisher-name fl", :target => "_blank" %>

    <%= format_date activity.created_on %>

    <%= activity.comments.count %>
    diff --git a/app/views/organizations/_subfield_list.html.erb b/app/views/organizations/_subfield_list.html.erb index e16e91486..2c679eb3d 100644 --- a/app/views/organizations/_subfield_list.html.erb +++ b/app/views/organizations/_subfield_list.html.erb @@ -23,14 +23,19 @@
  • <%= name %>
  • 默认
  • - <%= form_tag({:controller => 'org_subfields', :action => 'update_status', :id => field.id,},:remote=>'true', :method => 'post', :id=>"update_status_form_#{field.id}", :class => 'query_form') do %> -
    - -
    - <%= select( :name,:group_id, subfield_status_option, - { :include_blank => false,:selected => field.status}, - {:onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:30px;"}) %> + <% if field.name == "activity" %> + 默认 + <% else %> + <%= form_tag({:controller => 'org_subfields', :action => 'update_status', :id => field.id,},:remote=>'true', :method => 'post', :id=>"update_status_form_#{field.id}", :class => 'query_form') do %> +
    + +
    + <%= select( :name,:group_id, subfield_status_option, + { :include_blank => false,:selected => field.status}, + {:onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:56px;"}) %> + <% end %> <% end %> +
  • 默认
  • <%= field.hide==0?"隐藏":"可见" %> @@ -58,12 +63,12 @@ 列表 <% else %> <%= form_tag({:controller => 'org_subfields', :action => 'update_status', :id => field.id,},:remote=>'true', :method => 'post', :id=>"update_status_form_#{field.id}", :class => 'query_form') do %> -
    +
    <%= select( :name,:group_id, subfield_status_option, { :include_blank => false,:selected => field.status}, - {:onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:40px;"}) %> + {:onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:56px;"}) %> <% end %> <% end %> diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb index cf5866bc6..997d28f6d 100644 --- a/app/views/student_work/_programing_work_show.html.erb +++ b/app/views/student_work/_programing_work_show.html.erb @@ -65,7 +65,7 @@ 测试错误! <% end %> 您的输出: -
    <%=x["result"]%> 
    +
    <%=x["result"].force_encoding("UTF-8")%> 
    正确输出:
    <%=x["output"]%>
    diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index dea8be552..69d209df9 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -64,36 +64,36 @@ <% when 'Course' %> <% case user_activity.act_type.to_s %> <% when 'HomeworkCommon' %> - <% cache (act) do %> + <%# cache (act) do %> <%= render :partial => 'course_homework', :locals => {:activity => act,:user_activity_id =>user_activity.id,:course_activity => 0} %> - <% end %> + <%# end %> <% when 'News' %> - <% cache [act, act.comments.count] do %> + <%# cache [act, act.comments.count] do %> <%= render :partial => 'course_news', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> - <% end %> + <%# end %> <% when 'Message'%> <%= render :partial => 'course_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_course=>0,:is_board=>0} %> <% when 'Poll' %> <%= render :partial => 'course_poll', :locals => {:activity => act, :user_activity_id => user_activity.id} %> <% when 'Course'%> - <% cache (act) do %> + <%# cache (act) do %> <%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => act.id} %> - <%end%> + <%# end%> <% when 'JournalsForMessage'%> <%= render :partial => 'users/course_journalsformessage', :locals => {:activity => act, :user_activity_id => user_activity.id} %> <% end %> <% when 'Project' %> <% case user_activity.act_type.to_s %> <% when 'Issue' %> - <% cache [act, act.journals.count, act.attachments.count] do%> + <%# cache [act, act.journals.count, act.attachments.count] do%> <%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id, :user_id => user_id} %> - <% end %> + <%# end %> <% when 'Message' %> <%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_course=>0,:is_board=>0} %> <% when 'ProjectCreateInfo'%> - <% cache (act) do %> + <%# cache (act) do %> <%= render :partial => 'project_create', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> - <% end %> + <%# end %> <% end %> <% when 'Principal' %> <% case user_activity.act_type.to_s %> @@ -103,12 +103,12 @@ <% end %> <% end %> <% when 'Blog'%> - <% cache (act) do %> + <%# cache (act) do %> <% case user_activity.act_type.to_s %> <% when 'BlogComment' %> <%= render :partial => 'user_blog', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> <% end %> - <% end %> + <%# end %> <% end %> <% end %> diff --git a/lib/redmine/pagination.rb b/lib/redmine/pagination.rb index 79855b966..9132f973c 100644 --- a/lib/redmine/pagination.rb +++ b/lib/redmine/pagination.rb @@ -168,7 +168,7 @@ module Redmine if block_given? yield text, parameters, options else - if args[2][:path].nil? + if args[2].nil? || args[2][:path].nil? link_to text, params.merge(parameters), options else page = "&page=" + parameters[:page].to_s unless parameters[:page].nil? diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index 9dad153a3..3a203c10d 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -76,7 +76,7 @@ a.linkGrey8:hover {color:#585858;} .org_login_list a {color:#269ac9;} .orgListStatus {width:40px; float:left;} -.orgListStatusList {width:55px; float:left;} +.orgListStatusList {width:58px; float:left;} .personalUrl {border:1px solid #dddddd; width:75px; outline:none; white-space:nowrap; padding-left:2px;} .reCon{ margin:5px; width:710px;} .retop{width:710px; height:40px; background:#eaeaea; padding:5px;} diff --git a/public/stylesheets/org_new_style.css b/public/stylesheets/org_new_style.css index 0562bc088..442ca9ce3 100644 --- a/public/stylesheets/org_new_style.css +++ b/public/stylesheets/org_new_style.css @@ -154,7 +154,7 @@ a:hover.read-more{ text-decoration:underline;} overflow: hidden; text-indent: 100%; white-space: nowrap; - background: rgba(232, 98, 86, 0.8) url(../images/org_new_style/cd-top-arrow.svg) no-repeat center 50%; + background: rgba(108, 108, 108, 0.8) url(../images/org_new_style/cd-top-arrow.svg) no-repeat center 50%; visibility: hidden; opacity: 0; -webkit-transition: all 0.3s; @@ -185,6 +185,13 @@ a:hover.more-btn-center{ background:#29146f; color:#fff;} .nocontent{ font-size:30px; color:#888; margin:150px auto; text-align:center;} +/** 帖子列表模式 **/ +.note-box{ width:515px; } +.note-box span{ margin-right:5px;} +.note-title{ display:block; width:515px; font-size:16px;white-space:nowrap; overflow:hidden; text-overflow:ellipsis;} +.note-box p{display:block; width:515px; color:#888; font-size:12px; line-height:2.5;} +.right-info2{background:url(../images/org_new_style/icons.png) no-repeat -41px -540px ; width:15px; line-height:1.9; height:16px; padding-left:20px; color:#888; margin-top:5px;} +