diff --git a/doc/usage/theming.rst b/doc/usage/theming.rst index ab805bc..2daf8c1 100644 --- a/doc/usage/theming.rst +++ b/doc/usage/theming.rst @@ -80,6 +80,37 @@ on every page on the site. Usage: {% set site_title = "Pagure" %} +`projectstring(Bool:plural)` macro +############################# + +A macro that returns a string used to refer to Projects in Pagure +The plural parameter informs if the string to be returned is the +plural form. +This macro is optional. +Usage: + +:: + + {% macro projectstring(plural=False) -%} + {% if plural %} + Repositories + {% else %} + Repository + {% endif %} + {% endmacro -%} + + +`projecticon` variable +############################# + +A string containing the name of the fontawesome icon to use for +Projects. This variable is optional. Usage: + +:: + + {% set projecticon = "Package" %} + + `head_imports()` macro ###################### diff --git a/pagure/templates/_browseheader.html b/pagure/templates/_browseheader.html index a984238..30d95fb 100644 --- a/pagure/templates/_browseheader.html +++ b/pagure/templates/_browseheader.html @@ -1,4 +1,5 @@ {% import "theme.html" as theme with context %} +{% from "_projectstring.html" import projectstring, projecticon %} {% macro browse_header(select) -%} @@ -8,7 +9,7 @@
No projects found
+No {{projectstring(plural=True)}} found
{% endfor %} {%- endmacro %} @@ -110,7 +112,7 @@ {%- if username -%} {%- endif -%} @@ -180,7 +182,7 @@ {% else %} -No projects found
+No {{projectstring(plural=True)}} found
{% endfor %} @@ -260,7 +262,7 @@ {% else %}No projects found
+No {{projectstring(plural=True)}} found
- These projects are under the `{{ namespace }}` namespace making them + These {{projectstring(plural=True)}} are under the `{{ namespace }}` namespace making them likely related to the {{ namespace }} group. @@ -31,7 +32,7 @@
API keys are tokens used to authenticate you on pagure. They can also be used to grant access to 3rd party application to behave on all - projects in your name. + {{projectstring(plural=True)}} in your name.
These are your personal tokens; they are not visible to others. @@ -165,11 +166,11 @@ {% for acl in token.acls_list %} {% if acl == 'create_project' %} - + {% elif acl == 'fork_project' %} - + {% elif acl == 'modify_project' %} - + {% endif %} {% endfor %} diff --git a/pagure/templates/userdash_activity.html b/pagure/templates/userdash_activity.html index 550fab4..9e5503a 100644 --- a/pagure/templates/userdash_activity.html +++ b/pagure/templates/userdash_activity.html @@ -4,6 +4,7 @@ {% set tag = "projects" %} {% from "_browseheader.html" import browse_header %} {% from "_render_repo.html" import pagination_link %} +{% from "_projectstring.html" import projectstring, projecticon %} {% from "_render_repo.html" import render_repos_as_card, render_activity_graph %} @@ -17,8 +18,8 @@
No projects
+No {{projectstring(plural=True)}}
No starred projects or forks
+No starred {{projectstring}}s or forks