commit
						531b264a8f
					
				| @ -0,0 +1,79 @@ | |||||||
|  | <style type="text/css"> | ||||||
|  |     input.is_public,input.is_public_checkbox{height:12px;} | ||||||
|  |     input.is_public_checkbox{margin-left:4px;margin-right:4px;} | ||||||
|  | </style> | ||||||
|  | <div class="fl"> | ||||||
|  | <span id="attachments_fields" xmlns="http://www.w3.org/1999/html"> | ||||||
|  | <% if defined?(container) && container && container.saved_attachments %> | ||||||
|  |   <% container.attachments.each_with_index do |attachment, i| %> | ||||||
|  |     <span id="attachments_p<%= i %>" class="attachment"> | ||||||
|  |       <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly') %><%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %><span class="ispublic-label"><%= l(:field_is_public) %>:</span> | ||||||
|  |       <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %> | ||||||
|  |       <%= if attachment.id.nil? | ||||||
|  |             #待补充代码 | ||||||
|  |           else | ||||||
|  |             link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') | ||||||
|  |           end | ||||||
|  |       %> | ||||||
|  |       <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> | ||||||
|  | 
 | ||||||
|  |       <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> | ||||||
|  |     </span> | ||||||
|  |     <div class="cl"></div> | ||||||
|  |   <% end %> | ||||||
|  |       <% container.saved_attachments.each_with_index do |attachment, i| %> | ||||||
|  |     <span id="attachments_p<%= i %>" class="attachment"> | ||||||
|  |       <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly') %> | ||||||
|  |       <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %> | ||||||
|  |       <span class="ispublic-label"><%= l(:field_is_public) %>:</span> | ||||||
|  |       <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %> | ||||||
|  |       <%= if attachment.id.nil? | ||||||
|  |             #待补充代码 | ||||||
|  |           else | ||||||
|  |             link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') | ||||||
|  |           end | ||||||
|  |       %> | ||||||
|  |       <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> | ||||||
|  | 
 | ||||||
|  |       <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> | ||||||
|  |     </span> | ||||||
|  |     <div class="cl"></div> | ||||||
|  |   <% end %> | ||||||
|  | <% end %> | ||||||
|  | </span> | ||||||
|  |   <% project = project %> | ||||||
|  |   <div class="cl"></div> | ||||||
|  |   <!--<span class="add_attachment" style="font-weight:normal;">--> | ||||||
|  |     <%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> | ||||||
|  |     <!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%--> | ||||||
|  |     <%#= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file').click();",:onmouseover => 'this.focus()',:class => 'AnnexBtn fl mt3' %> | ||||||
|  |     <a href="javascript:void(0);" onclick="$('#_file').click();" class="AnnexBtn fl mr15">上传附件</a> | ||||||
|  |     <%= file_field_tag 'attachments[dummy][file]', | ||||||
|  |                        :id => '_file', | ||||||
|  |                        :class => 'file_selector', | ||||||
|  |                        :multiple => true, | ||||||
|  |                        :onchange => 'addInputFiles(this);', | ||||||
|  |                        :style => ie8? ? '' : 'display:none', | ||||||
|  |                        :data => { | ||||||
|  |                                :max_file_size => Setting.attachment_max_size.to_i.kilobytes, | ||||||
|  |                                :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), | ||||||
|  |                                :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, | ||||||
|  |                                :upload_path => uploads_path(:format => 'js', :project => project), | ||||||
|  |                                :description_placeholder => l(:label_optional_description), | ||||||
|  |                                :field_is_public => l(:field_is_public), | ||||||
|  |                                :are_you_sure => l(:text_are_you_sure), | ||||||
|  |                                :file_count => l(:label_file_count), | ||||||
|  |                                :delete_all_files => l(:text_are_you_sure_all) | ||||||
|  |                        } %> | ||||||
|  |     <!--<span id="upload_file_count">--> | ||||||
|  |       <!--<%#= l(:label_no_file_uploaded) %>--> | ||||||
|  |     <!--</span>--> | ||||||
|  |     <!--(<%#= l(:label_max_size) %>:--> | ||||||
|  |     <%#= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %> | ||||||
|  |     <!--)--> | ||||||
|  | <!--</span>--> | ||||||
|  | 
 | ||||||
|  |   <% content_for :header_tags do %> | ||||||
|  |       <%= javascript_include_tag 'attachments' %> | ||||||
|  |   <% end %> | ||||||
|  | </div> | ||||||
| @ -1,49 +1,26 @@ | |||||||
| <!-- added by fq --> |  | ||||||
| <!-- %= form_for(@forum) do |f| % --> |  | ||||||
| 
 | 
 | ||||||
| <div id="share_new" style = "width: 500px; margin:0 auto; " > | <div class="homepageContentContainer mb10"> | ||||||
|   <%= labelled_form_for(@forum) do |f|  %> |   <div class="homepageContent"> | ||||||
|   <% if @forum.errors.any? %> |     <div class="pageBanner mt15"><div class="NewsBannerName">编辑贴吧</div></div> | ||||||
|   <!--<div id="error_explanation"> |     <div class="cl"></div> | ||||||
|     <h2><#%= pluralize(@forum.errors.count, "error") %> prohibited this forum from being saved:</h2> |  | ||||||
| 
 | 
 | ||||||
|     <ul> |     <div class="postContainer"> | ||||||
|       <#% @forum.errors.full_messages.each do |msg| %> |       <%= labelled_form_for(@forum) do |f|  %> | ||||||
|       <li><#%= msg %></li> |       <div id="error" style="display: none;color: red;"> | ||||||
|       <#% end %> |  | ||||||
|     </ul> |  | ||||||
|   </div> --> |  | ||||||
|   <% end %> |  | ||||||
|   <div style="width: 120%;"> |  | ||||||
|     <div class="field"> |  | ||||||
|       <%= f.text_field :name, :required => true,  :style => 'width: 100%;', :class => 'create-share', :maxlength => 50%> |  | ||||||
|     </div> |  | ||||||
|     <div> |  | ||||||
|       <% if User.current.logged? && User.current.admin? %> |  | ||||||
|       <% if @forum.safe_attribute? 'sticky' %> |  | ||||||
|           <%= f.check_box :sticky %> |  | ||||||
|           <%= label_tag 'message_sticky', l(:label_board_sticky) %> |  | ||||||
|       <% end %> |  | ||||||
|       <% if @forum.safe_attribute? 'locked' %> |  | ||||||
|           <%= f.check_box :locked %> |  | ||||||
|           <%= label_tag 'message_locked', l(:label_board_locked) %> |  | ||||||
|       <% end %> |  | ||||||
|       <% end %> |  | ||||||
|       </div> |       </div> | ||||||
|       <div> |       <div> | ||||||
|       <p style="max-width:680px"> |         <textarea type="text" id="forum_name" name="forum[name]" class="postCreateInput" placeholder="对应贴吧名称"  ><%= @forum.name.html_safe%></textarea> | ||||||
|         <%= f.kindeditor :description, :required => true,:owner_id => @forum.id,:owner_type => 2 %> |  | ||||||
|       </p> |  | ||||||
|       <!-- <script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script> --> |  | ||||||
| 
 |  | ||||||
