diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index af489ef8..70f7572a 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -238,6 +238,10 @@ class RepositoriesController < ApplicationController @properties = @repository.properties(@path, @rev) @repositories = @project.repositories @course_tag = params[:course] + project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT + ip = RepositoriesHelper::REPO_IP_ADDRESS + @repos_url = "http://"+@repository.login.to_s+"_"+@repository.identifier.to_s+"@"+ip+ + @repository.url.slice(project_path_cut, @repository.url.length).to_s if @course_tag == 1 render :action => 'show', :layout => 'base_courses' else diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 1ba15fc7..a7894ab6 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -3,30 +3,36 @@
<%= render :partial => 'navigation' %>
- -<% project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT %> -<% ip = RepositoriesHelper::REPO_IP_ADDRESS %>

<%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'dir', :revision => @rev } %>
<%if @repository.type.to_s=="Repository::Git"%> - http://<%= @repository.login.to_s %>_<%= @repository.identifier.to_s%>@<%= ip %><%=h @repository.url.slice(project_path_cut, @repository.url.length) %> + <%= @repos_url%> <%else %> <%=h @repository.url %> <% end %>
- <% if @repositories.size > 1 %> + <% if @repositories.size >1 %>

(<%= l(:label_all_revisions) %><%= @repositories.sort.collect {|repo| link_to h(repo.name), {:controller => 'repositories', :action => 'show', :id => @project, :repository_id => repo.identifier_param, :rev => nil, :path => nil}, :class => 'repository' + (repo == @repository ? ' selected' : '') - }.join(' | ').html_safe %>)

+ }.join(' | ').html_safe %>)

<% end %>

- +<% if @repository.branches.empty?%> +

进入到需要建立版本库文件夹,打开命令行执行如下

+
+

git init

+

git add *

+

git commit -m "first commit"

+

git remote add origin <%= @repos_url%>

+

git push -u origin master

+
+<% end %> <% if !@entries.nil? && authorize_for('repositories', 'browse') %> <%= render :partial => 'dir_list' %> <% end %> diff --git a/config/database.yml b/config/database.yml index c8199efd..1073a8f6 100644 --- a/config/database.yml +++ b/config/database.yml @@ -15,7 +15,7 @@ production: development: adapter: mysql2 - database: trustie + database: test host: 10.107.17.20 #socket: /home/pdl/redmine-2.3.1-2/mysql/tmp/mysql.sock port: 3306 diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 6f82c937..19f76b4d 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -2659,3 +2659,16 @@ h2 img { vertical-align:middle; } text-decoration: none; cursor: pointer; } + +/*tanxianbo*/ +div.repos_explain{ + word-wrap: normal; + line-height: 8px; + font-size: 13px; + background-color: #f8f8f8; + border: 1px solid #ddd; + overflow: auto; + border-radius: 3px; + padding: 6px 10px; + font-family: Consolas, 'Liberation Mono', Courier, monospace; + color: rgb(51, 51, 51);