BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
0b5acdd8
Commit
0b5acdd8
authored
Jul 30, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show buttons to add license, changelog and contribution guide if they're missing.
parent
1e4b3264
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
7 deletions
+68
-7
CHANGELOG
CHANGELOG
+1
-0
projects.scss
app/assets/stylesheets/pages/projects.scss
+9
-0
projects_helper.rb
app/helpers/projects_helper.rb
+40
-4
show.html.haml
app/views/projects/show.html.haml
+18
-3
No files found.
CHANGELOG
View file @
0b5acdd8
...
...
@@ -19,6 +19,7 @@ v 7.14.0 (unreleased)
- Add fetch command to the MR page
- Fix bug causing Bitbucket importer to crash when OAuth application had been removed.
- Add fetch command to the MR page.
- Show buttons to add license, changelog and contribution guide if they're missing.
v 7.13.2
- Fix randomly failed spec
...
...
app/assets/stylesheets/pages/projects.scss
View file @
0b5acdd8
...
...
@@ -297,6 +297,15 @@ table.table.protected-branches-list tr.no-border {
ul
.nav-pills
{
display
:inline-block
;
}
li
{
display
:inline
;
}
a
{
float
:left
;
}
li
.missing
a
{
color
:
#bbb
;
border
:
1px
dashed
#ccc
;
&
:hover
{
background-color
:
#FAFAFA
;
}
}
}
pre
.light-well
{
...
...
app/helpers/projects_helper.rb
View file @
0b5acdd8
...
...
@@ -184,7 +184,43 @@ module ProjectsHelper
end
end
def
contribution_guide_url
(
project
)
def
add_contribution_guide_path
(
project
)
if
project
&&
!
project
.
repository
.
contribution_guide
namespace_project_new_blob_path
(
project
.
namespace
,
project
,
project
.
default_branch
,
file_name:
"CONTRIBUTING.md"
,
commit_message:
"Add contribution guide"
)
end
end
def
add_changelog_path
(
project
)
if
project
&&
!
project
.
repository
.
changelog
namespace_project_new_blob_path
(
project
.
namespace
,
project
,
project
.
default_branch
,
file_name:
"CHANGELOG"
,
commit_message:
"Add changelog"
)
end
end
def
add_license_path
(
project
)
if
project
&&
!
project
.
repository
.
license
namespace_project_new_blob_path
(
project
.
namespace
,
project
,
project
.
default_branch
,
file_name:
"LICENSE"
,
commit_message:
"Add license"
)
end
end
def
contribution_guide_path
(
project
)
if
project
&&
contribution_guide
=
project
.
repository
.
contribution_guide
namespace_project_blob_path
(
project
.
namespace
,
...
...
@@ -195,7 +231,7 @@ module ProjectsHelper
end
end
def
changelog_
url
(
project
)
def
changelog_
path
(
project
)
if
project
&&
changelog
=
project
.
repository
.
changelog
namespace_project_blob_path
(
project
.
namespace
,
...
...
@@ -206,7 +242,7 @@ module ProjectsHelper
end
end
def
license_
url
(
project
)
def
license_
path
(
project
)
if
project
&&
license
=
project
.
repository
.
license
namespace_project_blob_path
(
project
.
namespace
,
...
...
@@ -217,7 +253,7 @@ module ProjectsHelper
end
end
def
version_
url
(
project
)
def
version_
path
(
project
)
if
project
&&
version
=
project
.
repository
.
version
namespace_project_blob_path
(
project
.
namespace
,
...
...
app/views/projects/show.html.haml
View file @
0b5acdd8
...
...
@@ -22,19 +22,34 @@
%li
=
link_to
namespace_project_tags_path
(
@project
.
namespace
,
@project
)
do
=
pluralize
(
number_with_delimiter
(
@repository
.
tag_names
.
count
),
'tag'
)
-
if
@repository
.
changelog
%li
=
link_to
changelog_
url
(
@project
)
do
=
link_to
changelog_
path
(
@project
)
do
Changelog
-
if
@repository
.
license
%li
=
link_to
license_
url
(
@project
)
do
=
link_to
license_
path
(
@project
)
do
License
-
if
@repository
.
contribution_guide
%li
=
link_to
contribution_guide_
url
(
@project
)
do
=
link_to
contribution_guide_
path
(
@project
)
do
Contribution guide
-
if
current_user
&&
can_push_branch?
(
@project
,
@project
.
default_branch
)
-
unless
@repository
.
changelog
%li
.missing
=
link_to
add_changelog_path
(
@project
)
do
Add Changelog
-
unless
@repository
.
license
%li
.missing
=
link_to
add_license_path
(
@project
)
do
Add License
-
unless
@repository
.
contribution_guide
%li
.missing
=
link_to
add_contribution_guide_path
(
@project
)
do
Add Contribution guide
-
if
@project
.
archived?
.text-warning.center.prepend-top-20
%p
...
...
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