From 735cdb6a4632d2a7025ca97886dea4dbfc8bd9e0 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 27 Dec 2016 10:41:28 +0800 Subject: [PATCH 01/44] =?UTF-8?q?=E5=85=AC=E5=85=B1=E8=B4=B4=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/index.html.erb | 5 ++++- public/stylesheets/css/public.css | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 9b18070a8..46502db3a 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -130,7 +130,7 @@
-
+
+
+ dsag +
diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css index c2ff5c841..84d9f634b 100644 --- a/public/stylesheets/css/public.css +++ b/public/stylesheets/css/public.css @@ -406,7 +406,8 @@ a.st_down{ display: block; width:8px; float:left; height:13px; background:url(/i .likeNum{color: #7f7f7f} /*创建贴吧样式*/ -.postContainer {width:968px; border:1px solid #dddddd; padding:15px; background-color:#ffffff;} +.postContainer {width:718px; border:1px solid #dddddd; padding:15px; background-color:#ffffff;} +.postContainer_right {width:240px; border:1px solid #dddddd; padding:15px; background-color:#ffffff;} .postBanner {height:30px; width:970px; border-bottom:1px solid #efefef;} .postSort {width:40px; float:left; margin-top:5px; padding-left:5px;} a.sortArrowDown {background:url(../images/post_image_list.png) 0px 0px no-repeat; width:7px; height:9px; float:left; margin-left:5px; margin-top:5px;} From 616e7a2a11c256e54602219aa0f61152b9897644 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 27 Dec 2016 12:12:07 +0800 Subject: [PATCH 02/44] =?UTF-8?q?=E5=85=AC=E5=85=B1=E8=B4=B4=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/forums_controller.rb | 4 +- app/views/forums/_right_bar.html.erb | 41 ++++++++++++++++ app/views/forums/index.html.erb | 4 +- app/views/layouts/base_new_forum.html.erb | 58 +++++++++++++++++++++++ public/stylesheets/css/forum.css | 17 +++++++ public/stylesheets/css/public.css | 2 +- 6 files changed, 122 insertions(+), 4 deletions(-) create mode 100644 app/views/forums/_right_bar.html.erb create mode 100644 app/views/layouts/base_new_forum.html.erb create mode 100644 public/stylesheets/css/forum.css diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index 3332f1207..a5176d25e 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -97,6 +97,8 @@ class ForumsController < ApplicationController def index @offset, @limit = api_offset_and_limit({:limit => 10}) + @forums = Memo.all + if(params[:reorder_complex]) @type="reorder_complex" @str=params[:reorder_complex] @@ -122,7 +124,7 @@ class ForumsController < ApplicationController @forums = @forums_all.offset(@offset).limit(@limit).all #@forums = Forum.all respond_to do |format| - format.html # index.html.erb + format.html{render :layout => 'base_new_forum'} format.js format.json { render json: @forums } end diff --git a/app/views/forums/_right_bar.html.erb b/app/views/forums/_right_bar.html.erb new file mode 100644 index 000000000..c1832b291 --- /dev/null +++ b/app/views/forums/_right_bar.html.erb @@ -0,0 +1,41 @@ +
+
+

问吧

+ 新建贴吧 +
+
+

新手讨论吧

+
    +
  • 798
  • +
  • 回答
  • +
+ +
+
+

新手讨论吧新手讨论吧新手讨论吧

+
    +
  • 798
  • +
  • 回答
  • +
+ +
+
+

新手讨论吧

+
    +
  • 798
  • +
  • 回答
  • +
+ +
+ 点击展开更多 + +
\ No newline at end of file diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 46502db3a..4de6e4fab 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -130,7 +130,7 @@
-
+
- dsag + <%= render :partial => "forums/right_bar" %>
diff --git a/app/views/layouts/base_new_forum.html.erb b/app/views/layouts/base_new_forum.html.erb new file mode 100644 index 000000000..2fd6c2464 --- /dev/null +++ b/app/views/layouts/base_new_forum.html.erb @@ -0,0 +1,58 @@ + + + + + <%= h html_title %> + + + <%= csrf_meta_tag %> + <%= favicon %> + <%= javascript_heads %> + <%= heads_for_theme %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','application','prettify', :media => 'all' %> + <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> + <%= stylesheet_link_tag 'css/common','css/structure','css/public','css/forum' ,:media => 'all'%> + <%= call_hook :view_layouts_base_html_head %> + + <%= yield :header_tags -%> + + + + + +
+ +
+ + <%= render_flash_messages %> + <%= yield %> + <%= call_hook :view_layouts_base_content %> +
+
+ +
+<%= render :partial => 'layouts/footer' %> +
+<% if hidden_unproject_infos %> + <%= render :partial => 'layouts/new_feedback' %> +<% end %> + + + +<%= call_hook :view_layouts_base_body_bottom %> + + + + + +<%= javascript_include_tag('jquery-1.8.3-ui-1.9.2-ujs-2.0.3', 'application', 'jquery.colorbox-min') %> + + diff --git a/public/stylesheets/css/forum.css b/public/stylesheets/css/forum.css new file mode 100644 index 000000000..5e6984aed --- /dev/null +++ b/public/stylesheets/css/forum.css @@ -0,0 +1,17 @@ +/*问吧新增20161223*/ +.wenba-rightbar{ border: 1px solid #ddd;background-color:#fff; width: 238px;} +.wenba-h3-top{ font-size: 14px; color: #666; } +.wenba-rightbar-top{ height: 40px; line-height: 40px; border-bottom:1px solid #ddd; } +.wenba-rightbar-li{ padding:10px 0; border-bottom:1px solid #ddd; color: #666;} +.wenba-rightbar-title{ font-size: 14px; width: 140px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +.right-line{ border-right:1px solid #ddd;} +.wenba-rightbar-ul{ width: 45px; text-align: center;} +.wenba-rightbar-more{ padding:10px 0 ; text-align: center; display: block;} +.wenba-tiwenbox{border: 1px solid #ddd;background-color:#fff; width: 718px; padding:15px;} +.wenba-tiwen-con{ width: 100%; } +input.wenba-tiwen-input{ width:705px; height: 30px; line-height: 30px; padding:0 5px;} +textarea.wenba-tiwen-textarea{ padding:5px;width:705px; height: 150px;} +a.wenba-tiwen-tag{background-color: #E4EFF6;border-bottom: 1px solid #B1D3EB; border-right: 1px solid #B1D3EB;-webkit-text-size-adjust: none; color: #3E6D8E; font-size:12px;line-height: 2.4; padding: 5px 10px;text-decoration: none; white-space: nowrap;} +a:hover.wenba-tiwen-tag,a.wenba-tiwen-tag-active{ background: #3b94d6; color: #fff;border-bottom: 1px solid #2e76ab; border-right: 1px solid #2e76ab;} +.wenba-tagbox li{ float: left; margin:0 5px 5px 0;} +.wenba-tagbox h3{ font-weight: normal; color: #333;} \ No newline at end of file diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css index 84d9f634b..96edb2dd8 100644 --- a/public/stylesheets/css/public.css +++ b/public/stylesheets/css/public.css @@ -407,7 +407,6 @@ a.st_down{ display: block; width:8px; float:left; height:13px; background:url(/i /*创建贴吧样式*/ .postContainer {width:718px; border:1px solid #dddddd; padding:15px; background-color:#ffffff;} -.postContainer_right {width:240px; border:1px solid #dddddd; padding:15px; background-color:#ffffff;} .postBanner {height:30px; width:970px; border-bottom:1px solid #efefef;} .postSort {width:40px; float:left; margin-top:5px; padding-left:5px;} a.sortArrowDown {background:url(../images/post_image_list.png) 0px 0px no-repeat; width:7px; height:9px; float:left; margin-left:5px; margin-top:5px;} @@ -432,6 +431,7 @@ a.sortArrowActiveU {background:url(../images/post_image_list.png) -17px -20px no .postDetailContainer {padding:15px; border:1px solid #dddddd; background-color:#ffffff;} .postlabel {background-color:#edf1f2; color:#888888; padding:2px 5px; float:left; margin-bottom:5px;} .postRightContainer {width:718px; border:1px solid #dddddd; padding:15px; background-color:#ffffff; float:left; margin-bottom:10px;} +.forumRightContainer {width:718px; border:1px solid #dddddd; background-color:#ffffff; float:left; margin-bottom:10px;} .postDetailBanner {height:30px; width:720px; border-bottom:1px solid #efefef;} .postDetailRow {width:720px; border-bottom:1px solid #efefef; padding:15px 0;} .postDetailPortrait {width:50px; height:50px; float:left; margin-right:15px;} From 465b3e7b52c279c73b22749d0e40ff4e256b4085 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 27 Dec 2016 16:09:09 +0800 Subject: [PATCH 03/44] =?UTF-8?q?=E9=97=AE=E5=90=A7=20base=E6=A1=86?= =?UTF-8?q?=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/forums_controller.rb | 14 ++++++-------- app/helpers/application_helper.rb | 10 ++++++++++ app/views/forums/_new.html.erb | 23 +++++++++++++++++++++++ app/views/forums/new.js.erb | 5 +++++ app/views/forums/show.html.erb | 10 +++++++--- app/views/layouts/base_new_forum.html.erb | 2 +- public/stylesheets/css/structure.css | 1 + 7 files changed, 53 insertions(+), 12 deletions(-) create mode 100644 app/views/forums/_new.html.erb create mode 100644 app/views/forums/new.js.erb diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index a5176d25e..ba7b6284d 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -153,24 +153,22 @@ class ForumsController < ApplicationController @order_str = "reorder_time=desc" end @memo = Memo.new(:forum => @forum) - @topic_count = @forum.topics.count + @topic_count = Memo.count @topic_pages = Paginator.new @topic_count, per_page_option, params['page'] - @memos = @forum.topics. - # reorder("#{Memo.table_name}.sticky DESC"). - includes(:last_reply). + @memos = Memo.includes(:last_reply). limit(@topic_pages.per_page). offset(@topic_pages.offset). reorder(order). preload(:author, {:last_reply => :author}). all @memos - @my_topic_count = Memo.where("forum_id = #{@forum.id} and author_id = #{User.current.id} and parent_id is null").count - @my_replies_count = Memo.where("forum_id = #{@forum.id} and author_id = #{User.current.id} and parent_id is not null").count + @my_topic_count = Memo.where("author_id = #{User.current.id} and parent_id is null").count + @my_replies_count = Memo.where("author_id = #{User.current.id} and parent_id is not null").count @errors = params[:errors] respond_to do |format| format.js format.html { - render :layout => 'base_forums' + render :layout => 'base_new_forum' }# show.html.erb format.json { render json: @forum } end @@ -180,9 +178,9 @@ class ForumsController < ApplicationController # GET /forums/new.json def new @forum = Forum.new - respond_to do |format| format.html # new.html.erb + format.js format.json { render json: @forum } end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a2e69c846..02c591c3e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -37,6 +37,16 @@ module ApplicationHelper # super # end + # 公共分页 + def paginator_list objs, objs_count, limit, is_remote + @is_remote = is_remote + @objs_count = objs.count + @obj_pages = Paginator.new @objs_count, limit, params['page'] || 1 + @offset ||= @obj_pages.offset + @objs = paginateHelper @attachments,25 + end + + # 获取竞赛的管理人员 def contest_managers contest contest.contest_members.select{|cm| cm.roles.to_s.include?("ContestManager")} diff --git a/app/views/forums/_new.html.erb b/app/views/forums/_new.html.erb new file mode 100644 index 000000000..e70a63ff2 --- /dev/null +++ b/app/views/forums/_new.html.erb @@ -0,0 +1,23 @@ +
+
+

新建贴吧

+ +
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
+
+ + +
+
+
\ No newline at end of file diff --git a/app/views/forums/new.js.erb b/app/views/forums/new.js.erb new file mode 100644 index 000000000..1bf92b68d --- /dev/null +++ b/app/views/forums/new.js.erb @@ -0,0 +1,5 @@ +var htmlvalue = "<%= escape_javascript(render :partial => 'forums/new') %>"; +pop_box_new(htmlvalue,460,190); + + + diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 61ffb8b10..f5451c95a 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -1,10 +1,9 @@ <%= content_for(:header_tags) do %> <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> - <%= javascript_include_tag 'new_user' %> <% end %> -
+
@@ -53,6 +55,8 @@
+
+ <%= render :partial => "forums/right_bar" %>
\ No newline at end of file diff --git a/app/views/forums/_right_bar.html.erb b/app/views/forums/_right_bar.html.erb index c1832b291..056cbd1ba 100644 --- a/app/views/forums/_right_bar.html.erb +++ b/app/views/forums/_right_bar.html.erb @@ -1,41 +1,21 @@

问吧

- 新建贴吧 -
-
-

新手讨论吧

-
    -
  • 798
  • -
  • 回答
  • -
- -
-
-

新手讨论吧新手讨论吧新手讨论吧

-
    -
  • 798
  • -
  • 回答
  • -
- -
-
-

新手讨论吧

-
    -
  • 798
  • -
  • 回答
  • -
- + <%= link_to "新建贴吧", new_forum_path, :class => "btn-blue btn fr mt5 mr5", :remote => true %>
+ <% @forums.each do |forum| %> +
+

<%= link_to forum.name, forum_path(forum), :class => "" %>

+
    +
  • <%= link_to forum.topic_count, forum_path(forum), :class => "linkGrey5" %>
  • +
  • 回答
  • +
+
    +
  • <%= link_to forum.memo_count, forum_path(forum), :class => "linkGrey5" %>
  • +
  • 帖子
  • +
+
+ <% end %> 点击展开更多
\ No newline at end of file diff --git a/app/views/forums/create.js.erb b/app/views/forums/create.js.erb index ee8172cbd..39bebe20a 100644 --- a/app/views/forums/create.js.erb +++ b/app/views/forums/create.js.erb @@ -1,7 +1,5 @@ <%if @save_flag%> -//$('#new_forum_div').slideToggle();$('#create_btn').parent().slideToggle(); -//$('#reorder_time').click(); - window.location.href= "<%= host_with_protocol %>"+"/forums/" + "<%= @forum.id%>" +$("#forum_right_bar").html('<%= escape_javascript( render :partial => 'forums/right_bar') %>'); <%else%> $("#error").html("<%= @forum.errors.full_messages[0]%>").show(); <%end %> diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 4de6e4fab..5028f4131 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -1,179 +1,164 @@ -<%= javascript_include_tag 'new_user' %> -<%= stylesheet_link_tag 'css/common','css/public'%> - -
-
-
- -
- <%= render :partial => 'post_banner' ,:locals => {:order_type=>@type,:order_str=>@str}%> - - - - - +
+ + -
-
- <%= render :partial => 'forum_list',:locals => {:forums=>@forums}%> -
-
    - <%= pagination_links_full @forums_pages, @forums_count ,:per_page_links => true,:remote =>true,:flag=>true%> -
+ + +
+ <%= link_to "发布新帖", new_forum_path(@forums), :class => "c_white db creatPostIcon bBlue", :remote => true %> + +
-
-
- <%= render :partial => "forums/right_bar" %> -
-
+
+
+ <%= render :partial => 'show_topics',:locals => {:memos=>@memos}%> +
+ + + + + + + + + + +
+ +
+
<%= link_to image_tag(url_to_avatar(User.current),:width=>50,:height => 50,:alt=>'贴吧图像' ), user_path( User.current) %>
+
+
我在贴吧
+ +
+
+ +
发帖
+
+
+
+
+ +
+ <%= render :partial => "forums/right_bar" %> +
+ \ No newline at end of file diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index f5451c95a..94dd52318 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -28,6 +28,9 @@
<% end %>
+ + +
@@ -55,7 +58,25 @@
-
+ +
+
<%= link_to image_tag(url_to_avatar(User.current),:width=>50,:height => 50,:alt=>'贴吧图像' ), user_path( User.current) %>
+
+
我在贴吧
+ +
+
+ +
发帖
+
+
+
+
+ +
<%= render :partial => "forums/right_bar" %>
\ No newline at end of file diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index 287c5f202..afbd6f360 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -42,13 +42,13 @@
-
- <%=l(:field_mail_notification)%> - <%= render :partial => 'users/mail_notifications' %> -
+
- <%=l(:label_preferences)%> + <%= l(:label_preferences) %> <%= render :partial => 'users/preferences' %>
From 880c66c659550bf4d3fa725fccd4c6ecd17a1f95 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 28 Dec 2016 14:40:42 +0800 Subject: [PATCH 08/44] =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E8=B5=84=E6=96=99?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E5=8D=95=E4=BD=8D=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E8=A2=AB=E6=B8=85=E6=A5=9A=E5=90=8E=EF=BC=8C=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/my/account.html.erb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 0b6e51f6b..560c10d8f 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -665,6 +665,12 @@ $('#my_account_form').submit(); } + $("#province").blur(function(){ + if($(this).val() == ""){ + $(this).attr("placeholder","--请搜索您所在的高校(单位)--"); + } + }) + + +
  • + <%= kindeditor_tag 'memo[content]','', :height => 300, :editor_id => 'memo_content' %> + +
  • +
  • + <%= render :partial => 'forums/file_form', :locals => {:container => @memo} %> + + +
  • + + +
    + <%= link_to "取消", forum_path(@forum), :class => "btn fr" %> + 确定 +
    +
    + <% end %> +
    + + \ No newline at end of file diff --git a/app/views/memos/_new.html.erb b/app/views/memos/_new.html.erb new file mode 100644 index 000000000..153e93f2b --- /dev/null +++ b/app/views/memos/_new.html.erb @@ -0,0 +1,33 @@ +
    +
    +
      +
    • + +
    • +
    • + +
    • +
    • + +

      (未选择文件) 您可以上传小于50MB的文件

      +
    • +
    + +
    + + +
    +
    +
    \ No newline at end of file diff --git a/app/views/memos/new.html.erb b/app/views/memos/new.html.erb index 627fce5b4..e62ce056f 100644 --- a/app/views/memos/new.html.erb +++ b/app/views/memos/new.html.erb @@ -1,35 +1,5 @@ -<% @nav_dispaly_home_path_label = 1 - @nav_dispaly_main_course_label = 1 - @nav_dispaly_main_project_label = 1 - @nav_dispaly_main_contest_label = 1 %> -<% @nav_dispaly_forum_label = 1%> - -<%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> -<% end %> + +<%= render :partial => "memos/form" %> -
    - - - - - - - - - - -
    <%= l(:label_projects_community)%><%= l(:label_user_location) %> : - -
    <%= link_to request.host()+"/forums", forums_path %>

    <%=link_to l(:label_home),home_path %> > <%=link_to l(:label_forum), :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name %>

    -
    -

    <%=l(:label_memo_new)%>

    -
    -
    - <%= render :partial => 'memos/topic_form' %> -
    - - -
    +<%= render :partial => "forums/my_count_message" %> \ No newline at end of file diff --git a/app/views/memos/new.js.erb b/app/views/memos/new.js.erb new file mode 100644 index 000000000..e69de29bb diff --git a/public/stylesheets/css/forum.css b/public/stylesheets/css/forum.css index 04549526b..f1e3d4b4b 100644 --- a/public/stylesheets/css/forum.css +++ b/public/stylesheets/css/forum.css @@ -21,4 +21,6 @@ a:hover.wenba-tiwen-tag,a.wenba-tiwen-tag-active{ background: #3b94d6; color: #f .btn-green{background: #60b25e; color: #fff;} .btn-green:hover{background: #51a74f; color: #fff;} .btn-blue{background: #3b94d6; color: #fff;} -.btn-blue:hover{background: #2788d0; color: #fff;} \ No newline at end of file +.btn-blue:hover{background: #2788d0; color: #fff;} + +.banner-big {width:968px; background-color: #ffffff; padding:10px 15px; border:1px solid #dddddd;} \ No newline at end of file From a423909a711ca7c0e5c5ad1c16546edde73e2ee1 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 28 Dec 2016 16:18:47 +0800 Subject: [PATCH 10/44] =?UTF-8?q?=E5=AE=8C=E6=88=90memo=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E9=A1=B5=E9=9D=A2=E5=8F=8A=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 2 +- app/views/forums/show.html.erb | 2 +- app/views/memos/show.html.erb | 50 ++++++++++++++++++++++++++++- public/stylesheets/css/forum.css | 5 ++- 4 files changed, 55 insertions(+), 4 deletions(-) diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 115002ae7..1306ce697 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -137,7 +137,7 @@ class MemosController < ApplicationController respond_to do |format| format.js - format.html {render :layout=> 'base_forums'}#:layout=> 'base_forums', + format.html {render :layout => 'base_new_forum'} format.json { render json: @memo } format.xml { render xml: @memo } end diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 6e98d6fa3..a99506538 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -39,7 +39,7 @@
    <%= link_to "我要提问", new_forum_memo_path(:forum_id => @forum), :class => "c_white db creatPostIcon bBlue" %> - 发布新帖 +
    diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 1066c494d..5b42f1903 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -16,7 +16,7 @@ } } -
    +
    <%= link_to image_tag(url_to_avatar(@memo.author),:width=>50,:height => 50,:alt=>'贴吧图像' ),user_path(@memo.author) %> @@ -96,6 +96,54 @@
    + +
    +
    +
    <%= link_to image_tag(url_to_avatar(@forum.creator),:width=>75,:height => 75,:alt=>'贴吧图像' ),user_path( @forum.creator) %> + +
    +
    + <%= link_to @forum.name, forum_path(@forum), :class => "f16 fontBlue", :style => "word-break: break-all; word-wrap:break-word;white-space:pre-wrap;" %> + <% user_name = @forum.creator.show_name.empty? ? @forum.creator.name : @forum.creator.show_name %> + + +
    +
    +
    <%= @forum.description.html_safe%> + <%if @forum.creator.id == User.current.id%> + + <%= image_tag('signature_edit.png',{:width=>12,:height=>12})%> + + <%end%> +
    +
    +
    + <%= render :partial=>'forums/forum_tag_list',:locals=>{:forum=>@forum}%> +
    + <% if(@forum.creator.id == User.current.id)%> + + 添加标签 + <% end %> +
    +
    + <%if @forum.creator.id == User.current.id%> + + + 编辑贴吧 + 删除贴吧 + + + <% end %> +
    + +
    + <%= link_to "我要提问+".html_safe, new_forum_memo_path(:forum_id => @forum) %> +
    + +
    + \ No newline at end of file From ba08bbf9062c2e29a02da3a2a067886ca2c55ca1 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 29 Dec 2016 13:52:45 +0800 Subject: [PATCH 13/44] =?UTF-8?q?=E8=B4=B4=E5=90=A7=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E7=9A=84=E8=B4=B4=E5=90=A7=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/_right_bar.html.erb | 9 +++--- app/views/forums/index.html.erb | 44 ++++++++++++++++++-------- app/views/layouts/base_forums.html.erb | 2 +- 3 files changed, 35 insertions(+), 20 deletions(-) diff --git a/app/views/forums/_right_bar.html.erb b/app/views/forums/_right_bar.html.erb index 8445364ff..afcdbf6ea 100644 --- a/app/views/forums/_right_bar.html.erb +++ b/app/views/forums/_right_bar.html.erb @@ -1,7 +1,7 @@ - <% @forums.each do |forum| %> -
    -

    <%= link_to forum.name, forum_path(forum), :class => "" %>

    + <% @forums.each_with_index do |forum, i| %> +
    +

    <%= link_to forum.name, forum_path(forum), :class => "" %>

    • <%= link_to forum.topic_count, forum_path(forum), :class => "linkGrey5" %>
    • 回答
    • @@ -11,5 +11,4 @@
    • 帖子
    - <% end %> -
    \ No newline at end of file + <% end %> \ No newline at end of file diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 43b1d20ca..33ec1feb2 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -4,16 +4,10 @@
    - - - - -
    +
    - -
    <%= link_to "发布新帖", new_forum_path(@forums), :class => "c_white db creatPostIcon bBlue", :remote => true %> @@ -21,7 +15,7 @@
    - <%= render :partial => 'show_topics',:locals => {:memos=>@memos}%> + <%= render :partial => 'show_topics',:locals => {:memos => @memos} %>
    @@ -38,8 +32,8 @@
    <%= link_to image_tag(url_to_avatar(User.current),:width=>50,:height => 50,:alt=>'贴吧图像' ), user_path( User.current) %>
    -
    -
    我在贴吧
    +
    +
    我在贴吧
    回答
    @@ -53,17 +47,39 @@
    -
    -
    +

    问吧

    <%= link_to "新建贴吧", new_forum_path, :class => "btn-blue btn fr mt5 mr5", :remote => true %>
    +
    <%= render :partial => "forums/right_bar" %> - 点击展开更多 + <% if @forums.count > 10 %> + 点击展开更多 + <% end %> +
    -
    +
    @@ -23,9 +36,14 @@ <%= get_praise_num(topic)%>
    -
    <%= topic.content.html_safe%> - +
    +
    + <%= topic.content.html_safe%> +
    + + +
    <% author = topic.last_reply.try(:author)%> <% if author%>
    最后回复:<%= author.show_name%>
    diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index a99506538..7a28185bc 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -31,7 +31,7 @@ -
    +
    diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index b8341f023..9778c6b4f 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -74,7 +74,7 @@
    - <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id => user_activity_id, :content => activity.description} %> + <%= render :partial => "users/intro_content", :locals => {:user_activity_id => user_activity_id, :content => activity.description} %>
    diff --git a/app/views/users/_project_issue_detail.html.erb b/app/views/users/_project_issue_detail.html.erb index cb160c3b5..34c131a89 100644 --- a/app/views/users/_project_issue_detail.html.erb +++ b/app/views/users/_project_issue_detail.html.erb @@ -58,7 +58,8 @@ - <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "assigned"},:remote=>'true', :method => :put, :id=>"issue_query_assign_form_#{activity.id}", :class => 'query_form') do %> + <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "assigned"}, + :remote=>'true', :method => :put, :id => "issue_query_assign_form_#{activity.id}", :class => 'query_form') do %>
  •  指派  : 

    From 143e33a891f6715eb8db065cd2711facc412e0fc Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 29 Dec 2016 15:13:55 +0800 Subject: [PATCH 15/44] =?UTF-8?q?=E9=97=AE=E5=90=A7=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/_show_topics.html.erb | 4 ++-- app/views/forums/show.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/forums/_show_topics.html.erb b/app/views/forums/_show_topics.html.erb index a8ef5cdaf..4d81c07f3 100644 --- a/app/views/forums/_show_topics.html.erb +++ b/app/views/forums/_show_topics.html.erb @@ -54,8 +54,8 @@
  • <% end %> -
      - <%= pagination_links_full @topic_pages, @topic_count ,:per_page_links => true, :remote => true, :flag => true %> +
        + <%= pagination_links_full @topic_pages, @topic_count ,:per_page_links => true, :remote => true, :flag => true, :is_new => true %>
      <% else %>

      <%= l(:label_no_data) %>

      diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 7a28185bc..03ad25c43 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -44,7 +44,7 @@
    - <%= render :partial => 'show_topics',:locals => {:memos=>@memos}%> + <%= render :partial => 'show_topics',:locals => {:memos => @memos}%>
    From 9fcd5b48ed2154ec2090a1bd51efa3cb73e7e40e Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 29 Dec 2016 15:57:52 +0800 Subject: [PATCH 16/44] =?UTF-8?q?forum=20index=E9=A1=B5=E9=9D=A2=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E5=8F=8A=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/_right_bar.html.erb | 2 +- app/views/forums/index.html.erb | 8 ++++---- app/views/forums/index.js.erb | 4 ++-- public/stylesheets/css/forum.css | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/forums/_right_bar.html.erb b/app/views/forums/_right_bar.html.erb index afcdbf6ea..1bd6ead7a 100644 --- a/app/views/forums/_right_bar.html.erb +++ b/app/views/forums/_right_bar.html.erb @@ -1,7 +1,7 @@ <% @forums.each_with_index do |forum, i| %>
    -

    <%= link_to forum.name, forum_path(forum), :class => "" %>

    +

    <%= link_to forum.name, forum_path(forum), :class => "" %>

    • <%= link_to forum.topic_count, forum_path(forum), :class => "linkGrey5" %>
    • 回答
    • diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 33ec1feb2..67cee80af 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -1,7 +1,7 @@ <%= content_for(:header_tags) do %> <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> <% end %> - +
      @@ -9,12 +9,12 @@
      - <%= link_to "发布新帖", new_forum_path(@forums), :class => "c_white db creatPostIcon bBlue", :remote => true %> + <%= link_to "发布新帖", new_forum_path(@forum), :class => "c_white db creatPostIcon bBlue", :remote => true %>
      -
      +
      <%= render :partial => 'show_topics',:locals => {:memos => @memos} %>
      @@ -31,7 +31,7 @@
      -
      <%= link_to image_tag(url_to_avatar(User.current),:width=>50,:height => 50,:alt=>'贴吧图像' ), user_path( User.current) %>
      +
      <%= link_to image_tag(url_to_avatar(User.current), :width => 50, :height => 50,:alt=>'贴吧图像' ), user_path( User.current) %>
      我在贴吧
      diff --git a/app/views/forums/index.js.erb b/app/views/forums/index.js.erb index 642c3c20a..6df357975 100644 --- a/app/views/forums/index.js.erb +++ b/app/views/forums/index.js.erb @@ -1,4 +1,4 @@ //$("#postBanner").html("<%#= render :partial => 'post_banner' ,:locals => {:order_type=>@type,:order_str=>@str }%>"); -$("#forum_list").html("<%= escape_javascript(render :partial => 'forum_list',:locals => {:forums=>@forums}) %>"); +$("#forum_list").html("<%= escape_javascript(render :partial => 'show_topics', :locals => {:memos => @memos}) %>"); //这里出现一个问题竟然是单双引号引起的。注意!! -$("#pages").html('<%= pagination_links_full @forums_pages, @forums_count,:per_page_links => false,:remote =>true,:flag=>true%>'); \ No newline at end of file +$("#pages").html('<%= pagination_links_full @topic_pages, @topic_count ,:per_page_links => true, :remote => true, :flag => true, :is_new => true %>'); \ No newline at end of file diff --git a/public/stylesheets/css/forum.css b/public/stylesheets/css/forum.css index cef98199e..dc4d7aa9e 100644 --- a/public/stylesheets/css/forum.css +++ b/public/stylesheets/css/forum.css @@ -3,9 +3,9 @@ .wenba-h3-top{ font-size: 14px; color: #666; } .wenba-rightbar-top{ height: 40px; line-height: 40px; border-bottom:1px solid #ddd; } .wenba-rightbar-li{ padding:10px 0; border-bottom:1px solid #ddd; color: #666;} -.wenba-rightbar-title{ font-size: 14px; width: 140px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +.wenba-rightbar-title{ font-size: 14px; width: 145px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} .right-line{ border-right:1px solid #ddd;} -.wenba-rightbar-ul{ width: 45px; text-align: center;} +.wenba-rightbar-ul{ width: 40px; text-align: center;} .wenba-rightbar-more{ padding:10px 0 ; text-align: center; display: block;} .wenba-tiwenbox{border: 1px solid #ddd;background-color:#fff; width: 718px; padding:15px;} .wenba-tiwen-con{ width: 100%; } From 134bdcebf23a7f60e2d1c2252fa06391bbe066dc Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 29 Dec 2016 16:21:39 +0800 Subject: [PATCH 17/44] =?UTF-8?q?=E9=97=AE=E5=90=A7=20index=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/forums_controller.rb | 4 +- app/views/forums/_my_count_message.html.erb | 12 +++--- app/views/forums/index.html.erb | 47 +++++---------------- 3 files changed, 18 insertions(+), 45 deletions(-) diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index 75153c6de..5a5655ad0 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -121,8 +121,8 @@ class ForumsController < ApplicationController preload(:author, {:last_reply => :author}). all @forums = Forum.includes(:memos).preload(:topics) - @my_topic_count = Memo.where("author_id = #{User.current.id} and parent_id is null").count - @my_replies_count = Memo.where("author_id = #{User.current.id} and parent_id is not null").count + @my_forums_count = Forum.where(:creator_id => User.current.id).count + @my_memos_count = Memo.where(:author_id => User.current.id).count @errors = params[:errors] respond_to do |format| format.js diff --git a/app/views/forums/_my_count_message.html.erb b/app/views/forums/_my_count_message.html.erb index dfb9a5b12..ce0053cd2 100644 --- a/app/views/forums/_my_count_message.html.erb +++ b/app/views/forums/_my_count_message.html.erb @@ -1,16 +1,16 @@
      -
      <%= link_to image_tag(url_to_avatar(User.current), :width => 50, :height => 50, :alt=>'贴吧图像'), user_path(User.current) %>
      -
      -
      我在贴吧
      +
      <%= link_to image_tag(url_to_avatar(User.current), :width => 50, :height => 50,:alt=>'贴吧图像' ), user_path( User.current) %>
      +
      -
      \ No newline at end of file +
      diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 67cee80af..a3d06f78a 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -10,56 +10,29 @@
      <%= link_to "发布新帖", new_forum_path(@forum), :class => "c_white db creatPostIcon bBlue", :remote => true %> -
      <%= render :partial => 'show_topics',:locals => {:memos => @memos} %>
      - - - - - - - - - - -
      -
      -
      <%= link_to image_tag(url_to_avatar(User.current), :width => 50, :height => 50,:alt=>'贴吧图像' ), user_path( User.current) %>
      -
      -
      我在贴吧
      - -
      -
      - -
      发帖
      -
      +<%= render :partial => "my_count_message" %> + +
      +
      +

      问吧

      + <%= link_to "新建贴吧", new_forum_path, :class => "btn-blue btn fr mt5 mr5", :remote => true %>
      -
      -
      - -
      -
      -

      问吧

      - <%= link_to "新建贴吧", new_forum_path, :class => "btn-blue btn fr mt5 mr5", :remote => true %> -
      -
      +
      <%= render :partial => "forums/right_bar" %> <% if @forums.count > 10 %> - 点击展开更多 + 点击展开更多 <% end %> -
      +
      \ No newline at end of file From 3bdf26c63e5bbdeb8057daa93f26acddca883d8e Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 29 Dec 2016 17:07:34 +0800 Subject: [PATCH 20/44] =?UTF-8?q?=E9=97=AE=E5=90=A7=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E5=8A=A0=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/show.html.erb | 2 +- app/views/memos/show.html.erb | 5 ++++- public/stylesheets/css/forum.css | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 042fd2b1b..85ba16263 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -1,7 +1,7 @@ <%= content_for(:header_tags) do %> <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> <% end %> - +
      - -
      diff --git a/app/views/forums/show.js.erb b/app/views/forums/show.js.erb index 48b1474cb..a832b67d9 100644 --- a/app/views/forums/show.js.erb +++ b/app/views/forums/show.js.erb @@ -1 +1 @@ -$("#topics_list").html("<%= escape_javascript(render :partial => 'show_topics',:locals => {:memos=>@memos})%>") +$("#topics_list").html("<%= escape_javascript(render :partial => 'show_topics',:locals => {:memos=>@memos}) %>") diff --git a/app/views/memos/_my_count_message.html.erb b/app/views/memos/_my_count_message.html.erb index e8fab19eb..76269366d 100644 --- a/app/views/memos/_my_count_message.html.erb +++ b/app/views/memos/_my_count_message.html.erb @@ -1,16 +1,46 @@ -
      -
      <%= link_to image_tag(url_to_avatar(User.current), :width => 50, :height => 50,:alt=>'贴吧图像' ), user_path( User.current) %>
      -
      -
      我在贴吧
      -
      - -
      回答
      +
      +
      +
      <%= link_to image_tag(url_to_avatar(@forum.creator),:width=>75,:height => 75,:alt=>'贴吧图像' ), user_path( @forum.creator) %> +
      -
      -
      - -
      发帖
      +
      + <%= link_to @forum.name, forum_path(@forum), :class => "f16 fontBlue", :style => "word-break: break-all; word-wrap:break-word;white-space:pre-wrap;" %> + <% user_name = @forum.creator.show_name.empty? ? @forum.creator.name : @forum.creator.show_name %> + +
      +
      +
      <%= @forum.description.html_safe%> + <%if @forum.creator.id == User.current.id%> + + <%= image_tag('signature_edit.png',{:width=>12,:height=>12}) %> + + <%end%> +
      +
      +
      + <%= render :partial => 'forums/forum_tag_list', :locals => {:forum => @forum} %> +
      + <% if(@forum.creator.id == User.current.id)%> + + 添加标签 + <% end %> +
      +
      + <% if @forum.creator.id == User.current.id %> + + + 编辑贴吧 + 删除贴吧 + + + <% end %>
      -
      -
      + +
      + <%= link_to "我要提问".html_safe, new_forum_memo_path(:forum_id => @forum) %> +
      + +
      \ No newline at end of file diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index de7ce4294..0aaef10fc 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -100,52 +100,8 @@
      -
      -
      -
      <%= link_to image_tag(url_to_avatar(@forum.creator),:width=>75,:height => 75,:alt=>'贴吧图像' ),user_path( @forum.creator) %> - -
      -
      - <%= link_to @forum.name, forum_path(@forum), :class => "f16 fontBlue", :style => "word-break: break-all; word-wrap:break-word;white-space:pre-wrap;" %> - <% user_name = @forum.creator.show_name.empty? ? @forum.creator.name : @forum.creator.show_name %> - - -
      -
      -
      <%= @forum.description.html_safe%> - <%if @forum.creator.id == User.current.id%> - - <%= image_tag('signature_edit.png',{:width=>12,:height=>12})%> - - <%end%> -
      -
      -
      - <%= render :partial=>'forums/forum_tag_list',:locals=>{:forum=>@forum}%> -
      - <% if(@forum.creator.id == User.current.id)%> - + 添加标签 - <% end %> -
      -
      - <%if @forum.creator.id == User.current.id%> - - - 编辑贴吧 - 删除贴吧 - - - <% end %> -
      +<%= render :partial => "memos/my_count_message" %> -
      - <%= link_to "我要提问".html_safe, new_forum_memo_path(:forum_id => @forum) %> -
      - -
      -
      -
      - <%= kindeditor_tag 'memo[content]','',:height=>300,:editor_id=>'memo_content'%> -
      -
      - - <%= render :partial => 'file_form', :locals => {:container => @memo} %> -
      - 确定 -
      - -
      -
      - <% end %> -
      -
      From 16e1f0c701e3e12a109708c129504992a68b08e5 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 30 Dec 2016 10:45:22 +0800 Subject: [PATCH 29/44] =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=A0=8F=E2=80=9C?= =?UTF-8?q?=E5=B8=AE=E5=8A=A9=E4=B8=AD=E5=BF=83=E2=80=9D=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E2=80=9C=E9=97=AE=E5=90=A7=E2=80=9D=EF=BC=8C=E5=B9=B6=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=B8=96=E5=AD=90=E5=B1=95=E7=A4=BA=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E7=9A=84=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/_show_topics.html.erb | 8 ++++---- app/views/forums/new.js.erb | 2 +- app/views/layouts/_logined_header.html.erb | 2 +- public/stylesheets/css/common.css | 3 ++- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/views/forums/_show_topics.html.erb b/app/views/forums/_show_topics.html.erb index 4d81c07f3..0e09754d7 100644 --- a/app/views/forums/_show_topics.html.erb +++ b/app/views/forums/_show_topics.html.erb @@ -5,16 +5,16 @@ $(function(){ showNormalImage('postDetailDes_<%= topic.id %>'); autoUrl('postDetailDes_<%= topic.id %>'); - if($("#intro_content_<%= topic.id %>").height() > 810) { + if($("#intro_content_<%= topic.id %>").height() > 300) { $("#intro_content_show_<%= topic.id %>").show(); } $("#intro_content_show_<%= topic.id %>").click(function(){ - $("#postDetailDes_<%= topic.id %>").toggleClass("maxh360"); + $("#postDetailDes_<%= topic.id %>").toggleClass("maxh300"); $("#intro_content_show_<%= topic.id %>").hide(); $("#intro_content_hide_<%= topic.id %>").show(); }); $("#intro_content_hide_<%= topic.id %>").click(function(){ - $("#postDetailDes_<%= topic.id %>").toggleClass("maxh360"); + $("#postDetailDes_<%= topic.id %>").toggleClass("maxh300"); $("#intro_content_hide_<%= topic.id %>").hide(); $("#intro_content_show_<%= topic.id %>").show(); }); @@ -36,7 +36,7 @@ <%= get_praise_num(topic)%>
      -
      +
      <%= topic.content.html_safe%>
      diff --git a/app/views/forums/new.js.erb b/app/views/forums/new.js.erb index 1bf92b68d..64d5e49c9 100644 --- a/app/views/forums/new.js.erb +++ b/app/views/forums/new.js.erb @@ -1,5 +1,5 @@ var htmlvalue = "<%= escape_javascript(render :partial => 'forums/new') %>"; -pop_box_new(htmlvalue,460,190); +pop_box_new(htmlvalue,560,390); diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 5aef422a0..734923e61 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -23,7 +23,7 @@ <% memo = Memo.where(:id => 1168).first %> <% unless memo.nil? %> <% end %> <% else %> diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css index cdbc543e5..0c5d834cf 100644 --- a/public/stylesheets/css/common.css +++ b/public/stylesheets/css/common.css @@ -365,6 +365,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/ .lh23{line-height: 23px;} /*该高度会写入配置文件*/ .maxh360 {max-height: 810px;} +.maxh300 { max-height: 300px; } .lh18 { line-height: 18px;} /* Font & background Color */ @@ -872,4 +873,4 @@ input.btn{display: inline-block;border:none; padding:0 10px;color: #333;backgrou input.btn-blue{background: #3b94d6; color: #fff; cursor:pointer;} input:hover.btn-blue{background: #2788d0; color: #fff;} input.btn-grey{background: #d9d9d9; color: #656565; cursor:default;} -input.btn-grey:hover{background: #717171; color: #fff; cursor:default;} +input.btn-grey:hover{background: #717171; color: #fff; cursor:default;} From 6acb0b0a5d84f84d561b936b7226924043234b44 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 30 Dec 2016 11:03:30 +0800 Subject: [PATCH 30/44] =?UTF-8?q?=E9=97=AE=E5=90=A7=E7=9A=84=E6=88=91?= =?UTF-8?q?=E8=A6=81=E6=8F=90=E9=97=AE=EF=BC=8C=E9=BB=98=E8=AE=A4=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=85=B6=E8=BF=9B=E5=85=A5=E7=9A=84=E8=B4=B4=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/memos/_form.html.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/memos/_form.html.erb b/app/views/memos/_form.html.erb index 363dd44bd..fbcbd161d 100644 --- a/app/views/memos/_form.html.erb +++ b/app/views/memos/_form.html.erb @@ -41,6 +41,9 @@
      \ No newline at end of file diff --git a/app/views/forums/_form.html.erb b/app/views/forums/_form.html.erb new file mode 100644 index 000000000..ec05d74a4 --- /dev/null +++ b/app/views/forums/_form.html.erb @@ -0,0 +1,61 @@ +
        +
      • + + + +
        + +
      • +
      • + + + +
        + +
      • + +
      +
      + 取消 + 确定 +
      + + \ No newline at end of file diff --git a/app/views/forums/edit.js.erb b/app/views/forums/edit.js.erb new file mode 100644 index 000000000..98fbc95b7 --- /dev/null +++ b/app/views/forums/edit.js.erb @@ -0,0 +1,5 @@ +var htmlvalue = "<%= escape_javascript(render :partial => 'forums/edit') %>"; +pop_box_new(htmlvalue,460,190); + + + diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 17900055e..fcc44196a 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -21,16 +21,20 @@
      -<%= render :partial => "memos/my_count_message" %> +
      + <%= render :partial => "memos/my_count_message" %> -
      -
      -
      -

      推荐问吧

      +
      +
      +
      +

      推荐问吧

      +
      + <%= render :partial => "forums/right_bar" %>
      - <%= render :partial => "forums/right_bar" %>
      + + + <%= javascript_include_tag('jquery-1.8.3-ui-1.9.2-ujs-2.0.3', 'application', 'jquery.colorbox-min') %> From 53cd3a197b08583b671c13b5bbf8772c49476e46 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 30 Dec 2016 13:47:31 +0800 Subject: [PATCH 33/44] =?UTF-8?q?=E9=97=AE=E5=90=A7=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=92=8C=E6=96=B0=E5=BB=BA=E4=BB=A3=E7=A0=81=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/_edit.html.erb | 2 +- app/views/forums/_form.html.erb | 9 +++-- app/views/forums/_new.html.erb | 64 ++------------------------------- 3 files changed, 7 insertions(+), 68 deletions(-) diff --git a/app/views/forums/_edit.html.erb b/app/views/forums/_edit.html.erb index 234c965e2..5e8db19a5 100644 --- a/app/views/forums/_edit.html.erb +++ b/app/views/forums/_edit.html.erb @@ -6,7 +6,7 @@
      <%= labelled_form_for @forum, :html => {:id => "forum_new"} do |f| %> - <%= render :partial => "forums/form" %> + <%= render :partial => "forums/form", :locals => {:f => f} %> <% end %> <%#= form_tag({:controller => 'forums', :action => 'create'}, :method => 'post', :id => "forum_new") do |f| %> diff --git a/app/views/forums/_form.html.erb b/app/views/forums/_form.html.erb index ec05d74a4..35d202a79 100644 --- a/app/views/forums/_form.html.erb +++ b/app/views/forums/_form.html.erb @@ -2,14 +2,14 @@
    • - + <%= f.text_field :name, :label => "", :name => "forum[name]", :id => "forum_name", :class => "issues_calendar_input fl", :style => "width:320px;height:28px;", :placeholder => "请输入贴吧名称,最多50个字符", :onfocus => "$('#forum_name_error_tips').hide();" %> +
    • - - + <%= f.text_area :description, :label => "", :maxlength => "5000", :name => "forum[description]", :id => "forum_desc", :class => "mr15 mb10 fl newupload_textarea", :style => "width:320px;height:100px;", :placeholder => "请输入新建贴吧描述,最多5000个字符", :onfocus => "$('#forum_description_error_tips').hide();" %>
    • @@ -20,6 +20,7 @@ 确定
      + \ No newline at end of file From 70e8e51a5ec140750c9f965622aed1e94d7c7f98 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 30 Dec 2016 13:49:57 +0800 Subject: [PATCH 34/44] =?UTF-8?q?=E9=97=AE=E5=90=A7-=E8=B4=B4=E5=90=A7?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7js=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_new_forum.html.erb | 107 -------------------- app/views/memos/_my_count_message.html.erb | 109 ++++++++++++++++++++- 2 files changed, 108 insertions(+), 108 deletions(-) diff --git a/app/views/layouts/base_new_forum.html.erb b/app/views/layouts/base_new_forum.html.erb index 522c77dbd..5690209e0 100644 --- a/app/views/layouts/base_new_forum.html.erb +++ b/app/views/layouts/base_new_forum.html.erb @@ -53,113 +53,6 @@ tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]} }); - <%= javascript_include_tag('jquery-1.8.3-ui-1.9.2-ujs-2.0.3', 'application', 'jquery.colorbox-min') %> diff --git a/app/views/memos/_my_count_message.html.erb b/app/views/memos/_my_count_message.html.erb index 1875d8ef4..488f857d5 100644 --- a/app/views/memos/_my_count_message.html.erb +++ b/app/views/memos/_my_count_message.html.erb @@ -42,4 +42,111 @@ <%= link_to "我要提问".html_safe, new_forum_memo_path(:forum_id => @forum) %>
      <% end %> -
      \ No newline at end of file +
      + \ No newline at end of file From 912752d6461f4893596c2090b96a6069706df358 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 30 Dec 2016 13:54:42 +0800 Subject: [PATCH 35/44] =?UTF-8?q?=E9=97=AE=E5=90=A7=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99ajax=E5=B1=80=E9=83=A8=E5=88=B7?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/forums_controller.rb | 5 ++--- app/views/forums/_edit.html.erb | 5 +---- app/views/forums/show.html.erb | 4 +++- app/views/forums/update.js.erb | 1 + 4 files changed, 7 insertions(+), 8 deletions(-) create mode 100644 app/views/forums/update.js.erb diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index 35f8ee97b..a47d8ee09 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -245,15 +245,14 @@ class ForumsController < ApplicationController # PUT /forums/1.json def update @forum = Forum.find(params[:id]) - respond_to do |format| if @forum.update_attributes(params[:forum]) - format.js {render :text=> true} + format.js format.html { redirect_to @forum, notice: l(:label_forum_update_succ) } format.json { head :no_content } else flash.now[:error] = "#{l :label_forum_update_fail}: #{@forum.errors.full_messages[0]}" - format.js { render :text=> false} + format.js format.html { render action: "edit" } format.json { render json: @forum.errors, status: :unprocessable_entity } end diff --git a/app/views/forums/_edit.html.erb b/app/views/forums/_edit.html.erb index 5e8db19a5..e19068ef1 100644 --- a/app/views/forums/_edit.html.erb +++ b/app/views/forums/_edit.html.erb @@ -5,12 +5,9 @@
      - <%= labelled_form_for @forum, :html => {:id => "forum_new"} do |f| %> + <%= labelled_form_for @forum, :html => {:id => "forum_new", :remote => true} do |f| %> <%= render :partial => "forums/form", :locals => {:f => f} %> <% end %> - <%#= form_tag({:controller => 'forums', :action => 'create'}, :method => 'post', :id => "forum_new") do |f| %> - - <%# end %>
      diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index fcc44196a..d07a42ed5 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -22,7 +22,9 @@
      - <%= render :partial => "memos/my_count_message" %> +
      + <%= render :partial => "memos/my_count_message" %> +
      diff --git a/app/views/forums/update.js.erb b/app/views/forums/update.js.erb new file mode 100644 index 000000000..721154202 --- /dev/null +++ b/app/views/forums/update.js.erb @@ -0,0 +1 @@ +$("#my_count_message").html('<%= escape_javascript( render :partial => 'memos/my_count_message') %>'); \ No newline at end of file From a8d16a15dee353e799e72fe96c41eb2b17d42bae Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 30 Dec 2016 14:20:01 +0800 Subject: [PATCH 36/44] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E8=B4=B4=E5=90=A7?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/memos/_my_count_message.html.erb | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/views/memos/_my_count_message.html.erb b/app/views/memos/_my_count_message.html.erb index 488f857d5..b4121e66a 100644 --- a/app/views/memos/_my_count_message.html.erb +++ b/app/views/memos/_my_count_message.html.erb @@ -15,20 +15,20 @@ <%= image_tag('signature_edit.png',{:width=>12,:height=>12}) %> - <%end%> -
      -
      -
      - <%= render :partial => 'forums/forum_tag_list', :locals => {:forum => @forum} %> -
      - <% if(@forum.creator.id == User.current.id)%> - + 添加标签 <% end %> -
      -
      +
      + + + + + + + + + + + + <% if @forum.creator.id == User.current.id %> <%= link_to "编辑贴吧", edit_forum_path(@forum), :class => "linkGrey3", :remote => true %> From 58162dab95a31ac50a1e1b2f997dec106b481b18 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 30 Dec 2016 14:53:02 +0800 Subject: [PATCH 37/44] =?UTF-8?q?=E9=97=AE=E5=90=A7=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 2 +- app/views/memos/edit.html.erb | 13 ++++++++++--- app/views/memos/show.html.erb | 3 ++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index a86ee89b4..e45d63fc0 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -148,7 +148,7 @@ class MemosController < ApplicationController @my_replies_count = Memo.where("forum_id = #{@memo.forum_id} and author_id = #{User.current.id} and parent_id is not null").count @replying = false respond_to do |format| - format.html {render :layout=>'base_forums'} + format.html {render :layout => 'base_new_forum'} end end diff --git a/app/views/memos/edit.html.erb b/app/views/memos/edit.html.erb index 6806e0996..ae5d91af5 100644 --- a/app/views/memos/edit.html.erb +++ b/app/views/memos/edit.html.erb @@ -39,10 +39,12 @@ } } -
      -
      编辑帖子
      + -
      + +
      <%= labelled_form_for(@memo, :url => forum_memo_path(@memo.forum_id, @memo),:html=>{:id=>'edit_memo'}) do |f| %> <% end %>
      + +
      + <%= render :partial => "memos/my_count_message" %> +
      + - -
    • - <%= kindeditor_tag 'memo[content]','', :height => 300, :editor_id => 'memo_content' %> - -
    • - -
    • - <%= render :partial => 'forums/file_form', :locals => {:container => @memo} %> - - -
    • -
    -
      -

      请选择分类

      - <% @forums.each do |forum| %> -
    • <%= forum.name %>
    • - <% end %> -
    - -
    - <%= link_to "取消", forum_path(@forum), :class => "btn fr" %> - 确定 -
    -
    - <% end %> +
    +
      +
    • + <%= f.text_field :subject, :no_label => true, :id => "memo_subject", :maxlength => "50", :style => "width:708px", :onblur => "check_memo_name();", :onfocus => "$('#memo_name_error_tips').hide();", :onmouseover => "this.style.borderColor='#d9d9d9'", :class => "wenba-tiwen-input", :placeholder => "请输入标题" %> + + +
    • +
    • + <%= f.kindeditor :content, :editor_id => "memo_content", :height => 300, :no_label => true %> +
    • + +
    • + <%= render :partial => 'forums/file_form', :locals => {:container => @memo} %> +
    • +
    +
      +

      请选择分类

      + <% @forums.each do |forum| %> + + <% end %> +
    + +
    + <%= link_to "取消", forum_path(@forum), :class => "btn fr" %> + 确定 +
    +
    -
    -
    - <%= kindeditor_tag 'memo[content]',@memo.content,:height=>300,:editor_id=>'memo_content'%> -
    -
    - - <%= render :partial => 'forums/file_form', :locals => {:container => @memo} %> - - -
    -
    - <% end %> -
    +<%= labelled_form_for(@memo, :url => forum_memo_path(@memo.forum_id, @memo),:html=>{:id=>'edit_memo'}) do |f| %> + <%= render :partial => "memos/form", :locals => {:f => f} %> +<% end %>
    <%= render :partial => "memos/my_count_message" %> diff --git a/app/views/memos/new.html.erb b/app/views/memos/new.html.erb index 77e56666b..5c6e9bd95 100644 --- a/app/views/memos/new.html.erb +++ b/app/views/memos/new.html.erb @@ -1,5 +1,6 @@ - -<%= render :partial => "memos/form" %> +<%= labelled_form_for(@memo, :url => forum_memos_path(@forum)) do |f| %> + <%= render :partial => "memos/form", :locals => {:f => f} %> +<% end %> <%= render :partial => "forums/my_count_message" %> \ No newline at end of file diff --git a/public/stylesheets/css/forum.css b/public/stylesheets/css/forum.css index 8c90413c5..2c33ec19d 100644 --- a/public/stylesheets/css/forum.css +++ b/public/stylesheets/css/forum.css @@ -11,7 +11,7 @@ .wenba-tiwen-con{ width: 100%; } input.wenba-tiwen-input{ width:705px; height: 30px; line-height: 30px; padding:0 5px;} textarea.wenba-tiwen-textarea{ padding:5px;width:705px; height: 150px;} -a.wenba-tiwen-tag{background-color: #E4EFF6;border-bottom: 1px solid #B1D3EB; border-right: 1px solid #B1D3EB;-webkit-text-size-adjust: none; color: #3E6D8E; font-size:12px;line-height: 2.4; padding: 5px 10px;text-decoration: none; white-space: nowrap;} +a.wenba-tiwen-tag{background-color: #E4EFF6;border-bottom: 1px solid #B1D3EB; border-right: 1px solid #B1D3EB;-webkit-text-size-adjust: none; color: #3E6D8E; font-size:12px;line-height: 2.4; padding: 5px 10px;text-decoration: none; white-space: nowrap;width: 200px;} a:hover.wenba-tiwen-tag,a.wenba-tiwen-tag-active{ background: #3b94d6; color: #fff;border-bottom: 1px solid #2e76ab; border-right: 1px solid #2e76ab;} .wenba-tagbox li{ float: left; margin:0 5px 5px 0;} .wenba-tagbox h3{ font-weight: normal; color: #333;} From f332307caeb893bc5ffbf05c38cf5ca8b4cff3c3 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 30 Dec 2016 16:12:25 +0800 Subject: [PATCH 41/44] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E8=B4=B4=E5=90=A7?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/forums_controller.rb | 13 +++++++++++++ app/views/memos/_my_count_message.html.erb | 19 ++++++++++--------- config/routes.rb | 1 + 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index a47d8ee09..057a056f3 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -271,6 +271,19 @@ class ForumsController < ApplicationController end end + # 更新贴吧描述 + def update_memo_description + @forum = Forum.find(params[:id]) + if @forum.blank? + result = { :result => false } + else + forum_decription = params[:forum][:description] + @forum.update_attributes(:description => forum_decription ) + result = { :result => true } + end + render :json => result + end + def search_forum # @forums = paginateHelper Forum.where("name LIKE '%#{params[:name]}%'") q = "%#{params[:name].strip}%" diff --git a/app/views/memos/_my_count_message.html.erb b/app/views/memos/_my_count_message.html.erb index 36c500cf0..16af682ba 100644 --- a/app/views/memos/_my_count_message.html.erb +++ b/app/views/memos/_my_count_message.html.erb @@ -5,7 +5,8 @@
    <% user_name = @forum.creator.show_name.empty? ? @forum.creator.name : @forum.creator.show_name %> -
    吧主:
    <%= user_name %> +
    吧主:
    + <%= user_name %>
    @@ -13,8 +14,9 @@ <%= link_to @forum.name, forum_path(@forum), :class => "f16 fontBlue", :style => "word-break: break-all; word-wrap:break-word;white-space:pre-wrap;" %>
    -
    <%= @forum.description.html_safe%> - <%if @forum.creator.id == User.current.id%> +
    + <%= h @forum.description.html_safe%> + <% if @forum.creator.id == User.current.id %> <%= image_tag('signature_edit.png',{:width => 12,:height => 12}) %> @@ -49,23 +51,22 @@