diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index aac107cfb..c75b9f9bf 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -241,7 +241,7 @@ class AdminController < ApplicationController end else respond_to do |format| - flash.now[:error] = "#{l :label_first_page_create_fail}: #{@first_page.errors.full_messages[0]}\n\t#{@contest_page.errors.full_messages[0]}" + flash.now[:error] = "#{l :label_first_page_create_fail}: #{@first_page.errors.full_messages[0]}\n\t#{@contest_page.errors.full_messages[0]}\n\t#{@notification.errors.full_messages[0]}" format.html { render :action => 'contest_page_made' } diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 666c39d30..3d541fd61 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -26,6 +26,18 @@ class FilesController < ApplicationController include SortHelper helper :project_score + def show_attachments obj + all_attachments = [] + obj.each do |container| + all_attachments += container.attachments + end + @limit = 10 + @feedback_count = all_attachments.count + @feedback_pages = Paginator.new @feedback_count, @limit, params['page'] + @offset ||= @feedback_pages.offset + @curse_attachments = all_attachments[@offset, @limit] + end + def index #sort_init 'filename', 'asc' sort_init 'created_on', 'desc' @@ -39,15 +51,7 @@ class FilesController < ApplicationController @containers = [ Project.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@project.id)] @containers += @project.versions.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").all.sort - all_attachments = [] - @containers.each do |container| - all_attachments += container.attachments - end - @limit = 10 - @feedback_count = all_attachments.count - @feedback_pages = Paginator.new @feedback_count, @limit, params['page'] - @offset ||= @feedback_pages.offset - @curse_attachments = all_attachments[@offset, @limit] + show_attachments @containers render :layout => !request.xhr? elsif params[:course_id] @@ -79,16 +83,7 @@ class FilesController < ApplicationController @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on desc").find(@course.id)] end - all_attachments = [] - @containers.each do |container| - all_attachments += container.attachments - end - - @limit = 10 - @feedback_count = all_attachments.count - @feedback_pages = Paginator.new @feedback_count, @limit, params['page'] - @offset ||= @feedback_pages.offset - @curse_attachments = all_attachments[@offset, @limit] + show_attachments @containers render :layout => 'base_courses' end @@ -133,6 +128,8 @@ class FilesController < ApplicationController @containers = [Project.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@project.id)] #modify by Long Jun @containers += @project.versions.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").all.sort + show_attachments @containers + @attachtype = 0 @contenttype = 0 @@ -159,6 +156,8 @@ class FilesController < ApplicationController @containers = [Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)] + show_attachments @containers + @attachtype = 0 @contenttype = 0 diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 9d734db37..b522a09d6 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -83,6 +83,10 @@ class IssuesController < ApplicationController :limit => @limit) @issue_count_by_group = @query.issue_count_by_group + + + + respond_to do |format| format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young format.api { diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index cdeb17e54..44496c3d7 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -34,6 +34,7 @@ class MessagesController < ApplicationController # Show a topic and its replies def show + @isReply = true page = params[:page] # Find the page of the requested reply if params[:r] && page.nil? @@ -103,6 +104,7 @@ class MessagesController < ApplicationController # Edit a message def edit + @isReply = false if @project (render_403; return false) unless @message.editable_by?(User.current) else @@ -123,7 +125,6 @@ class MessagesController < ApplicationController } end end - end # Delete a messages diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 91da700a1..14814ed32 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -37,16 +37,41 @@ class MyController < ApplicationController }.freeze def index + page render :action => 'page' - end + end # Show user's page def page @user = User.current + @Issues= Issue.visible.open. + where(:assigned_to_id => ([User.current.id] + User.current.group_ids)) + @limit = 10 + @feedback_count = @Issues.count + @feedback_pages = Paginator.new @feedback_count, @limit, params['page'] + @offset ||= @feedback_pages.offset + @curse_attachments = @Issues[@offset, @limit] + @blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT end + def page2 + @limit = 10 + @user = User.current + @Issues= Issue.visible.open. + where(:assigned_to_id => ([User.current.id] + User.current.group_ids)) + @feedback_count = @Issues.count + @feedback_pages = Paginator.new @feedback_count, @limit, params['page'] + @offset ||= @feedback_pages.offset + @curse_attachments = @Issues[@offset, @limit] + @state = false + @blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT + respond_to do |format| + format.js + end + end + # Edit user's account def account @user = User.current diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 1893224f8..ee42c2c6a 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -407,7 +407,7 @@ class ProjectsController < ApplicationController @page = @page.to_i # Find the page of the requested reply @jours = @project.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') - @limit = 3 + @limit = 10 offset = @jours.count(:conditions => ["#{JournalsForMessage.table_name}.id > ?", params[:r].to_i]) page = 1 + offset / @limit diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index e31bb2738..2d03b2112 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -99,7 +99,7 @@ class WordsController < ApplicationController @project = Project.find params[:project_id] # Find the page of the requested reply @jours = @project.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') - @limit = 3 + @limit = 10 offset = @jours.count(:conditions => ["#{JournalsForMessage.table_name}.id > ?", params[:r].to_i]) page = 1 + offset / @limit diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index e08e50e80..1fd1646b8 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -441,7 +441,7 @@ module CoursesHelper def homework_user_of_homework homework,is_teacher homework_users = "" homework.users.each do |user| - homework_users = homework_users + (is_teacher ? (user.firstname + user.lastname) : user.login) + homework_users = homework_users + (is_teacher ? (user.lastname + user.firstname) : user.login) if user != homework.users.last homework_users = homework_users + "、" end diff --git a/app/helpers/user_score_helper.rb b/app/helpers/user_score_helper.rb index 376f676b7..c94763e31 100644 --- a/app/helpers/user_score_helper.rb +++ b/app/helpers/user_score_helper.rb @@ -864,7 +864,7 @@ FROM `users` where id = #{user.id}") users = Attachment.find_by_sql("SELECT COUNT(*) as m_count FROM #{Attachment.table_name} WHERE author_id = '#{user.id}' and container_type = 'Project' and container_id = #{project.id}") result = 0 if users.count > 0 - result = users.first.m_coumt + result = users.first.m_count end result end diff --git a/app/models/contest_notification.rb b/app/models/contest_notification.rb index c1f2fde6f..d525b4b3a 100644 --- a/app/models/contest_notification.rb +++ b/app/models/contest_notification.rb @@ -1,3 +1,4 @@ class ContestNotification < ActiveRecord::Base attr_accessible :content, :title + validates_length_of :title, maximum: 30 end diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index 0677d324b..097539888 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -1,10 +1,10 @@ - + <% if defined?(container) && container && container.saved_attachments %> <% container.attachments.each_with_index do |attachment, i| %> <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") + - link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %> + link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %> <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%> <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> diff --git a/app/views/attachments/_form_course.html.erb b/app/views/attachments/_form_course.html.erb new file mode 100644 index 000000000..e5fbd3f82 --- /dev/null +++ b/app/views/attachments/_form_course.html.erb @@ -0,0 +1,61 @@ + +<% if defined?(container) && container && container.saved_attachments %> + <% if isReply %> + <% container.saved_attachments.each_with_index do |attachment, i| %> + + <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> + <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") + + link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %> + <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> + <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%> + <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> + + <% end %> + <% else %> + <% container.attachments.each_with_index do |attachment, i| %> + + <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> + <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") + + link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %> + <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> + <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%> + <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> + + <% end %> + <% end %> +<% end %> + + + +<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> + +<%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()" %> +<%= file_field_tag 'attachments[dummy][file]', + :id => '_file', + :class => 'file_selector', + :multiple => true, + :onchange => 'addInputFiles(this);', + :style => 'display:none', + :data => { + :max_file_size => Setting.attachment_max_size.to_i.kilobytes, + :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), + :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, + :upload_path => uploads_path(:format => 'js'), + :description_placeholder => l(:label_optional_description) + } %> +<%= l(:label_no_file_uploaded)%> +(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) + + +<% content_for :header_tags do %> + <%= javascript_include_tag 'attachments' %> +<% end %> + + diff --git a/app/views/attachments/autocomplete.js.erb b/app/views/attachments/autocomplete.js.erb index 404ad9a61..abe2c3757 100644 --- a/app/views/attachments/autocomplete.js.erb +++ b/app/views/attachments/autocomplete.js.erb @@ -4,4 +4,5 @@ $('#relation_file').html('<%=render_attachments_for_new_project(@project, nil)%> <% elsif @course%> $('#relation_file').html('<%=render_attachments_for_new_course(@course, nil)%>'); <% end%> +$('#attachments').children().css("width","100%").css("word-break","break-all"); diff --git a/app/views/attachments/file.html.erb b/app/views/attachments/file.html.erb index 57393b81e..37db6f2bc 100644 --- a/app/views/attachments/file.html.erb +++ b/app/views/attachments/file.html.erb @@ -4,8 +4,16 @@