|       <p style="color: #ff0000"> |  | ||||||
|         (<%= l(:label_forums_max_length) %>) |  | ||||||
|       </p> |  | ||||||
|       </div> |       </div> | ||||||
|     <div class="actions" style=" padding-top: 10px; float:right"> |       <div class="mt15"> | ||||||
|       <%= submit_tag l(:button_submit) %> |         <textarea type="text" id="forum_desc" name="forum[description]" class="postCreateInput" placeholder="对应贴吧描述" ><%= @forum.description.html_safe%></textarea> | ||||||
|       <%= link_to l(:button_back), forums_path ,:style => 'font-size: 14px; padding: 0px 3px;'  %> |  | ||||||
|       </div> |       </div> | ||||||
|  |       <div class="mt10"> | ||||||
|  |         <div class="fr"><a href="javascript:void(0);" class="submit_btn" onclick="check_and_submit($(this));">确定</a></div> | ||||||
|  |         <div class="fr"><a href="<%= forum_path(@forum)%>" class="linkGrey2 mr10" >取消</a><span class="mr10 fontGrey">或</span></div> | ||||||
|  |         <div class="cl"></div> | ||||||
|       </div> |       </div> | ||||||
|       <% end %> |       <% end %> | ||||||
|  |     </div> | ||||||
|  | 
 | ||||||
|  |   </div> | ||||||
| </div> | </div> | ||||||
| @ -0,0 +1,15 @@ | |||||||
|  | <div><img src="images/post_portrait.jpg" width="75" height="75" alt="贴吧图片" id="forum_image" class="mr10 fl" /> | ||||||
|  |   <a href="javascript:void(0)" class="upImg linkGrey2 fl" onclick="open_upload_diaglog();">上传图片</a> | ||||||
|  |   <div class="cl"></div> | ||||||
|  | </div> | ||||||
|  | <div class="mt15"> | ||||||
|  |   <input type="text" name="postName" class="postCreateInput" placeholder="输入贴吧名称"  /> | ||||||
|  | </div> | ||||||
|  | <div class="mt15"> | ||||||
|  |   <input type="text" name="postName" class="postCreateInput" placeholder="输入贴吧描述" /> | ||||||
|  | </div> | ||||||
|  | <div class="mt10"> | ||||||
|  |   <div class="fr"><a href="javascript:void(0);" class="submit_btn">确定</a></div> | ||||||
|  |   <div class="fr"><a href="javascript:void(0);" class="linkGrey2 mr10" onclick="$('#new_forum_div').slideToggle();$('#create_btn').parent().slideToggle();">取消</a><span class="mr10 fontGrey">或</span></div> | ||||||
|  |   <div class="cl"></div> | ||||||
|  | </div> | ||||||
| @ -1,57 +1,38 @@ | |||||||
| <!-- added by fq --> | 
 | ||||||
| <div class="forums-list"> |  | ||||||
| <% if forums.any? %> | <% if forums.any? %> | ||||||
| 	<% forums.each do |forum| %> | 	<% forums.each do |forum| %> | ||||||
| 	<div class="forums-index"> |           <div class="postRow"> | ||||||
| 		<div class="forums-inex-avatar"> |             <div class="postPortrait"><a href="javascript:void(0);" class="linkGrey2"> | ||||||
|           <%= forum.creator.nil? ? (link_to image_tag(url_to_avatar(forum.creator), :class => "avatar")) : (link_to image_tag(url_to_avatar(forum.creator), :class => "avatar"), user_path(forum.creator)) %> |               <%= link_to image_tag(url_to_avatar(forum.creator),:width=>75,:height => 75 ),user_path( forum.creator) %> | ||||||
|         </div> |  | ||||||
| 		<div class="forums-index-content"> |  | ||||||
|           <table class="content-text-list" style="table-layout: fixed;"> |  | ||||||
|             <tr> |  | ||||||
|               <td valign="top" width="500px" class=" <%= forum.sticky? ? 'sticky' : '' %><%= forum.locked? ? 'locked' : '' %>" style="word-break: break-all;word-wrap: break-word;"> |  | ||||||
|                   <p > |  | ||||||
|                     <%= link_to h(forum.name), forum_path(forum) %> |  | ||||||
|                   </p> |  | ||||||
|               </td> |  | ||||||
|             </tr> |  | ||||||
| 			<tr> |  | ||||||
|               <td style="word-break: break-all;word-wrap: break-word;" class="upload_img"> |  | ||||||
|                 <p> |  | ||||||
|                   <%= textAreailizable forum.description%> |  | ||||||
|                 </p> |  | ||||||
|               </td> |  | ||||||
|             </tr> |  | ||||||
| 			<tr> |  | ||||||
|               <td style="word-break: break-all;word-wrap: break-word;"> |  | ||||||
|                 <p > |  | ||||||
|                   <%= authoring forum.created_at, forum.creator %> |  | ||||||
|                 </p> |  | ||||||
|               </td> |  | ||||||
|             </tr> |  | ||||||
|           </table> |  | ||||||
|         </div> |  | ||||||
| 		<div class="forums-index-count"> |  | ||||||
| 			<table class="forums-count-color"> |  | ||||||
|               <tr class="forums-count-color" align="center"> |  | ||||||
|                 <td> |  | ||||||
|                   <%= link_to (forum.memo_count), forum_path(forum) %> |  | ||||||
|                 </td> |  | ||||||
|                 <td> |  | ||||||
|                   <%= link_to (forum.topic_count), forum_path(forum) %> |  | ||||||
|                 </td> |  | ||||||
|               </tr> |  | ||||||
|               <tr align="center"> |  | ||||||
|                 <td>回答</td> |  | ||||||
|                 <td>帖子</td> |  | ||||||
|               </tr> |  | ||||||
|             </table> |  | ||||||
|             </div> |             </div> | ||||||
|  |             <div class="postWrap"> | ||||||
|  |               <div class="postTitle"> | ||||||
|  |                 <!--<a href="javascript:void(0);" class="f16 linkBlue">新手讨论吧</a>--> | ||||||
|  |                 <%= link_to forum.name, forum_path(forum),:class=>"f16 linkBlue" %> | ||||||
|               </div> |               </div> | ||||||
| 	<% end %> |               <div class="postDes"><%= textAreailizable forum.description%></div> | ||||||
| 	<div class="pagination" style="margin-top: 10px;"> |               <div class="postCreater">创建者:<a href="<%= user_path( forum.creator)%>" class="linkGrey2" target="_blank"><%= forum.creator.name %></a></div> | ||||||
|       <%= pagination_links_full @forums_pages, @forums_count %> |               <div class="postDate">创建时间:<%= format_date(forum.created_at) %></div> | ||||||
|  |             </div> | ||||||
|  |             <div class="postStatics"> | ||||||
|  |               <div> | ||||||
|  |                 <!--<a href="javascript:void(0);" class="linkGrey5 fb">280</a>--> | ||||||
|  |                     <%= link_to ( forum.topic_count), forum_path(forum),:class=>"linkGrey5 fb" %> | ||||||
|  |               </div> | ||||||
|  |               <div>帖子</div> | ||||||
|  |             </div> | ||||||
|  |             <div class="slice"></div> | ||||||
|  |             <div class="postStatics mr20"> | ||||||
|  |               <div> | ||||||
|  |                 <!--<a href="javascript:void(0);" class="linkGrey5 fb">335</a>--> | ||||||
|  |                 <%= link_to (forum.memo_count), forum_path(forum),:class=>"linkGrey5 fb" %> | ||||||
|               </div> |               </div> | ||||||
|  |               <div>回答</div> | ||||||
|  |             </div> | ||||||
|  |             <div class="cl"></div> | ||||||
|  |           </div> | ||||||
|  | 	<% end %> | ||||||
|  | 
 | ||||||
