From 7d04ce80d487a2f1f904811204fc1dc8189d5e14 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 8 Oct 2015 13:56:17 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=20tag=E4=B8=BA=E5=8F=AF=E4=BB=A5=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E7=9A=84=E6=97=B6=E5=80=99=20=E6=98=AF=20=E6=89=8B?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/courses.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index c6e9b27d3..11d38eb58 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -722,7 +722,7 @@ a.wzan_visited{background:url(../images/new_project/public_icon.png) 0px -503px .files_tag{ width:670px; min-height:22px;margin-bottom:10px;}/* overflow:hidden; */ /*padding:1px 10px 修改原因,padding会导致内部输入框和外边框有边距*/ a.files_tag_icon{ width:auto;background:#e2f3f9; color:#54aeca; border:1px solid #bbe2ef; padding:1px 5px; float:left; margin-right:10px;margin-bottom:10px; } -span.files_tag_icon{ width:auto;background:#e2f3f9; color:#54aeca; border:1px solid #bbe2ef; padding:1px 5px; float:left; margin-right:10px;margin-bottom:10px; } +span.files_tag_icon{ width:auto;background:#e2f3f9; color:#54aeca; border:1px solid #bbe2ef; padding:1px 5px; float:left; margin-right:10px;margin-bottom:10px;cursor: pointer } a.files_tag_select{ background:#64bdd9; color:#fff; border:1px solid #bbe2ef; padding:1px 1px; float:left; margin-right:10px;margin-bottom:10px;}/* padding:1px 10px;*/ /* 20150423作业评分*/ From 7cbee4cd5379ff6f5195374bb4439ed5e7c50048 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 8 Oct 2015 14:11:54 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E7=BC=96=E8=BE=91tag=E6=9C=89=E6=97=B6?= =?UTF-8?q?=E5=80=99=E4=B8=8D=E8=83=BD=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/tags_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 0ffa334c2..4f1a343d5 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -246,7 +246,7 @@ class TagsController < ApplicationController if @taggable_id.blank? #如果没有传tag_id,那么直接更新tag_name就好了。但是要防止 重命名后的tag存在。 #看重命名后的tag是否存在。如果存在的话,只需要更改taggings里边的id即可 if @rename_tag - @taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_type(@tag_id,@taggable_id,@taggable_type) + @taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_type(@tag_id,@taggable_type) @taggings.update_attributes({:tag_id=>@rename_tag.id}) else #如果不存在,那么就直接更新该tag名称为新的名称 (ActsAsTaggableOn::Tag.find_by_name(@tag_name)).update_attributes(:name=>@rename_tag_name) From e76f9a169e88d5f888618ec8507fdb58cc754c5b Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 8 Oct 2015 14:14:28 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index ac0c50980..6b1fdb2e9 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -255,7 +255,7 @@ isdb = false; //这是单击 node = document.elementFromPoint(e.clientX, e.clientY); if(node.tagName == "INPUT"){ //如果是输入框的聚焦,那么就不要进行下去了 - isdb = true; // + isdb = true; //为了防止在编辑的时候又去单击其他tag去过滤。导致tag过滤不可用 return; } if($("#renameTagName")[0] != undefined ){//存在renameTagName,则处于编辑状态 From e054f8045cbb08aed61397404e9598e2272489ac Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 8 Oct 2015 14:23:32 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=8E=BB=E6=8E=89Git=E7=9A=84=E4=B8=AD?= =?UTF-8?q?=E8=8B=B1=E6=96=87=E8=AF=B4=E6=98=8E=20=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=E6=8C=87=E5=AE=9A=E5=85=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/git_usage_controller.rb | 12 - app/views/git_usage/ch_usage.html.erb | 352 ------------------------ app/views/git_usage/en_usage.html.erb | 346 ----------------------- app/views/repositories/show.html.erb | 5 +- config/routes.rb | 3 - 5 files changed, 1 insertion(+), 717 deletions(-) delete mode 100644 app/controllers/git_usage_controller.rb delete mode 100644 app/views/git_usage/ch_usage.html.erb delete mode 100644 app/views/git_usage/en_usage.html.erb diff --git a/app/controllers/git_usage_controller.rb b/app/controllers/git_usage_controller.rb deleted file mode 100644 index 56aaa56f1..000000000 --- a/app/controllers/git_usage_controller.rb +++ /dev/null @@ -1,12 +0,0 @@ -#added by baiyu -class GitUsageController < ApplicationController - layout "new_base" - def ch_usage - - end - - def en_usage - - end -end -#end \ No newline at end of file diff --git a/app/views/git_usage/ch_usage.html.erb b/app/views/git_usage/ch_usage.html.erb deleted file mode 100644 index 330ab9b5e..000000000 --- a/app/views/git_usage/ch_usage.html.erb +++ /dev/null @@ -1,352 +0,0 @@ - - - - - - - -无标题文档 - - - - - - - - -
Git使用说明
- - - - - -
我们将使用 git 这个分布式版本控制系统来提交代码,下面就来介绍一下代码的提交方法。
- - - - - -

 

-

Windows

- - - - - - - - - - -
1、安装
 

Step1:

-

http://code.google.com/p/msysgit下载msysgit, 我们使用的版本是Git-1.7.4-preview20110204.exe

- - - - -
安装时,选择Checkout as-is, commit as-is,这样Git 就不会修改换行风格了. 其他用缺省设置即可。
- - - - - - - - - - -
 

Step2:

-

http://code.google.com/p/tortoisegit/下载TortoiseGit,我们使用的版本是Tortoisegit-1.6.5.0-32bit.msi

安装时, 选择TortoisePLink。
- - - - -
这两个软件安装完成后, 就可以开始使用了。
- - - - -
 
- - - - -

Step3:

-

在目录中右键单击TortoiseGit 再选Create Branch…就可以创建分支了。

-

 

- - - - - - - - - - - - - - - - -
2、配置
 

在桌面上点击鼠标右键,选择TortoiseGit的Settings进行设置

Name和Email是用来设置自己的用户名和联系方式的(user.name和user.email必须填写,这些将在版本库提交时用到, 其中的name和email要和<%= Setting.host_name %>上的登陆名和邮箱保持一致 - ,方便代码贡献统计 )。

接着可以定制上下文菜单:

-

我们在Context Menu里勾选的是 CloneSyncCommit

-

在Set Extend Menu Item里勾选的是Import Svn IgnoreShow ReflogBrowse ReferencesStash ApplySubmodule Sync

- - - - -
 
- - - - -
3、日常用法
- - - - -
 
- - - - - - - -

Step1:

-

创建版本库(两种途径)

-

(a)在文件夹中按右键, 选择Git Create repository here 就可以创建库了,在出现的窗口中, 不勾选选项, 直接按OK。

-

完成上述操作后,可以看到工作区中出现了隐藏目录 .git。这个隐藏的 .git目录就是git版本库(repository)。

-

 

-

(b)从远程服务器上克隆一个已存在的版本库到本地:在目录中单击右键,选择Git Clone... 然后在URL里填入要clone的文件的地址。

 
- - - - -

Step2:

-

添加文件和文件夹

-

在文件夹中按右键, 选Git Commit -> "master"… ,接着填写Message, 勾选Whole Project 选项, 这样Commit 的时候可以将整个项目的信息全部Commit 上去, 可以实现不需要打Tag 就能Checkout 出每次Commit 的内容.

-

比如:

-

在工作区添加file1.txt,commit以后接着修改file1.txt,再创建一个文件夹dir1, 并且放置一个file2.txt 在dir1 目
- 录中, 再次commit 时, 就可以将dir1 和file2.txt 一起加入了.

- - - - -
 
- - - - -

Step3:

-

创建分支

-

在目录中单击右键,选择TortoiseGit 里的create Branch…就可以创建分支了。

-

勾选Switch to new branch, 就可以跳转到建立好的分支上。

-

比如:

-

添加一个file3.txt 后, commit 修改。接着通过Switch/Checkout….可以切换回master 分支。

- - - - -
 
- - - - -

Step4:

-

看分支情况及修改log

-

在目录中单击右键,选择TortoiseGit 里的Show log, 可以看分支情况和修改log。 勾选All Branches 可以看到所有分支的情况.

-

在Message 列中, 绿色 - 的是分支, 红色 - 的是当前工作分支

- - - - -
 
- - - - -

Step5:

-

比较版本差异

-

通过按Shift , 可以选中两个版本, 接着再按鼠标右键, 选中Compare revisions, 就可以比较两个revision 了。

- - - - -
 
- - - - -

Step6:

-

合并分支

-

首先切换到master 分支, 接着点击鼠标右键选择TortoiseGit 里的Merge,就可以实现将分支合并到主版本。

- - - - -
 
- - - - -

Step7:

-

其他操作

-

(a) Stash

-

Git 提供了一个暂存修改的功能, 称为Stash。 在一些程序进行了修改, 但还不
- 想commit 成revision 时, 就可以将这些修改Stash 起来, 等到后面需要时再将它
- 们Pop 出来。

-

(b) 忽略文件

-

一些编辑器在修改文件后会产生bak 文件, 一般不希望这些备份文件也加入
- 库中, 可以选中一个.bak 文件, 然后选择Add to ignore list 中的*.bak, 这样bak 文
- 件以后就不会被commit 了。

- - - - - - - -

 

-

Tips:

在碰到不熟悉的命令时,可以通过 git help命令查看git的用户手册,命令如下:

- - - - -

$git help <command>

- - - - -
 
- - - - - -
Linux
- - - - - - - - - - -
1、安装
如果你用的是Linux,你可以用你的本地包管理系统(native package management system)来安装。

$ yum install git-core

-

在redhat等系统下用yum

-

$apt-get install git-core

-

在debian,ubuntu等系统下用apt-get

- - - - - - - - - - - -
 
2、配置

$git config --global user.name “your_name”

-

$git config --global user.email “your_email” 

-

Name和Email是用来设置自己的用户名和联系方式的(user.name和user.email必须填写,这些将在版本库提交时用到, - 其中的name和email要和<%= Setting.host_name %>上的登陆名和密码保持一致 -,方便代码贡献统计 )。

- - - - - - - - - - -
 
3、代码提交方法

cd file1

-

$ git add file1

-

$ git init

-

$ git commit -a

-

$ git remote add [name] [版本库里给的URL(去掉http)]

-

$ git push [name] master

-

输入password后即可上传。

-

 

- - - - -
——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 deleted file mode 100644 index 237895d23..000000000 --- a/app/views/git_usage/en_usage.html.erb +++ /dev/null @@ -1,346 +0,0 @@ - - - - - - -无标题文档 - - - - - - - - -
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.
- - - - - - - - - - - - - - -
- - - -
 
- - - - -
Windows
- - - - -
1. Installation

Step1:

Download msysgit from http://code.google.com/p/msysgit, the version we have used is

-

Git-1.7.4-preview20110204.exe.

Please tick "Checkout as-is" and "commit as-is" options during installation so git does not modify the line feed style. Other options you can use the default settings.

- - - - -
 
- - - - -

Step2:

-

Download TortoiseGit from http://code.google.com/p/tortoisegit/, the version we have used is

-

Tortoisegit-1.6.5.0-32bit.msi.

-

Please tick "TortoisePLink" option during installation.

-

You can start using Git when you complete the installation.

- - - - -
 
- - - - -

Step3:

-

You can create a branch with method that right-click the "TortoiseGit" in the directory and check the "Create Branch… " option.

- - - - -
 
- - - - -
2. Configuration
- - - - -

Right-click on the desktop and select the "Settings" in the "TortoiseGit"

-

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, the name and email must be the same with login name and email you registed in the <%= Setting.host_name %> - ).

-

Then you can customize the "Context Menu":

-

Please check the "Clone","Sync" and "Commit" options in the "Context Menu",

-

check the "Import Svn Ignore", "Show Reflog", "Browse References", "Stash Apply" and "Submodule Sync" in the "Set Extend Menu Item".

- - - - -
 
- - - - -
3. Simple usage
- - - - -

Step1:

-

Create a new repository by two ways, here we go

-

(a) You can create a repository by right-click in the folder and select "Git Create repository here". Uncheck any options in the new window, instead of it please click "OK".

-

After completed these operation, you can see there is a hidden directory ( .git ) in the workspace and this hidden directory is the git repository.

-

(b) Clone a exist version from the remote server to local: right-click in the folder and select " Git Clone.." and fill in the URL where you had clone from.

- - - - -
 
- - - - -

Step2:

-

Add the new file and folder

-

Right-click in the folder and select Git Commit -> "master"… , then fill in the "Message" and check the " Whole Project " option so that the whole information of the project can commit.

-

For example:

-

Create a new file in the workspace named "file1.txt", commit it, and then creat a new folder in the workspace named "dir1", after that create a new file again, but this file is in the folder dir1, named "file2.txt". After that select "Git Commit", then file1 and dir1 can be joined together.

- - - - -
 
- - - - -

Step3:

-

Create a new Branch

-

You can create a new branch by right-click in the folder and select TortoiseGit -> " create Branch… ".

-

You will switch to the new branch when you check "Switch to new branch" option.

-

For example:

-

Create a new file in the workspace named "file3.txt", commit it. And you can switch to the "master" by select the "Switch/Checkout..." in the "TortoiseGit".

- - - - -
 
- - - - -

Step4:

-

View and modify the log

-

You can view the situation of the branch by right-click in the folder and select TortoiseGit -> " Show log". Even you can also modify the log in it. And you can view all the branch's situation by check the " All Branches " option.

-

In the "Message" colume, branch is - green - and the current branch is red - .

- - - - -
 
- - - - -

Step5:

-

Compare the version

-

You can select two version in the same time by press "shift", and you can compare the different between two version by right-click the " Compare revisions ".

- - - - -
 
- - - - -

Step6:

-

Merge the branch

-

First, you should switch to the "master", then righr-click on it and select TortoiseGit -> "Merge" so that the branch can merge into the main version.

- - - - -
 
- - - - -

Step7:

-

Other operations

-

(a) Stash

-

Git provides a function named Stash to temporarily store the revised programs. When you revise some programs but still do not want to commit them, you can stash these revised programs and pop them if you need them then.

-

(b) Ignore Files

-

The editor will generate some .bak files after editing. If you do not want to add these .bak files to the repository you can select the ".bak" file and check the "*.bak" in the " Add to ignore list". Then the .bak files will not be commited.
-

-


-

- - - - -
 
- - - - -

Tips:

-

You can read the user manual by enter " git help " command when you are confused, command as follows:

- - - - -
$git help <command>
- - - - -
 
- - - - - -
Linux
- - - - - - - -
1.Installation

If you are useing Linux, you can install git through native package management system.

-

$ yum install git-core

-

if you are using redhat, you should type "yum".

-

$apt-get install git-core

-

if you are using debian or ubuntu, you should type "apt-get".

- - - - - - - - - - -
 
2. Configuration

$git config --global user.name “your_name”M

-

$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, - the name and email must be the same with login name and email you registed in the <%= Setting.host_name %> -).

