#1163项目、课程讨论区新建帖子增加js验证

This commit is contained in:
sw 2014-10-27 14:20:59 +08:00
parent 5aa68ba9b4
commit e220f100d6
10 changed files with 262 additions and 199 deletions

View File

@ -26,7 +26,11 @@
<%= back_url_hidden_field_tag %>
<table>
<tr>
<td align="right"><label for="username"><%=l(:lable_user_name)%>:</label></td>
<td align="right">
<label for="username">
<%=l(:lable_user_name)%>:
</label>
</td>
<td align="left">
<%= text_field_tag 'username', params[:username], :tabindex => '1' , :value => "#{l(:label_login_prompt)}",
:onfocus => "clearInfo('username','#{l(:label_login_prompt)}')",
@ -35,33 +39,48 @@
</td>
</tr>
<tr>
<td align="right"><label for="password"><%=l(:field_password)%>:</label></td>
<td align="left"><%= password_field_tag 'password', nil, :tabindex => '2' %></td>
<td align="right">
<label for="password">
<%=l(:field_password)%>:
</label>
</td>
<td align="left">
<%= password_field_tag 'password', nil, :tabindex => '2' %>
</td>
</tr>
<% if Setting.openid? %>
<tr>
<td align="right"><label for="openid_url"><%=l(:field_identity_url)%></label></td>
<td align="left"><%= text_field_tag "openid_url", nil, :tabindex => '3' %></td>
<td align="right">
<label for="openid_url">
<%=l(:field_identity_url)%>
</label>
</td>
<td align="left">
<%= text_field_tag "openid_url", nil, :tabindex => '3' %>
</td>
</tr>
<% end %>
<tr>
<td></td>
<td align="left">
<% if Setting.autologin? %>
<label for="autologin"><%= check_box_tag 'autologin', 1, false, :tabindex => 4 %> <%= l(:label_stay_logged_in) %></label>
<label for="autologin">
<%= check_box_tag 'autologin', 1, false, :tabindex => 4 %>
<%= l(:label_stay_logged_in) %>
</label>
<% end %>
</td>
</tr>
<tr>
<td colspan="2" >
<span style="float: left"><% if Setting.lost_password? %>
<span style="float: left">
<% if Setting.lost_password? %>
<%= link_to l(:label_password_lost), lost_password_path %>
<% end %></span>
<span style="float: right">
<input type="submit" class="small" name="login" value="<%=l(:button_login)%> &#187;" tabindex="5"/></span>
</td>
</tr>
</table>

View File

@ -1,31 +1,36 @@
<!-- <%#= course_board_breadcrumb(@board) %> -->
<!--new and follow-->
<!-- <div class="content-title-top">
<%#= link_to l(:label_message_new),
new_board_message_path(@board),
:class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %> -->
<!-- <%#= watcher_link(@board, User.current) %> -->
<!-- </div> -->
<script type="text/javascript">
function submitCoursesBoard()
{
if(regexSubject()&&regexContent())
{
$("#message-form").submit();
}
}
</script>
<div id="add-message" class="add_frame" style="display:none;">
<% if User.current.logged? %>
<h3><%= link_to h(@board.name), course_board_path(@course, @board) %> &#187; <%= l(:label_message_new) %></h3>
<h3>
<%= link_to h(@board.name), course_board_path(@course, @board) %> &#187;
<%= l(:label_message_new) %>
</h3>
<div class="add_frame_header" >
<%= l(:label_message_new) %>
</div>
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'messages/form', :locals => {:f => f} %>
<p><%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %>
<%#= preview_link(preview_board_message_path(@board), 'message-form' ,target='preview',{:class => 'whiteButton m3p10'} )%>
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' ,:class => 'whiteButton m3p10' %></p>
<p>
<input type="button" onclick="submitCoursesBoard();" class = "whiteButton m3p10 h30" value="<%= l(:button_submit)%>">
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' ,:class => 'whiteButton m3p10' %>
</p>
<% end %>
<div id="preview" class="wiki"></div>
<% end %>
</div>
<!--display the board-->
<div class="borad-title"><%=h @board.name %></div>
<div class="borad-title">
<%=h @board.name %>
</div>
<% if !User.current.logged?%>
<div style="font-size: 14px;margin:20px;">
@ -35,9 +40,12 @@
</div>
<% end %>
<!-- <div class="borad-description"><%=h @board.description %></div> -->
<div class="borad-setitle">
<span class="borad-topic-count">共有 <%=link_to @topic_count,:controller => 'boards',:action => 'index' %> 个贴子</span>
<span class="borad-topic-count">
共有
<%=link_to @topic_count,:controller => 'boards',:action => 'index' %>
个贴子
</span>
<span>
<%= link_to l(:label_message_new),
new_board_message_path(@board),
@ -47,15 +55,6 @@
</div>
<div style="padding-top: 10px">
<% if @topics.any? %>
<!-- <table class="list messages">
<thead><tr>
<th><%= l(:field_subject) %></th>
<th><%= l(:field_author) %></th>
<%= sort_header_tag('created_on', :caption => l(:field_created_on)) %>
<%= sort_header_tag('replies', :caption => l(:label_reply_plural)) %>
<%= sort_header_tag('updated_on', :caption => l(:label_message_last)) %>
</tr></thead>
<tbody> -->
<% @topics.each do |topic| %>
<table class="content-text-list">
<tr>
@ -64,36 +63,44 @@
<table width="640px" border="0">
<tr>
<td valign="top" width="500px" class=" <%= topic.sticky? ? 'sticky' : '' %>
<%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title: topic.subject.to_s %>
<%= topic.locked? ? 'locked' : '' %>">
<%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title: topic.subject.to_s %>
</td>
<td align="right" rowspan="3">
<table class="borad-count">
<tr>
<td align="center" class="borad-count-digit">
<%=link_to (topic.replies_count), board_message_path(@board, topic) %>
</td>
<td align="right" rowspan="3"><table class="borad-count"><tr><td align="center" class="borad-count-digit"><%=link_to (topic.replies_count), board_message_path(@board, topic) %></td></tr>
<tr><td align="center">回答</td></tr>
</table></td>
</tr>
<!-- <tr><td colspan="2" ><span class="font_description">标签</span></td></tr> -->
<tr><td align="left" colspan="2" ><span class="font_lighter"><%= authoring topic.created_on, topic.author %><br /></span></td></tr>
</table></td>
<tr>
<td align="center">
回答
</td>
</tr>
</table>
<!-- <tr class="message <%= cycle 'odd', 'even' %> <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
<td class="subject"><%= link_to h(topic.subject), board_message_path(@board, topic) %></td>
<td class="author"><%= link_to_user(topic.author) %></td>
<td class="created_on"><%= format_time(topic.created_on) %></td>
<td class="reply-count"><%= topic.replies_count %></td>
<td class="last_message">
<% if topic.last_reply %>
<%= authoring topic.last_reply.created_on, topic.last_reply.author %><br />
<%= link_to_message topic.last_reply %>
<% end %>
</td>
</tr> -->
</tr>
<tr>
<td align="left" colspan="2" >
<span class="font_lighter">
<%= authoring topic.created_on, topic.author %>
<br />
</span>
</td>
</tr>
</table>
</td>
</tr>
</table>
<% end %>
<!-- </tbody>
</table> -->
<div class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></div>
<div class="pagination">
<%= pagination_links_full @topic_pages, @topic_count %>
</div>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<% end %>
</div>

View File

@ -1,9 +1,15 @@
<%= error_messages_for @board %>
<div class="box tabular">
<p style="width:666;"><%= f.text_field :name, :required => true %></p><!--by young-->
<p><%= f.text_field :description, :required => true, :size => 30 %></p><!--by young-->
<p style="width:666;">
<%= f.text_field :name, :required => true %>
</p><!--by young-->
<p>
<%= f.text_field :description, :required => true, :size => 30 %>
</p><!--by young-->
<% if @board.valid_parents.any? %>
<p><%= f.select :parent_id, boards_options_for_select(@board.valid_parents), :include_blank => true, :label => :field_board_parent %></p>
<p>
<%= f.select :parent_id, boards_options_for_select(@board.valid_parents), :include_blank => true, :label => :field_board_parent %>
</p>
<% end %>
</div>

