From f662bfa40b4a74623ab5df1e288843ae18634d37 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 31 Mar 2016 17:06:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=A7=91=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 4 +-- app/helpers/organizations_helper.rb | 2 +- app/views/layouts/base_org_newstyle.html.erb | 26 +++++++++----------- public/stylesheets/org_new_style.css | 5 ++-- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 281f779d7..1ea109ff1 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -160,7 +160,7 @@ class OrganizationsController < ApplicationController def get_project_activities_org org project_ids = org.projects.map{|project| project.id}.join(",") 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 3;") + 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;") else project_acts = nil end @@ -171,7 +171,7 @@ class OrganizationsController < ApplicationController def get_course_activities_org org course_ids = org.courses.map{|course| course.id}.join(",") 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 6;") + 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;") else project_acts = nil end diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 84b38e628..4faa802a5 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -30,7 +30,7 @@ module OrganizationsHelper end def get_message_org(org_id, field_id) - OrgDocumentComment.find_by_sql("SELECT * FROM org_document_comments where organization_id = #{org_id} and org_subfield_id = #{field_id} and parent_id is null order by updated_at desc limit 3;") + OrgDocumentComment.find_by_sql("SELECT * FROM org_document_comments where organization_id = #{org_id} and org_subfield_id = #{field_id} and parent_id is null order by updated_at desc limit 8;") end def get_message_reply_org(org_id, ids) diff --git a/app/views/layouts/base_org_newstyle.html.erb b/app/views/layouts/base_org_newstyle.html.erb index f2210ae3a..442bb7b60 100644 --- a/app/views/layouts/base_org_newstyle.html.erb +++ b/app/views/layouts/base_org_newstyle.html.erb @@ -110,13 +110,10 @@ <% if is_default_field?(field) %> <% case field.name %> <% when 'course' %> - - - -
+
<% if field.status == 0 %>
-

课程动态

course activities

+

课程动态

<% if @course_acts.nil? %> <% else %> @@ -173,16 +170,17 @@ <% end %>
<% when 'project' %> +
<% if field.status == 0 %> -
-

项目动态

+
+

项目动态

<% if @project_acts.nil? %> <% else %>
    <% unless @project_acts.nil? %> - <%= render :partial => 'organizations/org_new_project_pic', :locals => {:activities => @project_acts} %> + <%= 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" %> @@ -194,7 +192,7 @@
<% else %>
-

<%= field.name %>

+

项目动态

<% if @project_acts.nil? %> <% else %> @@ -209,7 +207,7 @@
<% end %> - +
<% end %> <% else %> <% if field.field_type == "Post" %> <%# 讨论类型 %> @@ -219,13 +217,13 @@ <% if field.status == 0 %>

<%= field.name %>

- <% if message_ats.nil? %> + <% if message_ats.blank? %> <% else %>
    - <% message_ats.each do |act| %> + <% message_ats.first(3).each do |act| %> <%= render :partial => 'organizations/org_new_forum_pic', :locals => {:activity => act, :field => field, :organization => @organization} %> <% end %>
    @@ -239,7 +237,7 @@ <% else %>

    <%= field.name %>

    - <% if message_ats.nil? %> + <% if message_ats.blank? %> <% else %>
    @@ -262,7 +260,7 @@

    <%= field.name %>

    - <% if org_attachs.nil? %> + <% if org_attachs.blank? %> <% else %>
    diff --git a/public/stylesheets/org_new_style.css b/public/stylesheets/org_new_style.css index 83fab83eb..0562bc088 100644 --- a/public/stylesheets/org_new_style.css +++ b/public/stylesheets/org_new_style.css @@ -95,7 +95,7 @@ a.pre-back{ background:#888;} .footer-con ul{ display:block; width:430px; height:50px; margin:0 auto; } .footer-con ul li a{font-size:18px; color:#fff; margin-right:35px; font-weight:bold;} /** download **/ -.row-ziyuan{ width:570px; border-bottom:1px solid #f0f0f0; padding:15px 0;margin: 0px 15px;} +.row-ziyuan{ width:570px; border-bottom:1px solid #e6e6e6; padding:15px 0;margin: 0px 15px;} .ziyuan-box{ width:420px; margin-right:20px;} .ziyuan-box span{ margin-right:5px;} .ziyuan-title{ display:block; width:420px; font-size:16px;white-space:nowrap; overflow:hidden; text-overflow:ellipsis;} @@ -177,7 +177,8 @@ a:hover.read-more{ text-decoration:underline;} a.more-btn{ display:block; background:#ccc; color:#fff; margin-top:10px; width:100px; height:38px;font-size:14px; -webkit-border-radius: 5px;border-radius:5px;text-align:center; line-height:38px;} -a.more-btn-center{ display:block; background:#ccc; color:#fff; margin-top:10px; width:100px; height:38px;font-size:14px; -webkit-border-radius: 5px;border-radius:5px;text-align:center; line-height:38px;width:100px; margin:0px auto;margin-top: 15px;} +a.more-btn{ display:block; border:1px solid #ccc; color:#000; margin-top:10px; width:120px; height:38px;font-size:14px; -webkit-border-radius: 25px;border-radius:25px;text-align:center; line-height:38px; margin:0 auto; margin-top:30px;} +a.more-btn-center{ display:block; border:1px solid #ccc; color:#000; margin-top:10px; width:120px; height:38px;font-size:14px; -webkit-border-radius: 25px;border-radius:25px;text-align:center; line-height:38px; margin:0 auto; margin-top:30px;} a:hover.more-btn{ background:#29146f; color:#fff;} a:hover.more-btn-center{ background:#29146f; color:#fff;} .mt30{ margin-top:30px;}