diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb
index 2fcc2e89b..932ffaa7a 100644
--- a/app/controllers/documents_controller.rb
+++ b/app/controllers/documents_controller.rb
@@ -44,7 +44,7 @@ class DocumentsController < ApplicationController
@grouped = documents.group_by {|d| d.title.first.upcase}
when 'author'
# @grouped = documents.select{|d| d.attachments.any?}.group_by {|d| d.attachments.last.author}
- @grouped = documents.group_by {|d| d.user.name }
+ @grouped = documents.group_by(&:user)
else
@grouped = documents.group_by(&:category)
end
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/documents/_document.html.erb b/app/views/documents/_document.html.erb
index b585f5dff..8ee1c6af5 100644
--- a/app/views/documents/_document.html.erb
+++ b/app/views/documents/_document.html.erb
@@ -1,18 +1,25 @@
-
-
- <%= link_to h(document.title), document_path(document) %>
-
+
+
+ <%= link_to h(document.title), document_path(document) %>
+
+
+
+
<%= textilizable(truncate_lines(document.description), :object => document) %>
-
- <%= format_time(document.updated_on) %>
-
+
+
+
+
+
+ <%= format_time(document.updated_on) %>
+
+
+
+
+
+
diff --git a/app/views/documents/index.html.erb b/app/views/documents/index.html.erb
index 43b0cff49..f7f76a812 100644
--- a/app/views/documents/index.html.erb
+++ b/app/views/documents/index.html.erb
@@ -12,23 +12,34 @@
-
<%=l(:label_document_new)%>
-<%= labelled_form_for @document, :url => project_documents_path(@project), :html => {:multipart => true} do |f| %>
-<%= render :partial => 'form', :locals => {:f => f} %>
-
- <%= submit_tag l(:button_create) %>
- <%= link_to l(:button_cancel), "#", :onclick => '$("#add-document").hide(); return false;' %>
-
-<% end %>
+
+ <%=l(:label_document_new)%>
+
+ <%= labelled_form_for @document, :url => project_documents_path(@project), :html => {:multipart => true} do |f| %>
+ <%= render :partial => 'form', :locals => {:f => f} %>
+
+ <%= submit_tag l(:button_create) %>
+ <%= link_to l(:button_cancel), "#", :onclick => '$("#add-document").hide(); return false;' %>
+
+ <% end %>
<%=l(:label_document_plural)%>
-<% if @grouped.empty? %><%= l(:label_no_data) %>
<% end %>
+<% if @grouped.empty? %>
+
+ <%= l(:label_no_data) %>
+
+<% end %>
-<% @grouped.keys.sort.each do |group| %>
-
+<% if @grouped.has_key? nil %>
+ <% @grouped.keys.each do |group| %>
+ <%= render :partial => 'documents/document', :collection => @grouped[group] %>
+ <% end %>
+<% else %>
+ <% @grouped.keys.sort.each do |group| %>
<%= render :partial => 'documents/document', :collection => @grouped[group] %>
+ <% end %>
<% end %>
<% html_title(l(:label_document_plural)) -%>
diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb
index 6977385d8..40094b162 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 %>
@@ -188,7 +190,7 @@
<% html_title @topic.subject %>
+
<%= 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) %>
+ <% if replying %>
+ <%= f.text_field :subject, { size: 60, style: "width: 99%;", id: "message_subject" }.merge(extra_option) %>
+ <% else %>
+ <%= f.text_field :subject, { size: 60, style: "width: 99%;", id: "message_subject", onblur: "regexSubject();" }.merge(extra_option) %>
+ <% end %>
+
<% 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..98a1a5767 100644
--- a/app/views/messages/_project_show.html.erb
+++ b/app/views/messages/_project_show.html.erb
@@ -1,9 +1,4 @@