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/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) diff --git a/app/views/files/_tag_yun.html.erb b/app/views/files/_tag_yun.html.erb index 6d3ebdf68..59b25c035 100644 --- a/app/views/files/_tag_yun.html.erb +++ b/app/views/files/_tag_yun.html.erb @@ -1,10 +1,11 @@ <% unless tag_list.nil?%> <% tag_list.each do |k,v|%> <% if tag_name && tag_name == k%> - <%= k%>×<%= v%> + + <%= k%>×<%= v%> <% else%> - <%= k%>×<%= v%> <% end%> 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,则处于编辑状态 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 这个分布式版本控制系统来提交代码,下面就来介绍一下代码的提交方法。 | -
- |
-
- |
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…就可以创建分支了。 |
-
-
- |
在桌面上点击鼠标右键,选择TortoiseGit的Settings进行设置 |
-
Name和Email是用来设置自己的用户名和联系方式的(user.name和user.email必须填写,这些将在版本库提交时用到, |
-
接着可以定制上下文菜单: -我们在Context Menu里勾选的是 Clone、Sync和Commit -在Set Extend Menu Item里勾选的是Import Svn Ignore、Show Reflog、Browse References、Stash Apply和Submodule Sync |
-
- |
- |
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 目 |
-
- |
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。 在一些程序进行了修改, 但还不 (b) 忽略文件 -一些编辑器在修改文件后会产生bak 文件, 一般不希望这些备份文件也加入 |
-
- Tips: |
-
在碰到不熟悉的命令时,可以通过 git help命令查看git的用户手册,命令如下: |
-
$git help <command> |
-
- |
如果你用的是Linux,你可以用你的本地包管理系统(native package management system)来安装。 | -
$ yum install git-core -在redhat等系统下用yum -$apt-get install git-core -在debian,ubuntu等系统下用apt-get |
-
- |
$git config --global user.name “your_name” -$git config --global user.email “your_email” -Name和Email是用来设置自己的用户名和联系方式的(user.name和user.email必须填写,这些将在版本库提交时用到,
- |
-
-
- |
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. | -
|
- |||
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. |
-
- |
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, 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". |
-
- |
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, |
-
- |
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> | -
- |
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". |
-
- |
$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,
- |
-
- |
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/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' %> 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] 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作业评分*/