Template logic error for unapproved topics

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Template logic error for unapproved topics
« on June 29th, 2013, 11:27 PM »
Code: [Select]
Index: I:/Backups/Linux Drive/john/repos/arantor_wedge/trunk/Themes/default/MessageIndex.template.php
===================================================================
--- I:/Backups/Linux Drive/john/repos/arantor_wedge/trunk/Themes/default/MessageIndex.template.php (revision 2166)
+++ I:/Backups/Linux Drive/john/repos/arantor_wedge/trunk/Themes/default/MessageIndex.template.php (working copy)
@@ -111,7 +111,7 @@
  <td class="subject ', $alternate_class, '">
  <div', (!empty($topic['quick_mod']['modify']) ? ' id="topic_' . $topic['id'] . '" ondblclick="modify_topic(' . $topic['id'] . ', ' . $topic['first_post']['id'] . ');"' : ''), '>
  <span id="msg_' . $topic['first_post']['id'] . '">', $topic['new'] && we::$is_member ? $topic['new_link'] : $topic['first_post']['link'],
- !$context['can_approve_posts'] && !$topic['approved'] ? ' <em>(' . $txt['awaiting_approval'] . ')</em>' : '', '</span>';
+ $context['can_approve_posts'] && !$topic['approved'] ? ' <em>(' . $txt['awaiting_approval'] . ')</em>' : '', '</span>';
 
  // Is this topic new? (assuming they are logged in!)
  if ($topic['new'] && we::$is_member)
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

Nao

  • Dadman with a boy
  • Posts: 16,082

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Template logic error for unapproved topics
« Reply #2, on June 30th, 2013, 11:43 PM »
Actually, I'm not so sure that is a logic error. What we're saying, ultimately, is that the topic is awaiting approval. Previously it's telling people who can't approve posts that it's awaiting approval (i.e. the person who made the topic), as opposed to now telling people who can approve posts...

Thing is, now the person who posted it has no guide that it is awaiting approval other than the colour change.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Re: Template logic error for unapproved topics
« Reply #3, on July 1st, 2013, 01:12 AM »
I see. Now  what if we remove the permission check, because a moderator might not realize right away why a given topic is orange. Or add the different colors to the legend?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Template logic error for unapproved topics
« Reply #4, on July 1st, 2013, 01:17 AM »
Well... those who can approve should get a big red (!) symbol next to the topic, those who can't should get the 'Awaiting Approval' notice... at least that's how it was in SMF, I don't recall us breaking it.

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Template logic error for unapproved topics
« Reply #6, on July 1st, 2013, 09:48 AM »
Personally, I'd be okay with removing the can_approve test entirely, as it's no big deal either way, and could save people some support work... ;)