From 2b4f16e5f17d27f42899b6c40519312b28940b13 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 29 Apr 2016 14:46:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E7=9B=AE=E5=BD=95=E6=96=B0?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E7=9A=84=E5=B8=96=E5=AD=90=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sub_document_comments_controller.rb | 11 +- app/models/organization.rb | 4 + .../_show_newstyle.html.erb | 57 ++++ .../_show_sub_document_newstyle.html.erb | 29 ++ .../sub_document_comments/index.html.erb | 33 +- app/views/sub_document_comments/show.html.erb | 310 +++++++++--------- 6 files changed, 275 insertions(+), 169 deletions(-) create mode 100644 app/views/sub_document_comments/_show_newstyle.html.erb create mode 100644 app/views/sub_document_comments/_show_sub_document_newstyle.html.erb diff --git a/app/controllers/sub_document_comments_controller.rb b/app/controllers/sub_document_comments_controller.rb index 4dfa6658f..b2c39b39e 100644 --- a/app/controllers/sub_document_comments_controller.rb +++ b/app/controllers/sub_document_comments_controller.rb @@ -37,14 +37,21 @@ class SubDocumentCommentsController < ApplicationController end def show - @document = SubDocumentComment.find(params[:id]) + if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) + @document = SubDocumentComment.find(params[:id]) + respond_to do |format| + format.html {render :layout => @organization.switch_type ? 'base_sub_domain' : 'base_org'} + end + else + render_403 + end end def index if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) @documents = @subdomain.sub_document_comments.where("parent_id is null").order("created_at desc") respond_to do |format| - format.html {render :layout => 'base_org'} + format.html {render :layout => @organization.switch_type ? 'base_sub_domain' : 'base_org'} end else render_403 diff --git a/app/models/organization.rb b/app/models/organization.rb index 427cd4c10..8f9d290eb 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -22,4 +22,8 @@ class Organization < ActiveRecord::Base OrgSubfield.create(:organization_id => self.id, :name => 'course', :field_type => 'default', :priority => 2) OrgSubfield.create(:organization_id => self.id, :name => 'project', :field_type => 'default', :priority => 3) end + + def switch_type + self.show_mode.to_i == 1 ? true : false + end end diff --git a/app/views/sub_document_comments/_show_newstyle.html.erb b/app/views/sub_document_comments/_show_newstyle.html.erb new file mode 100644 index 000000000..53fbbc6ca --- /dev/null +++ b/app/views/sub_document_comments/_show_newstyle.html.erb @@ -0,0 +1,57 @@ +
+
+
您的位置:首页 >业界动态
+
+
+

北斗(长沙)开放实验室迎湖南省省直机关领导调研参观

+
+

来源:卫星导航仿真与测试开放实验室 发布时间::2016-04-08 浏览:200次

+

2016年3月27日上午,湖南省经信委巡视员钟志慧,湖南省发改委副主任卓群、高技处处长何志明、就业处处长周建龙等领导代表在长沙中电软件园董事长何明、总经理夏利锋的陪同下来北 + 斗开放实验室长沙分实验室调研参观。北斗开放实验室办公室主任明德祥为参观的各位领导详细介绍了北斗开放实验室运行机制及各项共享资源。北斗开放实验室长沙分实验室是由导航仪器湖 + 南省工程研究中心、湖南矩阵电子科技有限公司及中国仪器仪表学会空间仪器分会共同建设。

+ +

北斗开放实验室办公室主任明德祥为湖南省发改委领导介绍

+

为进一步推动北斗资源共享、创新北斗人才培养,更好地服务湖南北斗产业应用发展、培育湖南省卫星导航产业创新体系,2016年,北斗开放实验室联合长沙中电软件园对长沙分实验室进行扩 + 建,扩建后的长沙分实验室立足长沙国家高新区,辐射整个中南地区,成为推动中南地区导航产业的发展的主力军。 + + 今后,北斗开放实验室长沙分实验室将在政府的推动下,以北斗领域相关企事业单位创新需求为导向,以北斗开放实验室名誉主任孙家栋院士、北斗开放实验室专家委员会主任委员谭述森院士 + 以及北斗开放实验室专家库专家为核心,以长沙分实验室共建单位——导航仪器湖南省工程研究中心为依托,借助北斗开放实验室发起单位及各地分实验室资源,建设院士工作站,联合进行创 + 新研究,促进研究成果产业化。 + + 为充分发挥长沙分实验室在释放资源和人才培养方面的作用,北斗开放实验室计划于4月下旬依托扩建后的长沙分实验室举办首届北斗精英实训;并将联合各地分实验室为首批微小课题申请者 + 定期提供专业系统的指导和培训,务实推动北斗开放实验室“LAB-ETS”人才联合培养。具体培训信息请实时关注北斗开放实验室微信号“GnssOpenLab”或官网www.gnssopenlab.org。

