From d28a46c48afc950006bb0e303c9276edabaec3ab Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 29 Mar 2016 16:45:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=97=E6=96=97=E8=B5=84=E6=BA=90=E5=BA=93?= =?UTF-8?q?=E6=9D=BF=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/organizations_helper.rb | 12 +-- app/views/layouts/base_org_newstyle.html.erb | 80 +++---------------- .../_org_new_project_create.html.erb | 3 - .../_org_new_project_message.html.erb | 10 +-- .../organizations/_org_new_resource.html.erb | 14 ++++ public/stylesheets/org_new_style.css | 4 +- 6 files changed, 38 insertions(+), 85 deletions(-) create mode 100644 app/views/organizations/_org_new_resource.html.erb diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index bc143aa65..89a21ba0e 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -28,16 +28,12 @@ module OrganizationsHelper end end - def get_project_activities_org org - - end - - def get_course_activity_org org - - 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 + def get_attach_org(field_id) + Attachment.find_by_sql("SELECT * FROM `attachments` where container_id =#{field_id} and container_type = 'OrgSubfield' and is_public =1 order by created_on limit 6;") + end + end diff --git a/app/views/layouts/base_org_newstyle.html.erb b/app/views/layouts/base_org_newstyle.html.erb index f1ec13246..0a2c2efdf 100644 --- a/app/views/layouts/base_org_newstyle.html.erb +++ b/app/views/layouts/base_org_newstyle.html.erb @@ -10,7 +10,7 @@ <%= javascript_heads %> <%= heads_for_theme %> <%= stylesheet_link_tag 'org_new_style' %> - <%= javascript_include_tag 'org'%> + <%= javascript_include_tag 'org' %> <%= javascript_include_tag 'attachments' %> <%= call_hook :view_layouts_base_html_head %> @@ -125,15 +125,15 @@ <% when 'activity' %> <%= link_to "首页", organization_path(@organization), :class => "fl navact" %> <% when 'course' %> - 课程动态 + 课程动态 <% when 'project' %> - 项目动态 + 项目动态 <% end %> <% else %> <% if field.field_type == "Post" && field.hide == 0 %> - <%= link_to field.name, organization_path(@organization), :class => "fl" %> + <%= field.name %> <% elsif field.field_type == "Resource" && field.hide == 0%> - <%= link_to field.name, organization_path(@organization), :class => "fl" %> + <%= field.name %> <% end %> <% end %> <% end %> @@ -193,7 +193,7 @@ <% when 'course' %>
-

课程动态

course activities

+

课程动态

course activities

@@ -262,7 +262,7 @@ <% when 'project' %>
-

项目动态

project activities

+

项目动态

project activities

@@ -271,7 +271,7 @@ <% @project_acts.each do |act| %> <% if act.container_type == 'Project' %> <% case act.org_act_type.to_s %> - <% when 'Issue' %> + <% 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)} %> @@ -327,7 +327,7 @@ <% message_ats = get_message_org(@organization.id, field.id) %>
-

<%= field.name %>

activity zone

+

<%= field.name %>

activity zone

<% message_ats.each do |message| %>
@@ -346,67 +346,13 @@
<% elsif field.field_type == "Resource" %> + <% org_attachs = get_attach_org(field.id) %>
-

北斗资源下载

resource dwonload

+

<%= field.name %>

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

-
- 下载 -
-
+ <%= render :partial => 'organizations/org_new_resource', :locals => {:org_attachs => org_attachs} %> +
diff --git a/app/views/organizations/_org_new_project_create.html.erb b/app/views/organizations/_org_new_project_create.html.erb index 7ae93b035..e69de29bb 100644 --- a/app/views/organizations/_org_new_project_create.html.erb +++ b/app/views/organizations/_org_new_project_create.html.erb @@ -1,3 +0,0 @@ -<% project = Project.find(activity.org_act_id) %> -

<%= format_time(project.updated_on) %>项目社区<%= project.name %>

-

<%= project.description %>

\ No newline at end of file diff --git a/app/views/organizations/_org_new_project_message.html.erb b/app/views/organizations/_org_new_project_message.html.erb index 69667e313..08338aca8 100644 --- a/app/views/organizations/_org_new_project_message.html.erb +++ b/app/views/organizations/_org_new_project_message.html.erb @@ -5,11 +5,11 @@ <%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board.id,activity.id) %> <% end %> +<% if activity.parent_id.nil? %> + <% content = activity.content%> +<% else %> + <% content = activity.parent.content%> +<% end %>

- <% if activity.parent_id.nil? %> - <% content = activity.content%> - <% else %> - <% content = activity.parent.content%> - <% end %> <%= content.to_s.html_safe %>

\ No newline at end of file diff --git a/app/views/organizations/_org_new_resource.html.erb b/app/views/organizations/_org_new_resource.html.erb new file mode 100644 index 000000000..08d1f8b78 --- /dev/null +++ b/app/views/organizations/_org_new_resource.html.erb @@ -0,0 +1,14 @@ +<% org_attachs.each do |attach| %> +
+ <%= link_to image_tag(url_to_avatar(attach.author),:width => "40", :height => "40"), user_path(attach.author), :class => "fl user-img" %> + +
+ <%= link_to truncate(attach.filename,length: 35, omission: '...'), + download_named_attachment_path(attach.id, attach.filename), + :title => attach.filename+"\n"+attach.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;", :class => "fl ziyuan-title" %> +

上传时间:<%= format_time attach.created_on %>类型:软件 上传者:尹刚 下载次数:40

+
+ 下载 +
+
+<% end %> \ No newline at end of file diff --git a/public/stylesheets/org_new_style.css b/public/stylesheets/org_new_style.css index c31155de8..4833e8966 100644 --- a/public/stylesheets/org_new_style.css +++ b/public/stylesheets/org_new_style.css @@ -122,7 +122,7 @@ background:url(../images/org_new_style/icons.png) no-repeat -100px -511px ; ul.callbacks_tabs.callbacks1_tabs {position:absolute;bottom: 7.3%;z-index: 999;left: -92%; display: block;} /** 开源 **/ .box2{ height:569px; padding:70px 0; width:100%; background:url(../images/org_new_style/bg.jpg) no-repeat; } -.row-box3{ width:380px;} +.row-box3{ width:370px;} .row-title3{ width:290px; font-size:18px;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-weight:bold; } .box3{height:540px; width:100%; padding:70px 0; background:url(../images/org_new_style/bg2.jpg) no-repeat; } .box-title-p3{font-size:14px; color:#999999;} @@ -167,7 +167,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;} /** ziyuan **/ -.row-ziyuan{ width:570px; border-bottom:1px solid #f0f0f0; padding:15px 0;} +.row-ziyuan{ width:570px; border-bottom:1px solid #f0f0f0; 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;}