Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
ea58ad1a04f8
Commit
ea58ad1a
authored
Jan 26, 2015
by
Marin Jankovski
Browse files
Merge branch 'master' into move_external_issue_tracker_away_from_yml_config
Conflicts: app/models/project.rb spec/models/project_spec.rb
parents
2f93e635cc51
d78b355244e5
Changes
78
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
ea58ad1a
...
...
@@ -3,7 +3,7 @@
v 7.8.0
- Replace highlight.js with rouge-fork rugments (Stefan Tatschner)
- Make project search case insensitive (Hannes Rosenögger)
-
-
Include issue/mr participants in list of recipients for reassign/close/reopen emails
- Expose description in groups API
-
-
...
...
@@ -17,8 +17,8 @@
- Show tags in commit view (Hannes Rosenögger)
- Only count a user's vote once on a merge request or issue (Michael Clarke)
-
-
-
-
Increate font size when browse source files and diffs
-
Create new file in empty repository using GitLab UI
-
- Upgrade Sidekiq gem to version 3.3.0
- Stop git zombie creation during force push check
...
...
@@ -22,7 +22,7 @@
-
- Upgrade Sidekiq gem to version 3.3.0
- Stop git zombie creation during force push check
-
-
Show success/error messages for test setting button in services
-
- Fix commits pagination
-
...
...
@@ -34,5 +34,6 @@
-
-
-
- Add Project Avatars (Steven Thonus and Hannes Rosenögger)
-
-
...
...
@@ -37,7 +38,6 @@
-
-
-
-
- Password reset token validity increased from 2 hours to 2 days since it is also send on account creation.
-
-
-
...
...
app/assets/javascripts/dispatcher.js.coffee
View file @
ea58ad1a
...
...
@@ -96,6 +96,7 @@
new
Profile
()
when
'projects'
new
Project
()
new
ProjectAvatar
()
switch
path
[
1
]
when
'edit'
shortcut_handler
=
new
ShortcutsNavigation
()
...
...
app/assets/javascripts/project_avatar.js.coffee
0 → 100644
View file @
ea58ad1a
class
@
ProjectAvatar
constructor
:
->
$
(
'.js-choose-project-avatar-button'
).
bind
'click'
,
->
form
=
$
(
this
).
closest
(
'form'
)
form
.
find
(
'.js-project-avatar-input'
).
click
()
$
(
'.js-project-avatar-input'
).
bind
'change'
,
->
form
=
$
(
this
).
closest
(
'form'
)
filename
=
$
(
this
).
val
().
replace
(
/^.*[\\\/]/
,
''
)
form
.
find
(
'.js-avatar-filename'
).
text
(
filename
)
app/assets/stylesheets/generic/avatar.scss
View file @
ea58ad1a
...
...
@@ -8,5 +8,6 @@
&
.avatar-inline
{
float
:
none
;
margin-left
:
3px
;
margin-left
:
4px
;
margin-bottom
:
2px
;
...
...
@@ -12,6 +13,6 @@
&
.s16
{
margin-right
:
2
px
;
}
&
.s24
{
margin-right
:
2
px
;
}
&
.s16
{
margin-right
:
4
px
;
}
&
.s24
{
margin-right
:
4
px
;
}
}
&
.s16
{
width
:
16px
;
height
:
16px
;
margin-right
:
6px
;
}
...
...
@@ -22,3 +23,16 @@
&
.s90
{
width
:
90px
;
height
:
90px
;
margin-right
:
15px
;
}
&
.s160
{
width
:
160px
;
height
:
160px
;
margin-right
:
20px
;
}
}
.identicon
{
text-align
:
center
;
vertical-align
:
top
;
&
.s16
{
font-size
:
12px
;
line-height
:
1
.33
;
}
&
.s24
{
font-size
:
14px
;
line-height
:
1
.8
;
}
&
.s26
{
font-size
:
20px
;
line-height
:
1
.33
;
}
&
.s32
{
font-size
:
24px
;
line-height
:
1
.33
;
}
&
.s60
{
font-size
:
45px
;
line-height
:
1
.33
;
}
&
.s90
{
font-size
:
68px
;
line-height
:
1
.33
;
}
&
.s160
{
font-size
:
120px
;
line-height
:
1
.33
;
}
}
app/assets/stylesheets/generic/buttons.scss
View file @
ea58ad1a
...
...
@@ -173,6 +173,11 @@
margin-right
:
0px
;
}
}
&
.btn-lg
{
font-size
:
15px
;
line-height
:
1
.4
;
}
}
.btn-block
{
...
...
app/assets/stylesheets/generic/highlight.scss
View file @
ea58ad1a
...
...
@@ -10,8 +10,8 @@
border
:
none
;
border-radius
:
0
;
font-family
:
$monospace_font
;
font-size
:
12px
!
important
;
line-height
:
16px
!
important
;
font-size
:
$code_font_size
!
important
;
line-height
:
$code_line_height
!
important
;
margin
:
0
;
overflow
:
auto
;
overflow-y
:
hidden
;
...
...
@@ -38,8 +38,8 @@
a
{
font-family
:
$monospace_font
;
display
:
block
;
font-size
:
12px
!
important
;
line-height
:
16px
!
important
;
font-size
:
$code_font_size
!
important
;
line-height
:
$code_line_height
!
important
;
white-space
:
nowrap
;
i
{
...
...
app/assets/stylesheets/main/variables.scss
View file @
ea58ad1a
...
...
@@ -59,3 +59,5 @@
$sidebar_width
:
230px
;
$avatar_radius
:
50%
;
$code_font_size
:
13px
;
$code_line_height
:
1
.5
;
app/assets/stylesheets/sections/dashboard.scss
View file @
ea58ad1a
...
...
@@ -75,6 +75,9 @@
}
}
}
.project-avatar
{
float
:
left
;
}
.project-description
{
overflow
:
hidden
;
...
...
@@ -92,5 +95,8 @@
}
}
.dash-project-avatar
{
float
:
left
;
}
.dash-project-access-icon
{
float
:
left
;
...
...
@@ -95,5 +101,5 @@
.dash-project-access-icon
{
float
:
left
;
margin-right
:
3
px
;
margin-right
:
5
px
;
width
:
16px
;
}
...
...
@@ -98,2 +104,15 @@
width
:
16px
;
}
.dash-new-project
{
background
:
$bg_success
;
border
:
1px
solid
$border_success
;
a
{
color
:
#FFF
;
}
}
.dash-list
.str-truncated
{
max-width
:
72%
;
}
app/assets/stylesheets/sections/diff.scss
View file @
ea58ad1a
...
...
@@ -37,7 +37,7 @@
overflow-y
:
hidden
;
background
:
#FFF
;
color
:
#333
;
font-size
:
12px
;
font-size
:
$code_font_size
;
.old
{
span
.idiff
{
background-color
:
#F99
;
...
...
@@ -64,8 +64,8 @@
margin
:
0px
;
padding
:
0px
;
td
{
line-height
:
18px
;
font-size
:
12px
;
line-height
:
$code_line_height
;
font-size
:
$code_font_size
;
}
}
...
...
app/assets/stylesheets/sections/projects.scss
View file @
ea58ad1a
...
...
@@ -16,6 +16,8 @@
.project-home-panel
{
margin-bottom
:
15px
;
position
:
relative
;
padding-left
:
85px
;
&
.empty-project
{
border-bottom
:
0px
;
...
...
@@ -23,6 +25,22 @@
margin-bottom
:
0px
;
}
.project-identicon-holder
{
position
:
absolute
;
left
:
0
;
.avatar
{
width
:
70px
;
height
:
70px
;
@include
border-radius
(
0px
);
}
.identicon
{
font-size
:
45px
;
line-height
:
1
.6
;
}
}
.project-home-dropdown
{
margin-left
:
10px
;
float
:
right
;
...
...
app/controllers/passwords_controller.rb
View file @
ea58ad1a
...
...
@@ -5,8 +5,8 @@
resource_found
=
resource_class
.
find_by_email
(
email
)
if
resource_found
&&
resource_found
.
ldap_user?
flash
[
:alert
]
=
"Cannot reset password for LDAP user."
respond_with
({},
:
location
=>
after_sending_reset_password_instructions_path_for
(
resource_name
))
and
return
respond_with
({},
location
:
after_sending_reset_password_instructions_path_for
(
resource_name
))
and
return
end
self
.
resource
=
resource_class
.
send_reset_password_instructions
(
resource_params
)
if
successfully_sent?
(
resource
)
...
...
@@ -9,8 +9,8 @@
end
self
.
resource
=
resource_class
.
send_reset_password_instructions
(
resource_params
)
if
successfully_sent?
(
resource
)
respond_with
({},
:
location
=>
after_sending_reset_password_instructions_path_for
(
resource_name
))
respond_with
({},
location
:
after_sending_reset_password_instructions_path_for
(
resource_name
))
else
respond_with
(
resource
)
end
...
...
app/controllers/projects/avatars_controller.rb
0 → 100644
View file @
ea58ad1a
class
Projects::AvatarsController
<
Projects
::
ApplicationController
layout
'project'
before_filter
:project
def
show
@blob
=
@project
.
repository
.
blob_at_branch
(
'master'
,
@project
.
avatar_in_git
)
if
@blob
headers
[
'X-Content-Type-Options'
]
=
'nosniff'
send_data
(
@blob
.
data
,
type:
@blob
.
mime_type
,
disposition:
'inline'
,
filename:
@blob
.
name
)
else
not_found!
end
end
def
destroy
@project
.
remove_avatar!
@project
.
save
@project
.
reset_events_cache
redirect_to
edit_project_path
(
@project
)
end
end
app/controllers/projects/base_tree_controller.rb
deleted
100644 → 0
View file @
2f93e635
class
Projects::BaseTreeController
<
Projects
::
ApplicationController
include
ExtractsPath
before_filter
:authorize_download_code!
before_filter
:require_non_empty_project
end
app/controllers/projects/blame_controller.rb
View file @
ea58ad1a
...
...
@@ -2,7 +2,7 @@
class
Projects::BlameController
<
Projects
::
ApplicationController
include
ExtractsPath
# Authorize
before_filter
:assign_ref_vars
before_filter
:authorize_download_code!
before_filter
:require_non_empty_project
...
...
app/controllers/projects/blob_controller.rb
View file @
ea58ad1a
...
...
@@ -2,5 +2,7 @@
class
Projects::BlobController
<
Projects
::
ApplicationController
include
ExtractsPath
# Authorize
# Raised when given an invalid file path
class
InvalidPathError
<
StandardError
;
end
before_filter
:authorize_download_code!
...
...
@@ -6,3 +8,3 @@
before_filter
:authorize_download_code!
before_filter
:require_non_empty_project
before_filter
:require_non_empty_project
,
except:
[
:new
,
:create
]
before_filter
:authorize_push_code!
,
only:
[
:destroy
]
...
...
@@ -8,2 +10,8 @@
before_filter
:authorize_push_code!
,
only:
[
:destroy
]
before_filter
:assign_blob_vars
before_filter
:commit
,
except:
[
:new
,
:create
]
before_filter
:blob
,
except:
[
:new
,
:create
]
before_filter
:from_merge_request
,
only:
[
:edit
,
:update
]
before_filter
:after_edit_path
,
only:
[
:edit
,
:update
]
before_filter
:require_branch_head
,
only:
[
:edit
,
:update
]
...
...
@@ -9,6 +17,21 @@
before_filter
:blob
def
new
commit
unless
@repository
.
empty?
end
def
create
file_path
=
File
.
join
(
@path
,
File
.
basename
(
params
[
:file_name
]))
result
=
Files
::
CreateService
.
new
(
@project
,
current_user
,
params
,
@ref
,
file_path
).
execute
if
result
[
:status
]
==
:success
flash
[
:notice
]
=
"Your changes have been successfully committed"
redirect_to
project_blob_path
(
@project
,
File
.
join
(
@ref
,
file_path
))
else
flash
[
:alert
]
=
result
[
:message
]
render
:new
end
end
def
show
end
...
...
@@ -11,7 +34,38 @@
def
show
end
def
edit
@last_commit
=
Gitlab
::
Git
::
Commit
.
last_for_path
(
@repository
,
@ref
,
@path
).
sha
end
def
update
result
=
Files
::
UpdateService
.
new
(
@project
,
current_user
,
params
,
@ref
,
@path
).
execute
if
result
[
:status
]
==
:success
flash
[
:notice
]
=
"Your changes have been successfully committed"
if
from_merge_request
from_merge_request
.
reload_code
end
redirect_to
after_edit_path
else
flash
[
:alert
]
=
result
[
:message
]
render
:edit
end
end
def
preview
@content
=
params
[
:content
]
diffy
=
Diffy
::
Diff
.
new
(
@blob
.
data
,
@content
,
diff:
'-U 3'
,
include_diff_info:
true
)
@diff_lines
=
Gitlab
::
Diff
::
Parser
.
new
.
parse
(
diffy
.
diff
.
scan
(
/.*\n/
))
render
layout:
false
end
def
destroy
result
=
Files
::
DeleteService
.
new
(
@project
,
current_user
,
params
,
@ref
,
@path
).
execute
...
...
@@ -46,6 +100,4 @@
if
@blob
@blob
elsif
tree
.
entries
.
any?
redirect_to
project_tree_path
(
@project
,
File
.
join
(
@ref
,
@path
))
and
return
else
...
...
@@ -51,4 +103,10 @@
else
if
tree
=
@repository
.
tree
(
@commit
.
id
,
@path
)
if
tree
.
entries
.
any?
redirect_to
project_tree_path
(
@project
,
File
.
join
(
@ref
,
@path
))
and
return
end
end
return
not_found!
end
end
...
...
@@ -52,4 +110,34 @@
return
not_found!
end
end
def
commit
@commit
=
@repository
.
commit
(
@ref
)
return
not_found!
unless
@commit
end
def
assign_blob_vars
@id
=
params
[
:id
]
@ref
,
@path
=
extract_ref
(
@id
)
rescue
InvalidPathError
not_found!
end
def
after_edit_path
@after_edit_path
||=
if
from_merge_request
diffs_project_merge_request_path
(
from_merge_request
.
target_project
,
from_merge_request
)
+
"#file-path-
#{
hexdigest
(
@path
)
}
"
else
project_blob_path
(
@project
,
@id
)
end
end
def
from_merge_request
# If blob edit was initiated from merge request page
@from_merge_request
||=
MergeRequest
.
find_by
(
id:
params
[
:from_merge_request_id
])
end
end
app/controllers/projects/commits_controller.rb
View file @
ea58ad1a
...
...
@@ -3,7 +3,7 @@
class
Projects::CommitsController
<
Projects
::
ApplicationController
include
ExtractsPath
# Authorize
before_filter
:assign_ref_vars
before_filter
:authorize_download_code!
before_filter
:require_non_empty_project
...
...
app/controllers/projects/edit_tree_controller.rb
deleted
100644 → 0
View file @
2f93e635
class
Projects::EditTreeController
<
Projects
::
BaseTreeController
before_filter
:require_branch_head
before_filter
:blob
before_filter
:authorize_push_code!
before_filter
:from_merge_request
before_filter
:after_edit_path
def
show
@last_commit
=
Gitlab
::
Git
::
Commit
.
last_for_path
(
@repository
,
@ref
,
@path
).
sha
end
def
update
result
=
Files
::
UpdateService
.
new
(
@project
,
current_user
,
params
,
@ref
,
@path
).
execute
if
result
[
:status
]
==
:success
flash
[
:notice
]
=
"Your changes have been successfully committed"
if
from_merge_request
from_merge_request
.
reload_code
end
redirect_to
after_edit_path
else
flash
[
:alert
]
=
result
[
:message
]
render
:show
end
end
def
preview
@content
=
params
[
:content
]
diffy
=
Diffy
::
Diff
.
new
(
@blob
.
data
,
@content
,
diff:
'-U 3'
,
include_diff_info:
true
)
@diff_lines
=
Gitlab
::
Diff
::
Parser
.
new
.
parse
(
diffy
.
diff
.
scan
(
/.*\n/
))
render
layout:
false
end
private
def
blob
@blob
||=
@repository
.
blob_at
(
@commit
.
id
,
@path
)
end
def
after_edit_path
@after_edit_path
||=
if
from_merge_request
diffs_project_merge_request_path
(
from_merge_request
.
target_project
,
from_merge_request
)
+
"#file-path-
#{
hexdigest
(
@path
)
}
"
else
project_blob_path
(
@project
,
@id
)
end
end
def
from_merge_request
# If blob edit was initiated from merge request page
@from_merge_request
||=
MergeRequest
.
find_by
(
id:
params
[
:from_merge_request_id
])
end
end
app/controllers/projects/network_controller.rb
View file @
ea58ad1a
...
...
@@ -2,7 +2,7 @@
include
ExtractsPath
include
ApplicationHelper
# Authorize
before_filter
:assign_ref_vars
before_filter
:authorize_download_code!
before_filter
:require_non_empty_project
...
...
app/controllers/projects/new_tree_controller.rb
deleted
100644 → 0
View file @
2f93e635
class
Projects::NewTreeController
<
Projects
::
BaseTreeController
before_filter
:require_branch_head
before_filter
:authorize_push_code!
def
show
end
def
update
file_path
=
File
.
join
(
@path
,
File
.
basename
(
params
[
:file_name
]))
result
=
Files
::
CreateService
.
new
(
@project
,
current_user
,
params
,
@ref
,
file_path
).
execute
if
result
[
:status
]
==
:success
flash
[
:notice
]
=
"Your changes have been successfully committed"
redirect_to
project_blob_path
(
@project
,
File
.
join
(
@ref
,
file_path
))
else
flash
[
:alert
]
=
result
[
:message
]
render
:show
end
end
end
app/controllers/projects/protected_branches_controller.rb
View file @
ea58ad1a
...
...
@@ -24,7 +24,7 @@
)
respond_to
do
|
format
|
format
.
json
{
render
:
json
=>
protected_branch
,
status: :ok
}
format
.
json
{
render
json
:
protected_branch
,
status: :ok
}
end
else
respond_to
do
|
format
|
...
...
Prev
1
2
3
4
Next
Write
Preview
Supports
Markdown
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