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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
a2d3b211
Commit
a2d3b211
authored
Dec 19, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
User profile restyle. Feed(Atom) links for commits & issues
parent
54fb0f85
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
147 additions
and
92 deletions
+147
-92
app/assets/images/rss_icon_gray.png
app/assets/images/rss_icon_gray.png
+0
-0
app/assets/stylesheets/application.css
app/assets/stylesheets/application.css
+3
-0
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+8
-0
app/controllers/keys_controller.rb
app/controllers/keys_controller.rb
+4
-0
app/models/user.rb
app/models/user.rb
+4
-0
app/views/commits/index.html.haml
app/views/commits/index.html.haml
+5
-3
app/views/issues/index.html.haml
app/views/issues/index.html.haml
+6
-0
app/views/keys/_show.html.haml
app/views/keys/_show.html.haml
+7
-4
app/views/keys/create.js.haml
app/views/keys/create.js.haml
+1
-1
app/views/keys/index.html.haml
app/views/keys/index.html.haml
+9
-9
app/views/keys/show.html.haml
app/views/keys/show.html.haml
+10
-0
app/views/layouts/_head_panel.html.erb
app/views/layouts/_head_panel.html.erb
+1
-1
app/views/layouts/_middle_panel.html.haml
app/views/layouts/_middle_panel.html.haml
+4
-1
app/views/profile/password.html.haml
app/views/profile/password.html.haml
+41
-37
app/views/profile/show.html.haml
app/views/profile/show.html.haml
+31
-34
spec/requests/keys_spec.rb
spec/requests/keys_spec.rb
+13
-2
No files found.
app/assets/images/rss_icon_gray.png
0 → 100644
View file @
a2d3b211
844 Bytes
app/assets/stylesheets/application.css
View file @
a2d3b211
...
@@ -40,6 +40,9 @@
...
@@ -40,6 +40,9 @@
.append-bottom-10
{
.append-bottom-10
{
margin-bottom
:
10px
;
margin-bottom
:
10px
;
}
}
.append-bottom-20
{
margin-bottom
:
20px
;
}
.prepend-top-10
{
.prepend-top-10
{
margin-top
:
10px
;
margin-top
:
10px
;
}
}
...
...
app/assets/stylesheets/projects.css.scss
View file @
a2d3b211
...
@@ -639,3 +639,11 @@ h4.middle-panel {
...
@@ -639,3 +639,11 @@ h4.middle-panel {
background
:
#4A2
;
background
:
#4A2
;
color
:
white
;
color
:
white
;
}
}
.rss-icon
{
margin
:
0
15px
;
padding
:
5px
;
border
:
1px
solid
#ccc
;
border-radius
:
3px
;
float
:left
;
}
app/controllers/keys_controller.rb
View file @
a2d3b211
...
@@ -6,6 +6,10 @@ class KeysController < ApplicationController
...
@@ -6,6 +6,10 @@ class KeysController < ApplicationController
@keys
=
current_user
.
keys
.
all
@keys
=
current_user
.
keys
.
all
end
end
def
show
@key
=
current_user
.
keys
.
find
(
params
[
:id
])
end
def
new
def
new
@key
=
current_user
.
keys
.
new
@key
=
current_user
.
keys
.
new
...
...
app/models/user.rb
View file @
a2d3b211
...
@@ -46,6 +46,10 @@ class User < ActiveRecord::Base
...
@@ -46,6 +46,10 @@ class User < ActiveRecord::Base
admin
admin
end
end
def
require_ssh_key?
keys
.
count
==
0
end
def
can_create_project?
def
can_create_project?
projects_limit
>=
my_own_projects
.
count
projects_limit
>=
my_own_projects
.
count
end
end
...
...
app/views/commits/index.html.haml
View file @
a2d3b211
-
content_for
(
:body_class
,
"project-page commits-page"
)
-
content_for
(
:body_class
,
"project-page commits-page"
)
-
if
current_user
.
private_token
=
content_for
:rss_icon
do
.rss-icon
=
link_to
project_commits_path
(
@project
,
:atom
,
{
:private_token
=>
current_user
.
private_token
,
:ref
=>
@ref
})
do
=
image_tag
"rss_icon_gray.png"
,
:width
=>
16
,
:title
=>
"feed"
-#%a.right.button{:href => "#"} Download
-#-if can? current_user, :admin_project, @project
%a.right.button.blue{:href => "#"} EDIT
-
if
params
[
:path
]
-
if
params
[
:path
]
%h2
.icon
%h2
.icon
%span
%span
...
...
app/views/issues/index.html.haml
View file @
a2d3b211
-
if
current_user
.
private_token
=
content_for
:rss_icon
do
.rss-icon
=
link_to
project_issues_path
(
@project
,
:atom
,
{
:private_token
=>
current_user
.
private_token
})
do
=
image_tag
"rss_icon_gray.png"
,
:width
=>
16
,
:title
=>
"feed"
%div
#issues-table-holder
%div
#issues-table-holder
%table
.round-borders
#issues-table
%table
.round-borders
#issues-table
%thead
%thead
...
...
app/views/keys/_show.html.haml
View file @
a2d3b211
%tr
%a
.update-item
{
:href
=>
key_path
(
key
)}
%td
=
truncate
key
.
title
,
:lenght
=>
12
%span
.update-title
%td
=
truncate
key
.
key
,
:lenght
=>
1114
=
key
.
title
%td
=
link_to
'Cancel'
,
key
,
:confirm
=>
'Are you sure?'
,
:method
=>
:delete
,
:class
=>
"grey-button negative delete-key"
,
:id
=>
"destroy_key_
#{
key
.
id
}
"
,
:remote
=>
true
%span
.update-author
Added
=
time_ago_in_words
(
key
.
created_at
)
ago
app/views/keys/create.js.haml
View file @
a2d3b211
-
if
@key
.
valid?
-
if
@key
.
valid?
:plain
:plain
$("#new_key_dialog").dialog("close");
$("#new_key_dialog").dialog("close");
$("#keys-table").append("
#{
escape_javascript
(
render
(
:partial
=>
'show'
,
:locals
=>
{
:key
=>
@key
}
))
}
");
$("#keys-table
.data
").append("
#{
escape_javascript
(
render
(
:partial
=>
'show'
,
:locals
=>
{
:key
=>
@key
}
))
}
");
$("#no_ssh_key_defined").hide();
$("#no_ssh_key_defined").hide();
-
else
-
else
:plain
:plain
...
...
app/views/keys/index.html.haml
View file @
a2d3b211
%div
#new-key-holder
%h2
.icon
%span
>
SSH Keys
%div
#new-key-holder
.right
=
link_to
"Add new"
,
new_key_path
,
:remote
=>
true
,
:class
=>
"grey-button"
=
link_to
"Add new"
,
new_key_path
,
:remote
=>
true
,
:class
=>
"grey-button"
%br
%br
%table
.round-borders
#keys-table
%div
#keys-table
{
:class
=>
"update-data ui-box ui-box-small ui-box-big"
}
%tr
.data
%th
title
-
@keys
.
each
do
|
key
|
%th
key
=
render
(
:partial
=>
'show'
,
:locals
=>
{
:key
=>
key
})
%th
Actions
-
@keys
.
each
do
|
key
|
=
render
(
:partial
=>
'show'
,
:locals
=>
{
:key
=>
key
})
:javascript
:javascript
$
(
'
.delete-key
'
).
live
(
'
ajax:success
'
,
function
()
{
$
(
'
.delete-key
'
).
live
(
'
ajax:success
'
,
function
()
{
$
(
this
).
closest
(
'
tr
'
).
fadeOut
();
});
$
(
this
).
closest
(
'
.update-item
'
).
fadeOut
();
});
app/views/keys/show.html.haml
0 → 100644
View file @
a2d3b211
.ui-box.width-100p
%h3
=
@key
.
title
.data
%pre
=
@key
.
key
.clear
.buttons
=
link_to
'Remove'
,
@key
,
:confirm
=>
'Are you sure?'
,
:method
=>
:delete
,
:class
=>
"red-button delete-key right"
.clear
app/views/layouts/_head_panel.html.erb
View file @
a2d3b211
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
<%
end
%>
<%
end
%>
<%
end
%>
<%
end
%>
<%
if
current_user
.
keys
.
all
.
empt
y?
%>
<%
if
current_user
.
require_ssh_ke
y?
%>
<div
id=
"no_ssh_key_defined"
class=
"big-message error"
>
<div
id=
"no_ssh_key_defined"
class=
"big-message error"
>
<p>
No SSH Key is defined. You won't be able to use any Git command!. Click
<%=
link_to
(
'here'
,
keys_path
)
%>
to add one!
<p>
No SSH Key is defined. You won't be able to use any Git command!. Click
<%=
link_to
(
'here'
,
keys_path
)
%>
to add one!
</div>
</div>
...
...
app/views/layouts/_middle_panel.html.haml
View file @
a2d3b211
%h4
.middle-panel
%h4
.middle-panel
.project_name
=
truncate
@project
.
name
,
:length
=>
20
.project_name
=
truncate
@project
.
name
,
:length
=>
20
.git_url_wrapper
.git_url_wrapper
%input
.git-url.text
{
:id
=>
""
,
:name
=>
""
,
:readonly
=>
""
,
:type
=>
"text"
,
:value
=>
@project
.
url_to_repo
,
:class
=>
"one_click_select"
}
%input
.git-url.text
{
:id
=>
""
,
:name
=>
""
,
:readonly
=>
""
,
:type
=>
"text"
,
:value
=>
@project
.
url_to_repo
,
:class
=>
"one_click_select"
}
=
yield
:rss_icon
-
if
@project
.
repo_exists?
-
if
@project
.
repo_exists?
.right
=
render
:partial
=>
"projects/refs"
,
:locals
=>
{
:destination
=>
controller
.
controller_name
==
"commits"
?
"commits"
:
"tree"
}
.right
=
render
:partial
=>
"projects/refs"
,
:locals
=>
{
:destination
=>
controller
.
controller_name
==
"commits"
?
"commits"
:
"tree"
}
app/views/profile/password.html.haml
View file @
a2d3b211
%p
Note: after success password update you will be redirected to login page where you should login with new password
.ui-box.width-100p.append-bottom-20
=
form_for
@user
,
:url
=>
profile_password_path
,
:method
=>
:put
do
|
f
|
%h3
Password
-
if
@user
.
errors
.
any?
=
form_for
@user
,
:url
=>
profile_password_path
,
:method
=>
:put
do
|
f
|
#error_explanation
.data
%h2
=
"
#{
pluralize
(
@user
.
errors
.
count
,
"error"
)
}
prohibited this password from being saved:"
%p
After successfull password update you will be redirected to login page where you should login with new password
%ul
-
if
@user
.
errors
.
any?
-
@user
.
errors
.
full_messages
.
each
do
|
msg
|
#error_explanation
%li
=
msg
%ul
-
@user
.
errors
.
full_messages
.
each
do
|
msg
|
%li
=
msg
.form-row
.form-row
=
f
.
label
:password
=
f
.
label
:password
%br
%br
=
f
.
password_field
:password
=
f
.
password_field
:password
.form-row
.form-row
=
f
.
label
:password_confirmation
=
f
.
label
:password_confirmation
%br
%br
=
f
.
password_field
:password_confirmation
=
f
.
password_field
:password_confirmation
.actions
.buttons
=
f
.
submit
'Save'
,
:class
=>
"grey-button"
=
f
.
submit
'Save'
,
:class
=>
"grey-button"
.clear
%br
.ui-box.width-100p
%br
%h3
%br
Private token
%em
.cred.right
=
form_for
@user
,
:url
=>
profile_reset_private_token_path
,
:method
=>
:put
do
|
f
|
keep it in secret!
%p
=
form_for
@user
,
:url
=>
profile_reset_private_token_path
,
:method
=>
:put
do
|
f
|
Current private token:
.data
-
if
current_user
.
private_token
%p
Private token used to access application resources without authentication.
%strong
%p
For example its required to access commits feed.
=
current_user
.
private_token
%hr
%em
.cred
%p
.cgray
keep it in secret!
-
if
current_user
.
private_token
-
else
=
text_field_tag
"token"
,
current_user
.
private_token
%strong
don`t have
-
else
.actions
You don`t have one yet. Click generate to fix it.
-
if
current_user
.
private_token
.buttons
=
f
.
submit
'Reset'
,
:confirm
=>
"Are you sure?"
,
:class
=>
"grey-button"
-
if
current_user
.
private_token
-
else
=
f
.
submit
'Reset'
,
:confirm
=>
"Are you sure?"
,
:class
=>
"grey-button"
=
f
.
submit
'Generate'
,
:class
=>
"grey-button"
-
else
=
f
.
submit
'Generate'
,
:class
=>
"positive-button"
app/views/profile/show.html.haml
View file @
a2d3b211
%h2
.icon
.ui-box.width-100p
%span
>
%h3
=
@user
.
name
=
@user
.
name
=
form_for
@user
,
:url
=>
profile_edit_path
,
:method
=>
:put
do
|
f
|
.data
-
if
@user
.
errors
.
any?
#error_explanation
%ul
-
@user
.
errors
.
full_messages
.
each
do
|
msg
|
%li
=
msg
.clear
.form-row
=
f
.
label
:name
=
form_for
@user
,
:url
=>
profile_edit_path
,
:method
=>
:put
do
|
f
|
%br
-
if
@user
.
errors
.
any?
=
f
.
text_field
:name
#error_explanation
.form-row
%ul
=
f
.
label
:email
-
@user
.
errors
.
full_messages
.
each
do
|
msg
|
%br
%li
=
msg
=
f
.
text_field
:email
.form-row
.form-row
=
f
.
label
:skype
=
f
.
label
:name
%br
%br
=
f
.
text_field
:skype
=
f
.
text_field
:name
.form-row
.form-row
=
f
.
label
:linkedin
=
f
.
label
:email
%br
%br
=
f
.
text_field
:linkedin
=
f
.
text_field
:email
.form-row
.form-row
=
f
.
label
:twitter
=
f
.
label
:skype
%br
%br
=
f
.
text_field
:twitter
=
f
.
text_field
:skype
.buttons
.form-row
=
f
.
submit
'Save'
,
:class
=>
"grey-button"
=
f
.
label
:linkedin
%br
=
f
.
text_field
:linkedin
.form-row
=
f
.
label
:twitter
%br
=
f
.
text_field
:twitter
.actions
=
f
.
submit
'Save'
,
:class
=>
"grey-button"
spec/requests/keys_spec.rb
View file @
a2d3b211
...
@@ -16,9 +16,11 @@ describe "Issues" do
...
@@ -16,9 +16,11 @@ describe "Issues" do
it
{
should
have_content
(
@key
.
title
)
}
it
{
should
have_content
(
@key
.
title
)
}
describe
"Destroy"
do
describe
"Destroy"
do
before
{
visit
key_path
(
@key
)
}
it
"should remove entry"
do
it
"should remove entry"
do
expect
{
expect
{
click_link
"
destroy_key_
#{
@key
.
id
}
"
click_link
"
Remove
"
}.
to
change
{
@user
.
keys
.
count
}.
by
(
-
1
)
}.
to
change
{
@user
.
keys
.
count
}.
by
(
-
1
)
end
end
end
end
...
@@ -47,8 +49,17 @@ describe "Issues" do
...
@@ -47,8 +49,17 @@ describe "Issues" do
page
.
should_not
have_content
(
"Add new public key"
)
page
.
should_not
have_content
(
"Add new public key"
)
page
.
should
have_content
"laptop"
page
.
should
have_content
"laptop"
page
.
should
have_content
"publickey234="
end
end
end
end
end
end
describe
"Show page"
do
before
do
@key
=
Factory
:key
,
:user
=>
@user
visit
key_path
(
@key
)
end
it
{
page
.
should
have_content
@key
.
title
}
it
{
page
.
should
have_content
@key
.
key
[
0
..
10
]
}
end
end
end
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