#907: update #branches UI

This commit is contained in:
Vokhmin Alexey V 2013-02-13 14:25:09 +04:00
parent 04b70fe91f
commit 3929c4bb57
8 changed files with 67 additions and 5 deletions

View File

@ -53,16 +53,31 @@ header menu ul li a {
display: inline-block;
padding: 10px;
margin: 0 5px;
border: 1px solid #a9c6dd;
border-bottom: none;
}
li.selected {
background-color: #FFF;
border: 1px solid #a9c6dd;
border-bottom: none;
}
.tags { float: right; }
}
}
#project-branches {
width: 100%;
border-spacing: 0;
margin-top: 20px;
tr.base {
background: #dcecfa;
}
td.actions ul {
float: right;
}
.text { font-size: 12px; }
td {
border-bottom: 1px solid #a9c6dd;
padding: 0 20px;
}
}
article div.activity, .commits_activity {
border: 1px solid #D6D6D6;
border-radius: 5px 5px 5px 5px;

View File

@ -25,9 +25,11 @@ class Projects::Git::TreesController < Projects::Git::BaseController
end
def tags
@tags = @project.repo.tags
end
def branches
@branches = @project.repo.branches
end
end

View File

@ -0,0 +1,10 @@
- base = branch.name == @branch.name
%tr{:class => (base ? 'base' : '')}
%td.name= link_to branch.name, tree_path(@project, branch.name)
%td.actions
%ul.actions
- if base
%li.text= t('layout.projects.base_branch')
- else
%li
= link_to t('diff'), diff_path(@project, "#{@branch.name}...#{branch.name}")

View File

@ -0,0 +1,10 @@
- subjects_name = action_name.to_s
%h3= t("layout.projects.#{subjects_name}")
- if subject.empty?
%p= t("layout.projects.no_#{subjects_name}")
- elsif subject.count == 1
%p= t("layout.projects.showing_#{subjects_name.gsub /[e]*s$/, ''}")
- else
%p= t("layout.projects.showing_#{subjects_name}", :count => subject.count)
.both

View File

@ -1,4 +1,10 @@
-set_meta_tags :title => "#{title_object @project}"
= render 'submenu'
= render 'repo_block', :project => @project
= render 'repo_block', :project => @project
= render 'header', :subject => @branches
- if @branches.present?
%table#project-branches
%tbody
= render :partial => 'branch', :collection => @branches.select{ |b| b.name != @branch.name }.unshift(@branch)

View File

@ -1,4 +1,5 @@
-set_meta_tags :title => "#{title_object @project}"
= render 'submenu'
= render 'repo_block', :project => @project
= render 'repo_block', :project => @project
= render 'header', :subject => @tags

View File

@ -1,6 +1,15 @@
en:
layout:
projects:
branches: Branches
showing_branches: Showing %{count} branches
showing_branch: Showing 1 branch
no_branches: No branches
base_branch: Base branch
tags: Tags
showing_tags: Showing %{count} tags
showing_tag: Showing 1 tag
no_tags: No tags
add: Add
public_projects_list: Public projects list
edit: Settings

View File

@ -1,6 +1,15 @@
ru:
layout:
projects:
branches: Ветки
showing_branches: Показано %{count} веток
showing_branch: Показана 1 ветка
no_branch: Нет веток
base_branch: Текущая ветка
tags: Теги
showing_tags: Показано %{count} тегов
showing_tag: Показан 1 тег
no_tags: Нет тегов
add: Добавить
public_projects_list: Список публичных проектов
edit: Настройки