- <%= 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 %>
<%= render :partial => "search_project", :locals => {:project_type => 0}%>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 716889bbc..11c9e054a 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -515,6 +515,7 @@ zh:
label_project_new_description: '项目可以是软件开发项目,也可以是协作研究项目。'
label_project_plural: 项目列表
label_project_score: 项目评分
+ label_first_page_made: 首页定制
label_x_projects:
zero: 无项目
one: 1 个项目
@@ -561,6 +562,10 @@ zh:
label_login_with_open_id_option: 或使用OpenID登录
label_password_lost: 忘记密码
label_home: 主页
+ label_web_title: 浏览器标题
+ label_site_title: 网站标题
+ label_site_description: 网站简介
+ label_site_image: 简介图片
#by young
label_requirement: 需求
label_new_course: 课程列表
diff --git a/config/routes.rb b/config/routes.rb
index f9dd53cf3..7c5f878eb 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -558,6 +558,7 @@ RedmineApp::Application.routes.draw do
match 'admin', :controller => 'admin', :action => 'index', :via => :get
match 'admin/projects', :controller => 'admin', :action => 'projects', :via => :get
match 'admin/users', :controller => 'admin', :action => 'users', :via => :get
+ match 'admin/first_page_made',:controller => 'admin',:action => 'first_page_made',:via => [:get,:post]
match 'admin/search', :controller => 'admin', :action => 'search', :via => [:get, :post]
match 'admin/plugins', :controller => 'admin', :action => 'plugins', :via => :get
match 'admin/info', :controller => 'admin', :action => 'info', :via => :get
diff --git a/db/migrate/20140710071720_create_first_pages.rb b/db/migrate/20140710071720_create_first_pages.rb
new file mode 100644
index 000000000..fa7d01601
--- /dev/null
+++ b/db/migrate/20140710071720_create_first_pages.rb
@@ -0,0 +1,17 @@
+# -*coding:utf-8 -*-
+class CreateFirstPages < ActiveRecord::Migration
+ def change
+ create_table :first_pages do |t|
+ t.string :web_title
+ t.string :title
+ t.string :description
+
+ t.timestamps
+ end
+ fp = FirstPage.new
+ fp.web_title = "Trustie - 为大学生技术创新筑巢"
+ fp.title = "Trustie在线项目托管平台"
+ fp.description = "面向中国大学生与软件从业者,提供社交化的项目管理、代码托管、资源共享、合作交流。"
+ fp.save
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 6e750aa9f..d84c30f9a 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20140708023356) do
+ActiveRecord::Schema.define(:version => 20140710071720) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -406,6 +406,14 @@ ActiveRecord::Schema.define(:version => 20140708023356) do
add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type"
add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id"
+ create_table "first_pages", :force => true do |t|
+ t.string "web_title"
+ t.string "title"
+ t.string "description"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
create_table "forums", :force => true do |t|
t.string "name", :null => false
t.string "description", :default => ""
diff --git a/lib/redmine.rb b/lib/redmine.rb
index e17d657c8..6215a04ba 100644
--- a/lib/redmine.rb
+++ b/lib/redmine.rb
@@ -351,6 +351,7 @@ end
Redmine::MenuManager.map :admin_menu do |menu|
menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural
menu.push :users, {:controller => 'admin', :action => 'users'}, :caption => :label_user_plural
+ menu.push :first_page_made, {:controller => 'admin',:action => 'first_page_made'},:caption => :label_first_page_made
menu.push :groups, {:controller => 'groups'}, :caption => :label_group_plural
menu.push :roles, {:controller => 'roles'}, :caption => :label_role_and_permissions
menu.push :trackers, {:controller => 'trackers'}, :caption => :label_tracker_plural
diff --git a/test/fixtures/first_pages.yml b/test/fixtures/first_pages.yml
new file mode 100644
index 000000000..5af4dd417
--- /dev/null
+++ b/test/fixtures/first_pages.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+one:
+ web_title: MyString
+ title: MyString
+ description: MyString
+
+two:
+ web_title: MyString
+ title: MyString
+ description: MyString
diff --git a/test/unit/first_page_test.rb b/test/unit/first_page_test.rb
new file mode 100644
index 000000000..77e2cc97a
--- /dev/null
+++ b/test/unit/first_page_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class FirstPageTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end