- - - - - - - - - - -
 
3. How to commit

cd file1

-

$ git add file1

-

$ git init

-

$ git commit -a

-

$ git remote add [name] [The URL which we give you in our website(with out http)]

-

$ git push [name] master

-

The last step is enter your password.

-

 

- - - - -
—— By Trustie Team
-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

- - - diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 242b87a74..28a260178 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -76,10 +76,7 @@ <% end %> -

查看如何提交代码: - <%= link_to(l(:label_how_commit_code_chinese), ch_usage_path, :class => "c_blue") %> - <%= link_to('English', en_usage_path, :class => "c_blue") %> - +

点击查看如何提交代码

<% content_for :header_tags do %> diff --git a/config/routes.rb b/config/routes.rb index ca301d078..d6c36212a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -257,9 +257,6 @@ RedmineApp::Application.routes.draw do match 'welcome/contest', :via => :get # end longjun - #added by baiyu - match 'git_usage/ch_usage', :via => :get, :as => 'ch_usage' - match 'git_usage/en_usage', :via => :get, :as => 'en_usage' #added by nie match '/projects/search', :via => [:get, :post] match '/users/search', :via => [:get, :post] From 9291758ef4dd06da176b2c3b5b307aaf35f942f5 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 8 Oct 2015 14:24:51 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E9=BC=A0=E6=A0=87=E7=A7=BB=E5=88=B0tag?= =?UTF-8?q?=E4=B8=8A=E5=8F=98=E6=89=8B=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_tag_yun.html.erb | 2 +- app/views/tags/_tag_list.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/files/_tag_yun.html.erb b/app/views/files/_tag_yun.html.erb index 6d3ebdf68..159384c6e 100644 --- a/app/views/files/_tag_yun.html.erb +++ b/app/views/files/_tag_yun.html.erb @@ -4,7 +4,7 @@ <%= k%>×<%= v%> <% else%> - <%= k%>×<%= v%> <% end%> diff --git a/app/views/tags/_tag_list.html.erb b/app/views/tags/_tag_list.html.erb index 49c9b2351..bc4a5b54e 100644 --- a/app/views/tags/_tag_list.html.erb +++ b/app/views/tags/_tag_list.html.erb @@ -2,8 +2,8 @@ <% if @tags.size > 0 %> <% @tags.each do |tag| %> - <%#= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %> - <%= tag %> + <%#= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %> + <%= tag %> <% case object_flag %> <% when '10' %> From 418e7e379d8bd0e3d8bcbf018102766e0dd568fd Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 8 Oct 2015 14:33:58 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=AE=A4=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E7=A7=BB=E5=8A=A8=E5=85=89=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_tag_yun.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/files/_tag_yun.html.erb b/app/views/files/_tag_yun.html.erb index 159384c6e..59b25c035 100644 --- a/app/views/files/_tag_yun.html.erb +++ b/app/views/files/_tag_yun.html.erb @@ -1,7 +1,8 @@ <% unless tag_list.nil?%> <% tag_list.each do |k,v|%> <% if tag_name && tag_name == k%> - <%= k%>×<%= v%> + + <%= k%>×<%= v%> <% else%>