socialforge/app/views/forums/show.html.erb

55 lines
2.3 KiB
Plaintext

<!-- added by fq -->
<div id="add-memo" class='lz' style="<% unless @memo.errors.any?%>display: none;<% end %> padding: 20px;">
<h3>
<%=l(:label_memo_new)%>
</h3>
<% if User.current.logged? %>
<%= labelled_form_for(@memo, :url => create_memo_forum_path(@forum), :html => {:multipart => true} ) do |f| %>
<div class="actions" style="max-width:680px">
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<p>
<%= f.text_field :subject, :required => true, :maxlength => 50%>
</p>
<p style="max-width:680px">
<%= f.kindeditor :content, :required => true %>
</p>
<!--<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor02');</script>-->
<p style="color: #ff0000">
(<%= l(:label_memos_max_length) %>)
</p>
<p class="fl" style="margin-top: 5px;">
<%= l(:label_attachment_plural) %>
<br />
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
</p>
<div class="cl"></div>
<%= f.submit :value => l(:label_memo_create) %>
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-memo").hide(); return false;' %>
</div>
<% end %>
<% end %>
</div>
<!--modified by huang-->
<% #= link_to '发布帖子', new_forum_memo_path(@forum), :class => 'icon icon-add' %>
<span class="contextual-borad">
<%= link_to(
image_tag('edit.png')+l(:label_forum_edit),
{:action => 'edit', :id => @forum},
:method => 'get',
:title => l(:button_edit)
) if @forum.editable_by?(User.current) %>
<%= link_to(
image_tag('delete.png')+'删除讨论区',
{:action => 'destroy', :id => @forum},
:method => :delete,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if @forum.destroyable_by?(User.current) %>
</span>
<span>
<%= link_to l(:label_memo_new_from_forum), new_forum_memo_path(@forum), :class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-memo", "memo_subject"); return false;' if User.current.logged? %>
</span>
<%= render :partial => 'forums/show_topics', :locals => {:memos => @memos} %>