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/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/file.html.erb b/app/views/attachments/file.html.erb index c85cbe32a..37db6f2bc 100644 --- a/app/views/attachments/file.html.erb +++ b/app/views/attachments/file.html.erb @@ -4,14 +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 %>)    - <%= link = link_to(l(:button_add), {:controller => 'code_review', + (<%= 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/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/projects/_file_score_index.html.erb b/app/views/projects/_file_score_index.html.erb index ce80ddbd2..bfc87097e 100644 --- a/app/views/projects/_file_score_index.html.erb +++ b/app/views/projects/_file_score_index.html.erb @@ -1,4 +1,4 @@ -
<%= l(:label_file_number) %> * 4 = <%= document_num(@project) %> * 4 = <%= format("%.2f" , document_score(@project)).to_i %>
-
<%= l(:label_file_score) %> = <%= format("%.2f" , document_score(@project)).to_i %>
+
<%= l(:label_file_number) %> * 4 = <%= documents_num(@project) %> * 4 = <%= format("%.2f" , documents_score(@project)).to_i %>
+
<%= l(:label_file_score) %> = <%= format("%.2f" , documents_score(@project)).to_i %>
\ No newline at end of file diff --git a/app/views/projects/_project.html.erb b/app/views/projects/_project.html.erb index 3d7cdfb6c..92e20f9e4 100644 --- a/app/views/projects/_project.html.erb +++ b/app/views/projects/_project.html.erb @@ -45,8 +45,8 @@
- <%= line_num %> + + <%= line_num %> -
<%= line.html_safe %>
+
<%= line.html_safe %>
- <% #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/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 %>