socialforge/app/views/memos/edit.html.erb

55 lines
2.0 KiB
Plaintext
Raw Normal View History

2013-11-26 16:32:08 +08:00
<!-- <h1>New memo</h1> -->
<% @replying = !@memo.parent.nil? %>
2013-11-26 16:32:08 +08:00
<h3><%=l(:label_memo_edit)%></h3>
<%= labelled_form_for(@memo, :url => forum_memo_path(@memo.forum_id, @memo)) do |f| %>
<% if @memo.errors.any? %>
<div id="error_explanation">
<h2>
<%= pluralize(@memo.errors.count, "error") %>
prohibited this memo from being saved:
</h2>
2013-11-26 16:32:08 +08:00
<ul>
<% @memo.errors.full_messages.each do |msg| %>
<li>
<%= msg %>
</li>
2013-11-26 16:32:08 +08:00
<% end %>
</ul>
</div>
<% end %>
<div class="actions">
<p>
<% 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 %>
</p>
<% if User.current.admin?%>
<p>
<% 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 %>
</p>
<% end %>
<p>
<%= f.text_area :content, :required => true, :size => 80, id: 'editor01' %>
</p>
2013-11-26 16:32:08 +08:00
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script>
<p>
<%= l(:label_attachment_plural) %>
<br />
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
</p>
2013-11-26 16:32:08 +08:00
<br/>
<%= f.submit :value => l(:button_change) %>&nbsp;&nbsp;<%= link_to l(:button_back), back_url ,:class => "button-canel",:style => "color: #ffffff;"%>
2013-11-26 16:32:08 +08:00
</div>
<% end %>