From 2b9ddf35946921530cbba3d82009d6ee1cb8923d Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 29 Mar 2016 13:43:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=96=B0=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 1 - app/helpers/organizations_helper.rb | 4 + app/views/layouts/base_org_newstyle.html.erb | 437 +++++++++--------- .../_org_left_subfield_list.html.erb | 4 +- public/stylesheets/org_new_style.css | 12 +- 5 files changed, 244 insertions(+), 214 deletions(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index e649dffb5..38514dfc4 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -81,7 +81,6 @@ class OrganizationsController < ApplicationController @project_acts = get_project_activities_org @organization @course_acts_homework = get_course_homework_activities_org @organization @course_acts_message = get_course_message_activities_org @organization - else if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) @organization = Organization.find(params[:id]) diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index db7d6f576..bc143aa65 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -36,4 +36,8 @@ 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} order by updated_at desc limit 3;") + end + end diff --git a/app/views/layouts/base_org_newstyle.html.erb b/app/views/layouts/base_org_newstyle.html.erb index 1c30bc192..f1ec13246 100644 --- a/app/views/layouts/base_org_newstyle.html.erb +++ b/app/views/layouts/base_org_newstyle.html.erb @@ -130,9 +130,9 @@ 项目动态 <% end %> <% else %> - <% if field.field_type == "Post" %> + <% if field.field_type == "Post" && field.hide == 0 %> <%= link_to field.name, organization_path(@organization), :class => "fl" %> - <% elsif field.field_type == "Resource" %> + <% elsif field.field_type == "Resource" && field.hide == 0%> <%= link_to field.name, organization_path(@organization), :class => "fl" %> <% end %> <% end %> @@ -188,216 +188,233 @@ <% @subfield_content.each do |field| %> -
-
-

课程动态

course activities

-
-
- - <% @course_acts_homework.each do |act| %> - <% if act.container_type == 'Course' %> - <% case act.org_act_type.to_s %> - <% when 'HomeworkCommon' %> - <%= render :partial => 'org_new_course_homework', :locals => {:activity => HomeworkCommon.find(act.org_act_id),:user_activity_id =>act.id,:course_activity => 0} %> - <% when 'News' %> - <%= render :partial => 'org_new_course_news', :locals => {:activity => News.find(act.org_act_id),:user_activity_id =>act.id} %> - <% when 'Message'%> - <%= render :partial => 'org_new_course_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %> - <% when 'Poll' %> - <%= render :partial => 'org_new_course_poll', :locals => {:activity => Poll.find(act.org_act_id), :user_activity_id => act.id} %> - <% when 'Course'%> - <%= render :partial => 'org_new_course_create', :locals => {:activity => Course.find(act.org_act_id), :user_activity_id => act.id} %> - <% end %> - <% end %> - <% end %> - More -
-
- - <% @course_acts_message.each do |act| %> - <% if act.container_type == 'Course' %> - <% case act.org_act_type.to_s %> - <% when 'HomeworkCommon' %> - <%= render :partial => 'org_new_course_homework', :locals => {:activity => HomeworkCommon.find(act.org_act_id),:user_activity_id =>act.id,:course_activity => 0} %> - <% when 'News' %> - <%= render :partial => 'org_new_course_news', :locals => {:activity => News.find(act.org_act_id),:user_activity_id =>act.id} %> - <% when 'Message'%> - <%= render :partial => 'org_new_course_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %> - <% when 'Poll' %> - <%= render :partial => 'org_new_course_poll', :locals => {:activity => Poll.find(act.org_act_id), :user_activity_id => act.id} %> - <% when 'Course'%> - <%= render :partial => 'org_new_course_create', :locals => {:activity => Course.find(act.org_act_id), :user_activity_id => act.id} %> - <% end %> - <% end %> - <% end %> - More -
- -
-
-
-
- - -
-
-

项目动态

project activities

