Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
9710e42d
Commit
9710e42d
authored
Mar 25, 2013
by
Andrew8xx8
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Layuot and templates for personal snippets added
parent
b3dc4fb7
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
75 additions
and
26 deletions
+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
No files found.
app/views/snippets/_blob.html.haml
View file @
9710e42d
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
%i
.icon-file
%i
.icon-file
%strong
=
@snippet
.
file_name
%strong
=
@snippet
.
file_name
%span
.options
%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
.file_content.code
-
unless
@snippet
.
content
.
empty?
-
unless
@snippet
.
content
.
empty?
%div
{
class:
user_color_scheme_class
}
%div
{
class:
user_color_scheme_class
}
...
...
app/views/snippets/_form.html.haml
View file @
9710e42d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
=
@snippet
.
new_record?
?
"New Snippet"
:
"Edit Snippet #
#{
@snippet
.
id
}
"
=
@snippet
.
new_record?
?
"New Snippet"
:
"Edit Snippet #
#{
@snippet
.
id
}
"
%hr
%hr
.snippet-form-holder
.snippet-form-holder
=
form_for
[
@project
,
@snippet
]
do
|
f
|
=
form_for
@snippet
,
as: :personal_snippet
,
url:
url
do
|
f
|
-
if
@snippet
.
errors
.
any?
-
if
@snippet
.
errors
.
any?
.alert.alert-error
.alert.alert-error
%ul
%ul
...
@@ -12,6 +12,9 @@
...
@@ -12,6 +12,9 @@
.clearfix
.clearfix
=
f
.
label
:title
=
f
.
label
:title
.input
=
f
.
text_field
:title
,
placeholder:
"Example Snippet"
,
class:
'input-xlarge'
,
required:
true
.input
=
f
.
text_field
:title
,
placeholder:
"Example Snippet"
,
class:
'input-xlarge'
,
required:
true
.clearfix
=
f
.
label
"Private?"
.input
=
f
.
check_box
:private
,
{
class:
''
}
.clearfix
.clearfix
=
f
.
label
"Lifetime"
=
f
.
label
"Lifetime"
.input
=
f
.
select
:expires_at
,
lifetime_select_options
,
{},
{
class:
'chosen span2'
}
.input
=
f
.
select
:expires_at
,
lifetime_select_options
,
{},
{
class:
'chosen span2'
}
...
@@ -28,9 +31,9 @@
...
@@ -28,9 +31,9 @@
.form-actions
.form-actions
=
f
.
submit
'Save'
,
class:
"btn-save btn"
=
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?
-
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
:javascript
...
...
app/views/snippets/_snippet.html.haml
View file @
9710e42d
%tr
%tr
%td
%td
-
if
snippet
.
private?
%i
.icon-lock
-
else
%i
.icon-globe
=
image_tag
gravatar_icon
(
snippet
.
author_email
),
class:
"avatar s24"
=
image_tag
gravatar_icon
(
snippet
.
author_email
),
class:
"avatar s24"
-
if
snippet
.
project_id?
%a
{
href:
project_snippet_path
(
snippet
.
project
,
snippet
)}
%a
{
href:
project_snippet_path
(
snippet
.
project
,
snippet
)}
%strong
=
truncate
(
snippet
.
title
,
length:
60
)
%strong
=
truncate
(
snippet
.
title
,
length:
60
)
-
else
%a
{
href:
snippet_path
(
snippet
)}
%strong
=
truncate
(
snippet
.
title
,
length:
60
)
%td
%td
=
snippet
.
file_name
=
snippet
.
file_name
%td
%td
...
@@ -11,3 +19,6 @@
...
@@ -11,3 +19,6 @@
=
snippet
.
expires_at
.
to_date
.
to_s
(
:short
)
=
snippet
.
expires_at
.
to_date
.
to_s
(
:short
)
-
else
-
else
Never
Never
%td
-
if
snippet
.
project_id?
=
link_to
snippet
.
project
.
name
,
project_path
(
snippet
.
project
)
app/views/snippets/_snippets.html.haml
0 → 100644
View file @
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
View file @
9710e42d
=
render
"snippets/form"
=
render
"snippets/form"
,
url:
snippet_path
(
@snippet
)
app/views/snippets/index.html.haml
View file @
9710e42d
%h3
.page_title
%h3
.page_title
Snippets
Snippets
%small
share code pastes with others out of git repository
%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
-
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
Add new snippet
%br
%
table
%
hr
%thead
.row
%tr
.span3
%th
Title
%ul
.nav.nav-pills.nav-stacked
%th
File Name
=
nav_tab
:scope
,
nil
do
%th
Expires At
=
link_to
"All"
,
snippets_path
=
render
@snippets
=
nav_tab
:scope
,
'projects'
do
-
if
@snippets
.
empty?
=
link_to
"Projects"
,
snippets_path
(
scope:
'projects'
)
%tr
%td
{
colspan:
3
}
.span9
%h3
.nothing_here_message
Nothing here.
=
render
'snippets'
app/views/snippets/new.html.haml
View file @
9710e42d
=
render
"snippets/form"
=
render
"snippets/form"
,
url:
snippets_path
(
@snippet
)
app/views/snippets/show.html.haml
View file @
9710e42d
%h3
.page_title
%h3
.page_title
-
if
@snippet
.
private?
%i
.icon-lock
-
else
%i
.icon-globe
=
@snippet
.
title
=
@snippet
.
title
%small
=
@snippet
.
file_name
%small
=
@snippet
.
file_name
-
if
can?
(
current_user
,
:admin_snippet
,
@project
)
||
@snippet
.
author
==
current_user
-
if
@snippet
.
author
==
current_user
=
link_to
"Edit"
,
edit_
project_snippet_path
(
@project
,
@snippet
),
class:
"btn btn-small pull-right"
,
title:
'Edit Snippet'
=
link_to
"Edit"
,
edit_
snippet_path
(
@snippet
),
class:
"btn btn-small pull-right"
,
title:
'Edit Snippet'
%br
%br
%div
=
render
'blob'
%div
=
render
'blob'
%div
#notes
=
render
"notes/notes_with_form"
app/views/snippets/user_index.html.haml
0 → 100644
View file @
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'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment