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
Léo-Paul Géneau
gitlab-ce
Commits
88fc7ccd
Commit
88fc7ccd
authored
Mar 22, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add project badges view prototype
parent
ea690378
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
2 deletions
+23
-2
app/controllers/projects/badges_controller.rb
app/controllers/projects/badges_controller.rb
+4
-1
app/views/projects/badges/index.html.haml
app/views/projects/badges/index.html.haml
+15
-0
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+3
-0
config/routes.rb
config/routes.rb
+1
-1
No files found.
app/controllers/projects/badges_controller.rb
View file @
88fc7ccd
class
Projects::BadgesController
<
Projects
::
ApplicationController
before_action
:no_cache_headers
before_action
:no_cache_headers
,
except:
[
:index
]
def
index
end
def
build
badge
=
Gitlab
::
Badge
::
Build
.
new
(
project
,
params
[
:ref
])
...
...
app/views/projects/badges/index.html.haml
0 → 100644
View file @
88fc7ccd
-
page_title
'Badges'
.prepend-top-10
.panel.panel-default
.panel-heading
%b
Builds badge
·
=
image_tag
(
build_namespace_project_badges_path
(
@project
.
namespace
,
@project
,
:master
,
format: :svg
),
alt:
'Builds badge'
)
.panel-body
%table
.table
%tr
%td
Markdown
%td
=
markdown
(
"```markdown
\n
[![build status](url)](link)
\n
```"
)
%tr
%td
HTML
%td
=
markdown
(
"```html
\n
<a href='link'><img src='url' /></a>
\n
```"
)
app/views/projects/show.html.haml
View file @
88fc7ccd
...
...
@@ -57,6 +57,9 @@
%li
.missing
=
link_to
add_contribution_guide_path
(
@project
)
do
Add Contribution guide
-
if
@project
.
builds_enabled?
%li
=
link_to
'Badges'
,
''
-
if
@repository
.
commit
.content-block.second-block.white
...
...
config/routes.rb
View file @
88fc7ccd
...
...
@@ -749,7 +749,7 @@ Rails.application.routes.draw do
end
resources
:runner_projects
,
only:
[
:create
,
:destroy
]
resources
:badges
,
only:
[]
do
resources
:badges
,
only:
[
:index
]
do
collection
do
scope
'*ref'
,
constraints:
{
ref:
Gitlab
::
Regex
.
git_reference_regex
}
do
get
:build
,
constraints:
{
format:
/svg/
}
...
...
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