项目新闻添加编辑器:显示页面、列表页面新样式显示
This commit is contained in:
parent
e0ea57b213
commit
95f3d89afa
|
@ -1,26 +1,35 @@
|
|||
<li class="ml45">
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||
<li>
|
||||
<label><span class="c_red">*</span> <%= l(:field_title) %> :</label>
|
||||
<input type="text" name="news[title]" class="hwork_input" id="news_title" size="60" onkeyup="regexTitle();" maxlength="60" placeholder="60个字符以内" value="<%= is_new ? '' : @news.title %>">
|
||||
<input type="text" name="news[title]" class="hwork_input_news" id="news_title" width="576px" onkeyup="regexTitle();" maxlength="60" placeholder="60个字符以内" value="<%= is_new ? '' : @news.title %>">
|
||||
<p id="title_notice_span" class="ml55"></p>
|
||||
</li>
|
||||
<li class="ml45">
|
||||
<li class="mb10">
|
||||
<% if is_new %>
|
||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
<label class="fl" ><span class="c_red">*</span> <%= l(:field_description) %> :</label>
|
||||
<textarea id="news_description" name="news[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="hwork_text fl" onkeyup="regexDescription();" maxlength="6000"><%= is_new ? '' : @news.description %></textarea>
|
||||
<%= f.kindeditor :description,:width=>'91%',:editor_id=>'project_news_description_editor' %>
|
||||
<p id="description_notice_span" class="ml55"></p>
|
||||
<% else %>
|
||||
<label class="fl" ><span class="c_red">*</span> <%= l(:field_description) %> :</label>
|
||||
<%= f.kindeditor :description,:width=>'91%', :editor_id=>'project_news_description_editor', :owner_id => @news.id, :owner_type => OwnerTypeHelper::NEWS %>
|
||||
<p id="description_notice_span" class="ml55"></p>
|
||||
<% end %>
|
||||
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45">
|
||||
<label class="fl"> <%= l(:label_attachment_plural) %> :</label>
|
||||
<li>
|
||||
<label class="fl mt5"> <%= l(:label_attachment_plural) %> :</label>
|
||||
<%= render :partial => 'attachments/new_form', :locals => {:container => @news} %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" ml90" >
|
||||
<li class="ml40" >
|
||||
<% if is_new %>
|
||||
<%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fl c_white' %>
|
||||
<%= link_to l(:button_create), "javascript:void(0)", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fl c_white' %>
|
||||
<%= link_to l(:button_cancel), project_news_index_path(@project), :onclick => '$("#add-news").hide()', :class => 'blue_btn grey_btn fl c_white' %>
|
||||
<% else %>
|
||||
<%= link_to l(:button_save), "#", :onclick => 'submitNews();',:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white' %>
|
||||
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;',:class => 'blue_btn grey_btn fl c_white' %>
|
||||
<%= link_to l(:button_save), "javascript:void(0)", :onclick => "submitNews();",:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white' %>
|
||||
<%= link_to l(:button_cancel), news_path(@news), :class => 'blue_btn grey_btn fl c_white' %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %>
|
||||
<span class="fl"> <%= l(:label_add_news) %>:</span><%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %><br />
|
||||
<div class="cl mb5"></div>
|
||||
<p id="news_description_<%= news.id %>" class="mt5 break_word"><%= news.description %><br /> </p>
|
||||
<p id="news_description_<%= news.id %>" class="mt5 break_word"><%=textAreailizable news.description %><br /> </p>
|
||||
<div class="news_foot" style="display: none;" onclick="news_show_more_des(<%= news.id %>);" id="news_foot_<%= news.id %>"><%= l(:label_expend_information) %> <span class="g-arr-down"><img src="/images/jiantou.jpg" width="12" height="6" /></span></div>
|
||||
<span class="f1"><%= l(:label_create_time) %> :<%= format_time(news.created_on) %></span>
|
||||
</div>
|
||||
|
|
|
@ -212,6 +212,7 @@ function regexTitle() {
|
|||
}
|
||||
|
||||
function regexDescription() {
|
||||
project_news_description_editor.sync();
|
||||
var name = $("#news_description").val();
|
||||
if (name.length == 0) {
|
||||
$("#description_notice_span").text("描述不能为空");
|
||||
|
|
|
@ -330,6 +330,7 @@ a:hover.st_add{ color:#ff8e15;}
|
|||
.hwork_new{ color:#4c4c4c;}
|
||||
.c_red{ color:#F00;}
|
||||
.hwork_input{ border:1px solid #64bdd9; height:22px; width:555px; background:#fff; margin-bottom:10px; padding:5px;}
|
||||
.hwork_input_news{ border:1px solid #64bdd9; height:22px; width:594px; background:#fff; margin-bottom:10px; padding:5px;}
|
||||
.hwork_input02{ border:1px solid #64bdd9; height:15px; width:120px; background:#fff; margin-bottom:10px; padding:5px;}
|
||||
.hwork_text{ border:1px solid #64bdd9; height:100px;width:555px; background:#fff; margin-left:5px; padding:5px; margin-bottom:10px;}
|
||||
.hwork_new ul li{ }
|
||||
|
|
Loading…
Reference in New Issue