#907: update #branches UI
This commit is contained in:
parent
04b70fe91f
commit
3929c4bb57
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}")
|
|
@ -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
|
|
@ -2,3 +2,9 @@
|
|||
|
||||
= render 'submenu'
|
||||
= 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)
|
|
@ -2,3 +2,4 @@
|
|||
|
||||
= render 'submenu'
|
||||
= render 'repo_block', :project => @project
|
||||
= render 'header', :subject => @tags
|
|
@ -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
|
||||
|
|
|
@ -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: Настройки
|
||||
|
|
Loading…
Reference in New Issue