#214: updated locales of branches
This commit is contained in:
parent
a37a23266f
commit
bc89c873ba
|
@ -2,7 +2,7 @@
|
|||
class Api::V1::ProjectsController < Api::V1::BaseController
|
||||
|
||||
before_filter :authenticate_user!
|
||||
skip_before_filter :authenticate_user!, :only => [:get_id, :show, :refs] if APP_CONFIG['anonymous_access']
|
||||
skip_before_filter :authenticate_user!, :only => [:get_id, :show, :refs_list] if APP_CONFIG['anonymous_access']
|
||||
|
||||
load_and_authorize_resource :project
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ class Ability
|
|||
can [:show, :archive], Project, :visibility => 'open'
|
||||
can :get_id, Project, :visibility => 'open' # api
|
||||
can :archive, Project, :visibility => 'open'
|
||||
can(:refs_list, Project) {|project| can? :show, project}
|
||||
can :read, Issue, :project => {:visibility => 'open'}
|
||||
can [:read, :commits, :files], PullRequest, :to_project => {:visibility => 'open'}
|
||||
can :search, BuildList
|
||||
|
@ -74,7 +75,6 @@ class Ability
|
|||
can(:destroy, Project) {|project| project.owner_type == 'Group' and project.owner.actors.exists?(:actor_type => 'User', :actor_id => user.id, :role => 'admin')}
|
||||
can :remove_user, Project
|
||||
can :preview, Project
|
||||
can(:refs_list, Project) {|project| can? :read, project}
|
||||
|
||||
can([:read, :create, :edit, :destroy, :update], Hook) {|hook| can?(:edit, hook.project)}
|
||||
|
||||
|
|
|
@ -8,8 +8,13 @@
|
|||
|
||||
%h3= t('layout.projects.branches')
|
||||
%p{'ng-show' => '!branches.length'}= t('layout.projects.no_branches')
|
||||
%p{'ng-show' => 'branches.length == 1'}= t('layout.projects.total_branch')
|
||||
%p{'ng-show' => 'branches.length > 1'}= t('layout.projects.total_branches', :count => '{{branches.length}}')
|
||||
%p{'ng-show' => 'branches.length == 1'}
|
||||
= t('layout.projects.total_branches', :count => '{{branches.length}}', :branches => t('layout.projects.pluralize.branches.branch'))
|
||||
%p{'ng-show' => 'branches.length > 1 && branches.length < 5'}
|
||||
= t('layout.projects.total_branches', :count => '{{branches.length}}', :branches => t('layout.projects.pluralize.branches.branches2'))
|
||||
%p{'ng-show' => 'branches.length > 4'}
|
||||
= t('layout.projects.total_branches', :count => '{{branches.length}}', :branches => t('layout.projects.pluralize.branches.branches'))
|
||||
|
||||
.both
|
||||
%br
|
||||
|
||||
|
@ -25,9 +30,10 @@
|
|||
%ul.actions
|
||||
%li.text{'ng-show' => 'branch.ref == current_ref'}
|
||||
= t('layout.projects.base_branch')
|
||||
%li{'ng-hide' => 'branch.ref == current_ref'}
|
||||
%a{:href => '', 'ng-click' => 'destroy(branch)'}
|
||||
= t('layout.projects.delete_branch')
|
||||
- if can?(:write, @project)
|
||||
%li{'ng-hide' => 'branch.ref == current_ref'}
|
||||
%a{:href => '', 'ng-click' => 'destroy(branch)'}
|
||||
= t('layout.projects.delete_branch')
|
||||
%li{'ng-hide' => 'branch.ref == current_ref'}
|
||||
%a{'ng-href' => '{{branch.diff_path(project, current_ref)}}' }
|
||||
= t('layout.projects.compare')
|
||||
|
|
|
@ -7,8 +7,12 @@
|
|||
|
||||
%h3= t('layout.projects.tags')
|
||||
%p{'ng-show' => '!tags.length'}= t('layout.projects.no_tags')
|
||||
%p{'ng-show' => 'tags.length == 1'}= t('layout.projects.total_tag')
|
||||
%p{'ng-show' => 'tags.length > 1'}= t('layout.projects.total_tags', :count => '{{tags.length}}')
|
||||
%p{'ng-show' => 'tags.length == 1'}
|
||||
= t('layout.projects.total_tags', :count => '{{tags.length}}', :tags => t('layout.projects.pluralize.tags.tag'))
|
||||
%p{'ng-show' => 'tags.length > 1 && tags.length < 5'}
|
||||
= t('layout.projects.total_tags', :count => '{{tags.length}}', :tags => t('layout.projects.pluralize.tags.tags2'))
|
||||
%p{'ng-show' => 'tags.length > 4'}
|
||||
= t('layout.projects.total_tags', :count => '{{tags.length}}', :tags => t('layout.projects.pluralize.tags.tags'))
|
||||
.both
|
||||
%br
|
||||
|
||||
|
|
|
@ -2,18 +2,27 @@ en:
|
|||
layout:
|
||||
projects:
|
||||
branches: Branches
|
||||
|
||||
pluralize:
|
||||
branches:
|
||||
branch: branch
|
||||
branches: branches
|
||||
branches2: branches
|
||||
tags:
|
||||
tag: tag
|
||||
tags: tags
|
||||
tags2: tags
|
||||
|
||||
delete_branch: Delete branch
|
||||
restore_branch: Restore branch
|
||||
total_branches: Total %{count} branches
|
||||
total_branch: Total 1 branch
|
||||
total_branches: Total %{count} %{branches}
|
||||
no_branches: No branches
|
||||
base_branch: Base branch
|
||||
compare: Compare
|
||||
browse_code: Browse code
|
||||
source_code: Source code (%{type})
|
||||
tags: Tags
|
||||
total_tags: Total %{count} tags
|
||||
total_tag: Total 1 tag
|
||||
total_tags: Total %{count} %{tags}
|
||||
no_tags: No tags
|
||||
add: Add
|
||||
public_projects_list: Public projects list
|
||||
|
|
|
@ -2,18 +2,27 @@ ru:
|
|||
layout:
|
||||
projects:
|
||||
branches: Ветки
|
||||
|
||||
pluralize:
|
||||
branches:
|
||||
branch: ветка
|
||||
branches: веток
|
||||
branches2: ветки
|
||||
tags:
|
||||
tag: тег
|
||||
tags: тегов
|
||||
tags2: тега
|
||||
|
||||
delete_branch: Удалить ветку
|
||||
restore_branch: Востановить ветку
|
||||
total_branches: Всего %{count} веток
|
||||
total_branch: Всего 1 ветка
|
||||
no_branch: Нет веток
|
||||
total_branches: Всего %{count} %{branches}
|
||||
no_branches: Нет веток
|
||||
base_branch: Текущая ветка
|
||||
compare: Сравнить
|
||||
browse_code: Просмотреть код
|
||||
source_code: Исходный код (%{type})
|
||||
tags: Теги
|
||||
total_tags: Всего %{count} тегов
|
||||
total_tag: Всего 1 тег
|
||||
total_tags: Всего %{count} %{tags}
|
||||
no_tags: Нет тегов
|
||||
add: Добавить
|
||||
public_projects_list: Список публичных проектов
|
||||
|
|
Loading…
Reference in New Issue