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 %> - + - - + + <% if Setting.openid? %> - - + + <% end %>
+ + <%= text_field_tag 'username', params[:username], :tabindex => '1' , :value => "#{l(:label_login_prompt)}", :onfocus => "clearInfo('username','#{l(:label_login_prompt)}')", @@ -35,33 +39,48 @@
<%= password_field_tag 'password', nil, :tabindex => '2' %> + + + <%= password_field_tag 'password', nil, :tabindex => '2' %> +
<%= text_field_tag "openid_url", nil, :tabindex => '3' %> + + + <%= text_field_tag "openid_url", nil, :tabindex => '3' %> +
<% if Setting.autologin? %> - + <% 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 @@ - - - - - - + -
<%=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 @@ - - - - - - + -
<%= 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| %> @@ -88,7 +82,6 @@
- <%= 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) %> +

- - - - - - + + + + + + + + <% 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 %> - - + + 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 @@ - -
<%= 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.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 %>
- - + + + + - - + + + + + + + +
<%= 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_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 @@


-

<%= l(:label_reply_plural) %> (<%= @reply_count %>)

+

+ <%= l(:label_reply_plural) %> + (<%= @reply_count %>) +

<% reply_count = 0 %> <% @replies.each do |message| %>
"> - - + + <%= link_to_attachments message, :author => false %> + - +
<%= 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 @@
<%= textilizable message,:content,:attachments => message.attachments %> - <%#= message.content.html_safe %>
- <%= 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') %> @@ -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 } %>


- <%= 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 %>

- -

- <%= text_area :quote,:quote,:style => 'display:none' %> + +
+ <%= 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 @@