From 720c75478a1912f3779ab62103a4f534efe617df Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 10 Jul 2014 10:15:20 +0800 Subject: [PATCH 01/68] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=8F=AF=E4=BC=A0=E9=9D=9E=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E6=96=87=E4=BB=B6bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/avatar/_avatar_form.html.erb | 3 +++ config/configuration.yml | 1 + config/locales/zh.yml | 1 + lib/redmine/configuration.rb | 3 ++- public/javascripts/avatars.js | 26 +++++++++++++++++++++++++- 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/app/views/avatar/_avatar_form.html.erb b/app/views/avatar/_avatar_form.html.erb index 272397c62..a880f32aa 100644 --- a/app/views/avatar/_avatar_form.html.erb +++ b/app/views/avatar/_avatar_form.html.erb @@ -45,6 +45,7 @@ <%= l(:button_upload_photo) %> + <%= file_field_tag 'avatar[image]', :id => nil, @@ -57,6 +58,8 @@ :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, + :file_type => Redmine::Configuration['pic_types'].to_s, + :type_support_message => l(:error_pic_type), :upload_path => upload_avatar_path(:format => 'js'), :description_placeholder => nil ,# l(:label_optional_description) :source_type => source.class.to_s, diff --git a/config/configuration.yml b/config/configuration.yml index a98ea3391..4bdd279aa 100644 --- a/config/configuration.yml +++ b/config/configuration.yml @@ -199,6 +199,7 @@ default: # Maximum number of simultaneous AJAX uploads #max_concurrent_ajax_uploads: 2 + #pic_types: "bmp,jpeg,jpg,png,gif" # specific configuration options for production environment # that overrides the default ones diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 1b3774d65..716889bbc 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1217,6 +1217,7 @@ zh: button_export: 导出 label_export_options: "%{export_format} 导出选项" error_attachment_too_big: 该文件无法上传。超过文件大小限制 (%{max_size}) + error_pic_type: "仅支持如下图片格式:" notice_failed_to_save_time_entries: "无法保存下列所选取的 %{total} 个项目中的 %{count} 工时: %{ids}。" label_x_issues: zero: 0 问题 diff --git a/lib/redmine/configuration.rb b/lib/redmine/configuration.rb index 6723b777e..ba8e91294 100644 --- a/lib/redmine/configuration.rb +++ b/lib/redmine/configuration.rb @@ -21,7 +21,8 @@ module Redmine # Configuration default values @defaults = { 'email_delivery' => nil, - 'max_concurrent_ajax_uploads' => 2 + 'max_concurrent_ajax_uploads' => 2, + 'pic_types' => "bmp,jpeg,jpg,png,gif" } @config = nil diff --git a/public/javascripts/avatars.js b/public/javascripts/avatars.js index 24bc1ee1c..db9a2255e 100644 --- a/public/javascripts/avatars.js +++ b/public/javascripts/avatars.js @@ -140,10 +140,34 @@ function uploadAndAttachFiles(files, inputEl) { if (sizeExceeded) { window.alert(maxFileSizeExceeded); } else { - $.each(files, function() {addFile(inputEl, this, true);}); + uploadAndTypeFiles(files,inputEl); + //$.each(files, function() {addFile(inputEl, this, true);}); } } +function uploadAndTypeFiles(files, inputEl) { + + var enableType = $(inputEl).data('file-type'); + var typeSupportrdMessage = $(inputEl).data('type-support-message'); + if (enableType == null || enableType.trim() == "") + { + $.each(files, function() {addFile(inputEl, this, true);}); + return; + } + var typeSupported = false; + $.each(files, function() { + var a = this.name.split('.'); + var type = a[a.length-1]; + var rs = enableType.indexOf(type); + if(rs >= 0) {typeSupported = true } + }); + if (typeSupported) { + $.each(files, function() {addFile(inputEl, this, true);}); + } else { + window.alert(typeSupportrdMessage + enableType); + } +} + function handleFileDropEvent(e) { $(this).removeClass('fileover'); From 39434766e3cd18ae9cf964af15d8307ab96ae2b8 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 10 Jul 2014 16:35:53 +0800 Subject: [PATCH 02/68] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E8=B6=85=E7=BA=A7?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E6=97=A0=E6=B3=95=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8=E7=9A=84?= =?UTF-8?q?BUG=202.=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/bids_controller.rb | 2 +- app/models/course.rb | 3 ++- app/views/courses/_course.html.erb | 8 ++++++-- app/views/courses/index.html.erb | 2 ++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index a728ee6e2..b9f9245c8 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -449,7 +449,7 @@ class BidsController < ApplicationController # 显示作业课程 # add by nwb def show_courseEx - if (User.current.logged? && User.current.member_of_course?(@bid.courses.first)) + if (User.current.logged? && (User.current.member_of_course?(@bid.courses.first) || User.current.admin?)) # flash[:notice] = "" @membership = User.current.coursememberships.all(:conditions => Course.visible_condition(User.current)) diff --git a/app/models/course.rb b/app/models/course.rb index 5034ab0d8..bac28e4c2 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -92,7 +92,8 @@ class Course < ActiveRecord::Base # 课程的短描述信息 def short_description(length = 255) - description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description + description.gsub(/<\/?.*?>/,"").strip if description + #description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description end def extra_frozen? diff --git a/app/views/courses/_course.html.erb b/app/views/courses/_course.html.erb index ef8f37566..6b720229a 100644 --- a/app/views/courses/_course.html.erb +++ b/app/views/courses/_course.html.erb @@ -16,7 +16,7 @@ <%= content_tag('span', "#{l(:label_institution_name)}:", :class => "course-font")%> <% @admin = @course.course_infos%> <%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%> - + <% unless @course.teacher.user_extensions.school.nil? %> <%= link_to @course.teacher.user_extensions.school.try(:name), school_course_list_path(@course.teacher.user_extensions.school) %> <% end %> @@ -28,7 +28,7 @@ <%= content_tag('a', @admin.collect{|u| link_to(u.user.lastname+u.user.firstname, user_path(u.user_id))}.join(", ").html_safe) %> <% end %>

- +
@@ -76,6 +76,10 @@
<%= content_tag "span", "#{l(:label_course_brief_introduction)}:", :class => "course-font" %> + <%# desc = course.short_description.nil? ? "" : course.short_description%> + <%= content_tag "div", course.short_description, :class => "brief_introduction", :title => course.short_description %>
diff --git a/app/views/courses/index.html.erb b/app/views/courses/index.html.erb index db94cf6c5..0586262e9 100644 --- a/app/views/courses/index.html.erb +++ b/app/views/courses/index.html.erb @@ -35,6 +35,8 @@
<%if @courses%> <%= render_course_hierarchy(@courses)%> + <%#= render :partial => 'course', :locals => {:course => @courses.first}%> + <%#= "hello".html_safe %> <%end%>
From 47ad20421e3fbe9c481e1fc9290863e230550c0d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 10 Jul 2014 16:48:13 +0800 Subject: [PATCH 03/68] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BD=93=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E6=8F=8F=E8=BF=B0=E4=B8=AD=E6=9C=89=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=98=AF=EF=BC=8C=E8=AF=BE=E7=A8=8B=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=8F=8F=E8=BF=B0=E6=98=BE=E7=A4=BA=E6=9C=89=E8=AF=AF?= =?UTF-8?q?=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/models/course.rb b/app/models/course.rb index bac28e4c2..7db789a7a 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -92,10 +92,21 @@ class Course < ActiveRecord::Base # 课程的短描述信息 def short_description(length = 255) - description.gsub(/<\/?.*?>/,"").strip if description + description.gsub(/<\/?.*?>/,"").html_safe if description #description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description end + def strip_html(html) + return html if html.empty? || !html.include?('<') + output = "" + tokenizer = HTML::Tokenizer.new(html) + while token = tokenizer.next + node = HTML::Node.parse(nil, 0, 0, token, false) + output += token unless (node.kind_of? HTML::Tag) or (token =~ /^ Date: Thu, 10 Jul 2014 16:57:04 +0800 Subject: [PATCH 04/68] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5=E4=B8=AD=E4=BD=9C=E4=B8=9A=E3=80=81=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E4=BB=8B=E7=BB=8D=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84?= =?UTF-8?q?BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/open_source_project.rb | 3 ++- app/models/project.rb | 3 ++- app/views/users/_course_form.html.erb | 2 +- app/views/users/user_projects.html.erb | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/models/open_source_project.rb b/app/models/open_source_project.rb index e3556ce55..2de5966bb 100644 --- a/app/models/open_source_project.rb +++ b/app/models/open_source_project.rb @@ -84,7 +84,8 @@ class OpenSourceProject < ActiveRecord::Base # end def short_description(length = 255) - description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description + #description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description + description.gsub(/<\/?.*?>/,"").html_safe if description end def applied_by?(user) diff --git a/app/models/project.rb b/app/models/project.rb index 5efaf10ab..4bd1f2774 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -623,7 +623,8 @@ class Project < ActiveRecord::Base # Returns a short description of the projects (first lines) def short_description(length = 255) - description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description + #description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description + description.gsub(/<\/?.*?>/,"").html_safe if description end def css_classes diff --git a/app/views/users/_course_form.html.erb b/app/views/users/_course_form.html.erb index f5cada9a8..4d9c58392 100644 --- a/app/views/users/_course_form.html.erb +++ b/app/views/users/_course_form.html.erb @@ -32,7 +32,7 @@

- <%= membership.course.description %> + <%= membership.course.short_description %>

diff --git a/app/views/users/user_projects.html.erb b/app/views/users/user_projects.html.erb index e16700cd1..66ddcaae2 100644 --- a/app/views/users/user_projects.html.erb +++ b/app/views/users/user_projects.html.erb @@ -30,7 +30,7 @@

- <%= membership.project.description%> + <%= membership.project.short_description%>

From 51ef3fa5a18799f34f0d3e398ac936014bafb520 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 10 Jul 2014 16:58:57 +0800 Subject: [PATCH 05/68] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=BB=8B=E7=BB=8D=E6=98=BE=E7=A4=BA=E6=9C=89?= =?UTF-8?q?=E8=AF=AF=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/welcome/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 345f47739..890155915 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -65,7 +65,7 @@ (<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
- ><%=project.description.truncate(50, omission: '...')%> + ><%=project.short_description.truncate(50, omission: '...')%>
<% issue_count = project.issues.count %> From b4dd8409eb57b17bce852226dcabaeceb8361a38 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 10 Jul 2014 17:38:04 +0800 Subject: [PATCH 06/68] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=89=98=E7=AE=A1=E5=B9=B3=E5=8F=B0=E9=A6=96=E9=A1=B5=E5=AE=9A?= =?UTF-8?q?=E5=88=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 30 +++++++++++++++++++ app/controllers/welcome_controller.rb | 2 +- app/helpers/application_helper.rb | 7 ++++- app/models/first_page.rb | 3 ++ app/views/admin/first_page_made.html.erb | 28 +++++++++++++++++ app/views/users/_score_new_index.html.erb | 6 ++-- app/views/users/_show_new_score.html.erb | 12 ++++---- app/views/users/_user_score.html.erb | 2 +- app/views/users/show_new_score.html.erb | 12 ++++---- app/views/welcome/index.html.erb | 12 ++++++-- config/locales/zh.yml | 5 ++++ config/routes.rb | 1 + .../20140710071720_create_first_pages.rb | 17 +++++++++++ db/schema.rb | 10 ++++++- lib/redmine.rb | 1 + test/fixtures/first_pages.yml | 11 +++++++ test/unit/first_page_test.rb | 7 +++++ 17 files changed, 144 insertions(+), 22 deletions(-) create mode 100644 app/models/first_page.rb create mode 100644 app/views/admin/first_page_made.html.erb create mode 100644 db/migrate/20140710071720_create_first_pages.rb create mode 100644 test/fixtures/first_pages.yml create mode 100644 test/unit/first_page_test.rb diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 2a3ce15d8..152fb059e 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -234,4 +234,34 @@ class AdminController < ApplicationController format.api end end + + #首页定制 + def first_page_made + if request.get? + @first_page = FirstPage.all.first + elsif request.post? + @first_page = FirstPage.all.first + @first_page.web_title = params[:web_title] + @first_page.description = params[:description] + @first_page.title = params[:title] + if @first_page.save + respond_to do |format| + format.html { + flash[:notice] = l(:notice_successful_update) + redirect_to admin_first_page_made_path + } + format.api { render_api_ok } + end + else + respond_to do |format| + format.html { + first_page_made + render :action => 'first_page_made' + } + format.api { render_validation_errors(@first_page) } + end + end + end + + end end diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index bf18332df..0920d2e42 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -21,7 +21,7 @@ class WelcomeController < ApplicationController before_filter :entry_select, :only => [:index] def index - + @first_page = FirstPage.all.first end def robots diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c9dc4fa26..3f873a64d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -625,10 +625,15 @@ module ApplicationHelper end def html_title(*args) + first_page = FirstPage.all.first if args.empty? title = @html_title || [] title << @project.name if @project - title << Setting.app_title unless Setting.app_title == title.last + if first_page.nil? || first_page.web_title.nil? + title << Setting.app_title unless Setting.app_title == title.last + else + title << first_page.web_title unless first_page.web_title == title.last + end title.select {|t| !t.blank? }.join(' - ') else @html_title ||= [] diff --git a/app/models/first_page.rb b/app/models/first_page.rb new file mode 100644 index 000000000..8d8bbcff6 --- /dev/null +++ b/app/models/first_page.rb @@ -0,0 +1,3 @@ +class FirstPage < ActiveRecord::Base + attr_accessible :description, :title, :web_title +end diff --git a/app/views/admin/first_page_made.html.erb b/app/views/admin/first_page_made.html.erb new file mode 100644 index 000000000..9e863d813 --- /dev/null +++ b/app/views/admin/first_page_made.html.erb @@ -0,0 +1,28 @@ +

<%=l(:label_first_page_made)%>

+ +<%= form_tag(:controller => 'admin', :action => 'first_page_made') do %> +

+ +

+
+ <%= render :partial=>"avatar/avatar_form",:style => "display:inline",:locals=> {source:@first_page} %> +
+

+ + <%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %> +

+

+ + <%= text_field_tag 'title', params[:label_site_title], :value => @first_page.title,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %> +

+

+ + <%= text_area_tag 'description',@first_page.description,:rows => 8, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %> +

+ <%= submit_tag l(:button_save), :class => "small", :name => nil %> +<% end %> +
+ + + +
\ No newline at end of file diff --git a/app/views/users/_score_new_index.html.erb b/app/views/users/_score_new_index.html.erb index 43687aa78..0f5d96a45 100644 --- a/app/views/users/_score_new_index.html.erb +++ b/app/views/users/_score_new_index.html.erb @@ -28,7 +28,7 @@
= <%= l(:label_user_score_of_collaboration) %> + <%= l(:label_user_score_of_influence) %> + <%= l(:label_user_score_of_skill)%> + <%= l(:label_user_score_of_active) %>
-
= <%= format("%.2f" ,@user.user_score_attr.collaboration.nil? ? 0:@user.user_score_attr.collaboration).to_f %> + <%= format("%.2f" , @user.user_score_attr.influence.nil? ? 0:@user.user_score_attr.influence ).to_f %> - + <%= format("%.2f" , @user.user_score_attr.skill.nil? ? 0:@user.user_score_attr.skill).to_f %> + <%= format("%.2f" , @user.user_score_attr.active.nil? ? 0:@user.user_score_attr.active).to_f %>
-
= <%= format("%.2f" ,@user.user_score_attr.total_score.nil? ? 0:@user.user_score_attr.total_score).to_f %>
+
= <%= format("%.2f" ,@user.user_score_attr.collaboration.nil? ? 0:@user.user_score_attr.collaboration).to_i %> + <%= format("%.2f" , @user.user_score_attr.influence.nil? ? 0:@user.user_score_attr.influence ).to_i %> + + <%= format("%.2f" , @user.user_score_attr.skill.nil? ? 0:@user.user_score_attr.skill).to_i %> + <%= format("%.2f" , @user.user_score_attr.active.nil? ? 0:@user.user_score_attr.active).to_i %>
+
= <%= format("%.2f" ,@user.user_score_attr.total_score.nil? ? 0:@user.user_score_attr.total_score).to_i %>
diff --git a/app/views/users/_show_new_score.html.erb b/app/views/users/_show_new_score.html.erb index c5f15694e..fddca46ac 100644 --- a/app/views/users/_show_new_score.html.erb +++ b/app/views/users/_show_new_score.html.erb @@ -38,7 +38,7 @@ - +
<%= l(:label_user_score) %>
<%= format("%.2f" , @user.user_score_attr.total_score).to_f %>
<%= format("%.2f" , @user.user_score_attr.total_score).to_i %>
@@ -49,23 +49,23 @@ <%= link_to l(:label_user_score) , {:controller => 'users', :action => 'score_new_index', :remote => true} %> : - <%= format("%.2f" , @user.user_score_attr.total_score).to_f %> + <%= format("%.2f" , @user.user_score_attr.total_score).to_i %>
<%= link_to l(:label_user_score_of_collaboration), {:controller => 'users',:action => 'topic_new_score_index', :remote => true} %> : - <%= format("%.2f" , @user.user_score_attr.collaboration.nil? ? 0:@user.user_score_attr.collaboration).to_f %> + <%= format("%.2f" , @user.user_score_attr.collaboration.nil? ? 0:@user.user_score_attr.collaboration).to_i %>
<%= link_to l(:label_user_score_of_influence), {:controller => 'users',:action => 'project_new_score_index', :remote => true} %> : - <%= format("%.2f" , @user.user_score_attr.influence.nil? ? 0:@user.user_score_attr.influence).to_f %> + <%= format("%.2f" , @user.user_score_attr.influence.nil? ? 0:@user.user_score_attr.influence).to_i %>
<%= link_to l(:label_user_score_of_skill), {:controller => 'users',:action => 'activity_new_score_index', :remote => true} %> : - <%= format("%.2f" , @user.user_score_attr.skill.nil? ? 0:@user.user_score_attr.skill).to_f %> + <%= format("%.2f" , @user.user_score_attr.skill.nil? ? 0:@user.user_score_attr.skill).to_i %>
<%= link_to l(:label_user_score_of_active), {:controller => 'users',:action => 'influence_new_score_index', :remote => true} %> : - <%= format("%.2f" , @user.user_score_attr.active.nil? ? 0:@user.user_score_attr.active).to_f %> + <%= format("%.2f" , @user.user_score_attr.active.nil? ? 0:@user.user_score_attr.active).to_i %>
diff --git a/app/views/users/_user_score.html.erb b/app/views/users/_user_score.html.erb index d047c11d0..53f05a2dd 100644 --- a/app/views/users/_user_score.html.erb +++ b/app/views/users/_user_score.html.erb @@ -1,5 +1,5 @@ <%= l(:label_user_grade)%>: -<%= link_to(format("%.2f" , user.user_score_attr.total_score).to_f, {:controller => 'users', +<%= link_to(format("%.2f" , user.user_score_attr.total_score).to_i, {:controller => 'users', :action => 'show_new_score', :remote => true, :id => user.id diff --git a/app/views/users/show_new_score.html.erb b/app/views/users/show_new_score.html.erb index 07e82fd5f..0efae940c 100644 --- a/app/views/users/show_new_score.html.erb +++ b/app/views/users/show_new_score.html.erb @@ -53,7 +53,7 @@ - +
<%= l(:label_user_score) %>
<%= format("%.2f" , @user.user_score_attr.total_score).to_f %>
<%= format("%.2f" , @user.user_score_attr.total_score).to_i %>
@@ -64,23 +64,23 @@ <%= l(:label_user_score) %> : - <%= format("%.2f" , @user.user_score_attr.total_score).to_f %> + <%= format("%.2f" , @user.user_score_attr.total_score).to_i %>
<%= l(:label_user_score_of_collaboration) %> : - <%= format("%.2f" , @user.user_score_attr.collaboration.nil? ? 0:@user.user_score_attr.collaboration).to_f %> + <%= format("%.2f" , @user.user_score_attr.collaboration.nil? ? 0:@user.user_score_attr.collaboration).to_i %>
<%= l(:label_user_score_of_influence) %> : - <%= format("%.2f" , @user.user_score_attr.influence.nil? ? 0:@user.user_score_attr.influence).to_f %> + <%= format("%.2f" , @user.user_score_attr.influence.nil? ? 0:@user.user_score_attr.influence).to_i %>
<%= l(:label_user_score_of_skill) %> : - <%= format("%.2f" , @user.user_score_attr.skill.nil? ? 0:@user.user_score_attr.skill).to_f %> + <%= format("%.2f" , @user.user_score_attr.skill.nil? ? 0:@user.user_score_attr.skill).to_i %>
<%= l(:label_user_score_of_active) %> : - <%= format("%.2f" , @user.user_score_attr.active.nil? ? 0:@user.user_score_attr.active).to_f %> + <%= format("%.2f" , @user.user_score_attr.active.nil? ? 0:@user.user_score_attr.active).to_i %>
diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 345f47739..ffc9706e9 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -30,13 +30,19 @@ +
- <%= image_tag '/images/transparent.png', size: "75x75" %> + + <% if get_avatar?(@first_page) %> + <%= image_tag(url_to_avatar(@first_page), size: "75x75") %> + <% else %> + <%= image_tag '/images/transparent.png', size: "75x75" %> + <% end %> +
- <%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_project) %> , <%= l(:label_welcome_trustie_project_description) %> + <%= @first_page.title %> , <%= @first_page.description %>