From 8ff8d0f4d44b73001b20fcb16f3e58fbe9b51ac6 Mon Sep 17 00:00:00 2001
From: xianbo
Date: Mon, 23 Sep 2013 21:47:07 +0800
Subject: [PATCH] modify some little bug && merge handle
---
app/controllers/my_controller.rb | 2 +-
app/controllers/projects_controller.rb | 2 +-
app/helpers/application_helper.rb | 2 +-
app/helpers/projects_helper.rb | 4 +-
app/helpers/users_helper.rb | 18 +-
app/views/account/register.html.erb | 339 ++++++++++--------------
app/views/bids/_bid_show.html.erb | 66 +----
app/views/bids/show.html.erb | 17 +-
app/views/layouts/base_courses.html.erb | 10 +-
app/views/projects/index.html.erb | 47 ----
config/database.yml | 2 +-
config/locales/zh.yml | 1 +
12 files changed, 167 insertions(+), 343 deletions(-)
diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb
index 91f04b4d2..21a474e89 100644
--- a/app/controllers/my_controller.rb
+++ b/app/controllers/my_controller.rb
@@ -77,7 +77,7 @@ class MyController < ApplicationController
# ue.save
# end
- # added by bai 往数据库里写职业、性别和地区
+ # added by bai
if @user.user_extensions.nil?
se = UserExtensions.new
se.user_id = @user.id
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 9ad847dde..67c0edb23 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -366,7 +366,7 @@ class ProjectsController < ApplicationController
r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first
m = Member.new(:user => User.current, :roles => [r])
project = ProjectInfo.new(:user_id => User.current.id, :project_id => @project.id)
- if params[:project][:is_public] == 1
+ if params[:project][:is_public] == '1' || @course_tag=="1"
project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0)
end
@project.members << m
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index b8a3fd791..54ab7b76b 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -977,7 +977,7 @@ module ApplicationHelper
end
def lang_options_for_select(blank=true)
- (blank ? [["(auto)", ""]] : []) + languages_options
+ { 'Chinese绠浣撲腑鏂 '=> 'zh', :English => :en}
end
def label_tag_for(name, option_tags = nil, options = {})
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 7dac3bf47..1b8340721 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -138,9 +138,9 @@ module ProjectsHelper
type = []
option1 = []
option2 = []
- option1 << '作业最终以附件形式提交'
+ option1 << '浣滀笟鏈缁堜互闄勪欢褰㈠紡鎻愪氦'
option1 << 1
- option2 << '作业最终以项目形式提交'
+ option2 << '浣滀笟鏈缁堜互椤圭洰褰㈠紡鎻愪氦'
option2 << 2
type << option1
type << option2
diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb
index 32b546078..c813714d3 100644
--- a/app/helpers/users_helper.rb
+++ b/app/helpers/users_helper.rb
@@ -64,9 +64,9 @@ module UsersHelper
# added by fq
#
def show_activity(state)
@@ -95,16 +95,16 @@ module UsersHelper
content = ''.html_safe
case state
when 0
- s = content_tag('span', '我的课程', :class => "current-page")
+ s = content_tag('span', '鎴戠殑璇剧▼', :class => "current-page")
content << content_tag('li', s)
- content << content_tag('li', link_to('我的作业', {:controller => 'users', :action => 'user_courses', :type => 1}))
+ content << content_tag('li', link_to('鎴戠殑浣滀笟', {:controller => 'users', :action => 'user_courses', :type => 1}))
when 1
- s = content_tag('span', '我的作业', :class => "current-page")
- content << content_tag('li', link_to('我的课程', {:controller => 'users', :action => 'user_courses'}))
+ s = content_tag('span', '鎴戠殑浣滀笟', :class => "current-page")
+ content << content_tag('li', link_to('鎴戠殑璇剧▼', {:controller => 'users', :action => 'user_courses'}))
content << content_tag('li', s, :class => "current-page")
when 2
- s = content_tag('span', '课程通知', :class => "current-page")
- content << content_tag('li', link_to('课程通知', {:controller => 'users', :action => 'user_courses'}))
+ s = content_tag('span', '璇剧▼閫氱煡', :class => "current-page")
+ content << content_tag('li', link_to('璇剧▼閫氱煡', {:controller => 'users', :action => 'user_courses'}))
content << content_tag('li', s, :class => "current-page")
end
content_tag('div', content, :class => "pagination")
diff --git a/app/views/account/register.html.erb b/app/views/account/register.html.erb
index 26ce15af6..ce666940e 100644
--- a/app/views/account/register.html.erb
+++ b/app/views/account/register.html.erb
@@ -1,173 +1,173 @@
-
+
-
-
<%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %>
@@ -253,29 +211,14 @@
<%="#{l(:label_mail_attention)} "%>
<%= f.select :language, lang_options_for_select %>
-
+
-
-
+ <%= select_tag 'identity', "
+
+ ".html_safe %>
<%= l(:label_gender) %> |
@@ -283,56 +226,54 @@
<%= select_tag 'gender', "
".html_safe %>
-<%= l(:label_location) %> |
+<%= l(:label_location) %> * |
|
|
-
<%= submit_tag l(:button_submit) %> |
<% end %>
-
<% if Setting.openid? %>
<%= f.text_field :identity_url %>
<% end %>
diff --git a/app/views/bids/_bid_show.html.erb b/app/views/bids/_bid_show.html.erb
index 21e4e30bb..d3f1cbb74 100644
--- a/app/views/bids/_bid_show.html.erb
+++ b/app/views/bids/_bid_show.html.erb
@@ -17,15 +17,11 @@
<% unless bid.reward_type == 3 %>
- <%= l(:label_x_biding_project, :count => bid.biding_projects.count) %>(<%= link_to bid.biding_projects.count, project_for_bid_path(bid) %>)
- <%= l(:label_x_bids_responses, :count => bid.commit) %>(<%= link_to bid.commit, respond_path(bid) %>)
- <%= l(:label_x_followers, :count => bid.watcher_users.count) %>(<%= link_to bid.watcher_users.count, respond_path(bid) %>) |
+ <%= l(:label_x_biding_project, :count => bid.biding_projects.count) %>(<%= link_to bid.biding_projects.count, project_for_bid_path(bid) %>)<%= l(:label_x_bids_responses, :count => bid.commit) %>(<%= link_to bid.commit, respond_path(bid) %>) <%= l(:label_x_followers, :count => bid.watcher_users.count) %>(<%= link_to bid.watcher_users.count, respond_path(bid) %>) |
<% else %>
- <%= l(:label_x_homework_project, :count => bid.biding_projects.count) %>(<%= link_to bid.biding_projects.count, project_for_bid_path(bid) %>)
- <%= l(:label_x_responses, :count => bid.commit) %>(<%= link_to bid.commit, respond_path(bid) %>)
- <%= l(:label_x_followers, :count => bid.watcher_users.count) %>(<%= link_to bid.watcher_users.count, respond_path(bid) %>) |
+ <%= l(:label_x_homework_project, :count => bid.biding_projects.count) %>(<%= link_to bid.biding_projects.count, project_for_bid_path(bid) %>) <%= l(:label_x_responses, :count => bid.commit) %>(<%= link_to bid.commit, respond_path(bid) %>) <%= l(:label_x_followers, :count => bid.watcher_users.count) %>(<%= link_to bid.watcher_users.count, respond_path(bid) %>) |
<% end %>
@@ -51,61 +47,3 @@
-
-
-
-
-
- <%= l(:label_x_biding_project, :count => bid.biding_projects.count) %>(<%=link_to bid.biding_projects.count, project_for_bid_path(bid) %>)
- <%= l(:label_x_responses, :count => bid.commit) %>(<%=link_to bid.commit, respond_path(bid) %>)
- <%= l(:label_x_followers, :count => bid.watcher_users.count) %>(<%=link_to bid.watcher_users.count, respond_path(bid) %>)
- |
-
-
-
-
-
-<%= l(:label_bid_project) %>(<%= link_to bid.biding_projects.count, project_for_bid_path(bid),:class=> "bids_user" %>) |
-
-
-<%= l(:label_responses) %>(<%= link_to bid.commit, respond_path(bid),:class=> "bids_user" %>) |
-
-
-<%= l(:label_followers) %>(<%= link_to bid.watcher_users.count, respond_path(bid),:class=> "bids_user" %>) |
-
-
-<%= l(:field_deadline) %><%= format_time bid.created_on %> |
-
- |
-
-
-<% end %>
- -->
diff --git a/app/views/bids/show.html.erb b/app/views/bids/show.html.erb
index 31cb60830..d6f7ce45c 100644
--- a/app/views/bids/show.html.erb
+++ b/app/views/bids/show.html.erb
@@ -13,22 +13,7 @@
-
-
-
- <%= render :partial => "/praise_tread/praise_tread",
- :locals => {:obj => @bid,:show_flag => true,:user_id =>User.current.id}%>
-
-
- |
-
-
-
- <%= render :partial => "/praise_tread/praise_tread",
- :locals => {:obj => @bid,:show_flag => true,:user_id =>User.current.id}%>
-
-
- |
+
<% if @bid.reward_type.nil? or @bid.reward_type == 1%>
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index 475bcb89b..f634d1975 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -77,10 +77,16 @@
璇剧▼瀛︽湡锛 |
-
+
+ <% unless @course.teacher.user_extensions.occupation.nil? %>
鏁欏笀鍗曚綅锛 |
-
+
+ <% else %>
+
+ 鏁欏笀鍗曚綅锛 |
+
+ <% end %>
diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb
index 7f62bf070..804e12537 100644
--- a/app/views/projects/index.html.erb
+++ b/app/views/projects/index.html.erb
@@ -35,53 +35,6 @@
-->
-
-
-
-<%= sort_project(@s_type)%>
-
-
-
-<%= sort_project(@s_type)%>
-
-
-
<%= render_project_hierarchy(@projects)%>
diff --git a/config/database.yml b/config/database.yml
index d9e69b298..15be8447a 100644
--- a/config/database.yml
+++ b/config/database.yml
@@ -5,7 +5,7 @@
production:
adapter: mysql2
- database: redmine
+ database: bitnami_redmine
host: 10.0.47.245
#socket: /home/pdl/redmine-2.3.1-2/mysql/tmp/mysql.sock
port: 3306
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index c7171cab3..aa5dc531a 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -223,6 +223,7 @@ zh:
field_course_code: 瀛﹀垎
field_state: 鍔犲叆璇剧▼鍙d护
field_term: 瀛︽湡
+ field_course_un: 鏆傛湭濉啓
#end
field_description: 鎻忚堪
field_summary: 鎽樿