Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
9710e42d
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,体验更适合开发者的 AI 搜索 >>
提交
9710e42d
编写于
3月 25, 2013
作者:
A
Andrew8xx8
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Layuot and templates for personal snippets added
上级
b3dc4fb7
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
75 addition
and
26 deletion
+75
-26
app/views/snippets/_blob.html.haml
app/views/snippets/_blob.html.haml
+1
-1
app/views/snippets/_form.html.haml
app/views/snippets/_form.html.haml
+6
-3
app/views/snippets/_snippet.html.haml
app/views/snippets/_snippet.html.haml
+13
-2
app/views/snippets/_snippets.html.haml
app/views/snippets/_snippets.html.haml
+13
-0
app/views/snippets/edit.html.haml
app/views/snippets/edit.html.haml
+1
-1
app/views/snippets/index.html.haml
app/views/snippets/index.html.haml
+13
-15
app/views/snippets/new.html.haml
app/views/snippets/new.html.haml
+1
-1
app/views/snippets/show.html.haml
app/views/snippets/show.html.haml
+7
-3
app/views/snippets/user_index.html.haml
app/views/snippets/user_index.html.haml
+20
-0
未找到文件。
app/views/snippets/_blob.html.haml
浏览文件 @
9710e42d
...
...
@@ -3,7 +3,7 @@
%i
.icon-file
%strong
=
@snippet
.
file_name
%span
.options
=
link_to
"raw"
,
raw_
project_snippet_path
(
@project
,
@snippet
),
class:
"btn btn-tiny"
,
target:
"_blank"
=
link_to
"raw"
,
raw_
snippet_path
(
@snippet
),
class:
"btn btn-tiny"
,
target:
"_blank"
.file_content.code
-
unless
@snippet
.
content
.
empty?
%div
{
class:
user_color_scheme_class
}
...
...
app/views/snippets/_form.html.haml
浏览文件 @
9710e42d
...
...
@@ -2,7 +2,7 @@
=
@snippet
.
new_record?
?
"New Snippet"
:
"Edit Snippet #
#{
@snippet
.
id
}
"
%hr
.snippet-form-holder
=
form_for
[
@project
,
@snippet
]
do
|
f
|
=
form_for
@snippet
,
as: :personal_snippet
,
url:
url
do
|
f
|
-
if
@snippet
.
errors
.
any?
.alert.alert-error
%ul
...
...
@@ -12,6 +12,9 @@
.clearfix
=
f
.
label
:title
.input
=
f
.
text_field
:title
,
placeholder:
"Example Snippet"
,
class:
'input-xlarge'
,
required:
true
.clearfix
=
f
.
label
"Private?"
.input
=
f
.
check_box
:private
,
{
class:
''
}
.clearfix
=
f
.
label
"Lifetime"
.input
=
f
.
select
:expires_at
,
lifetime_select_options
,
{},
{
class:
'chosen span2'
}
...
...
@@ -28,9 +31,9 @@
.form-actions
=
f
.
submit
'Save'
,
class:
"btn-save btn"
=
link_to
"Cancel"
,
project_
snippets_path
(
@project
),
class:
" btn"
=
link_to
"Cancel"
,
snippets_path
(
@project
),
class:
" btn"
-
unless
@snippet
.
new_record?
.pull-right
=
link_to
'Destroy'
,
[
@project
,
@snippet
]
,
confirm:
'Are you sure?'
,
method: :delete
,
class:
"btn pull-right danger delete-snippet"
,
id:
"destroy_snippet_
#{
@snippet
.
id
}
"
.pull-right
=
link_to
'Destroy'
,
snippet_path
(
@snippet
)
,
confirm:
'Are you sure?'
,
method: :delete
,
class:
"btn pull-right danger delete-snippet"
,
id:
"destroy_snippet_
#{
@snippet
.
id
}
"
:javascript
...
...
app/views/snippets/_snippet.html.haml
浏览文件 @
9710e42d
%tr
%td
-
if
snippet
.
private?
%i
.icon-lock
-
else
%i
.icon-globe
=
image_tag
gravatar_icon
(
snippet
.
author_email
),
class:
"avatar s24"
%a
{
href:
project_snippet_path
(
snippet
.
project
,
snippet
)}
%strong
=
truncate
(
snippet
.
title
,
length:
60
)
-
if
snippet
.
project_id?
%a
{
href:
project_snippet_path
(
snippet
.
project
,
snippet
)}
%strong
=
truncate
(
snippet
.
title
,
length:
60
)
-
else
%a
{
href:
snippet_path
(
snippet
)}
%strong
=
truncate
(
snippet
.
title
,
length:
60
)
%td
=
snippet
.
file_name
%td
...
...
@@ -11,3 +19,6 @@
=
snippet
.
expires_at
.
to_date
.
to_s
(
:short
)
-
else
Never
%td
-
if
snippet
.
project_id?
=
link_to
snippet
.
project
.
name
,
project_path
(
snippet
.
project
)
app/views/snippets/_snippets.html.haml
0 → 100644
浏览文件 @
9710e42d
%table
%thead
%tr
%th
Title
%th
File Name
%th
Expires At
%th
Project
=
render
partial:
'snippet'
,
collection:
@snippets
-
if
@snippets
.
empty?
%tr
%td
{
colspan:
4
}
%h3
.nothing_here_message
Nothing here.
app/views/snippets/edit.html.haml
浏览文件 @
9710e42d
=
render
"snippets/form"
=
render
"snippets/form"
,
url:
snippet_path
(
@snippet
)
app/views/snippets/index.html.haml
浏览文件 @
9710e42d
%h3
.page_title
Snippets
%small
share code pastes with others out of git repository
=
link_to
new_snippet_path
,
class:
"btn btn-small add_new pull-right"
,
title:
"New Snippet"
do
Add new snippet
-
if
can?
current_user
,
:write_snippet
,
@project
=
link_to
new_project_snippet_path
(
@project
),
class:
"btn btn-small add_new pull-right"
,
title:
"New Snippet"
do
Add new snippet
%br
%table
%thead
%tr
%th
Title
%th
File Name
%th
Expires At
=
render
@snippets
-
if
@snippets
.
empty?
%tr
%td
{
colspan:
3
}
%h3
.nothing_here_message
Nothing here.
%hr
.row
.span3
%ul
.nav.nav-pills.nav-stacked
=
nav_tab
:scope
,
nil
do
=
link_to
"All"
,
snippets_path
=
nav_tab
:scope
,
'projects'
do
=
link_to
"Projects"
,
snippets_path
(
scope:
'projects'
)
.span9
=
render
'snippets'
app/views/snippets/new.html.haml
浏览文件 @
9710e42d
=
render
"snippets/form"
=
render
"snippets/form"
,
url:
snippets_path
(
@snippet
)
app/views/snippets/show.html.haml
浏览文件 @
9710e42d
%h3
.page_title
-
if
@snippet
.
private?
%i
.icon-lock
-
else
%i
.icon-globe
=
@snippet
.
title
%small
=
@snippet
.
file_name
-
if
can?
(
current_user
,
:admin_snippet
,
@project
)
||
@snippet
.
author
==
current_user
=
link_to
"Edit"
,
edit_
project_snippet_path
(
@project
,
@snippet
),
class:
"btn btn-small pull-right"
,
title:
'Edit Snippet'
-
if
@snippet
.
author
==
current_user
=
link_to
"Edit"
,
edit_
snippet_path
(
@snippet
),
class:
"btn btn-small pull-right"
,
title:
'Edit Snippet'
%br
%div
=
render
'blob'
%div
#notes
=
render
"notes/notes_with_form"
app/views/snippets/user_index.html.haml
0 → 100644
浏览文件 @
9710e42d
%h3
.page_title
Snippets by
=
@user
.
name
%small
share code pastes with others out of git repository
=
link_to
new_snippet_path
,
class:
"btn btn-small add_new pull-right"
,
title:
"New Snippet"
do
Add new snippet
%hr
.row
.span3
%ul
.nav.nav-pills.nav-stacked
=
nav_tab
:scope
,
nil
do
=
link_to
"All"
,
user_snippets_path
(
@user
)
=
nav_tab
:scope
,
'private'
do
=
link_to
"Private"
,
user_snippets_path
(
@user
,
scope:
'private'
)
=
nav_tab
:scope
,
'public'
do
=
link_to
"Public"
,
user_snippets_path
(
@user
,
scope:
'public'
)
.span9
=
render
'snippets'
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录