From: Frank Brehm Date: Thu, 30 Aug 2018 09:34:23 +0000 (+0200) Subject: Adding Stylesheets X-Git-Tag: 0.10.10^2~2 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=655cb888f034241599ba35ff35e04e3a69e18add;p=pixelpark%2Fpuppetmaster-webhooks.git Adding Stylesheets --- diff --git a/lib/webhooks/base_app.py b/lib/webhooks/base_app.py index 99825d1..552648d 100644 --- a/lib/webhooks/base_app.py +++ b/lib/webhooks/base_app.py @@ -663,6 +663,43 @@ class BaseHookApp(BaseObject): + {t} diff --git a/lib/webhooks/show_modules.py b/lib/webhooks/show_modules.py index a43fb0f..5e31d4b 100644 --- a/lib/webhooks/show_modules.py +++ b/lib/webhooks/show_modules.py @@ -225,42 +225,52 @@ class ShowModulesApp(BaseHookApp): self.print_out(' ') self.print_out(' ') self.print_out(' ') - self.print_out(' Name') - self.print_out(' Vollständiger Name') - self.print_out(' Repository') - self.print_out(' Homepage bei Puppet Forge') - self.print_out(' Version') - self.print_out(' Letzter Check') + self.print_out(' Name') + self.print_out(' Vollständiger Name') + self.print_out(' Repository') + self.print_out(' Homepage bei Puppet Forge') + self.print_out(' Version') + self.print_out(' Letzter Check') self.print_out(' ') - self.print_out(' Puppet Forge') - self.print_out(' Development') - self.print_out(' Test') - self.print_out(' Production') + self.print_out(' Puppet Forge') + self.print_out(' Development') + self.print_out(' Test') + self.print_out(' Production') self.print_out(' ') self.print_out(' ') self.print_out(' ') nr_modules = 0 + line_class = 'even' + for module_info in module_infos: nr_modules += 1 + if nr_modules % 2: + line_class = 'odd' + else: + line_class = 'even' output_data = self.get_output_data(module_info) if not output_data['forge_version']: output_data['forge_version'] = '~' - if not output_data['forge_homepage_url']: + if output_data['forge_homepage_url']: + o = '{u}'.format(u=output_data['forge_homepage_url']) + output_data['forge_homepage_url'] = o + else: output_data['forge_homepage_url'] = '~' if not output_data['repo']: output_data['repo'] = '~' + output_data['line_class'] = line_class tpl = ' \n' - tpl += ' {name}\n' - tpl += ' {full_name}\n' - tpl += ' {repo}\n' - tpl += ' {forge_homepage_url}\n' - tpl += ' {forge_version}\n' - tpl += ' {version_development}\n' - tpl += ' {version_test}\n' - tpl += ' {version_production}\n' - tpl += ' {date_checked}\n' + tpl += ' {name}\n' + tpl += ' {full_name}\n' + tpl += ' {repo}\n' + tpl += ' {forge_homepage_url}\n' + tpl += ' {forge_version}\n' + tpl += ' {version_development}\n' + tpl += ' {version_test}\n' + tpl += ' {version_production}\n' + tpl += ' {date_checked}\n' tpl += ' ' if self.verbose > 2: LOG.debug("Row template:\n{}".format(tpl))