diff --git a/app/controllers/git_usage_controller.rb b/app/controllers/git_usage_controller.rb new file mode 100644 index 00000000..69b0c7f5 --- /dev/null +++ b/app/controllers/git_usage_controller.rb @@ -0,0 +1,11 @@ +#added by baiyu +class GitUsageController < ApplicationController + def ch_usage + + end + + def en_usage + + end +end +#end \ No newline at end of file diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 9c67b4c9..65b30602 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -22,7 +22,7 @@ class ProjectsController < ApplicationController # menu_item :settings, :only => :settings before_filter :find_project, :except => [ :index, :list, :new, :create, :copy ] - before_filter :authorize, :except => [ :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file, :statistics] + before_filter :authorize, :except => [ :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file, :statistics, :feedback] before_filter :authorize_global, :only => [:new, :create] before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy ] #by young @@ -122,6 +122,16 @@ class ProjectsController < ApplicationController } end end + + def feedback + @jours = @project.journals_for_messages.reverse + @limit = 10 + @feedback_count = @jours.count + @feedback_pages = Paginator.new @feedback_count, @limit, params['page'] + @offset ||= @feedback_pages.offset + @jour = @jours[@offset, @limit] + @state = false + end def new @issue_custom_fields = IssueCustomField.sorted.all diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 60b7d8bd..2fe1f61d 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -107,6 +107,15 @@ class WordsController < ApplicationController end end + def add_project_respond + user = User.current + message = params[:new_form][:project_message] + Project.add_jour(user, message) + + redirect_to project_feedback_path('trustie') + # redirect_to signin_path + end + private def find_user diff --git a/app/models/project.rb b/app/models/project.rb index 97c4f732..7af230aa 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -51,6 +51,9 @@ class Project < ActiveRecord::Base has_one :repository, :conditions => ["is_default = ?", true] has_many :repositories, :dependent => :destroy has_many :changesets, :through => :repository + # added by fq + has_many :journals_for_messages, :as => :jour, :dependent => :destroy + # end #ADDED BY NIE has_many :project_infos, :dependent => :destroy #end @@ -127,6 +130,14 @@ class Project < ActiveRecord::Base where("LOWER(identifier) LIKE :p OR LOWER(name) LIKE :p", :p => pattern) end } + + +# 项目留言 added by fq + def self.add_jour(user, notes) + project = Project.find('trustie') + project.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => 0) + end +# end def initialize(attributes=nil, *args) super diff --git a/app/views/git_usage/ch_usage.html.erb b/app/views/git_usage/ch_usage.html.erb new file mode 100644 index 00000000..dc5cf23e --- /dev/null +++ b/app/views/git_usage/ch_usage.html.erb @@ -0,0 +1,242 @@ + + + + +
+ +Git使用说明 | +
---|
我们将使用 git 这个分布式版本控制系统来提交代码,下面就来介绍一下代码的提交方法。 | +
+ |
Step1: |
+
打开终端,输入如下命令: |
+
$git config --global user.name “your_name” + +$git config --global user.email “your_email” |
+
用户名和email是用来设置自己的用户名和联系方式的(user.name和user.email必须填写,这些将在版本库提交时用到)。 |
+
+ |
Tips: |
+
在碰到不熟悉的命令时,可以通过 git help命令查看git的用户手册,命令如下: |
+
$git help <command> |
+
+ |
Step2: |
+
创建版本库(两种途径) |
+
(1)从远程服务器上克隆一个已存在的版本库到本地: |
+
$git clone http://user_name@domain/repo_path.git |
+
其中,domain是服务器的域名(在trustie系统域名222.247.54.100),repo_path.git是版本库在服务器的相对路径(这个地址在trustie系统中会给出) |
+
+ |
(2)在本地初始化一个版本库,比如将版本库命名为“DEMO”,使用名为/path/to/my/workspace的目录作为个人的工作区根目录,进入该目录后,执行git init创建版本库。 |
+
$cd /path/to/my/workspace |
+
$mkdir demo |
+
$cd demo |
+
$git init |
+
+
+
完成上述操作后,可以看到git init命令在工作区创建了隐藏目录 .git。这个隐藏的 .git目录就是git版本库(repository)。 |
+
+ |
Step3: |
+
提交文件到本地仓库: |
+
$git add file1 file2 |
+
files是做了修改的文件,多个文件使用空格隔开。 |
+
$git commit –m "commit message" |
+
通过-m参数设置提交说明为“commit message”,Git强制性的要求在提交过程中需要输入提交说明,可以使用git log命令来查看提交日志。 |
+
+ |
Step4: |
+
将本地分支推送到远程仓库: |
+
上述操作仅仅是在本地建立了一个git版本库,为了协同工作,我们可以将其推送到远程服务器。 |
+
$git remote add origin http://user_name@domain/repo_path.git |
+
远程库别名为origin |
+
$git push origin master |
+
将本地的master分支推送到origin的master分支 |
+
+ |
Step5: |
+
将远程仓库的分支更新到本地: |
+
当项目小组有成员将其自己的代码推送到服务器,我们可以使用git pull (或者git fetch)获取更新后的代码。 |
+
$git pull origin master |
+
将远程库origin的master分支更新到本地的master分支 |
+
+ |
——Trustie团队 | +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/app/views/git_usage/en_usage.html.erb b/app/views/git_usage/en_usage.html.erb new file mode 100644 index 00000000..9579ae88 --- /dev/null +++ b/app/views/git_usage/en_usage.html.erb @@ -0,0 +1,245 @@ + + + + + + +
Git User Guide | +
---|
We will use git which is a distributed version control and source code management system to submit our code, here is the submission method. | +
+ |
Step1: |
+
Enter the following command in the terminal: |
+
$git config --global user.name “your_name” + +$git config --global user.email “your_email” |
+
User name and email are used to set your own user name and contact information( user.name and user.email must be completed because these will be used when submitting the repository). |
+
+ |
Tips: |
+
You can read the user manual by enter " git help " command when you are confused, command as follows: |
+
$git help <command> |
+
+ |
Step2: |
+
Create a new repository by two ways, here we go |
+
(1) The first way is clone a repository which is already exists from remote Server to local: |
+
$git clone http://user_name@domain/repo_path.git |
+
The "domain" in the command means the server's domain name(the domain name in Trustie system is 222.247.54.100), "repo_path.git" is the relative path(this address will be given in Trustie) |
+
+ |
(2) Initialize a repository on the local, we named repository as “DEMO” for example, use the directory "/path/to/my/workspace" as a root of personal workspace. |
+
Enter the directory, execute the "git init" command to create the repository. |
+
$cd /path/to/my/workspace |
+
$mkdir demo |
+
$cd demo |
+
$git init |
+
+
+
After completed these operation, you can see "git init " command creates a hidden directory in the workspace and this hidden directory is the git repository. |
+
+ |
Step3: |
+
Submit the file to the local repository: |
+
$git add file1 file2 |
+
"file1" is the file which is already modified, multiple files separated by spaces. |
+
$git commit –m "commit message" |
+
“commit message”is a submission instructions which is a mandatory requirement in the Git, you can use "git log" to list the commit log. |
+
+ |
Step4: |
+
Push the local branches to the remote repository: |
+
The operation we mentioned above is only to establish a local git repository, we can push it to the remote server in order to work together in the future. |
+
$git remote add origin http://user_name@domain/repo_path.git |
+
In Git, we call remote repository as origin |
+
$git push origin master |
+
Push the local master branch to the origin master branch . |
+
+ |
Step5: |
+
Get the latest branch from the remote repository: |
+
When your team members push the code to the server, we can use "git pull " (or "git fetch") to obtain the modified code.。 |
+
$git pull origin master |
+
Pull the remote master branch to the local master branch. |
+
+ |
--By Trustie Team | +
+
+
+
+
+ + + + diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 45034667..822e9978 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -117,6 +117,11 @@
<%= link_to image_tag(url_to_avatar(journal.user), :class => "avatar"), user_path(journal.user), :class => "avatar" %> | +
|
+
朋友,系统仍在不断完善,有意见和建议请 <%= toggle_link '点击我', 'put-bid-form', {:focus => 'new_form_project_message'} %> | ||||
+ | +||||
<%= link_to image_tag("/images/welcome/1.png", weight:"190px", height:"190px"), :controller => 'projects', :action => 'index' %> | @@ -262,8 +307,12 @@ software development and software crowdsourcing. | <%= l(:label_milestone_description) %> | +