diff --git a/pagure/static/pagure.css b/pagure/static/pagure.css index a12b094..a75c4be 100644 --- a/pagure/static/pagure.css +++ b/pagure/static/pagure.css @@ -370,7 +370,8 @@ pre { } .tree_list .view_commit, -.tree_list .filehex +.tree_list .filehex, +.tag_list .tagid { float: right; text-align: right; @@ -378,6 +379,7 @@ pre { .tree_list li:nth-child(odd), .commit_list li:nth-child(odd), +.tag_list li:nth-child(odd), table.list tr:nth-child(odd) td { background-color: #ededed; @@ -387,21 +389,25 @@ table.list tr:nth-child(odd) td padding-left: 25px; } -.commit_list ul { +.commit_list ul, +.tag_list ul, { padding-left: 0; } -.commit_list li { +.commit_list li, +.tag_list li { list-style-type: none; } .commit_list li, -.tree_list li { +.tree_list li, +.tag_list li { padding:0 .5em; } .tree_list li:hover, .commit_list li:hover, +.tag_list li:hover, table.list tr:hover td { @@ -411,7 +417,9 @@ table.list tr:hover td .tree_list li:hover a, .commit_list li:hover a, +.tag_list li:hover a, .commit_list li:hover > a > span.commitid, +.tag_list li:hover > a > span.tagid, .commit_list li:hover > a > span.commitdate, .tree_list li:hover > a > span.filehex, table.list tr:hover td > a @@ -420,12 +428,14 @@ table.list tr:hover td > a } .commit_list li > a:first-child, .tree_list li > a:first-child, +.tag_list li > a:first-child, table.list tbody td > a { display: block; } .commit_list li > a > span.commitid, +.tag_list li > a > span.tagid, .tree_list li > a > span.filehex { color: #4d4d4d; diff --git a/pagure/templates/tags.html b/pagure/templates/tags.html new file mode 100644 index 0000000..0ddba2e --- /dev/null +++ b/pagure/templates/tags.html @@ -0,0 +1,31 @@ +{% extends "repo_master.html" %} + +{% block title %}Tags - {{ repo.name }}{% endblock %} +{%block tag %}home{% endblock %} + + +{% block repo %} + +

Tags

+ +
+ {% if tags %} + + {% else %} +

+ This project has not been tagged. +

+ {% endif %} +
+ +{% endblock %} diff --git a/pagure/ui/repo.py b/pagure/ui/repo.py index 00639d0..b47307d 100644 --- a/pagure/ui/repo.py +++ b/pagure/ui/repo.py @@ -620,6 +620,29 @@ def view_forks(repo, username=None): ) +@APP.route('//tags/') +@APP.route('//tags') +@APP.route('/fork///tags/') +@APP.route('/fork///tags') +def view_tags(repo, username=None): + """ Presents all the tags of the project. + """ + repo = pagure.lib.get_project(SESSION, repo, user=username) + + if not repo: + flask.abort(404, 'Project not found') + + tags = pagure.lib.git.get_git_tags_objects(repo) + + return flask.render_template( + 'tags.html', + select='tags', + username=username, + repo=repo, + tags=tags, + ) + + @APP.route('//settings/', methods=('GET', 'POST')) @APP.route('//settings', methods=('GET', 'POST')) @APP.route('/fork///settings/', methods=('GET', 'POST'))