Browse Source

MessageIndex Cleanup

!bugfix - There was an anchor being closed that was never opened,
invalid XHTML.

+ css class - A new CSS class "bold_text" was created to eliminate the
need for ternary conditions for both the start and close of strong tags
when one condition can be done and then a CSS class added, figure this
can be useful elsewhere also.

Beyond the bugfix, a lot of CSS tweaks were made to keep things
aligning better, a missing border was added, and a lot of other minor
tweaks.

Signed-Off: Matthew Kerle <[email protected]>
Matthew Kerle 12 years ago
parent
commit
a38c6a2343
2 changed files with 26 additions and 16 deletions
  1. 11 14
      Themes/default/MessageIndex.template.php
  2. 15 2
      Themes/default/css/index.css

+ 11 - 14
Themes/default/MessageIndex.template.php

@@ -197,7 +197,7 @@ function template_main()
 					<th scope="col" class="lefttext last_th" width="22%">', $context['topics_headers']['last_post'], '</th>';
 			else
 				echo '
-					<th scope="col" class="lefttext" width="22%">', $context['topics_headers']['last_post'], '</a></th>';
+					<th scope="col" class="lefttext" width="22%">', $context['topics_headers']['last_post'], '</th>';
 
 			// Show a "select all" box for quick moderation?
 			if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1)
@@ -263,19 +263,16 @@ function template_main()
 						</div>
 					</td>
 					<td class="', $alternate_class, ' subject">
-						<div ', (!empty($topic['quick_mod']['modify']) ? 'id="topic_' . $topic['first_post']['id'] . '"  ondblclick="oQuickModifyTopic.modify_topic(\'' . $topic['id'] . '\', \'' . $topic['first_post']['id'] . '\');"' : ''), '>';
-
-			// [WIP] Methinks the orange icons look better if they aren't all over the page.
-			// Is this topic new? (assuming they are logged in!)
-			if ($topic['new'] && $context['user']['is_logged'])
-					echo '
-							<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><span class="new_posts">' . $txt['new'] . '</span></a>';
-
-			echo '
-							', $topic['is_sticky'] ? '<strong>' : '', '<span class="preview" title="', $topic[(empty($settings['message_index_preview_first']) ? 'last_post' : 'first_post')]['preview'], '"><span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], ($context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span></span>', $topic['is_sticky'] ? '</strong>' : '', '
-
+						<div ', (!empty($topic['quick_mod']['modify']) ? 'id="topic_' . $topic['first_post']['id'] . '"  ondblclick="oQuickModifyTopic.modify_topic(\'' . $topic['id'] . '\', \'' . $topic['first_post']['id'] . '\');"' : ''), '>
+							<div class="message_index_title">
+								', $topic['new'] && $context['user']['is_logged'] ? '<a href="' . $topic['new_href'] . '" id="newicon' . $topic['first_post']['id'] . '" style="float: left; display: block; margin: 9px 0 0 3px;"><span class="new_posts">' . $txt['new'] . '</span></a>' : '', '
+								<span class="preview', $topic['is_sticky'] ? ' bold_text' : '', '" title="', $topic[(empty($settings['message_index_preview_first']) ? 'last_post' : 'first_post')]['preview'], '">
+									<span id="msg_', $topic['first_post']['id'], '">', $topic['first_post']['link'], ($context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>
+								</span>
+								<br class="clear" />
+							</div>
 							<p>', $txt['started_by'], ' ', $topic['first_post']['member']['link'], '
-								<small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>
+								<small id="pages', $topic['first_post']['id'], '">', $topic['pages'], '</small>
 							</p>
 						</div>
 					</td>
@@ -327,7 +324,7 @@ function template_main()
 		{
 			echo '
 				<tr class="titlebg">
-					<td colspan="6" align="right">
+					<td colspan="6" align="right" id="quick_actions">
 						<select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
 							<option value="">--------</option>';
 

+ 15 - 2
Themes/default/css/index.css

@@ -857,7 +857,7 @@ table.table_list a.collapse {
 }
 
 .table_grid th.last_th input {
-	margin: 0 2px;
+	margin: 0 7px;
 }
 .table_grid th.lefttext {
 	padding: 0 8px;
@@ -1861,13 +1861,18 @@ p.whoisviewing {
 .lastpost img {
 	float: right;
 	padding: 4px;
+	margin-top: 4px;
 }
 .titlebg td.qaction_cell {
 	font-size: 0.909em;
 }
-select.qaction, input.qaction {
+select.qaction {
 	padding: 0;
 }
+td#quick_actions {
+	border-right: 1px solid #ccc;
+	padding-right: 4px;
+}
 .qaction_cell .button_submit {
 	margin: 2px 4px 0 4px;
 }
@@ -1900,6 +1905,10 @@ select.qaction, input.qaction {
 	padding: 4px 6px 2px 6px;
 }
 
+.message_index_title {
+	margin-bottom: -3px;
+}
+
 /* Styles for the display template (topic view).
 ---------------------------------------------------- */
 /* Events */
@@ -4206,4 +4215,8 @@ tr.catbg th:last-child, #show_attachments th:last-child {
 
 div#manage_boards dl dd textarea[name=desc] {
 	margin-top: 1px;
+}
+
+.bold_text {
+	font-weight: bold;
 }