diff --git a/app/controllers/avatar_controller.rb b/app/controllers/avatar_controller.rb index fa7eb6052..b7dec5453 100644 --- a/app/controllers/avatar_controller.rb +++ b/app/controllers/avatar_controller.rb @@ -55,17 +55,20 @@ class AvatarController < ApplicationController # saved = @avatar.save begin f = Magick::ImageList.new(diskfile) - width = 300.0 - proportion = (width/f[0].columns) - height = (f[0].rows*proportion) - f.resize_to_fill!(width,height) - # f.scale!(width,height) - f.write(diskfile) + # gif格式不再做大小处理 + if f.format != 'GIF' + width = 300.0 + proportion = (width/f[0].columns) + height = (f[0].rows*proportion) + f.resize_to_fill!(width,height) + f.write(diskfile) + end + rescue Exception => e logger.error "[Error] avatar : avatar_controller#upload ===> #{e}" end - + respond_to do |format| format.js format.api { diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 38ae662fc..aa5e2c2a6 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -605,6 +605,15 @@ class CoursesController < ApplicationController events = @activity.events(@date_from, @date_to, :is_public => 1) end + # 无新动态时,显示老动态 + if events.count == 0 + if User.current.member_of_course?(@course)|| User.current.admin? + events = @activity.events + else + events = @activity.events(:is_public => 1) + end + end + @offset, @limit = api_offset_and_limit({:limit => 10}) @events_count = events.count @events_pages = Paginator.new @events_count, @limit, params['page'] diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index f3ab77603..c0561bd1c 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -594,6 +594,7 @@ class ProjectsController < ApplicationController "show_news" => true, "show_bids" => true, "show_contests" => true, + "show_wiki_edits"=>true, "show_journals_for_messages" => true } @date_to ||= Date.today + 1 diff --git a/app/models/repository.rb b/app/models/repository.rb index 260069f94..5680f05a7 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -39,7 +39,8 @@ class Repository < ActiveRecord::Base validates_length_of :password, :maximum => 255, :allow_nil => true validates_length_of :identifier, :maximum => IDENTIFIER_MAX_LENGTH, :allow_blank => true validates_presence_of :identifier#, :unless => Proc.new { |r| r.is_default? || r.set_as_default? } - validates_uniqueness_of :identifier, :scope => :project_id, :allow_blank => true + #validates_uniqueness_of :identifier, :scope => :project_id, :allow_blank => true + validates_uniqueness_of :identifier, :allow_blank => true validates_exclusion_of :identifier, :in => %w(show entry raw changes annotate diff show stats graph) # donwcase letters, digits, dashes, underscores but not digits only validates_format_of :identifier, :with => /^[a-z0-9_\-]+$/, :allow_blank => true diff --git a/db/schema.rb b/db/schema.rb index e23fd19d2..1307dd913 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -437,9 +437,9 @@ ActiveRecord::Schema.define(:version => 20140826072838) do t.string "web_title" t.string "title" t.text "description" - t.string "page_type" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false + t.string "page_type" t.integer "sort_type" t.integer "show_course", :default => 1 t.integer "show_contest", :default => 1 @@ -458,6 +458,26 @@ ActiveRecord::Schema.define(:version => 20140826072838) do t.datetime "updated_at", :null => false end + create_table "gitlab_projects", :force => true do |t| + t.integer "gitlab_project_id" + t.integer "project_id" + t.string "repository_url" + t.string "web_url" + t.string "localfile_url" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "gitlab_users", :force => true do |t| + t.integer "gitlab_user_id" + t.integer "user_id" + t.string "email" + t.string "password" + t.string "login", :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| t.integer "group_id", :null => false t.integer "user_id", :null => false