Browse Source

! Begin to standardize the error and notice boxes in the forum. (Post, Maintenance, PM, Register)
! Adjust pm error style to match post error style

Spuds 13 years ago
parent
commit
4ca0b08765

+ 8 - 1
Sources/PersonalMessage.php

@@ -1745,7 +1745,7 @@ function MessagePost()
 		$context['to_value'] = '';
 
 	// Set the defaults...
-	$context['subject'] = $form_subject != '' ? $form_subject : $txt['no_subject'];
+	$context['subject'] = $form_subject;
 	$context['message'] = str_replace(array('"', '<', '>', '&nbsp;'), array('&quot;', '&lt;', '&gt;', ' '), $form_message);
 	$context['post_error'] = array();
 	$context['copy_to_outbox'] = !empty($options['copy_to_outbox']);
@@ -1900,6 +1900,9 @@ function messagePostError($error_types, $named_recipients, $recipient_ids = arra
 
 	// Set each of the errors for the template.
 	loadLanguage('Errors');
+	
+	$context['error_type'] = 'minor';
+	
 	$context['post_error'] = array(
 		'messages' => array(),
 	);
@@ -1912,6 +1915,10 @@ function messagePostError($error_types, $named_recipients, $recipient_ids = arra
 				$txt['error_' . $error_type] = sprintf($txt['error_' . $error_type], $modSettings['max_messageLength']);
 			$context['post_error']['messages'][] = $txt['error_' . $error_type];
 		}
+		
+		// If it's not a minor error flag it as such.
+		if (!in_array($error_type, array('new_reply', 'not_approved', 'new_replies', 'old_topic', 'need_qr_verification', 'no_subject')))
+			$context['error_type'] = 'serious';
 	}
 
 	// We need to load the editor once more.

+ 1 - 1
Sources/Post.php

@@ -462,7 +462,7 @@ function Post()
 				$context['post_error']['messages'][] = $txt['error_' . $post_error];
 
 				// If it's not a minor error flag it as such.
-				if (!in_array($post_error, array('new_reply', 'not_approved', 'new_replies', 'old_topic', 'need_qr_verification')))
+				if (!in_array($post_error, array('new_reply', 'not_approved', 'new_replies', 'old_topic', 'need_qr_verification', 'no_subject')))
 					$context['error_type'] = 'serious';
 			}
 		}

+ 10 - 11
Themes/default/PersonalMessage.template.php

@@ -938,16 +938,15 @@ function template_send()
 	if (!empty($context['post_error']['messages']))
 	{
 		echo '
-				<div class="errorbox">
-					<strong>', $txt['error_while_submitting'], '</strong>
-					<ul class="reset">';
-
-		foreach ($context['post_error']['messages'] as $error)
-			echo '
-						<li class="error">', $error, '</li>';
-
-		echo '
-					</ul>
+				<div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors">
+					<dl>
+						<dt>
+							<strong id="error_serious">', $txt['pm_error_while_submitting'] , '</strong>
+						</dt>
+						<dd class="error" id="error_list">
+							', empty($context['post_error']['messages']) ? '' : implode('<br />', $context['post_error']['messages']), '
+						</dd>
+					</dl>
 				</div>';
 	}
 
@@ -992,7 +991,7 @@ function template_send()
 						<span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), '>', $txt['subject'], ':</span>
 					</dt>
 					<dd id="pm_subject">
-						<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="60" maxlength="60" />
+						<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="60" maxlength="60"',isset($context['post_error']['no_subject']) ? ' class="error"' : ' class="input_text"', '/>
 					</dd>
 				</dl><hr class="clear" />';
 

+ 6 - 5
Themes/default/Post.template.php

@@ -100,10 +100,10 @@ function template_main()
 
 	// If an error occurred, explain what happened.
 	echo '
-					<div class="errorbox"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors">
+					<div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors">
 						<dl>
 							<dt>
-								<strong style="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'display: none;' : '', '" id="error_serious">', $txt['error_while_submitting'], '</strong>
+								<strong id="error_serious">', $txt['error_while_submitting'], '</strong>
 							</dt>
 							<dd class="error" id="error_list">
 								', empty($context['post_error']['messages']) ? '' : implode('<br />', $context['post_error']['messages']), '
@@ -154,11 +154,11 @@ function template_main()
 
 	// Now show the subject box for this post.
 	echo '
-						<dt>
+						<dt class="clear">
 							<span', isset($context['post_error']['no_subject']) ? ' class="error"' : '', ' id="caption_subject">', $txt['subject'], ':</span>
 						</dt>
 						<dd>