- -
-
-
-
- <% @project_acts.each do |act| %> - <% if act.container_type == 'Project' %> - <% case act.org_act_type.to_s %> - <% when 'Issue' %> - <%= render :partial => 'organizations/org_new_project_issues', :locals => {:activity => Issue.find(act.org_act_id)} %> - <% when 'Message' %> - <%= render :partial => 'organizations/org_new_project_message', :locals => {:activity => Message.find(act.org_act_id)} %> - <% when 'ProjectCreateInfo'%> - <%= render :partial => 'organizations/org_new_project_create', :locals => {:activity => act} %> + <% if is_default_field?(field) %> + <% case field.name %> + <% when 'course' %> +
+
+

课程动态

course activities

+
+
+ + <% @course_acts_homework.each do |act| %> + <% if act.container_type == 'Course' %> + <% case act.org_act_type.to_s %> + <% when 'HomeworkCommon' %> + <%= render :partial => 'org_new_course_homework', :locals => {:activity => HomeworkCommon.find(act.org_act_id),:user_activity_id =>act.id,:course_activity => 0} %> + <% when 'News' %> + <%= render :partial => 'org_new_course_news', :locals => {:activity => News.find(act.org_act_id),:user_activity_id =>act.id} %> + <% when 'Message'%> + <%= render :partial => 'org_new_course_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %> + <% when 'Poll' %> + <%= render :partial => 'org_new_course_poll', :locals => {:activity => Poll.find(act.org_act_id), :user_activity_id => act.id} %> + <% when 'Course'%> + <%= render :partial => 'org_new_course_create', :locals => {:activity => Course.find(act.org_act_id), :user_activity_id => act.id} %> + <% end %> + <% end %> <% end %> - <% end %> - <% end %> -
-
-
-
-
    -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
-
+ More +
+
+ + <% @course_acts_message.each do |act| %> + <% if act.container_type == 'Course' %> + <% case act.org_act_type.to_s %> + <% when 'HomeworkCommon' %> + <%= render :partial => 'org_new_course_homework', :locals => {:activity => HomeworkCommon.find(act.org_act_id),:user_activity_id =>act.id,:course_activity => 0} %> + <% when 'News' %> + <%= render :partial => 'org_new_course_news', :locals => {:activity => News.find(act.org_act_id),:user_activity_id =>act.id} %> + <% when 'Message'%> + <%= render :partial => 'org_new_course_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %> + <% when 'Poll' %> + <%= render :partial => 'org_new_course_poll', :locals => {:activity => Poll.find(act.org_act_id), :user_activity_id => act.id} %> + <% when 'Course'%> + <%= render :partial => 'org_new_course_create', :locals => {:activity => Course.find(act.org_act_id), :user_activity_id => act.id} %> + <% end %> + <% end %> + <% end %> + More +
+ +
+
+
+
+ <% when 'project' %> +
+
+

项目动态

project activities

+ +
+
+
+
+ <% @project_acts.each do |act| %> + <% if act.container_type == 'Project' %> + <% case act.org_act_type.to_s %> + <% when 'Issue' %> + <%= render :partial => 'organizations/org_new_project_issues', :locals => {:activity => Issue.find(act.org_act_id)} %> + <% when 'Message' %> + <%= render :partial => 'organizations/org_new_project_message', :locals => {:activity => Message.find(act.org_act_id)} %> + <% when 'ProjectCreateInfo'%> + <%= render :partial => 'organizations/org_new_project_create', :locals => {:activity => act} %> + <% end %> + <% end %> + <% end %> +
+
+
+
+
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
+
+
+
+
+ + +
+
+
+ + +
+
+ <% end %> +<% else %> + <% if field.field_type == "Post" %> + <% message_ats = get_message_org(@organization.id, field.id) %> +
+
+

<%= field.name %>

activity zone

+ -
-
- - -
-
-
- - -
-
- -<% if field.field_type == "Post" %> - -<% end %> - - +
+
+ <% elsif field.field_type == "Resource" %> +
+
+

北斗资源下载

resource dwonload

