From b9ff46f8d01a033adcd39367f78a6a1e7abc6440 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 24 Sep 2015 09:40:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=96=E5=AD=90=E7=9A=84=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E4=B8=8E=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 5 + app/views/forums/index.html.erb | 2 +- app/views/memos/_attachments_links.html.erb | 6 +- app/views/memos/edit.html.erb | 100 +++++++++----------- app/views/memos/show.html.erb | 4 +- public/javascripts/new_user.js | 21 +++- public/stylesheets/header.css | 2 +- public/stylesheets/public_new.css | 2 +- 8 files changed, 79 insertions(+), 63 deletions(-) diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index f7de712ca..f3c383573 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -143,7 +143,12 @@ class MemosController < ApplicationController end def edit + @my_topic_count = Memo.where("forum_id = #{@memo.forum_id} and author_id = #{User.current.id} and parent_id is null").count + @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'} + end end def update diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 93dcbc3fa..8f5cb15cc 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -61,7 +61,7 @@ n += 1;//英文,不多说了 } } - if(n >= 160) + if(n >= 160 && event.keyCode != 8) event.returnValue = false; } }); diff --git a/app/views/memos/_attachments_links.html.erb b/app/views/memos/_attachments_links.html.erb index 7da30aad0..15473e6e7 100644 --- a/app/views/memos/_attachments_links.html.erb +++ b/app/views/memos/_attachments_links.html.erb @@ -35,13 +35,13 @@
<% end %> - <% if attachment.is_text? %> - <%= link_to image_tag('magnifier.png'), + <%# if attachment.is_text? %> + <%#= link_to image_tag('magnifier.png'), :controller => 'attachments', :action => 'show', :id => attachment, :filename => attachment.filename%> - <% end %> + <%# end %> diff --git a/app/views/memos/edit.html.erb b/app/views/memos/edit.html.erb index 487d923b5..0efa57ccc 100644 --- a/app/views/memos/edit.html.erb +++ b/app/views/memos/edit.html.erb @@ -1,55 +1,47 @@ - -<% @replying = !@memo.parent.nil? %> -<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %> -- <% if @memo.parent.nil? && @memo.children.first.nil? %> - <%#= f.text_field :subject, :required => true, :size => 96 ,:readonly => false, :maxlength => 50%> - <% else %> - <%#= f.text_field :subject, :required => true, :size => 96 ,:readonly => true, :style => "border: 1px solid gray", :maxlength => 50%> - <% end %> -
- <% if User.current.admin?%> -- <% unless @replying %> - <% if @memo.safe_attribute? 'sticky' %> - <%= f.check_box :sticky %> - <%= label_tag 'memo_sticky', l(:label_board_sticky) %> - <% end %> - <% if @memo.safe_attribute? 'lock' %> - <%= f.check_box :lock %> <%= label_tag 'memo_locked', l(:label_board_locked) %> - <% end %> - <% end %> -
- <% end %> -- <%= f.kindeditor :content, :required => true, :size => 80,:owner_id => @memo.id,:owner_type => 1 %> -
- -
- <%= l(:label_attachment_plural) %>
-
- <%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
-