diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 9da22577f..b0ad4d9c1 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -243,7 +243,7 @@ update # :name, :path, :kind, :size, :lastrev, :changeset @entries = @repository.entries(@path, @rev) # @trees = g.trees(project, @path) - @changeset = @repository.find_changeset_by_name(@rev) + # @changeset = @repository.find_changeset_by_name(@rev) #@project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT #@ip = RepositoriesHelper::REPO_IP_ADDRESS diff --git a/app/views/repositories/_navigation.html.erb b/app/views/repositories/_navigation.html.erb index 2fdf00cef..7140c6238 100644 --- a/app/views/repositories/_navigation.html.erb +++ b/app/views/repositories/_navigation.html.erb @@ -5,23 +5,21 @@ <%#= link_to l(:label_statistics), {:action => 'stats', :id => @project, :repository_id => @repository.identifier_param}, :class => 'mt3 c_blue fl' if @repository.supports_all_revisions? %> -
- <%= form_tag({:action => controller.action_name, - :id => @project, - :repository_id => @repository.identifier_param, - :path => to_path_param(@path), - :rev => nil}, - {:method => :get, :id => 'revision_selector', :class => "fl c_grey02"}) do -%> +
+ <%= form_tag({:action => controller.action_name, :id => @project, :repository_id => @repository.identifier_param, + :path => to_path_param(@path), + :rev => nil}, + {:method => :get, :id => 'revision_selector', :class => "fl c_grey02 ml5"}) do -%> <% if !@repository.branches.nil? && @repository.branches.length > 0 -%> <%= l(:label_branch) %>: <%= select_tag :branch, options_for_select([''] + @repository.branches, @rev), :id => 'branch' %> <% end -%> - <% if !@repository.tags.nil? && @repository.tags.length > 0 -%> - | <%= l(:label_tag) %>: - <%= select_tag :tag, options_for_select([''] + @repository.tags, @rev), :id => 'tag' %> - <% end -%> + <%# if !@repository.tags.nil? && @repository.tags.length > 0 -%> + + <%#= select_tag :tag, options_for_select([''] + @repository.tags, @rev), :id => 'tag' %> + <%# end -%> <%# if @repository.supports_all_revisions? %> <%#= l(:label_revision) %> @@ -29,4 +27,3 @@ <%# end %> <% end -%>
- diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index bc0ff18be..eca7a3322 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -3,28 +3,54 @@

<%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>

- <%= render :partial => 'navigation' %> -
-
- <% if @entries.nil? && authorize_for('repositories', 'browse') %> -
- 该版本库还没有上传代码! -
- <% end %> - <% if @repository.type.to_s=="Repository::Gitlab" %> - 版本库地址:<%= @repos_url %> - <% else %> - 版本库地址:<%= h @repository.url %> - <% end %> - - -
-
+ <% if @entries.nil? %> + <%# 未提交代码提示 %> +
+ <% if @entries.nil? && authorize_for('repositories', 'browse') %> +
+ 该版本库还没有上传代码! +
+ <% end %> + <% if @repository.type.to_s=="Repository::Gitlab" %> + 版本库地址:<%= @repos_url %> + <% else %> + 版本库地址:<%= h @repository.url %> + <% end %> + + +
+
+ <% else %> + <%= render :partial => 'navigation' %> +
克隆网址:
+ + +
ZIP
+
Fork 109
+
+
+ 头像 + <%#= @user_chageset_recently.user %>提交于两天前:<%#= @user_chageset_recently.comments %> + + <%= @repository.branches.count %>个分支 + + + <%=link_to @changesets.count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev} %>提交 + +
+ <% end %>
+ <% if !@entries.nil? && authorize_for('repositories', 'browse') %> <%# 数据统计 %> - <%= render :partial => 'summary' %> + <%#= render :partial => 'summary' %> <%# end %> <%= render :partial => 'dir_list' %> <% end %> diff --git a/public/images/vlicon/branch_icon.png b/public/images/vlicon/branch_icon.png new file mode 100644 index 000000000..c80e17134 Binary files /dev/null and b/public/images/vlicon/branch_icon.png differ diff --git a/public/images/vlicon/clone_url.png b/public/images/vlicon/clone_url.png new file mode 100644 index 000000000..a1c71862a Binary files /dev/null and b/public/images/vlicon/clone_url.png differ diff --git a/public/images/vlicon/commit_icon.png b/public/images/vlicon/commit_icon.png new file mode 100644 index 000000000..148dbcd4b Binary files /dev/null and b/public/images/vlicon/commit_icon.png differ diff --git a/public/images/vlicon/download_icon.png b/public/images/vlicon/download_icon.png new file mode 100644 index 000000000..b442730fe Binary files /dev/null and b/public/images/vlicon/download_icon.png differ diff --git a/public/images/vlicon/fork_icon.png b/public/images/vlicon/fork_icon.png new file mode 100644 index 000000000..45a6b0e82 Binary files /dev/null and b/public/images/vlicon/fork_icon.png differ diff --git a/public/javascripts/project.js b/public/javascripts/project.js index c74ff18bf..d9138901a 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -511,3 +511,9 @@ function submitProjectFeedback() { $("#project_feedback_form").submit(); } +// 点击按钮复制功能 +function jsCopy(){ + var e=document.getElementById("copy_rep_content"); + e.select(); + document.execCommand("Copy"); +} \ No newline at end of file diff --git a/public/stylesheets/repository.css b/public/stylesheets/repository.css index 0cb7d918e..ba3a419bf 100644 --- a/public/stylesheets/repository.css +++ b/public/stylesheets/repository.css @@ -205,3 +205,16 @@ table.list {margin-top:0.5em;} table.list th, table.list td {border: 1px solid #aaa;} } + +.cloneUrl {width:235px; height:21px; border:1px solid #dddddd; outline:none; overflow:hidden; line-height:21px; resize:none;} +.clone_btn {width:30px; height:21px; border-top:1px solid #dddddd; border-bottom:1px solid #dddddd; border-right:1px solid #dddddd; outline:none; float:left; background-image:linear-gradient(#FCFCFC, #EEE); text-align:center;} +.vl_btn {height:21px; padding:0px 5px; vertical-align:middle; border:1px solid #dddddd; float:left; line-height:21px; background-image:linear-gradient(#FCFCFC, #EEE);} +.vl_btn_2 {height:21px; padding:0px 5px; vertical-align:middle; border-top:1px solid #dddddd; border-bottom:1px solid #dddddd; border-right:1px solid #dddddd; float:left; line-height:21px;} +.recordBanner {width:670px; height:30px; background-color:#f1f1f1; color:#666666; line-height:30px; vertical-align:middle;} +.vl_copy {background:url(../images/vlicon/clone_url.png) 0px 0px no-repeat; padding-left:22px;} +.vl_zip {background:url(../images/vlicon/download_icon.png) 0px 0px no-repeat; padding-left:22px;} +.vl_fork {background:url(../images/vlicon/fork_icon.png) 0px -2px no-repeat; padding-left:22px;} +.vl_commit {background:url(../images/vlicon/commit_icon.png) 0px -2px no-repeat; padding-left:22px;weight:20px;height: 24px;} +.vl_branch {background:url(../images/vlicon/branch_icon.png) 0px -2px no-repeat; padding-left:22px} +.mt1 {margin-top:1px;} +.mt2 {margin-top:2px;} \ No newline at end of file