#52 Add a tag making it obvious when a package is retired on Fedora
Merged 7 years ago by pingou. Opened 7 years ago by pingou.

file modified
+11 -3
@@ -379,9 +379,8 @@ 

        $( "#pkgdescription" ).text(res['description']);

        if (res['url']){

            var _p = $('.projectinfo');

-           $('.projectinfo').html(

-             _p.html()

-             + ' (<a target="_blank" rel="noopener noreferrer" href="'

+           $('.projectinfo').append(

+             ' (<a target="_blank" rel="noopener noreferrer" href="'

              + res['url'] + '"a>upstream</a>)')

        }

      }
@@ -399,6 +398,13 @@ 

            branch = res.results[branch];

            var _it = $('#branch-' + branch.name);

            _it.addClass('disabled_branch');

+           if (branch.name == 'master') {

+             var _t = $('.projectinfo');

+             html = ' \

+                 <div class="small label label-sm label-danger" data-toggle="tooltip" \

+                  title="This package has been retired">Retired on Fedora</div>';

+             _t.append(html);

+           }

          }

          if (res.next){

            get_branches(res.next);
@@ -502,7 +508,9 @@ 

    });

    {% endif %}

  

+   {% if repo.is_fork %}

    disable_branches();

+   {% endif %}

  

  });

  </script>

projectinfo should likely be an ID instead of a class since it seems that there will only be one element that represents projectinfo per page.

As a side note, this AJAX call doesn't seem to work on the latest Chrome on F27. I get the following error:

Refused to execute script from 'https://apps.fedoraproject.org/mdapi/rawhide/pkg/fedrepo-req?callback=jQuery110206692310512757702_1515685041918&_=1515685041919' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled

A couple random comments but they aren't blocking. +1

That comes from a different template which I'd rather not change, so I'll leave this in for now.

2 new commits added

  • Small simplification of the JS code
  • Add a tag making it obvious when a package is retired on Fedora
7 years ago

Mind reporting the issue with mdapi on mdapi's tracker? https://pagure.io/mdapi

And thanks for the review :)

Pull-Request has been merged by pingou

7 years ago
Metadata