Commit ffd0a985ee86691ddb4807cf9be267bdd37c7815

Authored by Dmitriy Zaporozhets
1 parent 66998f6d

Point to project page from public area

app/controllers/public/projects_controller.rb
@@ -10,17 +10,4 @@ class Public::ProjectsController < ApplicationController @@ -10,17 +10,4 @@ class Public::ProjectsController < ApplicationController
10 @projects = @projects.search(params[:search]) if params[:search].present? 10 @projects = @projects.search(params[:search]) if params[:search].present?
11 @projects = @projects.includes(:namespace).order("namespaces.path, projects.name ASC").page(params[:page]).per(20) 11 @projects = @projects.includes(:namespace).order("namespaces.path, projects.name ASC").page(params[:page]).per(20)
12 end 12 end
13 -  
14 - def show  
15 - @project = Project.public_only.find_with_namespace(params[:id])  
16 - render_404 and return unless @project  
17 -  
18 - @repository = @project.repository  
19 - unless @project.empty_repo?  
20 - @recent_tags = @repository.tags.first(10)  
21 -  
22 - @commit = @repository.commit(params[:ref])  
23 - @tree = Tree.new(@repository, @commit.id)  
24 - end  
25 - end  
26 end 13 end
app/views/public/projects/_tree.html.haml
@@ -1,5 +0,0 @@ @@ -1,5 +0,0 @@
1 -- if tree.readme  
2 - = render "projects/tree/readme", readme: tree.readme  
3 -- else  
4 - .alert  
5 - %h3.nothing_here_message This project does not have README file  
app/views/public/projects/index.html.haml
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 %li 17 %li
18 .project-title 18 .project-title
19 %i.icon-share.cgray 19 %i.icon-share.cgray
20 - = link_to public_project_path(project) do 20 + = link_to project_path(project) do
21 %strong= project.name_with_namespace 21 %strong= project.name_with_namespace
22 .pull-right 22 .pull-right
23 %pre.public-clone git clone #{project.http_url_to_repo} 23 %pre.public-clone git clone #{project.http_url_to_repo}
app/views/public/projects/show.html.haml
@@ -1,49 +0,0 @@ @@ -1,49 +0,0 @@
1 -%h3.page-title  
2 - = @project.name_with_namespace  
3 - .pull-right  
4 - %pre.public-clone git clone #{@project.http_url_to_repo}  
5 - .pull-right  
6 - - if current_user  
7 - = link_to 'Browse project', @project, class: 'btn btn-create append-right-10'  
8 -  
9 -  
10 -%div  
11 - = link_to public_root_path do  
12 - ← To projects list  
13 - .pull-right  
14 - %span.light= @project.description  
15 -  
16 -%br  
17 -.row  
18 - - unless @project.empty_repo?  
19 - .span9  
20 - = render 'tree', tree: @tree  
21 - .span3  
22 - %h5 Repository:  
23 - %div  
24 - %p  
25 - %span.light Bare size is  
26 - #{@project.repository.size} MB  
27 -  
28 - %p  
29 - = pluralize(@repository.round_commit_count, 'commit')  
30 - %p  
31 - = pluralize(@repository.branch_names.count, 'branch')  
32 - %p  
33 - = pluralize(@repository.tag_names.count, 'tag')  
34 -  
35 - - if @recent_tags.present?  
36 - %hr  
37 - %h5 Most Recent Tags:  
38 - %ul.unstyled  
39 - - @recent_tags.each do |tag|  
40 - %li  
41 - %p  
42 - %i.icon-tag  
43 - %strong= tag.name  
44 - %small.light.pull-right  
45 - %i.icon-calendar  
46 - = time_ago_in_words(tag.commit.committed_date)  
47 - ago  
48 - - else  
49 - = 'Empty Repository'