View File

@ -1,25 +1,24 @@
<!-- <%#= board_breadcrumb(@board) %> -->
<!--new and follow-->
<!-- <div class="content-title-top">
<%#= link_to l(:label_message_new),
new_board_message_path(@board),
:class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %> -->
<!-- <%#= watcher_link(@board, User.current) %> -->
<!-- </div> -->
<script type="text/javascript">
function submitProjectBoard()
{
if(regexSubject()&&regexContent())
{
$("#message-form").submit();
}
}
</script>
<div id="add-message" class="add_frame" style="display:none;">
<% if User.current.logged? %>
<h3><%= link_to h(@board.name), project_board_path(@project, @board) %> &#187; <%= l(:label_message_new) %></h3>
<h3>
<%= link_to h(@board.name), project_board_path(@project, @board) %> &#187; <%= l(:label_message_new) %>
</h3>
<div class="add_frame_header">
<%= l(:label_message_new) %>
</div>
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'messages/form', :locals => {:f => f} %>
<p><%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %>
<%#= preview_link(preview_board_message_path(@board), 'message-form', target='preview', {:class => 'whiteButton m3p10'}) %>
<p>
<input type="button" onclick="submitProjectBoard();" class = "whiteButton m3p10 h30" value="<%= l(:button_submit)%>">
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;', :class => 'whiteButton m3p10' %></p>
<% end %>
<div id="preview" class="wiki"></div>
@ -27,7 +26,9 @@
</div>
<!--display the board-->
<div class="borad-title"><%= h @board.name %></div>
<div class="borad-title">
<%= h @board.name %>
</div>
<% if !User.current.logged? %>
<div style="font-size: 14px;margin:20px;">
@ -40,10 +41,12 @@
<hr/>
</div>
<% end %>
<!-- <div class="borad-description"><%= h @board.description %></div> -->
<div class="borad-setitle">
<span class="borad-topic-count">共有 <%= link_to @topic_count,:controller => 'boards',:action => 'index' %> 个贴子</span>
<span class="borad-topic-count">
共有
<%= link_to @topic_count,:controller => 'boards',:action => 'index' %>
个贴子
</span>
<% if @project.enabled_modules.where("name = 'boards'").count > 0 %>
<span>
<%= link_to l(:label_message_new),
@ -55,15 +58,6 @@
</div>
<div style="width: 100%;word-break: break-all;word-wrap: break-word;">
<% if @topics.any? %>
<!-- <table class="list messages">
<thead><tr>
<th><%= l(:field_subject) %></th>
<th><%= l(:field_author) %></th>
<%= sort_header_tag('created_on', :caption => l(:field_created_on)) %>
<%= sort_header_tag('replies', :caption => l(:label_reply_plural)) %>
<%= sort_header_tag('updated_on', :caption => l(:label_message_last)) %>
</tr></thead>
<tbody> -->
<% @topics.each do |topic| %>
<table class="content-text-list">
<tr>
@ -88,7 +82,6 @@
</table>
</td>
</tr>
<!-- <tr><td colspan="2" ><span class="font_description">标签</span></td></tr> -->
<tr>
<td align="left" colspan="2">
<span class="font_lighter"><%= authoring topic.created_on, topic.author %><br/></span></td>
@ -97,23 +90,10 @@
</td>
</tr>
</table>
<!-- <tr class="message <%= cycle 'odd', 'even' %> <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
<td class="subject"><%= link_to h(topic.subject), board_message_path(@board, topic) %></td>
<td class="author"><%= link_to_user(topic.author) %></td>
<td class="created_on"><%= format_time(topic.created_on) %></td>
<td class="reply-count"><%= topic.replies_count %></td>
<td class="last_message">
<% if topic.last_reply %>
<%= authoring topic.last_reply.created_on, topic.last_reply.author %><br />
<%= link_to_message topic.last_reply %>
<% end %>
</td>
</tr> -->
<% end %>
<!-- </tbody>
</table> -->
<div class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></div>
<div class="pagination">
<%= pagination_links_full @topic_pages, @topic_count %>
</div>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>

