#3631 introduce the browseheader_message macro
Merged 5 years ago by ryanlerch. Opened 5 years ago by ryanlerch.
ryanlerch/pagure welcome-message  into  master

file modified
+24
@@ -113,6 +113,30 @@ 

      {% endmacro %}

  

  

+ `browseheader_message(select)` macro

+ ######################

+ 

+ An optional Jinja macro that defines the welcome message that is shown

+ above the tabs on the Browse Pages (Projects, Users, and Groups). The 

+ select parameter is a string with the name of the page being shown

+ Example:

+ 

+ ::

+ 

+     {% macro browseheader_message(select) %}

+         {% if select == 'projects' %}

+         <div class="row justify-content-around">

+         <div class="col-md-8">

+             <div class="jumbotron bg-transparent m-0 py-4 text-center">

+                 <h1 class="display-5">Welcome to my Pagure</h1>

+                 <p class="lead">Pagure is an Open Source software code hosting system.</p>

+             </div>

+         </div>

+         </div>

+         {% endif %}

+     {% endmacro %}

+ 

+ 

  `footer()` macro

  ######################

  

@@ -1,15 +1,9 @@ 

+ {% import "theme.html" as theme with context %}

+ 

  {% macro browse_header(select) -%}

  

- {% if select == 'projects' %}

- <div class="row justify-content-around">

-   <div class="col-md-8">

-       <div class="jumbotron bg-transparent m-0 py-4 text-center">

-           <h1 class="display-5">Welcome to Pagure</h1>

-           <p class="lead">Pagure is an Open Source software code hosting system.</p>

-         </div>

-   </div>

- </div>

- {% endif %}

+ {{ theme.browseheader_message(select) if theme.browseheader_message is defined }}

