Commit 5e7f7f8d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Redesign project home page

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 62c8bc22
...@@ -15,48 +15,31 @@ ...@@ -15,48 +15,31 @@
} }
.project-home-panel { .project-home-panel {
margin-top: 10px; text-align: center;
margin-bottom: 15px; margin-bottom: 20px;
position: relative;
padding-left: 65px;
min-height: 50px;
.project-identicon-holder { .project-identicon-holder {
position: absolute; margin-bottom: 15px;
left: 0;
top: -14px;
.avatar { .avatar, .identicon {
width: 50px; margin: 0 auto;
height: 50px; float: none;
} }
.identicon { .identicon {
font-size: 26px; @include border-radius(50%);
line-height: 50px;
} }
} }
.project-home-row { .lead {
@extend .clearfix; p {
margin-bottom: 15px; display: inline;
&.project-home-row-top {
margin-bottom: 15px;
} }
}
.project-home-desc { .git-clone-holder {
color: $gray; max-width: 600px;
float: left; margin: 0 auto;
font-size: 16px;
line-height: 1.3;
margin-right: 250px;
// Render Markdown-generated HTML inline for this block
p {
display: inline;
}
}
} }
.visibility-level-label { .visibility-level-label {
...@@ -67,22 +50,19 @@ ...@@ -67,22 +50,19 @@
} }
.project-repo-buttons { .project-repo-buttons {
margin-top: -3px; margin-top: 25px;
position: absolute; margin-bottom: 25px;
right: 0;
width: 265px;
text-align: right;
.btn { .btn {
@extend .btn-info;
font-weight: bold; font-weight: bold;
font-size: 14px; font-size: 14px;
line-height: 16px; line-height: 16px;
padding: 8px 12px;
.count { .count {
padding-left: 10px; padding-left: 7px;
border-left: 1px solid #ccc;
display: inline-block; display: inline-block;
margin-left: 10px; margin-left: 7px;
} }
} }
} }
...@@ -307,3 +287,15 @@ table.table.protected-branches-list tr.no-border { ...@@ -307,3 +287,15 @@ table.table.protected-branches-list tr.no-border {
float: left; float: left;
margin-right: 10px; margin-right: 10px;
} }
.project-stats {
text-align: center;
ul.nav-pills { display:inline-block; }
li { display:inline; }
a { float:left; }
}
pre.light-well {
border-color: #f1f1f1;
}
- empty_repo = @project.empty_repo? - empty_repo = @project.empty_repo?
.project-home-panel.clearfix{:class => ("empty-project" if empty_repo)} .project-home-panel.clearfix{:class => ("empty-project" if empty_repo)}
.project-identicon-holder .project-identicon-holder
= project_icon(@project, alt: '', class: 'avatar project-avatar') = project_icon(@project, alt: '', class: 'project-avatar avatar s90')
.project-home-row.project-home-row-top .lead
.project-home-desc - if @project.description.present?
- if @project.description.present? = markdown(@project.description, pipeline: :description)
= markdown(@project.description, pipeline: :description)
- if can?(current_user, :admin_project, @project)
&ndash; .project-repo-buttons
= link_to 'Edit', edit_namespace_project_path .inline.star.js-toggler-container{class: @show_star ? 'on' : ''}
- elsif !empty_repo && @repository.readme - if current_user
- readme = @repository.readme = link_to_toggle_star('Star this project.', false)
&ndash; = link_to_toggle_star('Unstar this project.', true)
= link_to namespace_project_blob_path(@project.namespace, @project, tree_join(@repository.root_ref, readme.name)) do - else
= readme.name = link_to new_user_session_path, class: 'btn star-btn has_tooltip', title: 'You must sign in to star a project' do
.project-repo-buttons %span
.inline.star.js-toggler-container{class: @show_star ? 'on' : ''} = icon('star')
- if current_user Star
= link_to_toggle_star('Star this project.', false) %span.count
= link_to_toggle_star('Unstar this project.', true) = @project.star_count
- else - unless empty_repo
= link_to new_user_session_path, class: 'btn star-btn has_tooltip', title: 'You must sign in to star a project' do - if current_user && can?(current_user, :fork_project, @project) && @project.namespace != current_user.namespace
%span .inline.fork-buttons.prepend-left-10
= icon('star') - if current_user.already_forked?(@project) && current_user.manageable_namespaces.size < 2
Star = link_to namespace_project_path(current_user, current_user.fork_of(@project)), title: 'Go to your fork', class: 'btn btn-sm btn-default' do
%span.count = link_to_toggle_fork
= @project.star_count - else
- unless empty_repo = link_to new_namespace_project_fork_path(@project.namespace, @project), title: "Fork project", class: 'btn btn-sm btn-default' do
- if current_user && can?(current_user, :fork_project, @project) && @project.namespace != current_user.namespace = link_to_toggle_fork
.inline.fork-buttons.prepend-left-10
- if current_user.already_forked?(@project) && current_user.manageable_namespaces.size < 2 = render "shared/clone_panel"
= link_to namespace_project_path(current_user, current_user.fork_of(@project)), title: 'Go to your fork', class: 'btn btn-sm btn-default' do
= link_to_toggle_fork
- else
= link_to new_namespace_project_fork_path(@project.namespace, @project), title: "Fork project", class: 'btn btn-sm btn-default' do
= link_to_toggle_fork
...@@ -4,30 +4,28 @@ ...@@ -4,30 +4,28 @@
= render "home_panel" = render "home_panel"
.center.well .center.light-well
%h3 %h3.page-title
The repository for this project is empty The repository for this project is empty
%h4 %p
You can You can
= link_to namespace_project_new_blob_path(@project.namespace, @project, 'master'), class: 'btn btn-new btn-lg' do = link_to namespace_project_new_blob_path(@project.namespace, @project, 'master'), class: 'btn btn-new' do
add a file add a file
&nbsp;or do a push via the command line. &nbsp;or do a push via the command line.
.well %h3.page-title
= render "shared/clone_panel" Command line instructions
%h4
%strong Command line instructions
%div.git-empty %div.git-empty
%fieldset %fieldset
%legend Git global setup %h5 Git global setup
%pre.dark %pre.light-well
:preserve :preserve
git config --global user.name "#{git_user_name}" git config --global user.name "#{git_user_name}"
git config --global user.email "#{git_user_email}" git config --global user.email "#{git_user_email}"
%fieldset %fieldset
%legend Create a new repository %h5 Create a new repository
%pre.dark %pre.light-well
:preserve :preserve
git clone #{ content_tag(:span, default_url_to_repo, class: 'clone')} git clone #{ content_tag(:span, default_url_to_repo, class: 'clone')}
cd #{@project.path} cd #{@project.path}
...@@ -37,8 +35,8 @@ ...@@ -37,8 +35,8 @@
git push -u origin master git push -u origin master
%fieldset %fieldset
%legend Existing folder or Git repository %h5 Existing folder or Git repository
%pre.dark %pre.light-well
:preserve :preserve
cd existing_folder cd existing_folder
git init git init
......
...@@ -7,10 +7,40 @@ ...@@ -7,10 +7,40 @@
= render 'shared/no_password' = render 'shared/no_password'
= render "home_panel" = render "home_panel"
= render 'shared/show_aside' .project-stats
%ul.nav.nav-pills
%li
= link_to namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref) do
= pluralize(number_with_delimiter(@repository.commit_count), 'commit')
%li
= link_to namespace_project_branches_path(@project.namespace, @project) do
= pluralize(number_with_delimiter(@repository.branch_names.count), 'branch')
%li
= link_to namespace_project_tags_path(@project.namespace, @project) do
= pluralize(number_with_delimiter(@repository.tag_names.count), 'tag')
- if @repository.changelog
%li
= link_to changelog_url(@project) do
Changelog
- if @repository.license
%li
= link_to license_url(@project) do
License
- if @repository.contribution_guide
%li
= link_to contribution_guide_url(@project) do
Contribution guide
.row %hr
%section.col-md-8 %section
= render 'section' - if readme = @repository.readme
%aside.col-md-4.project-side %article.readme-holder#README
= render 'aside' .clearfix
%small.pull-right
= link_to namespace_project_blob_path(@project.namespace, @project, tree_join(@repository.root_ref, readme.name)), class: 'light' do
%i.fa.fa-file
= readme.name
.wiki
= render_readme(readme)
- else
%h4 Add README to this repository
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
:"data-container" => "body"} :"data-container" => "body"}
= gitlab_config.protocol.upcase = gitlab_config.protocol.upcase
= text_field_tag :project_clone, default_url_to_repo(project), class: "js-select-on-focus form-control input-sm", readonly: true = text_field_tag :project_clone, default_url_to_repo(project), class: "js-select-on-focus form-control input-sm", readonly: true
- if project.kind_of?(Project) && project.empty_repo? - if project.kind_of?(Project)
.input-group-addon .input-group-addon
.visibility-level-label.has_tooltip{'data-title' => "#{visibility_level_label(project.visibility_level)} project" } .visibility-level-label.has_tooltip{'data-title' => "#{visibility_level_label(project.visibility_level)} project" }
= visibility_level_icon(project.visibility_level) = visibility_level_icon(project.visibility_level)
......
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