diff --git a/app/api/mobile/apis/upgrade.rb b/app/api/mobile/apis/upgrade.rb index e6a7916d9..9ce1831f3 100644 --- a/app/api/mobile/apis/upgrade.rb +++ b/app/api/mobile/apis/upgrade.rb @@ -15,7 +15,7 @@ module Mobile if attachment.nil? raise '未发现客户端!' end - url = Setting.host_name + "/attachments/download/" + attachment.id.to_s + "/" + attachment.filename + url = "http://" + Setting.host_name + "/attachments/download/" + attachment.id.to_s + "/" + attachment.filename { version: @current_version.version, url: url, diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 72f4bdd92..23b080d94 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -20,9 +20,9 @@ class AttachmentsController < ApplicationController before_filter :find_project, :only => [:show, :download, :thumbnail, :destroy, :delete_homework]#, :except => [:upload, :autocomplete] before_filter :file_readable, :read_authorize, :only => [:show, :thumbnail]#Modified by young - before_filter :delete_authorize, :only => :destroy - before_filter :authorize_global, :only => :upload - before_filter :authorize_attachment_download1, :only => :download + before_filter :delete_authorize, :only => [:destroy] + before_filter :authorize_global, :only => [:upload] + before_filter :authorize_attachment_download1, :only => [:download] #before_filter :login_without_softapplication, only: [:download] accept_api_auth :show, :download, :upload require 'iconv' diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index d0be72961..ba312c74a 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -99,7 +99,7 @@ class MembersController < ApplicationController @project.members << members # added by nie @project.project_infos << project_info - @project.user_grades << user_grades + @project.user_grades << user_grades unless user_grades.first.user_id.nil? # end end if members.present? && members.all? { |m| m.valid? } @@ -108,7 +108,11 @@ class MembersController < ApplicationController end end if params[:flag] - flash[:notice] = l(:label_invite_success) + unless members.present? && members.all? {|m| m.valid? } + flash[:error] = members.collect {|m| m.errors.full_messages}.flatten.uniq.join(', ') + else + flash[:notice] = l(:label_invite_success) + end respond_to do |format| format.html { redirect_to invite_members_project_url(@project) } end diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index c9ea1ca80..1ec8a0ef0 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -1,3 +1,4 @@ +#coding=utf-8 class CoursesService include ApplicationHelper include CoursesHelper @@ -381,7 +382,7 @@ class CoursesService end latest_bid_message = messages.first unless latest_bid_message.nil? - latest_course_dynamics << {:type => 4,:time => latest_bid_message.created_on,:message => '最近更新了作业'}#l(:label_recently_updated_message,:locale => current_user.language.nil? ? 'zh':current_user.language)} + latest_course_dynamics << {:type => 4,:time => latest_bid_message.created_on,:message => l(:label_recently_updated_message,:locale => current_user.language.nil? ? 'zh':current_user.language)} end #每个作业中学生最后提交的作业 homeworks = [] @@ -396,7 +397,7 @@ class CoursesService end latest_homework_attach = homeworks.first unless latest_homework_attach.nil? - latest_course_dynamics << {:type => 4,:time => latest_homework_attach.updated_at,:message => '最近更新了作业'}#l(:label_recently_updated_homework,:locale => current_user.language.nil? ? 'zh':current_user.language)} + latest_course_dynamics << {:type => 4,:time => latest_homework_attach.updated_at,:message => l(:label_recently_updated_homework,:locale => current_user.language.nil? ? 'zh':current_user.language)} end latest_course_dynamics.sort!{|order,newer| newer[:time] <=> order[:time]} latest_course_dynamic = latest_course_dynamics.first diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index cd1e1f40f..bf6862244 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -7,10 +7,10 @@ #scrollsidebar a{ text-decoration:none;} html{ overflow-x:hidden;} - .scrollsidebar{ position:absolute;top:1px; right:1px; background:none; } + .scrollsidebar{ position:fixed;bottom:1px; right:1px; background:none; } .side_content{width:154px; height:auto; overflow:hidden; float:left; } .side_content .side_list {width:154px;overflow:hidden;} - .show_btn{ width:0; height:112px; overflow:hidden; float:left; cursor:pointer;} + .show_btn{ width:0; height:112px; overflow:hidden; float:left;margin-top: 200px; cursor:pointer;} .show_btn span { display:none;} .close_btn{width:24px;height:24px;cursor:pointer;} .side_title,.side_bottom,.close_btn,.show_btn {background:url(/images/sidebar_bg.png) no-repeat; } @@ -89,7 +89,7 @@ closeBtn.bind("click",function(){ sideContent.animate({width: '0px'},"fast"); show_btn.stop(true, true).delay(300).animate({ width: '25px'},"fast"); - cookiesave('minStatue','true','','',''); + cookiesave('minStatue','false','','',''); }); //show??? show_btn.bind("click",function() { diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 23f0be5e6..3098a5cda 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -101,8 +101,8 @@
-
- <%= link_to @project.name, project_path(@project) %> +
+ <%= link_to @project.name, project_path(@project), :style => "color:#3E4040"%> <% if !@project.is_public? %> <%= l(:label_private)%> <% end %> @@ -151,7 +151,7 @@ (<%= @project.issues.count %>) <% end %> <% if User.current.member_of?(@project) %> - <%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %> + <%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:16px;margin-top:4px;background:#28be6c;float:right;line-height:20px;" %> <% end %>
<% end %> @@ -162,7 +162,7 @@ (<%= @project.boards.first.topics.count %>) <% end %> <% if User.current.member_of?(@project) %> - <%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects',:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:4px;background:#28be6c;float:right;line-height:20px;" %> + <%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects',:style => "font-size:12px;color:#fff; padding:0px 3px 3px 3px;height:16px;margin-top:5px;background:#28be6c;float:right;line-height:20px;" %> <% end %>
<% end%> @@ -173,16 +173,14 @@ (<%= @project.attachments.count %>) <% end %> <% if User.current.member_of?(@project) %> - <%= link_to "+"+l(:label_upload_files), project_files_path(@project,:flag => true),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %> + <%= link_to "+"+l(:label_upload_files), project_files_path(@project,:flag => true),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:16px;margin-top:4px;background:#28be6c;float:right;line-height:20px;" %> <% end %> <% end%> - <% unless @project.enabled_modules.where("name = 'repository'").empty? %> + <% unless @project.enabled_modules.where("name = 'repository'").empty? || @project.repositories.count == 0 %>
-

邀请Trustie注册用户

+

<%= l(:label_invite_trustie_user) %>

<% if roles.any? %> <%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :method => :post}) do |f| %>