Commit a7fab42b authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Public area: Project#show page prototype

parent cb86cf84
......@@ -81,9 +81,11 @@ ul.nav.nav-projects-tabs {
.public-projects {
li {
margin-top: 8px;
margin-bottom: 5px;
border-bottom: 1px solid #eee;
.project-title {
font-size: 14px;
line-height: 2;
font-weight: normal;
}
.description {
margin-left: 15px;
......@@ -92,6 +94,14 @@ ul.nav.nav-projects-tabs {
}
}
.public-clone {
background: #333;
color: #f5f5f5;
padding: 5px 10px;
margin: 1px;
font-weight: normal;
}
.new-tag-btn {
position: relative;
top: -5px;
......
......@@ -10,4 +10,12 @@ class Public::ProjectsController < ApplicationController
@projects = @projects.search(params[:search]) if params[:search].present?
@projects = @projects.includes(:namespace).order("namespaces.path, projects.name ASC").page(params[:page]).per(20)
end
def show
@project = Project.public_only.find_with_namespace(params[:id])
render_404 and return unless @project
@repository = @project.repository
@recent_tags = @repository.tags.first(10)
end
end
......@@ -10,10 +10,16 @@
.container
%div.app_logo
%span.separator
= link_to root_path, class: "home" do
= link_to public_root_path, class: "home" do
%h1 GITLAB
%span.separator
%h1.project_name Public Projects
%ul.nav
%li
%a
%div.hide.turbolink-spinner
%i.icon-refresh.icon-spin
Loading...
.container.navless-container
.content
......
......@@ -11,20 +11,18 @@
= search_field_tag :search, params[:search], placeholder: "gitlab-ci", class: "span3 search-text-input", id: "projects_search"
= submit_tag 'Search', class: "btn btn-primary wide"
%hr
.public-projects
%ul.unstyled
%ul.bordered-list
- @projects.each do |project|
%li.clearfix
%div
%i.icon-share
- if current_user
= link_to_project project
- else
%li
.project-title
%i.icon-share.cgray
= link_to public_project_path(project) do
= project.name_with_namespace
.pull-right
%pre.dark.tiny git clone #{project.http_url_to_repo}
%pre.public-clone git clone #{project.http_url_to_repo}
- if project.description.present?
%div.description
= project.description
- unless @projects.present?
......
%h3.page-title
= @project.name_with_namespace
.pull-right
%pre.public-clone git clone #{@project.http_url_to_repo}
.pull-right
- if current_user
= link_to 'Browse project', @project, class: 'btn btn-create append-right-10'
%div
= link_to public_root_path do
&larr; To projects list
.pull-right
%span.light= @project.description
%br
.row
.span9
.light-well
%h3.nothing_here_message Some awesome stuff here
.span3
%h5 Repository:
%div
%p
%span.light Bare size is
#{@project.repository.size} MB
%p
= pluralize(@repository.round_commit_count, 'commit')
%p
= pluralize(@repository.branch_names.count, 'branch')
%p
= pluralize(@repository.tag_names.count, 'tag')
- if @recent_tags.present?
%hr
%h5 Most Recent Tags:
%ul.unstyled
- @recent_tags.each do |tag|
%li
%p
%i.icon-tag
%strong= tag.name
%small.light.pull-right
%i.icon-calendar
= time_ago_in_words(tag.commit.committed_date)
ago
......@@ -55,6 +55,8 @@ Gitlab::Application.routes.draw do
#
namespace :public do
resources :projects, only: [:index]
resources :projects, constraints: { id: /[a-zA-Z.\/0-9_\-]+/ }, only: [:show]
root to: "projects#index"
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment