parent
c8d07dedf6
commit
b9ff46f8d0
@ -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>
|
Loading…
Reference in new issue