-							<input type="text" name="subject"', $context['subject'] == '' ? '' : ' value="' . $context['subject'] . '"', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80" class="input_text" />
+							<input type="text" name="subject"', $context['subject'] == '' ? '' : ' value="' . $context['subject'] . '"', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80"', isset($context['post_error']['no_subject']) ? ' class="error"' : ' class="input_text"', '/>
 						</dd>
 						<dt class="clear_left">
 							', $txt['message_icon'], ':
@@ -607,7 +607,8 @@ function template_main()
 				for (var i = 0, numErrors = errors.getElementsByTagName(\'error\').length; i < numErrors; i++)
 					errorList[errorList.length] = errors.getElementsByTagName(\'error\')[i].firstChild.nodeValue;
 				document.getElementById(\'errors\').style.display = numErrors == 0 ? \'none\' : \'\';
-				document.getElementById(\'error_serious\').style.display = errors.getAttribute(\'serious\') == 1 ? \'\' : \'none\';
+				document.getElementById(\'errors\').className = errors.getAttribute(\'serious\') == 1 ? \'errorbox\' : \'noticebox\';
+				document.getElementById(\'error_serious\').style.display = numErrors == 0 ? \'none\' : \'\';
 				setInnerHTML(document.getElementById(\'error_list\'), numErrors == 0 ? \'\' : errorList.join(\'<br />\'));
 
 				// Show a warning if the topic has been locked.

+ 1 - 1
Themes/default/Register.template.php

@@ -73,7 +73,7 @@ function template_registration_form()
 	if (!empty($context['registration_errors']))
 	{
 		echo '
-		<div class="register_error">
+		<div class="errorbox">
 			<span>', $txt['registration_errors_occurred'], '</span>
 			<ul class="reset">';
 

+ 7 - 5
Themes/default/css/admin.css

@@ -363,11 +363,13 @@ dl.right dt
 ------------------------------------------------- */
 .maintenance_finished, #task_completed
 {
-	margin: 1ex;
-	padding: 1ex 2ex;
-	border: 1px dashed green;
-	color: green;
-	background: #efe;
+	background:#B7FCA7 url(../images/warning_watch.gif) center no-repeat;
+	background-position:8px 50%;
+	text-align:left;
+	border-top:1px solid green;
+	border-bottom:1px solid green;
+	padding:4px 10px 2px 30px;
+	margin-bottom: 1em;
 }
 /* Styles for the manage calendar section.
 ------------------------------------------------- */

+ 33 - 20
Themes/default/css/index.css

@@ -2559,20 +2559,7 @@ fieldset.merge_options
 	text-align: center;
 }
 
-/* Styles for the registration section.
-------------------------------------------------------- */
-.register_error
-{
-	border: 1px dashed red;
-	padding: 5px;
-	margin: 0 1ex 1ex 1ex;
-}
-.register_error span
-{
-	text-decoration: underline;
-}
-
-/* Additional profile fields */
+/* Additional register fields */
 dl.register_form
 {
 	margin: 0;
@@ -2798,13 +2785,14 @@ tr.windowbg td, tr.windowbg2 td, tr.approvebg td, tr.highlight2 td
 	width: 80%;
 	margin: auto;
 }
-
-.errorbox
+.errorbox 
 {
-	padding: 1em;
-	border: 1px solid #cc3344;
-	color: #000;
-	background-color: #ffe4e9;
+	background: #ffe4e9 url(../images/warning_mute.gif) center no-repeat;
+	background-position: 8px 50%;
+	text-align: left;
+	border-top: 2px solid #cc3344;
+	border-bottom: 2px solid #cc3344;
+	padding: 5px 10px 5px 30px;
 	margin-bottom: 1em;
 }
 .errorbox h3
@@ -2827,6 +2815,31 @@ tr.windowbg td, tr.windowbg2 td, tr.approvebg td, tr.highlight2 td
 	font-size: 1.5em;
 }
 
+/* Styles for info boxes
+------------------------------------------------- */
+
+.noticebox 
+{
+	color:#999;
+	background:#fff6bf url(../images/warning_moderate.gif) center no-repeat;
+	background-position: 8px 50%;
+	text-align:left;
+	border-top:1px solid #ffd324;
+	border-bottom:1px solid #ffd324;
+	padding:5px 2px 5px 30px;
+	margin-bottom: 1em;
+}
+.infobox 
+{
+	background:#c5ffb8 url(../images/warning_watch.gif) center no-repeat;
+	background-position:8px 50%;
+	text-align:left;
+	border-top:1px solid #ffd324;
+	border-bottom:1px solid #ffd324;
+	padding:1px 10px 1px 30px;
+	margin-bottom: 1em;
+}
+
 /* Styles for the profile section.
 ------------------------------------------------- */