Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
Conflicts: db/schema.rbcompetition
commit
1922593fee
@ -0,0 +1,6 @@
|
|||||||
|
class AddColumn < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column("first_pages","image_width",:integer,default: 107)
|
||||||
|
add_column("first_pages","image_height",:integer,default: 63)
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,28 @@
|
|||||||
|
class InsertToSetting < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
ss = Setting.find_all_by_name("plugin_redmine_ckeditor")
|
||||||
|
if ss.nil?
|
||||||
|
sett = Setting.new
|
||||||
|
sett.name = "plugin_redmine_ckeditor"
|
||||||
|
sett.value = "--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess
|
||||||
|
skin: kama
|
||||||
|
ui_color: ! '#f4f4f4'
|
||||||
|
width: ''
|
||||||
|
height: '400'
|
||||||
|
enter_mode: '1'
|
||||||
|
show_blocks: '1'
|
||||||
|
toolbar_can_collapse: '0'
|
||||||
|
toolbar_location: top
|
||||||
|
toolbar: Source,ShowBlocks,--,Undo,Redo,-,Find,Replace,--,Bold,Italic,Underline,Strike,-,Subscript,Superscript,-,NumberedList,BulletedList,-,Outdent,Indent,Blockquote,-,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,-,Link,Unlink,-,richImage,Table,HorizontalRule,/,Styles,Format,Font,FontSize,-,TextColor,BGColor,Cut,Copy,Paste,BidiLtr,BidiRtl,PasteText,PasteFromWord,RemoveFormat,SelectAll"
|
||||||
|
sett.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
ss = Setting.find_all_by_name("plugin_redmine_ckeditor")
|
||||||
|
if ss.nil?
|
||||||
|
else
|
||||||
|
ss.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,26 @@
|
|||||||
|
# -*coding:utf-8 -*-
|
||||||
|
desc "First Page Initialize"
|
||||||
|
task :first_page do
|
||||||
|
puts "first_page sync."
|
||||||
|
end
|
||||||
|
|
||||||
|
namespace :first_page do
|
||||||
|
desc "initialize first page"
|
||||||
|
task :initialize => :environment do
|
||||||
|
first_page = FirstPage.where("page_type = 'project'").first
|
||||||
|
first_page.description = "<div style='margin-top: 3px;'><span style='font-weight: bold; font-size: 18px; color: #e8770d;display:inline-block; margin-top: 5px;'>micROS多态智能集群机器人操作系统 </span><br />
|
||||||
|
<span style='font-weight:bold; font-size:18px;color:#15bccf; display:inline-block;margin-top:5px;''>中国开源社区 </span></div>"
|
||||||
|
first_page.image_width = 107;
|
||||||
|
first_page.image_height = 63;
|
||||||
|
course_page = FirstPage.where("page_type = 'course'").first
|
||||||
|
course_page.image_width = 75
|
||||||
|
course_page.image_height = 75
|
||||||
|
contest_page = FirstPage.where("page_type = 'contest'").first
|
||||||
|
contest_page.image_width = 75
|
||||||
|
contest_page.image_height = 75
|
||||||
|
first_page.save
|
||||||
|
course_page.save
|
||||||
|
contest_page.save
|
||||||
|
puts "initialized Successfully"
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in new issue