+ 

  <ul class="nav nav-tabs nav-small border-bottom-0">

    <li class="nav-item">

      <a {% if select == 'projects' %}class="nav-link active" {%

@@ -15,6 +15,19 @@ 

  <script src="{{ url_for('static', filename='vendor/bootstrap/bootstrap.bundle.min.js')}}"></script>

  {% endmacro %}

  

+ {% macro browseheader_message(select) %}

+     {% if select == 'projects' %}

+     <div class="row justify-content-around">

+     <div class="col-md-8">

+         <div class="jumbotron bg-transparent m-0 py-4 text-center">

+             <h1 class="display-5">Welcome to Pagure</h1>

+             <p class="lead">Pagure is an Open Source software code hosting system.</p>

+         </div>

+     </div>

+     </div>

+     {% endif %}

+ {% endmacro %}

+ 

  {% macro footer() %}

      <div class="footer bg-light py-3">

          <div class="container">

@@ -16,6 +16,24 @@ 

  <script src="{{ url_for('static', filename='vendor/bootstrap/bootstrap.bundle.min.js')}}"></script>

  {% endmacro %}

  

+ {% macro browseheader_message(select) %}

+     {# 

+         message that shows at the top of the browse pages:

+         'select' is the browse page. It can be either: 'projects',

+         'users', or 'groups'. 

+     #}

+     {% if select == 'projects' %}

+     <div class="row justify-content-around">

+     <div class="col-md-8">

+         <div class="jumbotron bg-transparent m-0 py-4 text-center">

+             <h1 class="display-5">Welcome to Pagure</h1>

+             <p class="lead">Pagure is an Open Source software code hosting system.</p>

+         </div>

+     </div>

+     </div>

+     {% endif %}

+ {% endmacro %}

+ 

  {% macro footer() %}

      <div class="footer py-3 bg-light border-top text-center">

          <div class="container">

@@ -21,6 +21,19 @@ 

  <script src="{{ url_for('static', filename='vendor/bootstrap/bootstrap.bundle.min.js')}}"></script>

  {% endmacro %}

  

+ {% macro browseheader_message(select) %}

+     {% if select == 'projects' %}

+     <div class="row justify-content-around">

+     <div class="col-md-8">

+         <div class="jumbotron bg-transparent m-0 py-4 text-center">

+             <h1 class="display-5">Welcome to Fedora Pagure</h1>

+             <p class="lead">Pagure is an Open Source software code hosting system.</p>

+         </div>

+     </div>

+     </div>

+     {% endif %}

+ {% endmacro %}

+ 

  {% macro footer() %}

      <div class="footer py-3">

          <div class="container">

@@ -1,65 +0,0 @@ 

- {% macro browse_header(select) -%}

- 

- {% if select == 'projects' %}

- <div class="row justify-content-around">

-   <div class="col-md-8">

-       <div class="jumbotron bg-transparent m-0 py-4 text-center">

-           <h1 class="display-5">Welcome to src.fedoraproject.org</h1>

-           <p class="lead">Fedora's repository for package maintenance.</p>

-         </div>

-   </div>

- </div>

- 

-   {% if not g.authenticated %}

-     <section class="container p-t-2">

-       <p>

-         Welcome, if you're looking to download software to run, look at

-         <a href="https://getfedora.org/">https://getfedora.org/</a>, or a

-         <a href="https://mirrors.fedoraproject.org/">Fedora Mirror</a>.

-         You can also find source RPMs for Fedora-packaged software there.

-         The source code for building those packages is found here.

-       </p>

- 

-       <p>

-         If you are looking for RPM spec files, module and container definitions,

-         Fedora-specific patches, tests, and so on, you're in the right place.

-         You can browse <a href="/browse/projects/">packages</a> and

-         <a href="/users">packagers</a> — and you can fork, improve, and submit

-         pull requests.

-         </p>

- 

-       <p>

-         If you are already a package maintainer, feel free to consult the

-         <a href="https://docs.pagure.org/pagure/usage.html">docs on using

-         pagure</a>. If you'd like to become a package maintainer, see

-         <a href="https://fedoraproject.org/wiki/Join_the_package_collection_maintainers">

-         this guide</a>.

-       </p>

- 

-       <p>

-         Note that package issues are still tracked in

-         <a href="https://bugzilla.redhat.com/">Bugzilla</a>,

-         not with Pagure's issue feature.

-       </p>

-       </section>

-   {% endif %}

- {% endif %}

- 

- <ul class="nav nav-tabs nav-small border-bottom-0">

-   <li class="nav-item">

-     <a {% if select == 'projects' %}class="nav-link active" {%

-         else %}class="nav-link"{%

-         endif %} href="{{ url_for('ui_ns.browse_projects') }}">Projects</a>

-   </li>

-   <li class="nav-item">

-     <a {% if select == 'users' %}class="nav-link active" {%

-         else %}class="nav-link"{%

-         endif %} href="{{ url_for('ui_ns.view_users') }}">Users</a>

-   </li>

-   <li class="nav-item">

-     <a {% if select == 'groups' %}class="nav-link active" {%

-         else %}class="nav-link"{%

-         endif %} href="{{ url_for('ui_ns.group_lists') }}">Groups</a>

-   </li>

- </ul>

- {%- endmacro %}

@@ -21,6 +21,53 @@ 

  <script src="{{ url_for('static', filename='vendor/bootstrap/bootstrap.bundle.min.js')}}"></script>

  {% endmacro %}

  

+ {% macro browseheader_message(select) %}

+     {% if select == 'projects' %}

+     <div class="row justify-content-around">

+     <div class="col-md-8">

+         <div class="jumbotron bg-transparent m-0 py-4 text-center">

+             <h1 class="display-5">Welcome to Fedora Package Sources</h1>

+             <p class="lead">Fedora's repository for package maintenance.</p>

+             </div>

+     </div>

+     </div>

+ 

+     {% if not g.authenticated %}

+         <section class="container p-t-2">

+         <p>

+             Welcome, if you're looking to download software to run, look at

+             <a href="https://getfedora.org/">https://getfedora.org/</a>, or a

+             <a href="https://mirrors.fedoraproject.org/">Fedora Mirror</a>.

+             You can also find source RPMs for Fedora-packaged software there.

+             The source code for building those packages is found here.

+         </p>

+ 

+         <p>

+             If you are looking for RPM spec files, module and container definitions,

+             Fedora-specific patches, tests, and so on, you're in the right place.

+             You can browse <a href="/browse/projects/">packages</a> and

+             <a href="/users">packagers</a> — and you can fork, improve, and submit

+             pull requests.

+             </p>

+ 

+         <p>

+             If you are already a package maintainer, feel free to consult the

+             <a href="https://docs.pagure.org/pagure/usage.html">docs on using

+             pagure</a>. If you'd like to become a package maintainer, see

+             <a href="https://fedoraproject.org/wiki/Join_the_package_collection_maintainers">

+             this guide</a>.

+         </p>

+ 

+         <p>

+             Note that package issues are still tracked in

+             <a href="https://bugzilla.redhat.com/">Bugzilla</a>,

+             not with Pagure's issue feature.

+         </p>

+         </section>

+     {% endif %}

+     {% endif %}

+ {% endmacro %}

+ 

  {% macro footer() %}

      <div class="footer py-3">

          <div class="container">

Introduces a new macro for themes, the browseheader_message.
This allows a theme to define the message that is shown on the
browse pages. In the default theme, this message was and is only
shown on the browse projects.

This also updates the srcfpo theme to use this new macro, and remove
the overridden template that was being used to do this.

Fixes #3617

This is a lazy title. The official title of the site is "Fedora Package Sources". Can we have something better to work with this?

This is a lazy title. The official title of the site is "Fedora Pagure". Can we use this here?

rebased onto da43254bd06a152862af9cdb7b00f34f3d48c4b6

5 years ago

rebased onto 3e09eee0e289020cb51bd0aa1cabdf281c2f69e8

5 years ago

Let's just put "my Pagure" here instead of "Pagure.io".

Aside for the remaining comment about the example, looks good to me.

After you make that change, feel free to merge.

:thumbsup:

rebased onto 64e143f

5 years ago

Pull-Request has been merged by ryanlerch

5 years ago