View File

@ -3,14 +3,26 @@
<%= link_to l(:label_board_new), new_project_board_path(@project), :class => 'icon icon-add' %>
<% end %>
</div>
<h3 style="padding-top:0px;"><%= l(:label_board_plural) %></h3>
<h3 style="padding-top:0px;">
<%= l(:label_board_plural) %>
</h3>
<table class="list boards">
<thead><tr>
<th><%= l(:label_board) %></th>
<th><%= l(:label_topic_plural) %></th>
<th><%= l(:label_message_plural) %></th>
<th><%= l(:label_message_last) %></th>
</tr></thead>
<thead>
<tr>
<th>
<%= l(:label_board) %>
</th>
<th>
<%= l(:label_topic_plural) %>
</th>
<th>
<%= l(:label_message_plural) %>
</th>
<th>
<%= l(:label_message_last) %>
</th>
</tr>
</thead>
<tbody>
<% Board.board_tree(@boards) do |board, level| %>
<tr class="<%= cycle 'odd', 'even' %>">
@ -18,8 +30,12 @@
<%= link_to h(board.name), project_board_path(board.project, board), :class => "board" %><br />
<%=h board.description %>
</td>
<td class="topic-count"><%= board.topics_count %></td>
<td class="message-count"><%= board.messages_count %></td>
<td class="topic-count">
<%= board.topics_count %>
</td>
<td class="message-count">
<%= board.messages_count %>
</td>
<td class="last-message">
<% if board.last_message %>
<%= authoring board.last_message.created_on, board.last_message.author %><br />

View File

