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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
edd95a0e
Commit
edd95a0e
authored
Jan 21, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:gitlabhq/gitlabhq
parents
1d2af745
5f9d90e2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
app/models/project.rb
app/models/project.rb
+4
-0
app/views/layouts/_head.html.haml
app/views/layouts/_head.html.haml
+5
-0
spec/models/project_spec.rb
spec/models/project_spec.rb
+5
-0
No files found.
app/models/project.rb
View file @
edd95a0e
...
...
@@ -205,6 +205,10 @@ class Project < ActiveRecord::Base
[
Gitlab
.
config
.
gitlab
.
url
,
path_with_namespace
].
join
(
"/"
)
end
def
web_url_without_protocol
web_url
.
split
(
"://"
)[
1
]
end
def
build_commit_note
(
commit
)
notes
.
new
(
commit_id:
commit
.
id
,
noteable_type:
"Commit"
)
end
...
...
app/views/layouts/_head.html.haml
View file @
edd95a0e
...
...
@@ -22,3 +22,8 @@
=
auto_discovery_link_tag
(
:atom
,
project_commits_url
(
@project
,
@ref
,
format: :atom
,
private_token:
current_user
.
private_token
),
title:
"Recent commits to
#{
@project
.
name
}
:
#{
@ref
}
"
)
-
if
current_controller?
(
:issues
)
=
auto_discovery_link_tag
(
:atom
,
project_issues_url
(
@project
,
:atom
,
private_token:
current_user
.
private_token
),
title:
"
#{
@project
.
name
}
issues"
)
-# Go repository retrieval support.
-
if
controller_name
==
'projects'
&&
action_name
==
'show'
%meta
{
name:
"go-import"
,
content:
"#{@project.web_url_without_protocol} git #{@project.web_url}.git"
}
spec/models/project_spec.rb
View file @
edd95a0e
...
...
@@ -99,6 +99,11 @@ describe Project do
project
.
web_url
.
should
==
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/somewhere"
end
it
"returns the web URL without the protocol for this repo"
do
project
=
Project
.
new
(
path:
"somewhere"
)
project
.
web_url_without_protocol
.
should
==
"
#{
Gitlab
.
config
.
gitlab
.
host
}
/somewhere"
end
describe
"last_activity methods"
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:last_event
)
{
double
(
created_at:
Time
.
now
)
}
...
...
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