<%= h("#{@attachment.description} - ") unless @attachment.description.blank? %> <%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %>

<%= link_to_attachment @attachment, :text => l(:button_download), :download => true -%> - (<%= number_to_human_size @attachment.filesize %>)

- + (<%= number_to_human_size @attachment.filesize %>)    + + <% if @attachment!=nil&&@attachment.container_type == 'Document' %> + <%= link = link_to(l(:button_add), {:controller => 'code_review', + :action => 'assign', :action_type => 'attachment', + :id=>@attachment.project, + :change_id => '', :attachment_id => @attachment.id, + }, :class => 'icon icon-add') %> + <% end %> +

  <%= render :partial => 'common/file', :locals => {:content => @content, :filename => @attachment.filename} %> diff --git a/app/views/bids/_homework_form.html.erb b/app/views/bids/_homework_form.html.erb index f7c753b45..463b2b621 100644 --- a/app/views/bids/_homework_form.html.erb +++ b/app/views/bids/_homework_form.html.erb @@ -26,9 +26,9 @@

<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT %>

<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %>

-

<%= f.text_field :deadline, :required => true, :size => 60, :style => "width:150px;" %><%= calendar_for('bid_deadline')%>

diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index 6d3a2adcc..6d1581820 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -28,7 +28,7 @@ - <% user_name = is_teacher ? (homework.user.firstname + homework.user.lastname) : homework.user.login %> + <% user_name = is_teacher ? (homework.user.lastname + homework.user.firstname) : homework.user.login %> diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 25d35d407..ca33b7516 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -63,7 +63,9 @@
<%= image_tag(url_to_avatar(homework.user), :class => "avatar")%>
- + diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb index 1327f13e9..ef1afd27e 100644 --- a/app/views/boards/_project_show.html.erb +++ b/app/views/boards/_project_show.html.erb @@ -71,7 +71,9 @@
<%= link_to h(topic.subject), board_message_path(@board, topic) %><%= 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) %>
回答
- + diff --git a/app/views/messages/_form.html.erb b/app/views/messages/_form.html.erb index 4208d3061..44d6dfbe4 100644 --- a/app/views/messages/_form.html.erb +++ b/app/views/messages/_form.html.erb @@ -42,7 +42,7 @@