+
+
+ +
+

留言板80条留言

+
+ +
+ 发表 +
+
+
+

全部评论

+
+
+ + 与再有10分钟 +

北斗真棒,北斗加油

+ (100) +
+
+
+ + 与再有10分钟 +

北斗真棒,北斗加油

+ (100) +
+
+ +
+
+
+
\ No newline at end of file diff --git a/app/views/sub_document_comments/_show_sub_document_newstyle.html.erb b/app/views/sub_document_comments/_show_sub_document_newstyle.html.erb new file mode 100644 index 000000000..7f72a6965 --- /dev/null +++ b/app/views/sub_document_comments/_show_sub_document_newstyle.html.erb @@ -0,0 +1,29 @@ +
+
+
+
您的位置:首页 > 数据资源 > 仿真数据
+
+
+

最新资讯

+ +
+ 上一页 + 1 + 2 + 3 + ... + 31 + 下一页 +
+
+
+
+
\ No newline at end of file diff --git a/app/views/sub_document_comments/index.html.erb b/app/views/sub_document_comments/index.html.erb index 0c8a99baa..aae1c2050 100644 --- a/app/views/sub_document_comments/index.html.erb +++ b/app/views/sub_document_comments/index.html.erb @@ -1,15 +1,20 @@ -<%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false, init_activity: true) %> -<% end %> - -<%= render :partial => 'new' %> -<% unless @documents.nil? %> - <% @documents.each do |document| %> - - - - - - <%= render :partial => 'sub_document_comments/show_sub_document', :locals => {:document => document, :act => OrgActivity.where("org_act_type='SubDocumentComment'and org_act_id=?", document.id).first, :flag => 0} %> +<% if @organization.show_mode %> + <% unless @documents.nil? %> + <%= render :partial => 'sub_document_comments/show_sub_document_newstyle', :locals => {:documents => @documents} %> <% end %> -<% end %> \ No newline at end of file +<% else %> + <%= content_for(:header_tags) do %> + <%= import_ke(enable_at: false, prettify: false, init_activity: true) %> + <% end %> + <%= render :partial => 'new' %> + <% unless @documents.nil? %> + <% @documents.each do |document| %> + + + + + + <%= render :partial => 'sub_document_comments/show_sub_document', :locals => {:document => document, :act => OrgActivity.where("org_act_type='SubDocumentComment'and org_act_id=?", document.id).first, :flag => 0} %> + <% end %> + <% end %> +<% end %> diff --git a/app/views/sub_document_comments/show.html.erb b/app/views/sub_document_comments/show.html.erb index f1bae6e6a..ad813f19e 100644 --- a/app/views/sub_document_comments/show.html.erb +++ b/app/views/sub_document_comments/show.html.erb @@ -1,75 +1,78 @@ -<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"create_kindeditor",'blog' %> - -
-
-
- <%= link_to image_tag(url_to_avatar(User.find(@document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(@document.creator_id) %> -
-
-
- <%= link_to User.find(@document.creator_id), user_url_in_org(@document.creator_id), :class => "newsBlue mr15" %> - TO  <%= link_to @document.organization.name, organization_path(@document.organization), :class => "newsBlue" %> - | - <% if @document.organization.home_id == @document.id %> - 首页 - <% else %> - 组织文章 - <% end %> -
-
<%= link_to @document.title, org_document_comment_path(:id => @document.id, :organization_id => @document.organization.id) %>
-
- 发布时间:<%= format_activity_day(@document.created_at) %> <%= format_time(@document.created_at, false) %>
- <% unless @document.content.blank? %> -
- <%= @document.content.html_safe %> +<% if @organization.show_mode %> + <%= render :partial => 'sub_document_comments/_show_newstyle', :locals => {:document => @document} %> +<% else %> + <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"create_kindeditor",'blog' %> + +
+
+
+ <%= link_to image_tag(url_to_avatar(User.find(@document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(@document.creator_id) %> +
+
+
+ <%= link_to User.find(@document.creator_id), user_url_in_org(@document.creator_id), :class => "newsBlue mr15" %> + TO  <%= link_to @document.organization.name, organization_path(@document.organization), :class => "newsBlue" %> + | + <% if @document.organization.home_id == @document.id %> + 首页 + <% else %> + 组织文章 + <% end %>
- <% end %> -
- <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @document} %> - <%#= link_to_attachments_course @document, :author => false %> -
- - <% if User.current.admin? || User.current.admin_of_org?(Organization.find(@document.organization_id) || User.current.id == @document.creator_id) %> -
-
    -
  • -
      -
    • - <%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => @document.organization_id, :home_id => @document.id}, :method => "put", :remote => true) do |f| %> - 设为首页 - <% end %> -
    • -
    • - <%= link_to "编辑文章", edit_org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id, :flag => 1), :class => "postOptionLink" %> -
    • -
    • - <%= link_to "删除文章", org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id, :detail_page => 1), :method => 'delete', - :data => {:confirm => l(:text_are_you_sure)}, - :remote => true, :class => 'postOptionLink' %> + <% if User.current.admin? || User.current.admin_of_org?(Organization.find(@document.organization_id) || User.current.id == @document.creator_id) %> +
      +
        +
      • +
          +
        • + <%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => @document.organization_id, :home_id => @document.id}, :method => "put", :remote => true) do |f| %> + 设为首页 + <% end %> +
        • +
        • + <%= link_to "编辑文章", edit_org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id, :flag => 1), :class => "postOptionLink" %> +
        • +
        • + <%= link_to "删除文章", org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id, :detail_page => 1), :method => 'delete', + :data => {:confirm => l(:text_are_you_sure)}, + :remote => true, :class => 'postOptionLink' %> +
        • +
      -
    • -
    -
