bodhi/static/css/layout.css | 11 +++++++++++ bodhi/static/images/shadow2-big.png |binary bodhi/templates/new.kid | 2 +- bodhi/templates/show.kid | 6 +++++- bodhi/widgets.py | 10 ++++++++-- 5 files changed, 25 insertions(+), 4 deletions(-)
New commits: commit e9318aa03cd2771fd4c4af42bd552ca465e6f3bd Author: Mathieu Bridon (bochecha) bochecha@fedoraproject.org Date: Sun Aug 30 12:20:02 2009 +0200
Ticket #286: Show an update example
When displaying the update, parse the MarkDown syntax in the update notes to render nicely formatted HTML.
diff --git a/bodhi/templates/show.kid b/bodhi/templates/show.kid index e81518a..2fa903b 100644 --- a/bodhi/templates/show.kid +++ b/bodhi/templates/show.kid @@ -13,6 +13,8 @@ from cgi import escape from bodhi import util from turbogears import identity +from markdown2 import markdown +import re
## Link to build info and logs buildinfo = '' @@ -33,7 +35,9 @@ title = title[:-2]
release = util.link(update.release.long_name, '/' + update.release.name) submitter = util.link(update.submitter, '/user/' + update.submitter) -notes = escape(update.notes).replace('\r\n', '<br/>') + +reg = re.compile(r'(^[-*] .*(?:\n[-*] .*)*)', re.MULTILINE) +notes = markdown(reg.sub(r'\n\1\n', escape(update.notes)))
if update.karma < 0: karma = -1 elif update.karma > 0: karma = 1
commit b7f47f9f77b41556cacb2c1efa1d42079b4b8e6f Author: Mathieu Bridon (bochecha) bochecha@fedoraproject.org Date: Sun Aug 30 01:28:40 2009 +0200
Ticket #286: Show an update example
New update notes tooltip now shows an example update with the use of MarkDown syntax.
diff --git a/bodhi/static/css/layout.css b/bodhi/static/css/layout.css index eee822c..13d07c6 100644 --- a/bodhi/static/css/layout.css +++ b/bodhi/static/css/layout.css @@ -576,6 +576,17 @@ td.value { height: 100px; }
+#tooltip.pretty-big { + width: 270px; +} + +#tooltip.pretty-big div { width: 270px; text-align: left; } + +#tooltip.fancy-big { + background: url('/updates/static/images/shadow2-big.png'); + height: 210px; +} + #main { padding: 1em; } #banner { padding: 15px; background-color: #06b; color: white; font-size: large; border-bottom: 1px solid #ccc; background: url(bg.gif) repeat-x; text-align: center } diff --git a/bodhi/static/images/shadow2-big.png b/bodhi/static/images/shadow2-big.png new file mode 100644 index 0000000..fdde8ae Binary files /dev/null and b/bodhi/static/images/shadow2-big.png differ diff --git a/bodhi/templates/new.kid b/bodhi/templates/new.kid index a6cd3a9..40c8933 100644 --- a/bodhi/templates/new.kid +++ b/bodhi/templates/new.kid @@ -24,7 +24,7 @@ fixPNG: true, opacity: 1 }); $("#form_notes").Tooltip({ - extraClass: "pretty fancy", showBody: " - ", left: 5, top: -15, + extraClass: "pretty fancy pretty-big fancy-big", showBody: " - ", left: 5, top: -15, fixPNG: true, opacity: 1 }); $("#form_bugs").Tooltip({ diff --git a/bodhi/widgets.py b/bodhi/widgets.py index bf2f98f..87141af 100644 --- a/bodhi/widgets.py +++ b/bodhi/widgets.py @@ -99,9 +99,15 @@ class NewUpdateForm(Form): 'CVE-2008-0001'}), TextArea('notes', validator=validators.UnicodeString(), rows=13, cols=65, - attrs={'title' : 'Advisory Notes - Some optional details ' + attrs={'title' : 'Advisory Notes - <p>Some optional details ' 'about this update that will appear in ' - 'the notice'}), + 'the notice.</p>' + '<p><strong>Exemple:</strong><br />' + 'This is an update that fixes problems with ' + '**<strong>connecting to a share</strong>**.</p>' + '<p>The following things *<em>break</em>*:</p>' + '<p>* Browsing with `<code>gnome-app-install</code>`<br />' + '* Emailing</p>'}), CheckBox(name='close_bugs', help_text='Automatically close bugs', validator=validators.StringBool(), default=True, attrs={'title' : 'Close Bugs - '