Skip to content

Commit

Permalink
[#2223]: Switched to Bootstrap flash messages; spaced out the page.
Browse files Browse the repository at this point in the history
  • Loading branch information
teajaymars committed Mar 20, 2012
1 parent 220559f commit f9bf0c6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
10 changes: 5 additions & 5 deletions ckan/lib/helpers.py
Expand Up @@ -146,10 +146,10 @@ def __html__(self):
class _Flash(object):

# List of allowed categories. If None, allow any category.
categories = ["warning", "notice", "error", "success"]
categories = ["", "alert-info", "alert-error", "alert-success"]

# Default category if none is specified.
default_category = "notice"
default_category = ""

def __init__(self, session_key="flash", categories=None, default_category=None):
self.session_key = session_key
Expand Down Expand Up @@ -195,13 +195,13 @@ def are_there_messages(self):
_flash = _Flash()

def flash_notice(message, allow_html=False):
_flash(message, category='notice', allow_html=allow_html)
_flash(message, category='alert-info', allow_html=allow_html)

def flash_error(message, allow_html=False):
_flash(message, category='error', allow_html=allow_html)
_flash(message, category='alert-error', allow_html=allow_html)

def flash_success(message, allow_html=False):
_flash(message, category='success', allow_html=allow_html)
_flash(message, category='alert-success', allow_html=allow_html)

def are_there_flash_messages():
return _flash.are_there_messages()
Expand Down
8 changes: 1 addition & 7 deletions ckan/public/css/style.css
Expand Up @@ -15,7 +15,7 @@ body.no-sidebar .content-outer {
background-image: linear-gradient(top, #e2e2e2, #cccccc);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#e2e2e2', EndColorStr='#cccccc');

margin-bottom: 0px;
margin-bottom: 18px;
-moz-box-shadow: 0px 2px 15px #dddddd;
-webkit-box-shadow: 0px 2px 15px #dddddd;
box-shadow: 0px 2px 15px #dddddd;
Expand Down Expand Up @@ -1240,12 +1240,6 @@ body.package.read .resource-information {
box-shadow: 1px 1px 3px #f7f7f7;
color: #808080;
}
.flash-messages .success .new-dataset {
font-size: 150%;
}
.flash-messages.success .new-dataset a {
font-weight: bold;
}
body.package.read #sidebar li.widget-container {
border: 0
}
Expand Down
2 changes: 1 addition & 1 deletion ckan/public/scripts/templates.js
Expand Up @@ -76,7 +76,7 @@ CKAN.Templates.resourceEntry = ' \
CKAN.Templates.resourceDetails = ' \
<div style="display: none;" class="resource-details"> \
<div class="flash-messages"> \
<div class="error resource-errors"></div> \
<div class="alert alert-error resource-errors"></div> \
</div> \
<table> \
<tbody> \
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/layout_base.html
Expand Up @@ -87,7 +87,7 @@
</div>
<py:with vars="messages = list(h._flash.pop_messages())">
<div class="flash-messages container">
<div class="${m.category}" py:for="m in messages">
<div class="alert ${m.category}" py:for="m in messages">
${h.literal(m)}
</div>
</div>
Expand Down

0 comments on commit f9bf0c6

Please sign in to comment.