Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
c51a9306
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
c51a9306
编写于
4月 06, 2018
作者:
P
Phil Hughes
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updates to template text to be i18n ready
上级
2aaa0222
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
35 addition
and
27 deletion
+35
-27
app/assets/javascripts/ide/components/changed_file_icon.vue
app/assets/javascripts/ide/components/changed_file_icon.vue
+10
-3
app/assets/javascripts/ide/components/commit_sidebar/list.vue
...assets/javascripts/ide/components/commit_sidebar/list.vue
+13
-7
app/assets/javascripts/ide/components/commit_sidebar/list_collapsed.vue
...ascripts/ide/components/commit_sidebar/list_collapsed.vue
+6
-15
app/assets/javascripts/ide/stores/getters.js
app/assets/javascripts/ide/stores/getters.js
+3
-1
app/assets/javascripts/ide/stores/modules/commit/getters.js
app/assets/javascripts/ide/stores/modules/commit/getters.js
+3
-1
未找到文件。
app/assets/javascripts/ide/components/changed_file_icon.vue
浏览文件 @
c51a9306
...
...
@@ -2,6 +2,7 @@
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
icon
from
'
~/vue_shared/components/icon.vue
'
;
import
{
pluralize
}
from
'
~/lib/utils/text_utility
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
export
default
{
components
:
{
...
...
@@ -34,11 +35,17 @@ export default {
const
type
=
this
.
file
.
tempFile
?
'
addition
'
:
'
modification
'
;
if
(
this
.
file
.
changed
&&
!
this
.
file
.
staged
)
{
return
`Unstaged
${
type
}
`
;
return
sprintf
(
__
(
'
Unstaged %{type}
'
),
{
type
,
});
}
else
if
(
!
this
.
file
.
changed
&&
this
.
file
.
staged
)
{
return
`Staged
${
type
}
`
;
return
sprintf
(
__
(
'
Staged %{type}
'
),
{
type
,
});
}
else
if
(
this
.
file
.
changed
&&
this
.
file
.
staged
)
{
return
`Unstaged and staged
${
pluralize
(
type
)}
`
;
return
sprintf
(
__
(
'
Unstaged and staged %{type}
'
),
{
type
:
pluralize
(
type
),
});
}
return
undefined
;
...
...
app/assets/javascripts/ide/components/commit_sidebar/list.vue
浏览文件 @
c51a9306
<
script
>
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
i
con
from
'
~/vue_shared/components/icon.vue
'
;
import
I
con
from
'
~/vue_shared/components/icon.vue
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
listItem
from
'
./list_item.vue
'
;
import
listCollapsed
from
'
./list_collapsed.vue
'
;
import
ListItem
from
'
./list_item.vue
'
;
import
ListCollapsed
from
'
./list_collapsed.vue
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
export
default
{
components
:
{
i
con
,
l
istItem
,
l
istCollapsed
,
I
con
,
L
istItem
,
L
istCollapsed
,
},
directives
:
{
tooltip
,
...
...
@@ -48,6 +49,11 @@ export default {
computed
:
{
...
mapState
([
'
rightPanelCollapsed
'
]),
...
mapGetters
([
'
collapseButtonIcon
'
,
'
collapseButtonTooltip
'
]),
titleText
()
{
return
sprintf
(
__
(
'
%{title} changes
'
),
{
title
:
this
.
title
,
});
},
},
methods
:
{
...
mapActions
([
'
toggleRightPanelCollapsed
'
,
'
stageAllChanges
'
,
'
unstageAllChanges
'
]),
...
...
@@ -83,7 +89,7 @@ export default {
:name=
"icon"
:size=
"18"
/>
{{
title
}}
changes
{{
title
Text
}}
<button
type=
"button"
class=
"btn btn-blank btn-link ide-staged-action-btn"
...
...
app/assets/javascripts/ide/components/commit_sidebar/list_collapsed.vue
浏览文件 @
c51a9306
<
script
>
import
icon
from
'
~/vue_shared/components/icon.vue
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
{
sprintf
,
n__
}
from
'
~/locale
'
;
import
{
sprintf
,
n__
,
__
}
from
'
~/locale
'
;
export
default
{
components
:
{
...
...
@@ -38,27 +38,18 @@ export default {
return
this
.
modifiedFilesLength
?
'
multi-file-modified
'
:
''
;
},
additionsTooltip
()
{
return
sprintf
(
n__
(
'
1 %{type} addition
'
,
'
%d %{type} additions
'
,
this
.
addedFilesLength
,
),
{
type
:
this
.
title
.
toLowerCase
()
},
);
return
sprintf
(
n__
(
'
1 %{type} addition
'
,
'
%d %{type} additions
'
,
this
.
addedFilesLength
),
{
type
:
this
.
title
.
toLowerCase
(),
});
},
modifiedTooltip
()
{
return
sprintf
(
n__
(
'
1 %{type} modification
'
,
'
%d %{type} modifications
'
,
this
.
modifiedFilesLength
,
),
n__
(
'
1 %{type} modification
'
,
'
%d %{type} modifications
'
,
this
.
modifiedFilesLength
),
{
type
:
this
.
title
.
toLowerCase
()
},
);
},
titleTooltip
()
{
return
`
${
this
.
title
}
changes`
;
return
sprintf
(
__
(
'
%{title} changes
'
),
{
title
:
this
.
title
})
;
},
},
};
...
...
app/assets/javascripts/ide/stores/getters.js
浏览文件 @
c51a9306
import
{
__
}
from
'
~/locale
'
;
export
const
activeFile
=
state
=>
state
.
openFiles
.
find
(
file
=>
file
.
active
)
||
null
;
export
const
addedFiles
=
state
=>
state
.
changedFiles
.
filter
(
f
=>
f
.
tempFile
);
...
...
@@ -36,6 +38,6 @@ export const hasChanges = state => !!state.changedFiles.length || !!state.staged
// eslint-disable-next-line no-confusing-arrow
export
const
collapseButtonTooltip
=
state
=>
state
.
rightPanelCollapsed
?
'
Expand sidebar
'
:
'
Collapse sidebar
'
;
state
.
rightPanelCollapsed
?
__
(
'
Expand sidebar
'
)
:
__
(
'
Collapse sidebar
'
)
;
export
const
hasMergeRequest
=
state
=>
!!
state
.
currentMergeRequestId
;
app/assets/javascripts/ide/stores/modules/commit/getters.js
浏览文件 @
c51a9306
import
*
as
consts
from
'
./constants
'
;
const
BRANCH_SUFFIX_COUNT
=
5
;
export
const
discardDraftButtonDisabled
=
state
=>
state
.
commitMessage
===
''
||
state
.
submitCommitLoading
;
...
...
@@ -8,7 +10,7 @@ export const commitButtonDisabled = (state, getters, rootState) =>
export
const
newBranchName
=
(
state
,
_
,
rootState
)
=>
`
${
gon
.
current_username
}
-
${
rootState
.
currentBranchId
}
-patch-
${
`
${
new
Date
().
getTime
()}
`
.
substr
(
-
5
,
-
BRANCH_SUFFIX_COUNT
,
)}
`
;
export
const
branchName
=
(
state
,
getters
,
rootState
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录