#4090 hide extra GIT URLs behind a collapseable element
Merged 5 years ago by pingou. Opened 5 years ago by ryanlerch.
ryanlerch/pagure issue4078  into  master

@@ -196,40 +196,53 @@ 

                      config.get('GIT_URL_GIT') }}{{ repo.path }}" readonly>

                  </div>

                </div>

- 

-               {% if config['DOC_APP_URL']

-                   and repo

-                   and repo.settings.get('project_documentation', True) %}

-                 <h5><strong>Documentation</strong></h5>

-                 {% if g.authenticated and g.repo_committer %}

-                   {{ print_ssh_url(repo, "docs/", g.fas_user.username) }}

-                 {% endif %}

-                 <div class="form-group">

-                   <div class="input-group input-group-sm">

-                     <div class="input-group-prepend"><span class="input-group-text">GIT</span></div>

-                     <input class="form-control bg-white" type="text" value="{{

-                       config.get('GIT_URL_GIT') }}docs/{{ repo.path }}" readonly>

+               {% if (config['DOC_APP_URL']

+                      and repo

+                      and repo.settings.get('project_documentation', True)

+                      )

+                      or

+                      (g.authenticated and g.repo_committer) %}

+ 

+                 <div id="giturl-more" class="hidden">

+                 {% if config['DOC_APP_URL']

+                     and repo

+                     and repo.settings.get('project_documentation', True) %}

+                   <h5><strong>Documentation</strong></h5>

+                   {% if g.authenticated and g.repo_committer %}

+                     {{ print_ssh_url(repo, "docs/", g.fas_user.username) }}

+                   {% endif %}

+                   <div class="form-group">

+                     <div class="input-group input-group-sm">

+                       <div class="input-group-prepend"><span class="input-group-text">GIT</span></div>

+                       <input class="form-control bg-white" type="text" value="{{

+                         config.get('GIT_URL_GIT') }}docs/{{ repo.path }}" readonly>

+                     </div>

                    </div>

-                 </div>

-               {% endif %}

+                 {% endif %}

  

-               {% if g.authenticated and g.repo_committer %}

-                 {% if config.get('ENABLE_TICKETS', True)

-                    and repo.settings.get('issue_tracker', True) %}

-                   <h5><strong>Issues</strong></h5>

-                   {{ print_ssh_url(repo, "tickets/", g.fas_user.username) }}

+                 {% if g.authenticated and g.repo_committer %}

+                   {% if config.get('ENABLE_TICKETS', True)

+                     and repo.settings.get('issue_tracker', True) %}

+                     <h5><strong>Issues</strong></h5>

+                     {{ print_ssh_url(repo, "tickets/", g.fas_user.username) }}

+                   {% endif %}

+                   <h5><strong>Pull Requests</strong></h5>

+                   {{ print_ssh_url(repo, "requests/", g.fas_user.username) }}

                  {% endif %}

-                 <h5><strong>Pull Requests</strong></h5>

-                 {{ print_ssh_url(repo, "requests/", g.fas_user.username) }}

-               {% endif %}

  

-               <hr />

-               <p>

-                 <a href="https://docs.pagure.org/pagure/usage/" target="_blank" rel="noopener noreferrer">

-                   Learn more about these different git repos.

+                 <hr />

+                 <p>

+                   <a href="https://docs.pagure.org/pagure/usage/" target="_blank" rel="noopener noreferrer">

+                     Learn more about these different git repos.

+                   </a>

+                 </p>

+               </div>

+               <p class="text-right">

+                 <a href="javascript:void(0)" id="giturl-toggle">

+                   Other Git URLs <i class="fa fa-angle-down" aria-hidden="true"></i>

                  </a>

                </p>

- 

+               {% endif %}

              </div>

            </div>

          </div>
@@ -419,7 +432,11 @@ 

  

  </script>

  <script>

- 

+ $("#giturl-toggle").on('click', function(event){

+   event.stopPropagation();

+   $("#giturl-more").toggle();

+   $("#giturl-toggle").hide();

+ })

  {% if g.authenticated and not g.repo_obj.is_empty %}

  

  {% if g.repo_committer %}

This hides by default the extra git repos (docs, issues, etc)
from the dropdown for viewing the clone URLs. A simple link
is added at the bottom of the dropdown to show the extra URLs

Fixes: #4078

rebased onto b674166

5 years ago

Tested locally and works as expected, thanks for this! :)

Pull-Request has been merged by pingou

5 years ago