changeset 237:f188b156603d

Added flash messages support
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 30 May 2010 17:52:20 +0200
parents 5ba66bb4ca95
children a55c17874486
files pylons_app/public/css/monoblue_custom.css pylons_app/public/images/icons/error_msg.png pylons_app/public/images/icons/notice_msg.png pylons_app/public/images/icons/success_msg.png pylons_app/public/images/icons/warning_msg.png pylons_app/templates/base/base.html
diffstat 6 files changed, 68 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/pylons_app/public/css/monoblue_custom.css	Sun May 30 16:59:18 2010 +0200
+++ b/pylons_app/public/css/monoblue_custom.css	Sun May 30 17:52:20 2010 +0200
@@ -44,8 +44,8 @@
 }
 .table_disp td {
     border-left: 1px solid #AAAAAA;
-    padding-left: 2px;
-    padding-right: 0px;
+    padding-left: 4px;
+    padding-right: 4px;
 }
 
 table tr.parity0:hover,table tr.parity1:hover {
@@ -99,6 +99,61 @@
     cursor: pointer;
 }
 
+.flash_msg ul{
+	margin:0;
+	padding:25px 0px 0px 0px;
+	
+}
+.error_msg {
+	background-color:#FFCFCF;
+	background-image: url("/images/icons/error_msg.png");
+	border:1px solid #FF9595;
+	color:#CC3300;
+}
+.warning_msg {
+	background-color:#FFFBCC;
+	background-image: url("/images/icons/warning_msg.png");
+	border:1px solid #FFF35E;
+	color:#C69E00;
+}
+.success_msg {
+	background-color:#D5FFCF;
+	background-image: url("/images/icons/success_msg.png");
+	border:1px solid #97FF88;
+	color:#009900;
+}
+.notice_msg {
+	background-color:#DCE3FF;
+	background-image: url("/images/icons/notice_msg.png");
+	border:1px solid #93A8FF;
+	color:#556CB5;
+}
+
+.success_msg, .error_msg, .notice_msg, .warning_msg{
+	background-position:10px center;
+	background-repeat:no-repeat;
+	font-size:12px;
+	font-weight:bold;
+	min-height:14px;
+	line-height:14px;
+	margin-bottom:0px;
+	margin-top:0px;
+	padding:3px 10px 3px 40px;
+	display:block;
+	overflow: auto;
+}        
+
+#msg_close {
+	background:transparent url("icons/cross_grey_small.png")	no-repeat scroll 0 0;
+	cursor:pointer;
+	height:16px;
+	position:absolute;
+	right:5px;
+	top:5px;
+	width:16px;
+}
+
+
 div#main {
 	padding: 5px;
 }
Binary file pylons_app/public/images/icons/error_msg.png has changed
Binary file pylons_app/public/images/icons/notice_msg.png has changed
Binary file pylons_app/public/images/icons/success_msg.png has changed
Binary file pylons_app/public/images/icons/warning_msg.png has changed
--- a/pylons_app/templates/base/base.html	Sun May 30 16:59:18 2010 +0200
+++ b/pylons_app/templates/base/base.html	Sun May 30 17:52:20 2010 +0200
@@ -16,7 +16,17 @@
     <div class="page-header">
         <h1>${next.breadcrumbs()}</h1>
         ${self.page_nav()}
-    <div id="main">
+    <div class="flash_msg">
+    <% messages = h.flash.pop_messages() %>
+		% if messages:
+		<ul id="flash-messages">
+		    % for message in messages:
+		    <li class="${message.category}_msg">${message}</li>
+		    % endfor
+		</ul>
+		% endif
+    </div>        
+    <div id="main"> 
     	${next.main()}
     </div>
     <div class="page-footer">