| <% else %> | <% else %> | ||||||
|  |     <%= render :partial => "layouts/no_content" %> | ||||||
| <% end %> | <% end %> | ||||||
| </div> |  | ||||||
| @ -0,0 +1,33 @@ | |||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | <div class="postSort" id="complex"><a href="javascript:void(0);" class="linkGrey2 fl">综合</a> | ||||||
|  |   <% if order_type=='reorder_complex' && order_str == 'desc' %> | ||||||
|  |     <a href="javascript:void(0);" id="reorder_complex" class="sortArrowActiveD"></a> | ||||||
|  |   <% elsif order_type=='reorder_complex' && order_str == 'asc' %> | ||||||
|  |       <a href="javascript:void(0);" id="reorder_complex" class="sortArrowActiveU"></a> | ||||||
|  |   <% else %> | ||||||
|  |       <a href="javascript:void(0);" id="reorder_complex" ></a> | ||||||
|  |   <% end %> | ||||||
|  | </div> | ||||||
|  | <div class="postSort" id="popu"><a href="javascript:void(0);" class="linkGrey2 fl">人气</a> | ||||||
|  |   <% if order_type=='reorder_popu' && order_str == 'desc' %> | ||||||
|  |       <a href="javascript:void(0);" id="reorder_popu" class="sortArrowActiveD"></a> | ||||||
|  |   <% elsif order_type=='reorder_popu' && order_str == 'asc' %> | ||||||
|  |       <a href="javascript:void(0);" id="reorder_popu" class="sortArrowActiveU"></a> | ||||||
|  |   <% else %> | ||||||
|  |       <a href="javascript:void(0);" id="reorder_popu" ></a> | ||||||
|  |   <% end %> | ||||||
|  | </div> | ||||||
|  | <div class="postSort" id="time"><a href="javascript:void(0);" class="linkGrey2 fl">时间</a> | ||||||
|  |   <% if order_type=='reorder_time' && order_str == 'desc' %> | ||||||
|  |       <a href="javascript:void(0);" id="reorder_time" class="sortArrowActiveD"></a> | ||||||
|  |   <% elsif order_type=='reorder_time' && order_str == 'asc' %> | ||||||
|  |       <a href="javascript:void(0);" id="reorder_time" class="sortArrowActiveU"></a> | ||||||
|  |   <% else %> | ||||||
|  |       <a href="javascript:void(0);" id="reorder_time" ></a> | ||||||
|  |   <% end %> | ||||||
|  | </div> | ||||||
|  | <div class="creatPost"> | ||||||
|  |   <a href="javascript:void(0);" id="create_btn" class="c_white db creatPostIcon bBlue" | ||||||
|  |      onclick="$('#error').hide();clear_form();$('#new_forum_div').slideToggle();$(this).parent().slideToggle();">新建贴吧</a></div> | ||||||
|  | <div class="cl"></div> | ||||||
| @ -1,47 +1,31 @@ | |||||||
| <script>$(function(){$("img").removeAttr("alt");});</script> |  | ||||||
| <div class="borad-topic-count">共有 <%=link_to @forum.memos.count %> 个贴子</div> |  | ||||||
| <div style="padding-top: 10px"> | <div style="padding-top: 10px"> | ||||||
|   <% if memos.any? %> |   <% if memos.any? %> | ||||||
|       <% memos.each do |topic| %> |       <% memos.each do |topic| %> | ||||||
|           <table class="content-text-list"> |           <div class="postDetailRow"> | ||||||
|             <tr> |             <div class="postDetailPortrait"> | ||||||
|               <td colspan="2" valign="top" style="width: 50px;"> |               <!--<img src="images/homepageImage.jpg" width="50" height="50" alt="贴吧图片" /></a>--> | ||||||
|                 <%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) if topic.author%> |               <%= link_to image_tag(url_to_avatar(topic.author), :width => 50,:height => 50,:alt => '贴吧图片'), user_path(topic.author) if topic.author%> | ||||||
|               </td> |             </div> | ||||||
|               <td> |             <div class="postDetailWrap"> | ||||||
|                 <table width="630px" border="0"> |               <div class="postDetailTitle"><a href="<%= forum_memo_path(topic.forum, topic) %>" class="f14 linkGrey4 fb"><%=topic.subject%></a></div> | ||||||
|                   <tr> |               <div class="postDetailDes"><%= topic.content.html_safe%> | ||||||
|                     <td valign="top" width="500px" class="<%= topic.sticky ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject), forum_memo_path(topic.forum, topic) %></td> |                 <!--<a href="javascript:void(0);" class="linkBlue2 underline ml8">显示全部</a>--> | ||||||
|                     <td align="right" rowspan="3"> |               </div> | ||||||
|                       <table class="borad-count"> |  | ||||||
|                         <tr> |  | ||||||
|                           <td align="center" class="borad-count-digit"><%= link_to (topic.replies_count), forum_memo_path(topic.forum, topic) %></td> |  | ||||||
|                         </tr> |  | ||||||
|                         <tr> |  | ||||||
|                           <td align="center">回答</td> |  | ||||||
|                         </tr> |  | ||||||
|                       </table></td> |  | ||||||
|                   </tr> |  | ||||||
|                   <tr> |  | ||||||
|                     <td colspan="2" ><span class="font_description">		</span></td> |  | ||||||
|                   </tr> |  | ||||||
|                   <tr> |  | ||||||
|                     <td align="left" colspan="2" ><span class="font_lighter"><%= authoring topic.created_at, topic.author %> |  | ||||||
|                       <span class="font_description2"> |  | ||||||
|               <% author = topic.last_reply.try(:author)%> |               <% author = topic.last_reply.try(:author)%> | ||||||
|               <% if author%> |               <% if author%> | ||||||
|                             最后回复:<%=link_to_user author %> |                   <div class="postDetailCreater">最后回复:<a href="<%= user_path(author) %>" class="linkBlue2" target="_blank"><%= author.name%></a></div> | ||||||
|  |                   <div class="postDetailDate"><%= format_date(topic.last_reply.created_at)%></div> | ||||||
|               <% end%> |               <% end%> | ||||||
|                       </span> | 
 | ||||||
|                         <br /> |             </div> | ||||||
|                     </span></td> |             <div class="postDetailReply"> | ||||||
|                   </tr> |               <a href="<%= forum_memo_path(topic.forum, topic)%>" class="postReplyIcon mr5" target="_blank"></a> | ||||||
|                 </table> |               <%= link_to (topic.replies_count), forum_memo_path(topic.forum, topic),:target =>'_blank',:class=>'linkGrey2' %> | ||||||
|               </td> |             </div> | ||||||
|             </tr> |             <div class="cl"></div> | ||||||
|           </table> |           </div> | ||||||
|       <% end %> |       <% end %> | ||||||
|       <div class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></div> | 
 | ||||||
|   <% else %> |   <% else %> | ||||||
|       <p class="nodata"><%= l(:label_no_data) %></p> |       <p class="nodata"><%= l(:label_no_data) %></p> | ||||||
|   <% end %> |   <% end %> | ||||||
|  | |||||||
| @ -0,0 +1,6 @@ | |||||||
|  | <%if @save_flag%> | ||||||
|  | $('#new_forum_div').slideToggle();$('#create_btn').parent().slideToggle(); | ||||||
|  | $('#reorder_time').click(); | ||||||
|  | <%else%> | ||||||
|  |  $("#error").html("<%= @forum.errors.full_messages[0]%>").show(); | ||||||
|  | <%end %> | ||||||
| @ -0,0 +1,2 @@ | |||||||
|  | $("#forum_tag_list").html("<%= escape_javascript( render :partial=>'forum_tag_list',:locals=>{:forum=>@forum}) %>"); | ||||||
|  | $('#add_tag01').hide(); | ||||||
| @ -1,4 +1,72 @@ | |||||||
| <!-- added by fq --> | 
 | ||||||