<%= l(:label_attachment_plural) %>
-<%= render :partial => 'attachments/form', :locals => {:container => @message} %>

+<%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %>

diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb index ad91c72f8..7f88816f5 100644 --- a/app/views/messages/_project_show.html.erb +++ b/app/views/messages/_project_show.html.erb @@ -95,11 +95,11 @@

-
+
<% if @project %> - <%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, project_boards_path(@topic.project) %> + <%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(24, omission: '...'), 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) %> + <%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(24,omission:'...'), course_boards_path(@topic.course),title: @topic.subject.to_s %> <% end %>
@@ -179,9 +179,6 @@
<% end %> - - - <% if !@topic.locked? && authorize_for('messages', 'reply') %>
<% if e.user == User.current %> <% else %>
<%= link_to h(topic.subject), board_message_path(@board, topic) %><%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title:topic.subject.to_s %> + diff --git a/app/views/common/_file.html.erb b/app/views/common/_file.html.erb index 22126b949..d4c0875c2 100644 --- a/app/views/common/_file.html.erb +++ b/app/views/common/_file.html.erb @@ -1,14 +1,14 @@
-
+
<% line_num = 1 %> <% syntax_highlight_lines(filename, Redmine::CodesetUtil.to_utf8_by_setting(content)).each do |line| %> - <% line_num += 1 %> diff --git a/app/views/courses/_homework_form.html.erb b/app/views/courses/_homework_form.html.erb index 41c059603..bfecb5304 100644 --- a/app/views/courses/_homework_form.html.erb +++ b/app/views/courses/_homework_form.html.erb @@ -30,7 +30,7 @@ <%#= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>