+
+
+
+ +
+ 资源名称资源名称资源名称资源名称资资源名称资源名称资源资源名称资源名称资源源 +

上传时间:2016-01-01类型:软件 上传者:尹刚 下载次数:40

+
+ 下载 +
+
+
+ +
+ 资源名称资源名称资源名称资源名称资源 +

上传时间:2016-01-01类型:软件 上传者:尹刚 下载次数:40

+
+ 下载 +
+
+
+ +
+ 资源名称资源名称资源名称资源名称资源 +

上传时间:2016-01-01类型:软件 上传者:尹刚 下载次数:40

+
+ 下载 +
+
+
+
+
+ +
+ 资源名称资源名称资源名称资源名称资源 +

上传时间:2016-01-01类型:软件 上传者:尹刚 下载次数:40

+
+ 下载 +
+
+
+ +
+ 资源名称资源名称资源名称资源名称资源 +

上传时间:2016-01-01类型:软件 上传者:尹刚 下载次数:40

+
+ 下载 +
+
+
+ +
+ 资源名称资源名称资源名称资源名称资源 +

上传时间:2016-01-01类型:软件 上传者:尹刚 下载次数:40

+
+ 下载 +
+
+
+
+
+
+
+
+ <% end %> + <% end %> <% end %> diff --git a/app/views/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb index 7e49d1780..ebab8354c 100644 --- a/app/views/organizations/_org_left_subfield_list.html.erb +++ b/app/views/organizations/_org_left_subfield_list.html.erb @@ -84,8 +84,8 @@ <% end %> <% else %>
- <% if field.field_type == "Post" %> - <% if !field.subfield_subdomain_dir.nil? %> + <% if field.field_type == "Post" %> + <% 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 "#{field.name}", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %> <% else %> diff --git a/public/stylesheets/org_new_style.css b/public/stylesheets/org_new_style.css index d4643a68a..c31155de8 100644 --- a/public/stylesheets/org_new_style.css +++ b/public/stylesheets/org_new_style.css @@ -85,7 +85,7 @@ a:hover.search-icon{ background:url(../images/org_new_style/icons.png) -387px -8 .row-title{ font-size:16px; font-weight:bold; line-height:1.9;display:block;white-space:nowrap; overflow:hidden; text-overflow:ellipsis;} .row-con { display:block; } .row-con:hover{ color:#29156f; } -.row-txt{line-height:2.4; padding-bottom:10px; margin-bottom:10px; color:#888;} +.row-txt{line-height:2.4; padding-bottom:10px; margin-bottom:10px; color:#888 !important; height: 68px; overflow: hidden;} .row-txt:hover{color:#29156f;} .row-txt-line{border-bottom:1px solid #cccccc; width:365px; height:56px; overflow:hidden;} a.btn-more{ display:block; font-size:14px; width:110px; height:40px;-moz-border-radius: 3px; -webkit-border-radius: 3px; background:#ffbd18; color:#fff; text-align:center; line-height:3.0;} @@ -166,6 +166,16 @@ a.pre-back{ background:#888;} .footer-con{ width:1200px; padding:65px 0 0 60px; margin:0 auto; text-align:center; font-size:14px; color:#fff;} .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;} +/** ziyuan **/ +.row-ziyuan{ width:570px; border-bottom:1px solid #f0f0f0; padding:15px 0;} +.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;} +.ziyuan-box p{display:block; width:420px; color:#888; font-size:12px; line-height:2.5;} +a.download-btn{ display:block; border:1px solid #ccc; margin-top:10px; font-size:14px; width:70px; height:27px;-moz-border-radius: 3px; -webkit-border-radius: 3px; color:#888; text-align:center; line-height:1.9;} +a:hover.download-btn{ background:#29146f; color:#fff; border:none;} +.user-img img{ border:2px solid #e6473b; margin-right:10px; -moz-border-radius: 50px; -webkit-border-radius: 50px;border-radius: 50px; display:block; width:40px; height:40px;} +.ml60{ margin-left:60px;}