@ -1,9 +1,4 @@
<style type="text/css">
/** {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-box-sizing: border-box;
}*/
.lz {
position: relative;
min-height: 200px;
@ -60,7 +55,9 @@
</style>
<div class="lz">
<!-- 在这里添加赞和踩-->
<span id="praise_tread" style="float: right"> <%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @topic,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%> </span>
<span id="praise_tread" style="float: right">
<%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @topic,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
</span>
<div class="contextual">
<%= watcher_link(@topic, User.current) %>
<%= link_to(
@ -103,12 +100,14 @@
<div class="memo-content">
<%= textilizable(@topic, :content) %>
<%= link_to_attachments @topic, :author => false %>
<%# options = {:author => true, :deletable => @topic.author.eql?(User.current)} %>
<%#= render :partial => 'attachments/app_link', :locals => {:attachments => @topi.attachments, :options => options} %>
</div>
<div class="memo-timestamp">
<div style="float: left"><%= authoring @topic.created_on, @topic.author %></div>
<div style="float: right"><%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %></div>
<div style="float: left">
<%= authoring @topic.created_on, @topic.author %>
</div>
<div style="float: right">
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>
</div>
</div>
</div>
<br />
@ -119,15 +118,19 @@
<br />
<br />
<br />
<h3 class="comments"><%= l(:label_reply_plural) %> (<%= @reply_count %>)</h3>
<h3 class="comments">
<%= l(:label_reply_plural) %>
(<%= @reply_count %>)
</h3>
<% reply_count = 0 %>
<% @replies.each do |message| %>
<div class="message reply" id="<%= "message-#{message.id}" %>">
<table class="borad-text-list">
<tr>
<!--<td class="font_lighter"> </td> -->
<td rowspan="3" valign="top" width="60px"><%= link_to image_tag(url_to_avatar(message.author), :class => "avatar"), user_path(message.author) %></td>
<td rowspan="3" valign="top" width="60px">
<%= link_to image_tag(url_to_avatar(message.author), :class => "avatar"), user_path(message.author) %>
</td>
<td>
<div class="contextual-borad">
<%= link_to(
@ -157,12 +160,14 @@
<td class="comments">
<div class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textilizable message,:content,:attachments => message.attachments %>
<%#= message.content.html_safe %>
</div>
<%= link_to_attachments message, :author => false %> </td>
<%= link_to_attachments message, :author => false %>
</td>
</tr>
<tr>
<td class="font_lighter" style="float: left"><%= authoring message.created_on, message.author %></td>
<td class="font_lighter" style="float: left">
<%= authoring message.created_on, message.author %>
</td>
</tr>
</table>
</div>
@ -174,12 +179,9 @@
<% end %>
<% if !@topic.locked? && authorize_for_course('messages', 'reply') %>
<div id="reply" style="display:none;">
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f, :replying => true} %>
<%#= submit_tag l(:button_submit) %>
<input type="button" class="enterprise" value="<%=l(:button_submit) %>" onmousemove="regexContent()" onclick="submit_message_replay();" >
<%#= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form') %>
<% end %>
<div id="preview" class="wiki"></div>
</div>

View File

@ -1,48 +1,82 @@
<script src="/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script>
<script type="text/javascript">
function regexSubject()
{
var content = $.trim($("#message_subject").val());
if(content.length ==0)
{
$("#subject_span").text("<%= l(:label_subject_empty) %>");
$("#subject_span").css('color','#ff0000');
return false;
}
else
{
$("#subject_span").text("<%= l(:label_field_correct) %>");
$("#subject_span").css('color','#008000');
return true;
}
return false;
}
function regexContent()
{
var content = $.trim($("#message_content").val());
if(content.length ==0)
{
$("#message_content_span").text("<%= l(:label_reply_empty) %>");
$("#message_content_span").css('color','#ff0000');
return false;
}
else
{
$("#message_content_span").text("<%= l(:label_field_correct) %>");
$("#message_content_span").css('color','#008000');
return true;
}
return false;
}
</script>
<%= error_messages_for 'message' %>
<% replying ||= false %>
<div class="box ph10_5">
<!--[form:message]-->
<% extra_option = replying ? { readonly: true} : { maxlength: 254 } %>
<% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
<p>
<label for="message_subject">
<%= l(:field_subject) %>
<span class="required"> *&nbsp;&nbsp;</span>
</label>
<br/>
<%= f.text_field :subject, { size: 60, style: "width: 99%;", id: "message_subject" }.merge(extra_option) %>
<%= f.text_field :subject, { size: 60, style: "width: 99%;", id: "message_subject", onblur: "regexSubject();" }.merge(extra_option) %>
<span id="subject_span"></span>
</p>
<p>
<% unless replying %>
<% if @message.safe_attribute? 'sticky' %>
<%= f.check_box :sticky %> <%= label_tag 'message_sticky', l(:label_board_sticky) %>
<%= f.check_box :sticky %>
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
<% end %>
<% if @message.safe_attribute? 'locked' %>
<%= f.check_box :locked %> <%= label_tag 'message_locked', l(:label_board_locked) %>
<%= f.check_box :locked %>
<%= label_tag 'message_locked', l(:label_board_locked) %>
<% end %>
<% end %>
</p>
<p>
<label for="message_subject"><%= l(:field_description) %>
<span class="required"> *&nbsp;&nbsp;</span></label>
<label for="message_subject">
<%= l(:field_description) %>
<span class="required"> *&nbsp;&nbsp;</span>
</label>
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
<%= text_area :quote,:quote,:style => 'display:none' %>
</p>
<p>
<%= label_tag "message_content", l(:description_message_content), :class => "hidden-for-sighted" %>
<%= f.text_area :content, :cols => 80, :rows => 13, :class => 'wiki-edit', :id => 'message_content', :onblur => "regexContent();" %>
<%= f.text_area :content, :cols => 80, :rows => 13, :class => 'wiki-edit', :id => 'message_content', :onblur => "regexContent();", :maxlength => 5000 %>
<span id="message_content_span"></span>
</p>
<!--[eoform:message]-->
<p>
<%= l(:label_attachment_plural) %>
<br />
<%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %>
</p>
</div>
<%#= wikitoolbar_for 'message_content' %>

View File

@ -1,9 +1,4 @@
<style type="text/css">
/** {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-box-sizing: border-box;
}*/
.lz {
position: relative;
min-height: 200px;
@ -63,7 +58,9 @@
<div class="lz">
<!-- 在这里添加赞和踩-->
<span id="praise_tread" style="float: right"> <%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @topic,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%> </span>
<span id="praise_tread" style="float: right">
<%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @topic,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
</span>
<div class="contextual">
<%= watcher_link(@topic, User.current) %>
<%= link_to(
@ -98,9 +95,11 @@
<div class="memo-section" style="width: 100%;word-break: break-all;word-wrap: break-word;">
<div class="memo-title <%= @topic.sticky? ? 'sticky' : '' %> <%= @topic.locked? ? 'locked' : '' %>" style="width: 53%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
<% if @project %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, project_boards_path(@topic.project),title: @topic.subject.to_s %>
<%= label_tag l(:field_subject) %>:
<%= link_to @topic.subject, project_boards_path(@topic.project),title: @topic.subject.to_s %>
<% elsif @course %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, course_boards_path(@topic.course),title: @topic.subject.to_s %>
<%= label_tag l(:field_subject) %>:
<%= link_to @topic.subject, course_boards_path(@topic.course),title: @topic.subject.to_s %>
<% end %>
</div>
<div class="memo-content">
@ -108,15 +107,13 @@
<%= link_to_attachments @topic, :author => false %>
</div>
<div class="memo-timestamp">
<div style="float: left"><%= authoring @topic.created_on, @topic.author %></div>
<div style="float: right"><%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %></div>
<div style="float: left">
<%= authoring @topic.created_on, @topic.author %>
</div>
<div style="float: right">
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>
</div>
</div>
</div>
<br />
</div>
@ -130,11 +127,11 @@
<% reply_count = 0 %>
<% @replies.each do |message| %>
<div class="message reply" id="<%= "message-#{message.id}" %>">
<table class="borad-text-list">
<tr>
<!--<td class="font_lighter"> </td> -->
<td rowspan="3" valign="top" width="60px"><%= link_to image_tag(url_to_avatar(message.author), :class => "avatar"), user_path(message.author) %></td>
<td rowspan="3" valign="top" width="60px">
<%= link_to image_tag(url_to_avatar(message.author), :class => "avatar"), user_path(message.author) %>
</td>
<td>
<div class="contextual-borad">
<%= link_to(
@ -164,22 +161,22 @@
<td class="comments">
<div class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textilizable message,:content,:attachments => message.attachments %>
<%#= message.content.html_safe %>
</div>
<%= link_to_attachments message, :author => false %> </td>
<%= link_to_attachments message, :author => false %>
</td>
</tr>
<tr>
<td class="font_lighter" style="float: left"><%= authoring message.created_on, message.author %></td>
<td class="font_lighter" style="float: left">
<%= authoring message.created_on, message.author %>
</td>
</tr>
</table>
</div>
<% end %>
<div class="pagination">
<%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %>
</div>
<% end %>
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
<div id="reply" style="display:none;">
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
@ -190,9 +187,7 @@
<div id="preview" class="wiki"></div>
</div>
<% end %>
<% html_title @topic.subject %>
<script type="text/javascript">
jQuery(document).ready(function($) {
transpotUrl('#content');

View File

@ -2168,3 +2168,4 @@ zh:
label_contest_news_condition: 竞赛描述超过5000个汉字
label_no_contest_news_title: 竞赛标题不能为空
label_contest_news_title_condition: 竞赛标题超过255个汉字
label_subject_empty: 主题不能为空

View File

@ -92,12 +92,20 @@
<%= hidden_field :issue, :lock_version%>
<%= hidden_field_tag :review_id, @review.id %>
<p>
<label><b><%=h l(:field_subject)%>:</b></label>
<label>
<b>
<%=h l(:field_subject)%>:
</b>
</label>
<%= f.text_field :subject, :size => 70, :value => @review.subject%>
</p>
<% if @allowed_statuses and @allowed_statuses.any? %>
<p>
<label><b><%=h l(:field_status)%>:</b></label>
<label>
<b>
<%=h l(:field_status)%>:
</b>
</label>
<%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), :required => true %>
</p>
<% end %>
@ -110,9 +118,7 @@
:id => 'review_comment_' + @review.id.to_s %>
</p>
<p>
<%
submit_url = url_for(:controller => 'code_review', :action => 'update', :id => @project)
-%>
<% submit_url = url_for(:controller => 'code_review', :action => 'update', :id => @project) -%>
<%= button_to_function l(:button_submit), "$('#show_review_#{@review.id}').load('#{submit_url}', $('##{review_form_id}').serialize())" %>
<input type="button" value="<%=h l(:button_cancel) %>" onclick='$("#review_form_<%= @review.id %>").hide();' />
<%= link_to_function l(:label_preview), "$('#preview_#{@review.id}').load('#{url_for(:controller => 'code_review', :action => 'preview', :id => @project)}', $('##{review_form_id}').serialize())" %>
@ -129,14 +135,18 @@
<% # ChiliProject -%>
<% if journals.length > 0 %>
<div id="history">
<h3 class="rounded-background"><%= l(:label_history) %></h3>
<h3 class="rounded-background">
<%= l(:label_history) %>
</h3>
<%= render :partial => 'history', :locals => { :issue => @review.issue, :journals => journals } %>
</div>
<% end %>
<% else %>
<% # Redmine -%>
<% if journals.length > 0 %>
<h3><%= l(:label_history) %></h3>
<h3>
<%= l(:label_history) %>
</h3>
<% end %>
<%= render :partial => 'reply', :collection => journals %>
<% end %>
@ -146,9 +156,7 @@
<p>
<%= toggle_link l(:button_reply), "reply_#{@review.id}", :focus => 'reply_comment_' + @review.id.to_s %>
</p>
<%
message_form_id = "message-form-#{@review.id}"
-%>
<% message_form_id = "message-form-#{@review.id}" -%>
<div id="reply_<%= @review.id %>" style="display:none;" class="box">
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @project, :review_id => @review.id}, :html => {:id => message_form_id} do |f| %>
<%= hidden_field_tag :review_id, @review.id %>
@ -156,8 +164,9 @@
<%= hidden_field :issue, :lock_version%>
<% if @allowed_statuses and @allowed_statuses.any? %>
<p>
<label><%=h l(:field_status) %>:</label>
<% # select :review, :status, {l(:label_review_closed) => CodeReview::STATUS_CLOSED, l(:label_review_open) => CodeReview::STATUS_OPEN} %>
<label>
<%=h l(:field_status) %>:
</label>
<%= select :review, :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), :required => true %>
</p>
<% end %>
@ -170,13 +179,9 @@
:id => 'reply_comment_' + @review.id.to_s %>
</p>
<p>
<%
submit_url = url_for(:controller => 'code_review', :action => 'reply', :id => @project)
-%>
<% submit_url = url_for(:controller => 'code_review', :action => 'reply', :id => @project)-%>
<%= button_to_function l(:button_apply), "$('#show_review_#{@review.id}').load('#{submit_url}', $('##{message_form_id}').serialize())" %>
<%
reply_preview_id = "reply_preview_#{@review.id}"
-%>
<% reply_preview_id = "reply_preview_#{@review.id}" -%>
<%= link_to_function l(:label_preview), "$('##{reply_preview_id}').load('#{url_for(:controller => 'code_review', :action => 'preview', :id => @project)}', $('##{message_form_id}').serialize())" %>
</p>
<div id="<%= reply_preview_id %>" class="wiki"></div>
@ -184,7 +189,5 @@
<% end %>
</div>
<% end %>
</div>
</div>