From e220f100d6f5bbc49272fec3397cbcef2c5bc5b3 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 27 Oct 2014 14:20:59 +0800
Subject: [PATCH] =?UTF-8?q?#1163=E9=A1=B9=E7=9B=AE=E3=80=81=E8=AF=BE?=
=?UTF-8?q?=E7=A8=8B=E8=AE=A8=E8=AE=BA=E5=8C=BA=E6=96=B0=E5=BB=BA=E5=B8=96?=
=?UTF-8?q?=E5=AD=90=E5=A2=9E=E5=8A=A0js=E9=AA=8C=E8=AF=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/account/login.html.erb | 35 ++++--
app/views/boards/_course_show.html.erb | 107 ++++++++++--------
app/views/boards/_form.html.erb | 12 +-
app/views/boards/_project_show.html.erb | 70 ++++--------
app/views/boards/index.html.erb | 38 +++++--
app/views/messages/_course_show.html.erb | 40 +++----
app/views/messages/_form.html.erb | 68 ++++++++---
app/views/messages/_project_show.html.erb | 47 ++++----
config/locales/zh.yml | 1 +
.../app/views/code_review/_show.html.erb | 43 +++----
10 files changed, 262 insertions(+), 199 deletions(-)
diff --git a/app/views/account/login.html.erb b/app/views/account/login.html.erb
index 20b0c5c04..1115ca80e 100644
--- a/app/views/account/login.html.erb
+++ b/app/views/account/login.html.erb
@@ -26,7 +26,11 @@
<%= back_url_hidden_field_tag %>
- <%=l(:lable_user_name)%>:
+
+
+ <%=l(:lable_user_name)%>:
+
+
<%= text_field_tag 'username', params[:username], :tabindex => '1' , :value => "#{l(:label_login_prompt)}",
:onfocus => "clearInfo('username','#{l(:label_login_prompt)}')",
@@ -35,33 +39,48 @@
- <%=l(:field_password)%>:
- <%= password_field_tag 'password', nil, :tabindex => '2' %>
+
+
+ <%=l(:field_password)%>:
+
+
+
+ <%= password_field_tag 'password', nil, :tabindex => '2' %>
+
<% if Setting.openid? %>
- <%=l(:field_identity_url)%>
- <%= text_field_tag "openid_url", nil, :tabindex => '3' %>
+
+
+ <%=l(:field_identity_url)%>
+
+
+
+ <%= text_field_tag "openid_url", nil, :tabindex => '3' %>
+
<% end %>
<% if Setting.autologin? %>
- <%= check_box_tag 'autologin', 1, false, :tabindex => 4 %> <%= l(:label_stay_logged_in) %>
+
+ <%= check_box_tag 'autologin', 1, false, :tabindex => 4 %>
+ <%= l(:label_stay_logged_in) %>
+
<% end %>
- <% if Setting.lost_password? %>
+
+ <% if Setting.lost_password? %>
<%= link_to l(:label_password_lost), lost_password_path %>
<% end %>
-
diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb
index 26576195d..5a25cf262 100644
--- a/app/views/boards/_course_show.html.erb
+++ b/app/views/boards/_course_show.html.erb
@@ -1,31 +1,36 @@
-
-
-
-
-
-
+
<% if User.current.logged? %>
-
<%= link_to h(@board.name), course_board_path(@course, @board) %> » <%= l(:label_message_new) %>
+
+ <%= link_to h(@board.name), course_board_path(@course, @board) %> »
+ <%= l(:label_message_new) %>
+
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'messages/form', :locals => {:f => f} %>
-
<%= 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' %>
+
+
+ <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' ,:class => 'whiteButton m3p10' %>
+
<% end %>
<% end %>
-<%=h @board.name %>
+
+ <%=h @board.name %>
+
<% if !User.current.logged?%>
@@ -35,9 +40,12 @@
<% end %>
-
- 共有 <%=link_to @topic_count,:controller => 'boards',:action => 'index' %> 个贴子
+
+ 共有
+ <%=link_to @topic_count,:controller => 'boards',:action => 'index' %>
+ 个贴子
+
<%= link_to l(:label_message_new),
new_board_message_path(@board),
@@ -47,15 +55,6 @@
<% if @topics.any? %>
-
<% @topics.each do |topic| %>
@@ -64,36 +63,44 @@
<%= 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 %>
+
+
+
+
+
+ <%=link_to (topic.replies_count), board_message_path(@board, topic) %>
+
+
+
+
+ 回答
+
+
+
- <%=link_to (topic.replies_count), board_message_path(@board, topic) %>
- 回答
-
-
- <%= authoring topic.created_on, topic.author %>
-
+
+
+
+ <%= authoring topic.created_on, topic.author %>
+
+
+
+
+
+
-
-
<% end %>
-
-
+
<% else %>
-
<%= l(:label_no_data) %>
+
+ <%= l(:label_no_data) %>
+
<% end %>
diff --git a/app/views/boards/_form.html.erb b/app/views/boards/_form.html.erb
index ffe23fbde..c1ab085cf 100644
--- a/app/views/boards/_form.html.erb
+++ b/app/views/boards/_form.html.erb
@@ -1,9 +1,15 @@
<%= error_messages_for @board %>
-
<%= f.text_field :name, :required => true %>
-
<%= f.text_field :description, :required => true, :size => 30 %>
+
+ <%= f.text_field :name, :required => true %>
+
+
+ <%= f.text_field :description, :required => true, :size => 30 %>
+
<% if @board.valid_parents.any? %>
-
<%= f.select :parent_id, boards_options_for_select(@board.valid_parents), :include_blank => true, :label => :field_board_parent %>
+
+ <%= f.select :parent_id, boards_options_for_select(@board.valid_parents), :include_blank => true, :label => :field_board_parent %>
+
<% end %>
diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb
index d615c877c..8128797c0 100644
--- a/app/views/boards/_project_show.html.erb
+++ b/app/views/boards/_project_show.html.erb
@@ -1,25 +1,24 @@
-
-
-
-
-
-
+
<% if User.current.logged? %>
-
<%= link_to h(@board.name), project_board_path(@project, @board) %> » <%= l(:label_message_new) %>
-
+
+ <%= link_to h(@board.name), project_board_path(@project, @board) %> » <%= l(:label_message_new) %>
+
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'messages/form', :locals => {:f => f} %>
-
<%= 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' %>
<% end %>
@@ -27,7 +26,9 @@
-<%= h @board.name %>
+
+ <%= h @board.name %>
+
<% if !User.current.logged? %>
@@ -40,10 +41,12 @@
<% end %>
-
-
- 共有 <%= link_to @topic_count,:controller => 'boards',:action => 'index' %> 个贴子
+
+ 共有
+ <%= link_to @topic_count,:controller => 'boards',:action => 'index' %>
+ 个贴子
+
<% if @project.enabled_modules.where("name = 'boards'").count > 0 %>
<%= link_to l(:label_message_new),
@@ -55,15 +58,6 @@
<% if @topics.any? %>
-
<% @topics.each do |topic| %>
-
<%= authoring topic.created_on, topic.author %>
@@ -97,23 +90,10 @@
-
-
<% end %>
-
-
+
<% else %>
<%= l(:label_no_data) %>
<% end %>
diff --git a/app/views/boards/index.html.erb b/app/views/boards/index.html.erb
index 614066613..d3671a096 100644
--- a/app/views/boards/index.html.erb
+++ b/app/views/boards/index.html.erb
@@ -3,14 +3,26 @@
<%= link_to l(:label_board_new), new_project_board_path(@project), :class => 'icon icon-add' %>
<% end %>
-<%= l(:label_board_plural) %>
+
+ <%= l(:label_board_plural) %>
+
-
- <%= l(:label_board) %>
- <%= l(:label_topic_plural) %>
- <%= l(:label_message_plural) %>
- <%= l(:label_message_last) %>
-
+
+
+
+ <%= l(:label_board) %>
+
+
+ <%= l(:label_topic_plural) %>
+
+
+ <%= l(:label_message_plural) %>
+
+
+ <%= l(:label_message_last) %>
+
+
+
<% Board.board_tree(@boards) do |board, level| %>
@@ -18,12 +30,16 @@
<%= link_to h(board.name), project_board_path(board.project, board), :class => "board" %>
<%=h board.description %>
- <%= board.topics_count %>
- <%= board.messages_count %>
+
+ <%= board.topics_count %>
+
+
+ <%= board.messages_count %>
+
<% if board.last_message %>
- <%= authoring board.last_message.created_on, board.last_message.author %>
- <%= link_to_message board.last_message %>
+ <%= authoring board.last_message.created_on, board.last_message.author %>
+ <%= link_to_message board.last_message %>
<% end %>
diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb
index 6977385d8..5459e1c17 100644
--- a/app/views/messages/_course_show.html.erb
+++ b/app/views/messages/_course_show.html.erb
@@ -1,9 +1,4 @@
-
<%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @topic,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
+
+ <%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @topic,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
+
<%= watcher_link(@topic, User.current) %>
<%= link_to(
@@ -103,12 +100,14 @@
<%= 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} %>
-
<%= authoring @topic.created_on, @topic.author %>
-
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>
+
+ <%= authoring @topic.created_on, @topic.author %>
+
+
+ <%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>
+
@@ -119,15 +118,19 @@
-
+
<% reply_count = 0 %>
<% @replies.each do |message| %>
">
-
- <%= link_to image_tag(url_to_avatar(message.author), :class => "avatar"), user_path(message.author) %>
+
+ <%= link_to image_tag(url_to_avatar(message.author), :class => "avatar"), user_path(message.author) %>
+
<%= link_to(
@@ -157,12 +160,14 @@
+ <%= link_to_attachments message, :author => false %>
+
- <%= authoring message.created_on, message.author %>
+
+ <%= authoring message.created_on, message.author %>
+
@@ -174,12 +179,9 @@
<% end %>
<% if !@topic.locked? && authorize_for_course('messages', 'reply') %>
-
<%= 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) %>
- <%#= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form') %>
<% end %>
diff --git a/app/views/messages/_form.html.erb b/app/views/messages/_form.html.erb
index eb0a7f53e..387e91c26 100644
--- a/app/views/messages/_form.html.erb
+++ b/app/views/messages/_form.html.erb
@@ -1,48 +1,82 @@
-
+
<%= error_messages_for 'message' %>
<% replying ||= false %>
- <% extra_option = replying ? { readonly: true} : { maxlength: 254 } %>
+ <% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
<%= l(:field_subject) %>
*
- <%= 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) %>
+
<% 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 %>
- <%= l(:field_description) %>
- *
-
- <%= text_area :quote,:quote,:style => 'display:none' %>
+
+ <%= l(:field_description) %>
+ *
+
+
+ <%= text_area :quote,:quote,:style => 'display:none' %>
<%= 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 %>
-
-
-
<%= l(:label_attachment_plural) %>
<%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %>
-
-
-
-<%#= wikitoolbar_for 'message_content' %>
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb
index 028be4b83..2dc0d89c2 100644
--- a/app/views/messages/_project_show.html.erb
+++ b/app/views/messages/_project_show.html.erb
@@ -1,9 +1,4 @@