--> <% time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') %> -

<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}") %><%= calendar_for('bid_deadline')%> +

<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}",:readonly => "readonly") %><%= calendar_for('bid_deadline')%>

<%= f.select :is_evaluation, is_evaluation_option %>

diff --git a/app/views/files/_course_show_all_attachment.html.erb b/app/views/files/_course_show_all_attachment.html.erb index f70142a05..fbf398c36 100644 --- a/app/views/files/_course_show_all_attachment.html.erb +++ b/app/views/files/_course_show_all_attachment.html.erb @@ -3,7 +3,7 @@ <% attachmenttypes = @course.attachmenttypes %> <% delete_allowed = User.current.allowed_to?(:manage_files, @course) %> <% edit_allowed = User.current.allowed_to?(:manage_files, @course) %> -
- <%= line_num %> + + <%= line_num %> -
<%= line.html_safe %>
+
<%= line.html_safe %>
+
@@ -40,17 +40,17 @@ <%next%> <%end%> "> - + - - + - - + - + - diff --git a/app/views/files/_show_all_attachment.html.erb b/app/views/files/_show_all_attachment.html.erb index 043fe1183..0dbd735c4 100644 --- a/app/views/files/_show_all_attachment.html.erb +++ b/app/views/files/_show_all_attachment.html.erb @@ -3,7 +3,8 @@ <% attachmenttypes = @project.attachmenttypes %> <% delete_allowed = User.current.allowed_to?(:manage_files, @project) %> <% edit_allowed = User.current.allowed_to?(:manage_files, @project) %> -
<%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> <%= number_to_human_size(file.filesize) %> + <%= number_to_human_size(file.filesize) %> <%= file.attachmentstype.typeName unless file.attachmentstype.nil? %> <%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %> <%= file.show_suffix_type %> + <%= file.show_suffix_type %> <%= file.file_dense_str %>   @@ -58,9 +58,9 @@ :attachment => file} %> <%= file.downloads %><%= file.downloads %> + <%= link_to(image_tag('delete.png'), attachment_path(file), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
+
+
@@ -40,17 +41,17 @@ <%next%> <%end%> "> - + - - + - - + - + - @@ -83,7 +84,7 @@
<%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> <%= number_to_human_size(file.filesize) %> + <%= number_to_human_size(file.filesize) %> <%= file.attachmentstype.typeName %> <%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %> <%= file.show_suffix_type %> + <%= file.show_suffix_type %> <%= file.file_dense_str %>   @@ -58,9 +59,9 @@ :attachment => file} %> <%= file.downloads %><%= file.downloads %> + <%= link_to(image_tag('delete.png'), attachment_path(file), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
- +
@@ -96,9 +96,9 @@
<% if @project %> - <%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, project_boards_path(@topic.project) %> + <%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(24, omission: '...'), 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) %> + <%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(24,omission:'...'), course_boards_path(@topic.course),title: @topic.subject.to_s %> <% end %>
@@ -109,14 +109,8 @@
<%= authoring @topic.created_on, @topic.author %>
- -
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>
- - - -