-
- <% end %> -
-
- <% comments_for_doc = @document.children.reorder("created_at desc") %> - <% count = @document.children.count() %> +
+
+ <% end %> +
+
+ <% comments_for_doc = @document.children.reorder("created_at desc") %> + <% count = @document.children.count() %> -
- <%# if count > 0 %> -
-
回复 - <%= count>0 ? "(#{count})" : "" %> +
+ <%# if count > 0 %> +
+
回复 + <%= count>0 ? "(#{count})" : "" %> <% if @document.creator_id.to_i == User.current.id.to_i %> @@ -77,102 +80,103 @@ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>@document, :user_activity_id=>@document.id,:type=>"activity"}%> <% end %> -
-
-
- <% comments_for_doc.each_with_index do |reply,i| %> - - <% user = User.find(reply.creator_id) %> -
-
- <%= link_to image_tag(url_to_avatar(user), :width => 33,:height => 33), user_url_in_org(user.id) %> -
-
- <%= link_to User.find(reply.creator_id).realname, user_url_in_org(reply.creator_id), :class => "newsBlue mr10 f14" %> -
- <%= reply.content.html_safe unless reply.content.nil? %> -
-
- <%= format_time(reply.created_at) %> - +
+
+
+ <% comments_for_doc.each_with_index do |reply,i| %> + + <% user = User.find(reply.creator_id) %> +
+
+ <%= link_to image_tag(url_to_avatar(user), :width => 33,:height => 33), user_url_in_org(user.id) %> +
+
+ <%= link_to User.find(reply.creator_id).realname, user_url_in_org(reply.creator_id), :class => "newsBlue mr10 f14" %> +
+ <%= reply.content.html_safe unless reply.content.nil? %> +
+
+ <%= format_time(reply.created_at) %> + <% if reply.creator_id.to_i == User.current.id.to_i %> <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <% end %> - +

+
-

-
-
-
- <% end %> -
-
- <%# end %> - <% if User.current.logged?%> -
- -
-
- <%= form_for :org_comment, :url => {:action => 'add_reply_in_doc',:controller => 'org_document_comments', :id => @document.id}, :html => {:multipart => true, :id => 'message_form'} do |f| %> - <%= f.kindeditor :org_content,:width=>'99%',:height => '100px;',:editor_id=>'message_content_editor' %> - <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'message_content_editor.html("");', :class => " grey_btn fr c_white mt10 mr5" %> - <%= link_to l(:button_reply), "javascript:void(0)", :onclick => "message_content_editor.sync();$('#message_form').submit();", :class => "blue_btn fr c_white mt10 mb10", :style => "margin-right: 5px;" %> - <% end %> -
-
+ <% end %>
- <% end %> -
-
+
+ <%# end %> + <% if User.current.logged?%> +
+ +
+
+ <%= form_for :org_comment, :url => {:action => 'add_reply_in_doc',:controller => 'org_document_comments', :id => @document.id}, :html => {:multipart => true, :id => 'message_form'} do |f| %> + <%= f.kindeditor :org_content,:width=>'99%',:height => '100px;',:editor_id=>'message_content_editor' %> + <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'message_content_editor.html("");', :class => " grey_btn fr c_white mt10 mr5" %> + <%= link_to l(:button_reply), "javascript:void(0)", :onclick => "message_content_editor.sync();$('#message_form').submit();", :class => "blue_btn fr c_white mt10 mb10", :style => "margin-right: 5px;" %> + <% end %> +
+
+
+ <% end %> +
+
- \ No newline at end of file + +<% end %>