Commit 04737788f14caa3be2a211afc26d681cbac508d5

Authored by Athos
1 parent 3437d48a

add README and some fixes

README.md 0 → 100644
... ... @@ -0,0 +1,24 @@
  1 +# About
  2 +
  3 +This app was built to support the development of Portal do Software Público Brasileiro.
  4 +
  5 +It shows versions for published packages in EPEL7 Fedora Copr repositories.
  6 +
  7 +Note that this app consists of a single PSGI script, a template file and Bootstrap.
  8 +
  9 +# Instalation
  10 +
  11 +In order to use this app you will need perl 5 and the following perl modules installed:
  12 +
  13 +Plack
  14 +LWP::Simple
  15 +JSON
  16 +Text::Template
  17 +
  18 +# License
  19 +
  20 +This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  21 +
  22 +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  23 +
  24 +You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
... ...
spb_copr_status.psgi
... ... @@ -39,7 +39,15 @@ sub info2html {
39 39 my $table_entries="";
40 40 foreach my $key (%{$inforef}) {
41 41 next if(ref($key) eq 'HASH');
42   - $table_entries .= "<tr>
  42 + my $fill_row;
  43 + if($inforef->{$key}->{'v4_version'} eq $inforef->{$key}->{'v5_version'}) {
  44 + $fill_row = "success";
  45 + }
  46 + else {
  47 + $fill_row = "danger";
  48 + }
  49 +
  50 + $table_entries .= "<tr class=\"$fill_row\">
43 51 <td>$key</td>
44 52 <td>$inforef->{$key}->{'v4_version'}</td>
45 53 <td>$inforef->{$key}->{'v5_version'}</td>
... ... @@ -70,6 +78,6 @@ my $app = sub {
70 78 };
71 79  
72 80 builder {
73   - enable "Static", path => qr!^(/css|/js|/fonts)!;
  81 + enable "Static", path => qr!^(/css|/js)!;
74 82 $app;
75 83 }
... ...
template.html.tt
... ... @@ -13,14 +13,49 @@
13 13 <![endif]-->
14 14 </head>
15 15 <body>
16   - <table class="table table-striped">
17   - <tr>
18   - <th>PACKAGE</th>
19   - <th>softwarepublico/v4</th>
20   - <th>softwarepublico/v5</th>
21   - </tr>
22   - {$table_entries}
23   - </table>
  16 + <div class="container">
  17 +
  18 + <div class="header clearfix">
  19 + <nav>
  20 + <ul class="nav nav-pills pull-right">
  21 + <li role="presentation"><a href="https://copr.fedoraproject.org/coprs/softwarepublico/v4/">softwarepublico/v4</a></li>
  22 + <li role="presentation"><a href="https://copr.fedoraproject.org/coprs/softwarepublico/v5/">softwarepublico/v5</a></li>
  23 + <li role="presentation"><a href="https://softwarepublico.gov.br">SPB</a></li>
  24 + </ul>
  25 + </nav>
  26 + <h3 class="text-muted">SPB Copr Status</h3>
  27 + </div>
  28 +
  29 + <div class="jumbotron">
  30 + <p class="lead">This app fetches data from softwarepublico Copr EPEL7 repositories and compare package versions. In short, red rows mean package versions differ among the repositories (<b>note that this it NOT necessarily a bad thing</b>).</p>
  31 + <div class="row">
  32 + <div class="col-md-6 col-md-offset-3">
  33 + <table class="table table-striped">
  34 + <tr>
  35 + <td class="success">Versions match</td>
  36 + </tr>
  37 + <tr>
  38 + <td class="danger">Versions do not match</td>
  39 + </tr>
  40 + </table>
  41 + </div>
  42 + </div>
  43 + </div>
  44 +
  45 + <table class="table table-striped">
  46 + <tr>
  47 + <th>PACKAGE</th>
  48 + <th>softwarepublico/v4</th>
  49 + <th>softwarepublico/v5</th>
  50 + </tr>
  51 + {$table_entries}
  52 + </table>
  53 +
  54 + <footer class="footer">
  55 + <p>2015 LAPPIS - #softwarepublico @ Freenode</p>
  56 + </footer>
  57 +
  58 + </div>
24 59 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
25 60 <script src="js/bootstrap.min.js"></script>
26 61 </body>
... ...