@@ -162,8 +156,9 @@
-
- <%= textilizable message, :content, :attachments => message.attachments %> +
+ <%= textAreailizable message,:content,:attachments => message.attachments %> + <%#= message.content.html_safe %>
<%= link_to_attachments message, :author => false %>
- <% #find_project_repository @project %> - <%= content_tag('span', "#{@project.repository.nil? || @project.project_status.nil? ? '0' : @project.project_status.changesets_count }", :class => "info") %> + + <%= content_tag('span', "#{changesets_num(@project)}", :class => "info") %> <%= content_tag('span', l(:label_commit_on)) %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 20f64dc3f..b70d73eb6 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -129,7 +129,7 @@
- <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier)) %> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %> + <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.id)) %> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %> diff --git a/app/views/users/user_newfeedback.html.erb b/app/views/users/user_newfeedback.html.erb index 22ff5a280..d6337e1d0 100644 --- a/app/views/users/user_newfeedback.html.erb +++ b/app/views/users/user_newfeedback.html.erb @@ -2,7 +2,7 @@
<%= render :partial => 'words/new', :locals => {:user => @user, :sta => @state} %>
-
+
<%= l(:label_newfeedback_message) %>(<%= @feedback_count%>)
diff --git a/app/views/welcome/contest.html.erb b/app/views/welcome/contest.html.erb index 8df19a280..30395aa6f 100644 --- a/app/views/welcome/contest.html.erb +++ b/app/views/welcome/contest.html.erb @@ -197,7 +197,7 @@ <%#= link_to l(:label_more_information), forums_path %>
-
<%= @contestNotification.title %>
+
<%= @contestNotification.title %>
diff --git a/app/views/words/_new.html.erb b/app/views/words/_new.html.erb index aa2001028..bc4d19225 100644 --- a/app/views/words/_new.html.erb +++ b/app/views/words/_new.html.erb @@ -72,7 +72,7 @@ + <%= submit_tag l(:button_cancel), :name => nil, :class => "enterprise", :onclick => "clearMessage('new_form_user_message');", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'" %>
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'"%> - <%= submit_tag l(:button_clear), :name => nil, :class => "enterprise", :onclick => "clearMessage('new_form_user_message');", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'" %>
<% else %> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index a73f9db56..4f0744d86 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1641,7 +1641,7 @@ zh: label_call_bonus: 奖金 label_bids_form_new_description: 企业可以在此发布一个软件开发任务或者一个技术方案需求:(1)获得价廉物美的解决方案;(2)发现对此项任务有贡献的大学生,获得可以招聘的人才。 label_bids_form_contest_new_description: 企业或者高校可以在此发布一个竞赛。 - label_homeworks_form_new_description: 发布一个作业,作业提交方式可以是附件或者项目形式,在作业类型里面设置。 + label_homeworks_form_new_description: 发布一个作业,作业提交方式可以是附件或者项目形式。 label_fork_form_new_description: 该需求将作为某课程的作业被发布,作业提交方式可以使附件或者项目形式,在作业类型里面设置。 label_bids_new_money: 输入奖励金额,如 500,2.5等 label_bids_new_credit: 输入该作业对应课程的学分,如 3,2.5等 diff --git a/config/routes.rb b/config/routes.rb index f93318c7d..ed9001ee2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -275,6 +275,8 @@ RedmineApp::Application.routes.draw do match 'my/remove_block', :controller => 'my', :action => 'remove_block', :via => :post match 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :via => :post + get 'my/page2', :to => 'my#page2', :as => "my_page2" + resources :users match 'users/:id/memberships/:membership_id', :to => 'users#edit_membership', :via => :put, :as => 'user_membership' match 'users/:id/memberships/:membership_id', :to => 'users#destroy_membership', :via => :delete diff --git a/db/schema.rb b/db/schema.rb index cdedc6a2c..525cfb745 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20140812065417) do +ActiveRecord::Schema.define(:version => 20140814062455) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -441,21 +441,21 @@ ActiveRecord::Schema.define(:version => 20140812065417) do t.datetime "created_at", :null => false t.datetime "updated_at", :null => false t.integer "sort_type" - t.integer "image_width", :default => 107 - t.integer "image_height", :default => 63 t.integer "show_course", :default => 1 t.integer "show_contest", :default => 1 + t.integer "image_width", :default => 107 + t.integer "image_height", :default => 63 end create_table "forums", :force => true do |t| - t.string "name", :null => false - t.string "description", :default => "" + t.string "name", :null => false + t.text "description" t.integer "topic_count", :default => 0 t.integer "memo_count", :default => 0 t.integer "last_memo_id", :default => 0 - t.integer "creator_id", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "creator_id", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "groups_users", :id => false, :force => true do |t|