完成wiki新建界面

This commit is contained in:
huang 2015-04-15 21:44:19 +08:00
parent d79de0a354
commit 6229acac71
2 changed files with 72 additions and 40 deletions

View File

@ -1,9 +1,12 @@
<%= wiki_page_breadcrumb(@page) %>
<script src="http://<%= Setting.host_name%>/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script>
<h3 style="word-break: break-all;word-wrap: break-word;">
<%= h @page.pretty_title %>
</h3>
<div class="project_r_h">
<h2 class="project_h2">Wiki</h2>
</div>
<!--<h3 style="word-break: break-all;word-wrap: break-word;">-->
<!--<%#= h @page.pretty_title %>-->
<!--</h3>-->
<%= form_for @content, :as => :content,
:url => {:action => 'update', :id => @page.title},
@ -15,44 +18,46 @@
<% end %>
<%= error_messages_for 'content' %>
<div class="actions" style="max-width:680px">
<p style="max-width:680px;">
<%=text_area_tag 'content[text]', @text, :required => true, :id => 'editor02', :cols => 100, :rows => 25 %>
</p>
<script type="text/javascript">
var ckeditor=CKEDITOR.replace('editor02',{height: '300'});
</script>
</div>
<div class="box tabular">
<% if @page.safe_attribute_names.include?('parent_id') && @wiki.pages.any? %>
<%= fields_for @page do |fp| %>
<p>
<label>
<%= l(:field_parent_title) %>
</label>
<%= fp.select :parent_id,content_tag('option', '', :value => '') + wiki_page_options_for_select(@wiki.pages.all(:include => :parent) - @page.self_and_descendants, @page.parent) %>
</p>
<div class="wiki_new">
<div class="actions" style="max-width:680px">
<p style="max-width:680px;">
<%=text_area_tag 'content[text]', @text, :required => true, :id => 'editor02', :cols => 100, :rows => 25 %>
</p>
<script type="text/javascript">
var ckeditor=CKEDITOR.replace('editor02',{height: '300'});
</script>
</div>
<div class="box tabular" style="padding-top: 10px;">
<% if @page.safe_attribute_names.include?('parent_id') && @wiki.pages.any? %>
<%= fields_for @page do |fp| %>
<p>
<label>
<%= l(:field_parent_title) %>
</label>
<%= fp.select :parent_id,content_tag('option', '', :value => '') + wiki_page_options_for_select(@wiki.pages.all(:include => :parent) - @page.self_and_descendants, @page.parent) %>
</p>
<% end %>
<% end %>
<% end %>
<p style="width: 100%;">
<label>
<%= l(:field_comments) %>
</label>
<%= f.text_field :comments, :style => "width:75%;" %>
</p>
<p>
<label>
<%=l(:label_attachment_plural)%>
</label>
<%= render :partial => 'attachments/form',:locals => {:container => @page} %>
</p>
<ul class="wiki_new_ul">
<li><label class="label">&nbsp;<%= l(:field_comments) %>&nbsp;&nbsp;:&nbsp;</label>
<%= f.text_field :comments, :class => "w557" %>
</li>
<div class="cl"></div>
<li><label class="label" >&nbsp;<%=l(:label_attachment_plural)%>&nbsp;&nbsp;:&nbsp;</label>
<%= render :partial => 'attachments/form',:locals => {:container => @page} %>
<label class="c_grey">(最大文件大小: 50 MB)</label>
</li>
<div class="cl"></div>
</ul>
<a remote="true" href="javascript:void(0)" class="blue_btn" onclick="$('#new_membership').submit();">
<%= l(:button_save) %>
</a>
</div>
</div>
<p>
<%= submit_tag l(:button_save) %>
</p>
<%= wikitoolbar_for 'content_text' %>
<% end %>
<div id="preview" class="wiki"></div>

View File

@ -428,9 +428,36 @@ img.ui-datepicker-trigger {
float:left;
}
/*用户反馈*/
.msg_box{ width:670px; height:173px; border-bottom:1px dashed #CCC; padding-top:10px;}
.msg_box h4{ }
.msg_box textarea{width:658px;height:90px;padding:5px;overflow:hidden;background-color: #ffffff; border:1px solid #CCC; margin:5px 0px; color:#666; font-size:12px; }
.msg_box textarea{width:658px;height:90px;padding:5px;overflow:hidden;background-color: #ffffff; border:1px solid #CCC; margin:5px 0px; color:#666; font-size:12px; }
/* 版本库 */
.repos_explain{ background:#f8f8f8; width:648px; padding:10px; margin-top:5px; border:1px solid #ddd; color:#555;}
.repos_files{ width:668px; border:1px solid #ddd; margin-bottom:10px; border-bottom:none;}
.w128{ width:128px; text-align:center; color:#555;}
.repos_files_ul{ font-size:14px; font-weight:bold; text-align:center; height:30px; color:#555;}
.repos_files ul{border-bottom:1px solid #ddd;}
.repos_files ul li{ float:left; padding-left:10px; height:26px;}
.repos_files ul:hover{ background:#ffffdd;}
.repos_t_c li{ text-align:center;}
/* 里程碑 */
.roadmap_box{ background:#f8f8f8; width:648px; padding:10px; margin-top:5px; border:1px solid #ddd; color:#555;}
.progress{ width:520px; height:20px; margin-bottom:5px; background:#e9e9e9;}
.closed{ background:#bae0ba; display:block;height:20px; float:left;}
.done{ background:#d3edd3; display:block;height:20px;float:left;}
.roadmap_box{ margin-bottom:10px;}
.roadmap_list_ul{border:1px solid #ddd; border-bottom:none; margin-bottom:10px;}
.roadmap_list_ul li{border-bottom:1px solid #ddd; height:21px; padding-top:5px; padding-left:10px;}
.roadmap_list_ul li:hover{background:#ffffdd;}
.text_line_s{ text-decoration:line-through; color:#999;}
.roadmap_list_w{ width:555px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.wiki_text{ width:663px; height:300px; margin-bottom:10px;}
.wiki_new_ul{ background:#f3f3f3; border:1px solid #ddd; padding:10px 0 0; margin-bottom:10px;}
.wiki_new_ul input{ height:26px; margin-bottom:10px;}
.wiki_con_tit{ font-size:14px; color:#09658c; font-weight:bold;width:630px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; margin-bottom:10px;}
.wiki_con_box{ line-height:1.9; color:#2d2d2d;}
.wiki_page_con{ border-bottom:1px dashed #CCC; margin-bottom:10px; padding-bottom:10px;}
#wiki_new_box{ display:none;}