From bee355e7478585b8c6946a9c600c75648c5cfaa8 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Sat, 14 Nov 2015 09:43:15 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=96=87=E7=AB=A0=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9B=20=E5=8A=A8=E6=80=81=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E4=B8=8D=E5=86=97=E4=BD=99=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/org_document_comments/edit.html.erb | 1 + app/views/org_document_comments/index.html.erb | 1 - app/views/organizations/show.html.erb | 3 ++- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/org_document_comments/edit.html.erb b/app/views/org_document_comments/edit.html.erb index ffb04a4f9..b4f8662a3 100644 --- a/app/views/org_document_comments/edit.html.erb +++ b/app/views/org_document_comments/edit.html.erb @@ -21,6 +21,7 @@
+
<%= kindeditor_tag 'org_document_comment[content]',@org_document.content, :editor_id => 'org_document_description_editor', :height => "150px" %> diff --git a/app/views/org_document_comments/index.html.erb b/app/views/org_document_comments/index.html.erb index a636b2ec8..d53ce543c 100644 --- a/app/views/org_document_comments/index.html.erb +++ b/app/views/org_document_comments/index.html.erb @@ -16,7 +16,6 @@ <% @documents.each do |document| %> diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index e77cc7d09..358b30c7d 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -52,7 +52,7 @@
<% end %> - <% if act.org_act_type == 'OrgDocumentComment' %> + <% if act.org_act_type == 'OrgDocumentComment' && act.org_act_id != @organization.home_id %> -

<%= render :partial => 'organizations/show_org_document', :locals => {:document => document} %> -

<% end %> <% end %> \ No newline at end of file diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index f1c633320..700db0eeb 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -1,4 +1,4 @@ -
+
<%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %> diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index e77cc7d09..55d296cd1 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -30,9 +30,8 @@ init_activity_KindEditor_data(<%= @organization.home_id%>, null, "87%"); }); -

+ <%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id} %> -

<% end %> <% unless @activities.nil? %> @@ -58,9 +57,7 @@ init_activity_KindEditor_data(<%= act.org_act.id%>, null, "87%"); }); -

<%= render :partial => 'show_org_document', :locals => {:document => act.org_act} %> -

<% end %> <% end %>
    diff --git a/db/schema.rb b/db/schema.rb index 1f48eaf02..73924d83c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20151110011003) do +ActiveRecord::Schema.define(:version => 20151112072948) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -960,6 +960,7 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.datetime "created_on" t.integer "comments_count", :default => 0, :null => false t.integer "course_id" + t.integer "sticky", :default => 0 end add_index "news", ["author_id"], :name => "index_news_on_author_id" From e1a88dedbbe20cc0511cec88274da90763d71788 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Sat, 14 Nov 2015 09:58:53 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=20=E9=A6=96=E9=A1=B5=E5=9B=9E=E5=A4=8D=20?= =?UTF-8?q?=E4=BC=9A=E5=8F=98=E6=88=90=E7=BB=84=E7=BB=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_show_org_document.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index 700db0eeb..b9c8c19aa 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -7,7 +7,7 @@
    <%= link_to User.find(document.creator_id), user_path(document.creator.id), :class => "newsBlue mr15" %> TO  <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %> | - <% if defined?(home_id) %> + <% if document.organization.home_id == document.id %> 首页 <% else %> 组织 From f313509d991a170db68c27c4350cbe63b9ae965c Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Sat, 14 Nov 2015 10:01:30 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E7=BB=84=E7=BB=87id=E7=9A=84=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E6=98=BE=E7=A4=BA=E7=BB=84=E7=BB=87=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_org.html.erb | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb index 32ada4729..b1434bb0f 100644 --- a/app/views/layouts/base_org.html.erb +++ b/app/views/layouts/base_org.html.erb @@ -50,13 +50,9 @@ <% end %> <% end%>
    -
    组织id:<%= @organization.id %>
    - <% if User.current.admin_of_org?(@organization) %> - 配置 - <% end %> - -
    - <%= link_to l(:label_org_name)+"#{@organization.name}", organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %> + +
    + <%= link_to @organization.name, organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %> <% if @organization.is_public? %> <%= l(:label_public)%> <% else %> @@ -64,6 +60,19 @@ <% end %>
    + <% if User.current.admin_of_org?(@organization) %> + 配置 + <% end %> + + + + + + + + + +
    <%= link_to '文章', organization_org_document_comments_path(@organization) %> ( From 9bf8f6058faeb2d43af2588d537d6bcf22d59f60 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Sat, 14 Nov 2015 10:25:51 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=92=8C=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organizations/_show_org_document.html.erb | 141 +++++++++--------- 1 file changed, 71 insertions(+), 70 deletions(-) diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index b9c8c19aa..4177c3688 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -1,75 +1,76 @@
    -
    -
    - <%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %> -
    -
    -
    - <%= link_to User.find(document.creator_id), user_path(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 image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %>
    -
    <%= document.title %>
    -
    - 发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
    - <% unless document.content.blank? %> -
    - <%= document.content.html_safe %> -
    - <% end %> - - <% 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), :class => "postOptionLink" %> -
      • -
      • - <%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :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() %> - -
    -
    -
    回复(<%= count %>)
    - <% if count > 3 %> - - <% end %> + <% 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), :class => "postOptionLink" %> +
      • +
      • + <%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :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() %> + +
    +
    +
    回复(<%= count %>)
    + <% if count > 3 %> + + <% end %> +
    +
      <% reply_id = 0 %> <% comments_for_doc.each do |comment| %> <% reply_id += 1 %> -
    • +
    • <%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像"), user_path(comment.creator_id) %>
      @@ -87,12 +88,12 @@
      - <%=link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_path(User.current) %> + <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_path(User.current) %>
      <%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id), :method => "post", :remote => true) do |f| %> - +
      @@ -110,15 +111,15 @@