Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
Conflicts: db/schema.rb
This commit is contained in:
commit
1922593fee
|
@ -150,6 +150,8 @@ class AdminController < ApplicationController
|
|||
@first_page.web_title = params[:web_title]
|
||||
@first_page.description = params[:first_page][:description]
|
||||
#@first_page.title = params[:title]
|
||||
@first_page.image_width = params[:image_width]
|
||||
@first_page.image_height = params[:image_height]
|
||||
@first_page.sort_type = params[:sort_type]
|
||||
if @first_page.save
|
||||
respond_to do |format|
|
||||
|
@ -183,6 +185,8 @@ class AdminController < ApplicationController
|
|||
@first_page.web_title = params[:web_title]
|
||||
@course_page.web_title = params[:web_title]
|
||||
@course_page.title = params[:course_title]
|
||||
@course_page.image_width = params[:image_width]
|
||||
@course_page.image_height = params[:image_height]
|
||||
@course_page.description = params[:course_description]
|
||||
if @first_page.save && @course_page.save
|
||||
respond_to do |format|
|
||||
|
@ -219,6 +223,8 @@ class AdminController < ApplicationController
|
|||
@first_page.web_title = params[:web_title]
|
||||
@contest_page.web_title = params[:web_title]
|
||||
@contest_page.title = params[:contest_title]
|
||||
@contest_page.image_width = params[:image_width]
|
||||
@contest_page.image_height = params[:image_height]
|
||||
@contest_page.description = params[:contest_description]
|
||||
@notification.title = params[:contest_notification_title]
|
||||
@notification.content = params[:contest_notification][:content]
|
||||
|
|
|
@ -2,5 +2,7 @@ class FirstPage < ActiveRecord::Base
|
|||
attr_accessible :description, :title, :web_title,:page_type,:sort_type
|
||||
validates_presence_of :web_title, :title, :description,:page_type
|
||||
validates_length_of :web_title,:title, maximum: 30
|
||||
validates_inclusion_of :image_width,:in => 50..120, :message => l(:image_width_error_message)
|
||||
validates_inclusion_of :image_height,:in => 50..80, :message => l(:image_height_error_message)
|
||||
#validates_length_of :description, maximum: 100
|
||||
end
|
||||
|
|
|
@ -20,6 +20,14 @@
|
|||
<div style="margin-left: 82px;" id="avatar">
|
||||
<%= render :partial=>"avatar/avatar_form",:style => "display:inline",:locals=> {source:@contest_page} %>
|
||||
</div>
|
||||
<p style="margin-left:60px;padding-right: 20px;">
|
||||
<label for='image_width' style="vertical-align: top"> <%= l(:label_image_width)%>:</label>
|
||||
<%= text_field_tag 'image_width', params[:label_image_width],:value => @contest_page.image_width,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||
</p>
|
||||
<p style="margin-left:60px;padding-right: 20px;">
|
||||
<label for='image_height' style="vertical-align: top"> <%= l(:label_imgae_height)%>:</label>
|
||||
<%= text_field_tag 'image_height', params[:label_imgae_height], :value => @contest_page.image_height,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||
</p>
|
||||
<p style="margin-left:60px;padding-right: 20px;">
|
||||
<label for='contest_title'> <%= l(:label_site_title) %>:</label>
|
||||
<%= text_field_tag 'contest_title', params[:label_site_title], :value => @contest_page.title,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||
|
|
|
@ -19,6 +19,14 @@
|
|||
<div style="margin-left: 82px;" id="avatar">
|
||||
<%= render :partial=>"avatar/avatar_form",:style => "display:inline",:locals=> {source:@course_page} %>
|
||||
</div>
|
||||
<p style="margin-left:60px;padding-right: 20px;">
|
||||
<label for='image_width' style="vertical-align: top"> <%= l(:label_image_width)%>:</label>
|
||||
<%= text_field_tag 'image_width', params[:label_image_width],:value => @course_page.image_width,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||
</p>
|
||||
<p style="margin-left:60px;padding-right: 20px;">
|
||||
<label for='image_height' style="vertical-align: top"> <%= l(:label_imgae_height)%>:</label>
|
||||
<%= text_field_tag 'image_height', params[:label_imgae_height], :value => @course_page.image_height,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||
</p>
|
||||
<p style="margin-left:60px;padding-right: 20px;">
|
||||
<label for='course_title'> <%= l(:label_site_title) %>:</label>
|
||||
<%= text_field_tag 'course_title', params[:label_site_title], :value => @course_page.title,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||
|
|
|
@ -19,7 +19,14 @@
|
|||
<div style="margin-left: 82px;" id="avatar">
|
||||
<%= render :partial=>"avatar/avatar_form",:style => "display:inline",:locals=> {source:@first_page} %>
|
||||
</div>
|
||||
|
||||
<p style="margin-left:60px;padding-right: 20px;">
|
||||
<label for='image_width' style="vertical-align: top"> <%= l(:label_image_width)%>:</label>
|
||||
<%= text_field_tag 'image_width', params[:label_image_width],:value => @first_page.image_width,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||
</p>
|
||||
<p style="margin-left:60px;padding-right: 20px;">
|
||||
<label for='image_height' style="vertical-align: top"> <%= l(:label_imgae_height)%>:</label>
|
||||
<%= text_field_tag 'image_height', params[:label_imgae_height], :value => @first_page.image_height,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||
</p>
|
||||
<!-- <p style="margin-left:60px;padding-right: 20px;">
|
||||
<label for='title'> <#%= l(:label_site_title) %>:</label>
|
||||
<#%= text_field_tag 'title', params[:label_site_title], :value => @first_page.title,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||
|
|
|
@ -143,7 +143,7 @@
|
|||
</p>
|
||||
<% end %>
|
||||
<% unless @user.user_extensions.nil? %>
|
||||
<p>
|
||||
<p style="width: 100%;word-break: break-all">
|
||||
<%= @user.user_extensions.brief_introduction %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
|
|
@ -18,37 +18,37 @@
|
|||
|
||||
<div class="information">
|
||||
<p class="stats">
|
||||
<table style="padding-left: 100px">
|
||||
<table style="width: 400px;">
|
||||
<tr>
|
||||
<td style="width: 40%;text-align: right;font-size: 17px;">
|
||||
<td style="width: 50%;text-align: right;font-size: 17px;">
|
||||
<strong><%= link_to @project.watcher_users.count, project_watcherlist_path(project)%></strong>
|
||||
</td>
|
||||
<td style="width: 60%;text-align: left">
|
||||
<td style="width: 50%;text-align: left">
|
||||
<%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 40%;text-align: right;font-size: 17px;">
|
||||
<td style="width: 50%;text-align: right;font-size: 17px;">
|
||||
<strong><%= link_to "#{@project.members.count}", project_member_path(@project)%></strong>
|
||||
</td>
|
||||
<td style="width: 60%;text-align: left">
|
||||
<td style="width: 50%;text-align: left">
|
||||
<%= content_tag('span', l(:label_x_current_contributors, :count => @project.users.count)) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 40%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
|
||||
<td style="width: 50%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
|
||||
<strong><%= content_tag('span', "#{(@project.repository.nil? || @project.repository.changesets[0].nil?) ? '0' : distance_of_time_in_words(Time.now, @project.repository.changesets[0].committed_on)}", :class => "info") %></strong>
|
||||
</td>
|
||||
<td style="width: 60%;text-align: left">
|
||||
<td style="width: 50%;text-align: left">
|
||||
<%= content_tag('span', l(:label_since_last_commits)) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 40%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
|
||||
<td style="width: 50%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
|
||||
<% find_project_repository @project %>
|
||||
<strong><%= content_tag('span', "#{@project.repository.nil? || @project.project_status.nil? ? '0' : @project.project_status.changesets_count }", :class => "info") %></strong>
|
||||
</td>
|
||||
<td style="width: 60%;text-align: left">
|
||||
<td style="width: 50%;text-align: left">
|
||||
<%= content_tag('span', l(:label_commit_on)) %>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -121,11 +121,11 @@
|
|||
</div>
|
||||
<div class="main-content-bar" id="main-content-bar">
|
||||
<!--文字-->
|
||||
<div style="float: left">
|
||||
<div style="float: left;padding-left:15px;">
|
||||
<% if get_avatar?(@contest_page) %>
|
||||
<%= image_tag(url_to_avatar(@contest_page), size: "75x75") %>
|
||||
<%= image_tag(url_to_avatar(@contest_page), width:@contest_page.image_width,height: @contest_page.image_height) %>
|
||||
<% else %>
|
||||
<%= image_tag '/images/transparent.png', size: "75x75" %>
|
||||
<%= image_tag '/images/transparent.png', width:@contest_page.image_width,height: @contest_page.image_height %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="welcome_left" id="welcome_left">
|
||||
|
|
|
@ -37,8 +37,8 @@
|
|||
<div class="weixin-content">微信扫码</div>
|
||||
</div>
|
||||
<div class="main-content-bar" id="main-content-bar">
|
||||
<div style="float: left">
|
||||
<%= image_tag(@logoLink, size: '75x75') %>
|
||||
<div style="float: left;padding-left:15px">
|
||||
<%= image_tag(@logoLink, width:@course_page.image_width,height: @course_page.image_height) %>
|
||||
|
||||
</div>
|
||||
<div class="course welcome_left" id="welcome_left">
|
||||
|
|
|
@ -37,9 +37,9 @@
|
|||
<div style="float: left;padding-left:15px ">
|
||||
<!-- <#%= image_tag(get_project_avatar(@first_page), size: "75x75") %> -->
|
||||
<% if get_avatar?(@first_page) %>
|
||||
<%= image_tag(url_to_avatar(@first_page), size: "107x63") %>
|
||||
<%= image_tag(url_to_avatar(@first_page), width:@first_page.image_width,height: @first_page.image_height) %>
|
||||
<% else %>
|
||||
<%= image_tag '/images/transparent.png', size: "107x63" %>
|
||||
<%= image_tag '/images/transparent.png', width:@first_page.image_width,height: @first_page.image_height %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -572,6 +572,10 @@ zh:
|
|||
label_site_title: 网站标题
|
||||
label_site_description: 网站简介
|
||||
label_site_image: 简介图片
|
||||
label_image_width: 图片宽度
|
||||
label_imgae_height: 图片高度
|
||||
image_width_error_message: 图片宽度只能是50至120之间的整数
|
||||
image_height_error_message: 图片高度只能是50至80之间的整数
|
||||
label_sort_type: 热门项目排序方式
|
||||
label_contest_notification_title: 竞赛通知标题
|
||||
label_contest_notification_content: 竞赛通知内容
|
||||
|
|
|
@ -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