socialforge/app/views/article_homepages/_article_form.html.erb

53 lines
2.2 KiB
Plaintext

<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false) %>
<%= javascript_include_tag 'homepage' %>
<% end %>
<div>
<input type="text" name="article_homepage[title]" id="message_subject" class="InputBox" style="width: 99.5%;" maxlength="255" onkeyup="regexTopicSubject();" placeholder="请输入标题" value="<%=@article.title %>" />
<p id="subjectmsg"></p>
</div>
<div>
<div class="mt10">
<div id="message_quote" class="wiki" style="width: 92%;word-break: break-all;word-wrap: break-word;margin-left: 40px;"></div>
<%= text_area :quote,:quote,:style => 'display:none' %>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<%= f.kindeditor :content, :editor_id => 'message_content_editor',
:owner_id => @article.nil? ? 0: @article.id,
:owner_type => OwnerTypeHelper::ArticleHomepage,
:width => '100%',
:height => 418,
:minHeight=>500,
:class => 'talk_text fl',
:input_html => { :id => 'message_content',
:class => 'talk_text fl',
:maxlength => 5000 }%>
<div class="cl"></div>
<p id="message_content_span"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
</div>
<div class="mt10">
<input type="checkbox" value="1" id="set_homepage" name="set_homepage"/>
<label for="set_homepage">设为主页</label>
</div>
<div class="cl"></div>
<div class="mt5">
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="submit_article();">确定</a>
<span class="fr mr10 mt3">或</span>
<a href="javascript:void(0);" class="fr mr10 mt3" onclick="reset_article();">取消</a>
</div>
<div class="cl"></div>
</div>
<script>
function reset_article(){
window.location.href = "<%=user_homepages_path(:user_id => User.current.id) %>";
}
$(function() {
<% if is_edit && @article.homepage.article_id == @article.id %>
$("#set_homepage").attr('checked',true);
<% end %>
});
</script>