| <h1>编辑讨论区</h1> | <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'new_user' %> | ||||||
| <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg'  %> | <script> | ||||||
|  |     $(function(){ | ||||||
|  |         document.getElementById('forum_name').onkeydown = function() | ||||||
|  |         { | ||||||
|  |             var n = 0; | ||||||
|  |             var str = this.value; | ||||||
|  |             for (i = 0; i < str.length; i++) { | ||||||
|  |                 var leg = str.charCodeAt(i);//ASCII码 | ||||||
|  |                 if (leg > 255) { | ||||||
|  |                     n += 2; | ||||||
|  |                 } else { | ||||||
|  |                     n += 1; | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |             if(n >= 160) | ||||||
|  |                 event.returnValue = false; | ||||||
|  |         } | ||||||
|  |     }) | ||||||
|  | 
 | ||||||
|  |     function check_and_submit(doc){ | ||||||
|  |         $("#error").html('').hide(); | ||||||
|  |         check_forum_name(); | ||||||
|  |         if(check_pass == false){ | ||||||
|  |             return; | ||||||
|  |         } | ||||||
|  |         if(  $("textarea[name='forum[name]']").val().trim() == "" &&  $("textarea[name='forum[description]']").val().trim()  != "" ){ | ||||||
|  |             $("#error").html("名称不能为空").show(); | ||||||
|  |             return; | ||||||
|  |         } else if( $("textarea[name='forum[description]']").val().trim()  == "" && $("textarea[name='forum[name]']").val().trim() != "" ){ | ||||||
|  |             $("#error").html("描述不能为空").show(); | ||||||
|  |             return; | ||||||
|  |         }else if($("textarea[name='forum[description]']").val().trim()  == "" && $("textarea[name='forum[name]']").val().trim() == ""){ | ||||||
|  |             $("#error").html("名称和描述不能为空").show(); | ||||||
|  |             return; | ||||||
|  |         } | ||||||
|  |         else{ | ||||||
|  |             doc.parent().parent().parent().submit(); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |     var check_pass = true; | ||||||
|  |     function check_forum_name(){ | ||||||
|  |         check_pass = true; | ||||||
|  |         name = $("textarea[name='forum[name]']").val().trim(); | ||||||
|  |         if(name == '<%= @forum.name%>'){ | ||||||
|  |             return; | ||||||
|  |         } | ||||||
|  |         if( name != ""){ | ||||||
|  |             $.get( | ||||||
|  |                     '<%= check_forum_name_forums_path %>', | ||||||
|  |                     {"forum_name":name}, | ||||||
|  |                     function(data){ | ||||||
|  | 
 | ||||||
|  |                         if( data == 'true'){ | ||||||
|  |                             $("#error").html("贴吧名称已经存在").show(); | ||||||
|  |                             check_pass = false; | ||||||
|  |                         } | ||||||
|  |                     } | ||||||
|  |             ); | ||||||
|  |         }else{ | ||||||
|  |             check_pass = false; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | </script> | ||||||
| <%= render 'form_edit_mode' %> | <%= render 'form_edit_mode' %> | ||||||
|  | <script> | ||||||
|  |     var textarea = document.getElementById('forum_name'); | ||||||
|  |     autoTextarea(textarea); | ||||||
|  |     var textarea1 = document.getElementById('forum_desc'); | ||||||
|  |     autoTextarea(textarea1); | ||||||
|  | </script> | ||||||
| @ -1,48 +1,170 @@ | |||||||
| <% @nav_dispaly_home_path_label = 1 | <%= javascript_include_tag 'new_user' %> | ||||||
|    @nav_dispaly_main_course_label = 1 | <%= stylesheet_link_tag 'public'%> | ||||||
|    @nav_dispaly_main_project_label = 1 | <script> | ||||||
|    @nav_dispaly_main_contest_label = 1 %> |   function add_class(id){ | ||||||
| <!-- added by fq --> |       if($("#"+id).hasClass("sortArrowActiveD")){ | ||||||
| <div class="top-content"> |           $("#"+id).removeClass("sortArrowActiveD"); | ||||||
| 	<table width="940px"> |           $("#"+id).addClass("sortArrowActiveU"); | ||||||
| 		<tr> |           $.ajax({ | ||||||
| 			<td class="info_font" style="width: 220px; color: #15bccf">公共贴吧 </td> |               type: 'GET', | ||||||
| 			<td class="location-list"> |               url: '<%= forums_path %>' + '.js?' + id + '=asc&page='+<%= @forums_pages.page%> | ||||||
|               <strong> | 
 | ||||||
|                 <%= l(:label_user_location) %> : |           }); | ||||||
|               </strong> |       }else if($("#"+id).hasClass("sortArrowActiveU")){ | ||||||
|             </td> |           $("#"+id).removeClass("sortArrowActiveU"); | ||||||
| 			<td rowspan="2">  |           $("#"+id).addClass("sortArrowActiveD"); | ||||||
|                 <% if User.current.logged? %> |           $.ajax({ | ||||||
|                 <%= link_to( l(:label_forum_new), new_forum_path, :class => 'icon icon-add') %> |               type: 'GET', | ||||||
|  |               url: '<%= forums_path %>' + '.js?' + id + '=desc&page='+<%= @forums_pages.page%> | ||||||
|  | 
 | ||||||
|  |           }); | ||||||
|  |       }else{ | ||||||
|  |           $("#"+id).addClass("sortArrowActiveD"); | ||||||
|  |           $.ajax({ | ||||||
|  |               type: 'GET', | ||||||
|  |               url: '<%= forums_path %>' + '.js?' + id + '=desc&page='+<%= @forums_pages.page%> | ||||||
|  | 
 | ||||||
|  |           }); | ||||||
|  |       } | ||||||
|  |   } | ||||||
|  |   $(function() { | ||||||
|  |       $("#complex").click(function(){ | ||||||
|  |           $("#reorder_popu").removeClass("sortArrowActiveU"); | ||||||
|  |           $("#reorder_popu").removeClass("sortArrowActiveD"); | ||||||
|  |           $("#reorder_time").removeClass("sortArrowActiveD"); | ||||||
|  |           $("#reorder_time").removeClass("sortArrowActiveU"); | ||||||
|  |           add_class("reorder_complex"); | ||||||
|  |       }); | ||||||
|  |       $("#popu").click(function () { | ||||||
|  |           $("#reorder_complex").removeClass("sortArrowActiveD"); | ||||||
|  |           $("#reorder_complex").removeClass("sortArrowActiveU"); | ||||||
|  |           $("#reorder_time").removeClass("sortArrowActiveD"); | ||||||
|  |           $("#reorder_time").removeClass("sortArrowActiveU"); | ||||||
|  |           add_class("reorder_popu"); | ||||||
|  |       }); | ||||||
|  |       $("#time").click(function () { | ||||||
|  |           $("#reorder_complex").removeClass("sortArrowActiveD"); | ||||||
|  |           $("#reorder_complex").removeClass("sortArrowActiveU"); | ||||||
|  |           $("#reorder_popu").removeClass("sortArrowActiveU"); | ||||||
|  |           $("#reorder_popu").removeClass("sortArrowActiveD"); | ||||||
|  |           add_class("reorder_time"); | ||||||
|  |       }); | ||||||
|  |       document.getElementById('forum_name').onkeydown = function() | ||||||
|  |       { | ||||||
|  |           var n = 0; | ||||||
|  |           var str = this.value; | ||||||
|  |           for (i = 0; i < str.length; i++) { | ||||||
|  |               var leg = str.charCodeAt(i);//ASCII码 | ||||||
|  |               if (leg > 255) {//大于255的都是中文 | ||||||
|  |                   n += 2;//如果是中文就是2个字节 | ||||||
|  |               } else { | ||||||
|  |                   n += 1;//英文,不多说了 | ||||||
|  |               } | ||||||
|  |           } | ||||||
|  |           if(n >= 160 && event.keyCode != 8) | ||||||
|  |               event.returnValue = false; | ||||||
|  |       } | ||||||
|  |   }); | ||||||
|  |   function check_and_submit(doc){ | ||||||
|  |       $("#error").html('').hide(); | ||||||
|  |       check_forum_name(); | ||||||
|  |     if(  $("textarea[name='forum[name]']").val().trim() == "" &&  $("textarea[name='forum[description]']").val().trim()  != "" ){ | ||||||
|  |         $("#error").html("名称不能为空").show(); | ||||||
|  |         return; | ||||||
|  |     } else if( $("textarea[name='forum[description]']").val().trim()  == "" && $("textarea[name='forum[name]']").val().trim() != "" ){ | ||||||
|  |         $("#error").html("描述不能为空").show(); | ||||||
|  |         return; | ||||||
|  |     }else if($("textarea[name='forum[description]']").val().trim()  == "" && $("textarea[name='forum[name]']").val().trim() == ""){ | ||||||
|  |         $("#error").html("名称和描述不能为空").show(); | ||||||
|  |         return; | ||||||
|  |     } | ||||||
|  |     else{ | ||||||
|  |         doc.parent().parent().submit(); | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   var check_pass = true; | ||||||
|  |   function check_forum_name(){ | ||||||
|  |       check_pass = true; | ||||||
|  |       name = $("textarea[name='forum[name]']").val().trim(); | ||||||
|  |       if( name != ""){ | ||||||
|  |           $.get( | ||||||
|  |               '<%= check_forum_name_forums_path %>', | ||||||
|  |               {"forum_name":name}, | ||||||
|  |              function(data){ | ||||||
|  | 
 | ||||||
|  |                  if( data == 'true'){ | ||||||
|  |                      $("#error").html("贴吧名称已经存在").show(); | ||||||
|  |                      check_pass = false; | ||||||
|  |                  } | ||||||
|  |               } | ||||||
|  |           ); | ||||||
|  |       }else{ | ||||||
|  |           check_pass = false; | ||||||
|  |       } | ||||||
|  |       if(check_pass == false){ | ||||||
|  |           return ; | ||||||
|  |       } | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   function hideError(){ | ||||||
|  |       $("#error").html("").hide(); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   function create_cancle(){ | ||||||
|  |       $('#error').hide(); | ||||||
|  |       $('#new_forum_div').slideToggle(); | ||||||
|  |       $('#create_btn').parent().slideToggle(); | ||||||
|  |       clear_form(); | ||||||
|  |   } | ||||||
|  |   function clear_form(){ | ||||||
|  |       $("#forum_name").val(''); | ||||||
|  |       $("#forum_desc").val(''); | ||||||
|  |   } | ||||||
|  | </script> | ||||||
|  | 
 | ||||||
|  | <div class="homepageContentContainer mb10"> | ||||||
|  |     <div class="homepageContent"> | ||||||
|  |     <div class="postContainer"> | ||||||
|  |      <div id="new_forum_div" class="mb5" style="display: none"> | ||||||
|  |        <div class="red fl mb10" id="error" style="display: none">error</div> | ||||||
|  |        <%= form_tag({:controller => 'forums',:action=>'create',:format=>'js'},:method => 'post',:remote=>'true') do  |f| %> | ||||||
|  |        <div class="mt15"> | ||||||
|  |          <textarea type="text" name="forum[name]"  id="forum_name"  class="postCreateInput" onfocus="hideError();" onblur="check_forum_name();" placeholder="输入贴吧名称"  ></textarea> | ||||||
|  |          <script> | ||||||
|  |            var textarea = document.getElementById('forum_name'); | ||||||
|  |                autoTextarea(textarea); | ||||||
|  |          </script> | ||||||
|  |        </div> | ||||||
|  |        <div class="mt15"> | ||||||
|  |          <textarea type="text" name="forum[description]" id="forum_desc" class="postCreateInput"  placeholder="输入贴吧描述"></textarea> | ||||||
|  |          <script> | ||||||
|  |              var textarea1 = document.getElementById('forum_desc'); | ||||||
|  |              autoTextarea(textarea1); | ||||||
|  |          </script> | ||||||
|  |        </div> | ||||||
|  |        <div class="mt10"> | ||||||
|  |          <div class="fr"><a href="javascript:void(0);" class="submit_btn" onclick="check_and_submit($(this));">确定</a></div> | ||||||
|  |          <div class="fr"><a href="javascript:void(0);" class="linkGrey2 mr10" onclick="create_cancle();">取消</a><span class="mr10 fontGrey">或</span></div> | ||||||
|  |          <div class="cl"></div> | ||||||
|  |        </div> | ||||||
|        <% end %> |        <% end %> | ||||||
| 			</td> |      </div> | ||||||
| 			<td rowspan="2" width="250px" > |     <div class="postBanner" id="postBanner"> | ||||||
| 				<div class="top-content-search"> |       <%= render :partial => 'post_banner' ,:locals => {:order_type=>@type,:order_str=>@str}%> | ||||||
| 					<%#= form_tag(:controller => 'forums', :action => "search_forum", :method => :get) do %> |       <!--<div class="postSort" id="complex"><a href="javascript:void(0);" class="linkGrey2 fl">综合</a><a href="javascript:void(0);" id="reorder_complex" class="sortArrowActiveD"></a></div>--> | ||||||
| 					<%#= text_field_tag 'name', params[:name], :size => 20 %> |       <!--<div class="postSort" id="popu"><a href="javascript:void(0);" class="linkGrey2 fl">人气</a><a href="javascript:void(0)"  id="reorder_popu" ></a></div>--> | ||||||
| 					<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %> |       <!--<div class="postSort" id="time"><a href="javascript:void(0);" class="linkGrey2 fl">时间</a><a href="javascript:void(0)"  id="reorder_time" ></a></div>--> | ||||||
| 					<%# end %> |       <!--<div class="creatPost"><a href="javascript:void(0);" id="create_btn" class="c_white db creatPostIcon bBlue" onclick="$('#error').hide();$('#new_forum_div').slideToggle();$(this).parent().slideToggle();">新建贴吧</a></div>--> | ||||||
| 				</div> |       <!--<div class="cl"></div>--> | ||||||
| 			</td> |  | ||||||
| 		</tr> |  | ||||||
| 		<tr> |  | ||||||
| 			<td style="padding-left: 8px"> |  | ||||||
|               <a> |  | ||||||
|                 <%= link_to request.host()+"/forums", forums_path %> |  | ||||||
|               </a> |  | ||||||
|             </td> |  | ||||||
| 			<td > |  | ||||||
|               <%= link_to l(:field_homepage), home_path %> > |  | ||||||
|               <%= link_to "公共贴吧", forums_path %> |  | ||||||
|             </td> |  | ||||||
| 		</tr> |  | ||||||
| 	</table> |  | ||||||
| </div> |  | ||||||
| <% if @forums.size > 0 %> |  | ||||||
|   <%= render :partial => 'forums/forum_list', :locals => {:forums => @forums} %> |  | ||||||
| <% else %> |  | ||||||
|   <%= render :partial => "layouts/no_content" %> |  | ||||||
| <% end %> |  | ||||||
| 
 | 
 | ||||||
| <%html_title l(:label_forum)%> |      </div> | ||||||
|  |       <div id="forum_list"> | ||||||
|  |       <%= render :partial => 'forum_list',:locals => {:forums=>@forums}%> | ||||||
|  |       </div> | ||||||
|  |       <ul class="wlist fr" id="pages" style="margin-top: 10px;"> | ||||||
|  |         <%= pagination_links_full @forums_pages, @forums_count ,:per_page_links => true,:remote =>true,:flag=>true%> | ||||||
|  |       </ul> | ||||||
|  |     <div class="cl"></div> | ||||||
|  |     </div> | ||||||
|  |     </div> | ||||||
|  | </div> | ||||||
|  | |||||||
| @ -0,0 +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}) %>"); | ||||||
|  | //这里出现一个问题竟然是单双引号引起的。注意!! | ||||||
|  | $("#pages").html('<%= pagination_links_full @forums_pages, @forums_count,:per_page_links => false,:remote =>true,:flag=>true%>'); | ||||||
| @ -0,0 +1,2 @@ | |||||||
|  | $("#topics_list").html("<%= escape_javascript(render :partial => 'show_topics',:locals => {:memos=>@memos})%>") | ||||||
|  | $("#pages").html('<%= pagination_links_full @topic_pages, @topic_count,:per_page_links => false,:remote =>true%>'); | ||||||
| @ -0,0 +1,71 @@ | |||||||
|  | <div class="mt10 fl" > | ||||||
|  |   <% for attachment in attachments %> | ||||||
|  |       <!--<p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">--> | ||||||
|  |           <!--<div style="max-width:55%;white-space: nowrap; overflow: hidden;  text-overflow: ellipsis;float: left;">--> | ||||||
|  |       <!--<span title="<%#= attachment.filename%>" id = "attachment_">--> | ||||||
|  |         <% if options[:length] %> | ||||||
|  |             <span class="pic_files fl "></span> | ||||||
|  |           <%= link_to_short_attachment attachment, :class => 'fl FilesName02', :download => true,:length => options[:length] -%> | ||||||
|  |          <a class="fl FilesName02"> (<%= number_to_human_size attachment.filesize , :precision => 0 %>)</a> | ||||||
|  |           <% if options[:deletable] %> | ||||||
|  |               <%#= link_to image_tag('delete.png'), attachment_path(attachment), | ||||||
|  |                           :data => {:confirm => l(:text_are_you_sure)}, | ||||||
|  |                           :method => :delete, | ||||||
|  |                           :class => 'delete', | ||||||
|  |                           #:remote => true, | ||||||
|  |                           #:id => "attachments_" + attachment.id.to_s, | ||||||
|  |                           :title => l(:button_delete) %> | ||||||
|  |               <span class="pic_del fl ">  <a href="<%=attachment_path(attachment) %>" onclick="confirm(<%=l(:text_are_you_sure) %>)" data-method="delete">   </a></span> | ||||||
|  |           <% end %> | ||||||
|  |             <div class="cl"></div> | ||||||
|  |         <% else %> | ||||||
|  |             <span class="pic_files fl "></span> | ||||||
|  |           <%= link_to_short_attachment attachment, :class => 'fl FilesName02', :download => true, :length => 32 -%> | ||||||
|  |           <a  href="javascript:void(0);" class="fl FilesName02"> (<%= number_to_human_size attachment.filesize , :precision => 0 %>)</a> | ||||||
|  |           <% if options[:deletable] %> | ||||||
|  |               <%#= link_to image_tag('delete.png'), attachment_path(attachment), | ||||||
|  |                           :data => {:confirm => l(:text_are_you_sure)}, | ||||||
|  |                           :method => :delete, | ||||||
|  |                           :class => 'delete', | ||||||
|  |                           #:remote => true, | ||||||
|  |                           #:id => "attachments_" + attachment.id.to_s, | ||||||
|  |                           :title => l(:button_delete) %> | ||||||
|  |               <a href="<%=attachment_path(attachment) %>" onclick="confirm(<%=l(:text_are_you_sure) %>)" data-method="delete">  <span class="pic_del fl "></span> </a> | ||||||
|  |           <% end %> | ||||||
|  |             <div class="cl"></div> | ||||||
|  |         <% end %> | ||||||
|  | 
 | ||||||
|  |       <%# if attachment.is_text? %> | ||||||
|  |           <%#= link_to image_tag('magnifier.png'), | ||||||
|  |                       :controller => 'attachments', | ||||||
|  |                       :action => 'show', | ||||||
|  |                       :id => attachment, | ||||||
|  |                       :filename => attachment.filename%> | ||||||
|  |       <%# end %> | ||||||
|  |       <!--<span title="<%#= attachment.description%>">--> | ||||||
|  |     <!--<%#= h(truncate(" - #{attachment.description}", length: options[:length] ? options[:length]:15, omission: '...')) unless attachment.description.blank? %>--> | ||||||
|  |   <!--</span>--> | ||||||
|  | 
 | ||||||
|  |       <!--<%# if options[:wrap] %>--> | ||||||
|  |           <!--<br/>--> | ||||||
|  |           <!-- --> | ||||||
|  |       <!--<%# end %>--> | ||||||
|  |       <!--<%# if options[:author] %>--> | ||||||
|  |     <!--<span class="author" title="<%#= attachment.author%>">--> | ||||||
|  |       <%#= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author) %> | ||||||
|  |       <!--<%#= format_time(attachment.created_on) %>--> | ||||||
|  |     <!--</span>--> | ||||||
|  |       <!--<%# end %>--> | ||||||
|  |       <!--</p>--> | ||||||
|  |   <% end %> | ||||||
|  |   <% if defined?(thumbnails) && thumbnails %> | ||||||
|  |       <% images = attachments.select(&:thumbnailable?) %> | ||||||
|  |       <% if images.any? %> | ||||||
|  |           <div class="pro_pic mb10" width="100" height="73"> | ||||||
|  |             <% images.each do |attachment| %> | ||||||
|  |                 <div><%= thumbnail_tag(attachment) %></div> | ||||||
|  |             <% end %> | ||||||
|  |           </div> | ||||||
|  |       <% end %> | ||||||
|  |   <% end %> | ||||||
|  | </div> | ||||||
| @ -0,0 +1,36 @@ | |||||||
|  | <!-- get_praise_num(obj,1)函数中 1代表返回顶得次数 0返回踩的次数  --> | ||||||
|  |    <% if User.current.logged? %> | ||||||
|  |     <% if horizontal %> | ||||||
|  |         <!-- 横排 --> | ||||||
|  |         <div id="praise_tread_<%= obj.id %>" style="float:right;"> | ||||||
|  |           <% @is_valuate = is_praise_or_tread(obj,user_id)%> | ||||||
|  |           <% if @is_valuate.size > 0 %> <!-- 评价过   1代表赞 0代表踩 --> | ||||||
|  |               <% @flag = @is_valuate.first.praise_or_tread %> | ||||||
|  |               <% if  @flag == 1 %> <!-- 顶过  --><!-- modified by bai --> | ||||||
|  |                   <a href="javascript:void(0);" class="linkGrey2 postLikeIcon" title="<%= l(:label_issue_praise_over)%>" >   <%= get_praise_num(obj)%></a> | ||||||
|  |               <% end %> | ||||||
|  |           <% else %> | ||||||
|  |               <% if user_id == obj.author_id %> | ||||||
|  | 
 | ||||||
|  |                         <!--<%#= image_tag "/images/praise_tread/praise_true.png" , weight:"22px", height:"22px",:title => l(:label_issue_not_praise_over) %>--> | ||||||
|  |                         <a href="javascript:void(0);" class="linkGrey2 postLikeIcon" title="<%= l(:label_issue_not_praise_over)%>" >   <%= get_praise_num(obj)%></a> | ||||||
|  | 
 | ||||||
|  |               <% else %> | ||||||
|  |                   <!-- 积分少于2分不能踩帖 --> | ||||||
|  |                   <%# if OptionNumber.get_user_option_number(user_id).nil? || OptionNumber.get_user_option_number(user_id).total_score < 2 %> | ||||||
|  | 
 | ||||||
|  |                             <%#= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)), | ||||||
|  |                                            :controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %> | ||||||
|  |                       <a href="<%= praise_tread_praise_plus_path({:obj_id=>obj.id,:obj_type=>obj.class,:horizontal => horizontal })%>" data-remote="true" class="linkGrey2 postLikeIcon" title="<%=  l(:label_issue_praise)%>" >   <%= get_praise_num(obj)%></a> | ||||||
|  |                   <!--<%# else %>--> | ||||||
|  | 
 | ||||||
|  |                             <!--<%#= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),--> | ||||||
|  |                                             <!--:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %>--> | ||||||
|  |                       <!--<a href="javascript:void(0);" class="linkGrey2 postLikeIcon" title="<%#=  l(:label_issue_praise)%>" target="_blank">   <%#= get_praise_num(obj)%></a>--> | ||||||
|  | 
 | ||||||
|  |                   <!--<%# end %>--> | ||||||
|  |               <% end %> | ||||||
|  |           <% end %> | ||||||
|  |         </div> | ||||||
|  |     <% end %> | ||||||
|  |    <% end %> | ||||||
| @ -1,55 +1,47 @@ | |||||||
| <!-- <h1>New memo</h1> --> | <%= javascript_include_tag 'new_user'%> | ||||||
| <% @replying = !@memo.parent.nil? %> | <script> | ||||||
| <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg'  %> |   $(function(){ | ||||||
| <h3><%=l(:label_memo_edit)%></h3> |       limitStrsize('memo_subject',50); | ||||||
| <%= labelled_form_for(@memo, :url => forum_memo_path(@memo.forum_id, @memo)) do |f|  %> |       limitStrsize('memo_content',5000); | ||||||
|   <% if @memo.errors.any? %> |   }); | ||||||
|     <div id="error_explanation"> |   function check_and_submit(){ | ||||||
|       <h2> |       if($("textarea[name='memo[subject]']").val().trim() != "" && $("textarea[name='memo[content]']").val().trim() != "" ){ | ||||||
|         <%= pluralize(@memo.errors.count, "error") %> |           $("#edit_memo").submit(); | ||||||
|         prohibited this memo from being saved: |       }else if($("textarea[name='memo[subject]']").val().trim() == "" && $("textarea[name='memo[content]']").val().trim() != "" ){ | ||||||
|       </h2> |           $("#error").html("主题不能为空").show(); | ||||||
|       <ul> |       }else if($("textarea[name='memo[subject]']").val().trim() != "" && $("textarea[name='memo[content]']").val().trim() == ""){ | ||||||
|       <% @memo.errors.full_messages.each do |msg| %> |           $("#error").html("内容不能为空").show(); | ||||||
|         <li> |       } | ||||||
|           <%= msg %> |   } | ||||||
|         </li> | </script> | ||||||
|       <% end %> | <div class="homepageRightBanner mt15"> | ||||||
|       </ul> |   <div class="NewsBannerName">编辑帖子</div> | ||||||
|  | </div> | ||||||
|  | <div class="postRightContainer" style="margin-top: 15px"> | ||||||
|  |   <%= labelled_form_for(@memo, :url => forum_memo_path(@memo.forum_id, @memo),:html=>{:id=>'edit_memo'}) do |f|  %> | ||||||
|  |       <div id="error" style="display: none"> | ||||||
|  | 
 | ||||||
|       </div> |       </div> | ||||||
|   <% end %> |   <div> | ||||||
|   <div class="actions"> |     <textarea type="text" id="memo_subject" name="memo[subject]" class="postDetailInput" placeholder="对应帖子标题"  ><%= @memo.subject%></textarea> | ||||||
|     <p> |     <script> | ||||||
|       <% if @memo.parent.nil? && @memo.children.first.nil? %> |       var ta = document.getElementById('memo_subject') | ||||||
|          <%#= f.text_field :subject, :required => true, :size => 96 ,:readonly => false,  :maxlength => 50%> |       autoTextarea(ta) | ||||||
|       <% else %> |     </script> | ||||||
|           <%#= f.text_field :subject, :required => true, :size => 96 ,:readonly => true, :style => "border: 1px solid gray", :maxlength => 50%> |   </div> | ||||||
|       <% end %> |   <div class="mt15"> | ||||||
|       </p> |     <textarea type="text" id="memo_content" name="memo[content]" class="postDetailInput" placeholder="对应帖子内容" ><%= @memo.content.html_safe%></textarea> | ||||||
|     <% if User.current.admin?%> |     <script> | ||||||
|         <p> |         var ta1 = document.getElementById('memo_content') | ||||||
|           <% unless @replying %> |         autoTextarea(ta1) | ||||||
|               <% if @memo.safe_attribute? 'sticky' %> |     </script> | ||||||
|                   <%= f.check_box :sticky %> |   </div> | ||||||
|                   <%= label_tag 'memo_sticky', l(:label_board_sticky) %> |   <div class="mt10"> | ||||||
|               <% end %> |     <!--<a href="javascript:void(0);" class="AnnexBtn fl mt3">对应附件名称</a>--> | ||||||
|               <% if @memo.safe_attribute? 'lock' %> |     <%= render :partial => 'forums/file_form', :locals => {:container => @memo} %> | ||||||
|                   <%= f.check_box :lock %> <%= label_tag 'memo_locked', l(:label_board_locked) %> |     <div class="fr"><a href="javascript:void(0);" class="submit_btn" onclick="check_and_submit();">确定</a></div> | ||||||
|               <% end %> |     <div class="fr"><a href="<%= forum_memo_path(@memo.forum,@memo)%>" class="linkGrey2 mr10">取消</a><span class="mr10 fontGrey">或</span></div> | ||||||
|           <% end %> |  | ||||||
|         </p> |  | ||||||
|     <% end %> |  | ||||||
|     <p> |  | ||||||
|       <%= f.kindeditor :content, :required => true, :size => 80,:owner_id => @memo.id,:owner_type => 1 %> |  | ||||||
|     </p> |  | ||||||
|    <!-- <script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script> --> |  | ||||||
|     <p style="float: left;margin-top: 5px;"> |  | ||||||
|       <%= l(:label_attachment_plural) %> |  | ||||||
|       <br /> |  | ||||||
|       <%= render :partial => 'attachments/form', :locals => {:container => @memo} %> |  | ||||||
|     </p> |  | ||||||
|     <br/> |  | ||||||
|     <div class="cl"></div> |     <div class="cl"></div> | ||||||
|     <%= f.submit :value => l(:button_change) %>  <%= link_to l(:button_back), back_url ,:class => "button-canel",:style => "color: #ffffff;"%> |  | ||||||
|   </div> |   </div> | ||||||
| <% end %> |   <% end %> | ||||||
|  | </div> | ||||||
| @ -1,4 +1,9 @@ | |||||||
| 
 | <% if @obj_type == 'Memo'%> | ||||||
| $('#praise_tread_<%= @obj.id %>').html('<%= j( |     $('#praise_tread_<%= @obj.id %>').html('<%= j( | ||||||
| render :partial => "/praise_tread/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal} |         render :partial => "/memos/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal} | ||||||
| )%>'); |     )%>'); | ||||||
|  | <% else %> | ||||||
|  |     $('#praise_tread_<%= @obj.id %>').html('<%= j( | ||||||
|  |     render :partial => "/praise_tread/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal} | ||||||
|  |     )%>'); | ||||||
|  | <% end %> | ||||||
|  | |||||||
| After Width: | Height: | Size: 2.3 KiB | 
| @ -0,0 +1,101 @@ | |||||||
|  | $(function(){ | ||||||
|  |     KindEditor.ready(function(K){ | ||||||
|  |         $("a[nhname='reply_btn']").live('click',function(){ | ||||||
|  |             var params = {}; | ||||||
|  |             params.kindutil = K; | ||||||
|  |             params.container = $(this).parent().parent('div'); | ||||||
|  |             params.div_form = $("div[nhname='div_form']",params.container); | ||||||
|  |             params.form = $("form",params.div_form); | ||||||
|  |             params.textarea = $("textarea[name='memo[content]']",params.div_form); | ||||||
|  |             //params.textarea.prev('div').css("height","60px");
 | ||||||
|  |             params.contentmsg = $("p[nhname='contentmsg']",params.div_form); | ||||||
|  |             params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form); | ||||||
|  |             params.cancel_btn = $("a[nhname='cancel_btn']",params.div_form); | ||||||
|  |             params.submit_btn = $("a[nhname='submit_btn']",params.div_form); | ||||||
|  |             params.height = 30; | ||||||
|  |             if(params.textarea.data('init') == undefined){ | ||||||
|  |                 params.editor = init_editor(params); | ||||||
|  |                 init_form(params); | ||||||
|  |                 params.cancel_btn.click(function(){ | ||||||
|  |                     nh_reset_form(params); | ||||||
|  |                     toggleAndSettingWordsVal(params.div_form, params.textarea); | ||||||
|  |                 }); | ||||||
|  |                 params.submit_btn.click(function(){ | ||||||
|  |                     params.form.submit(); | ||||||
|  |                 }); | ||||||
|  |                 params.textarea.data('init',1); | ||||||
|  |             } | ||||||
|  |             params.cancel_btn.click(); | ||||||
|  |             setTimeout(function(){ | ||||||
|  |                 if(!params.div_form.is(':hidden')){ | ||||||
|  |                     params.textarea.show(); | ||||||
|  |                     params.textarea.focus(); | ||||||
|  |                     params.textarea.hide(); | ||||||
|  |                 } | ||||||
|  |             },300); | ||||||
|  |         }); | ||||||
|  | 
 | ||||||
|  |         $("a[nhname='sub_reply_btn']").live('click',function(){ | ||||||
|  |             var params = {}; | ||||||
|  |             params.kindutil = K; | ||||||
|  |             params.container = $(this).parent().parent('div'); | ||||||
|  |             params.div_form = $("div[nhname='sub_div_form']",params.container); | ||||||
|  |             params.form = $("form",params.div_form); | ||||||
|  |             params.textarea = $("textarea[name='user_notes']",params.div_form); | ||||||
|  |             //params.textarea.prev('div').css("height","60px");
 | ||||||
|  |             params.contentmsg = $("p[nhname='sub_contentmsg']",params.div_form); | ||||||
|  |             params.toolbar_container = $("div[nhname='sub_toolbar_container']",params.div_form); | ||||||
|  |             params.cancel_btn = $("a[nhname='sub_cancel_btn']",params.div_form); | ||||||
|  |             params.submit_btn = $("a[nhname='sub_submit_btn']",params.div_form); | ||||||
|  |             params.height = 30; | ||||||
|  |             if(params.textarea.data('init') == undefined){ | ||||||
|  |                 params.editor = init_editor(params); | ||||||
|  |                 init_form(params); | ||||||
|  |                 params.cancel_btn.click(function(){ | ||||||
|  |                     nh_reset_form(params); | ||||||
|  |                     toggleAndSettingWordsVal(params.div_form, params.textarea); | ||||||
|  |                 }); | ||||||
|  |                 params.submit_btn.click(function(){ | ||||||
|  |                     params.form.submit(); | ||||||
|  |                 }); | ||||||
|  |                 params.textarea.data('init',1); | ||||||
|  |             } | ||||||
|  |             params.cancel_btn.click(); | ||||||
|  |             setTimeout(function(){ | ||||||
|  |                 if(!params.div_form.is(':hidden')){ | ||||||
|  |                     params.textarea.show(); | ||||||
|  |                     params.textarea.focus(); | ||||||
|  |                     params.textarea.hide(); | ||||||
|  |                 } | ||||||
|  |             },300); | ||||||
|  |         }); | ||||||
|  | 
 | ||||||
|  |         $("div[nhname='new_message']").each(function(){ | ||||||
|  |             var params = {}; | ||||||
|  |             params.kindutil = K; | ||||||
|  |             params.div_form = $(this); | ||||||
|  |             params.form = $("form",params.div_form); | ||||||
|  |             if(params.form==undefined || params.form.length==0){ | ||||||
|  |                 return; | ||||||
|  |             } | ||||||
|  |             params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form); | ||||||
|  |             params.contentmsg = $("p[nhname='contentmsg']",params.div_form); | ||||||
|  |             params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form); | ||||||
|  |             params.cancel_btn = $("#new_message_cancel_btn"); | ||||||
|  |             params.submit_btn = $("#new_message_submit_btn"); | ||||||
|  |             params.height = 30; | ||||||
|  |             if(params.textarea.data('init') == undefined){ | ||||||
|  |                 params.editor = init_editor(params); | ||||||
|  |                 init_form(params); | ||||||
|  |                 params.cancel_btn.click(function(){ | ||||||
|  |                     nh_reset_form(params); | ||||||
|  |                 }); | ||||||
|  |                 params.submit_btn.click(function(){ | ||||||
|  |                     params.form.submit(); | ||||||
|  |                 }); | ||||||
|  |                 params.textarea.data('init',1); | ||||||
|  |                 $(this).show(); | ||||||
|  |             } | ||||||
|  |         }); | ||||||
|  |     }); | ||||||
|  | }); | ||||||
| After Width: | Height: | Size: 11 KiB | 
| After Width: | Height: | Size: 4.8 KiB | 
					Loading…
					
					
				
		Reference in new issue