From fb2c03797ceda58387133e434226fa9b0fd040ef Mon Sep 17 00:00:00 2001 From: Tim Steiner <tsteiner2@unl.edu> Date: Thu, 20 Sep 2007 20:53:33 +0000 Subject: [PATCH] Comment section looks better now. --- application/views/request/view.xhtml | 54 ++++++++++++++++++++-------- document_root/css/request/view.oss | 32 ++++++++++++++++- 2 files changed, 70 insertions(+), 16 deletions(-) diff --git a/application/views/request/view.xhtml b/application/views/request/view.xhtml index 9f9e2c8a..958d5c50 100644 --- a/application/views/request/view.xhtml +++ b/application/views/request/view.xhtml @@ -98,13 +98,21 @@ <div class="tabContent" id="commentsContent"> - <?php foreach ($this->comments as $comment) { + <table class="comments"> + <tr> + <th class="who">Who</th> + <th class="when">When</th> + <th class="what">What</th> + </tr> + <?php foreach ($this->comments as $key => $comment) { if ($comment->visibility == 'global') { ?> - <div class="comment"> - <h3>Text:</h3> - <div><?php echo $comment->comment; ?></div> - </div> + <tr class="<?php echo ($key % 2) ? 'evenRow' : 'oddRow'; ?>"> + <td class="who"><?php echo $comment->user->userName; ?></td> + <td class="when"><?php echo $comment->postTime; ?></td> + <td class="what"><?php echo $comment->comment; ?></td> + </tr> <?php }} ?> + </table> <form method="post" action="/Request/AddComment/<?php echo $this->request->getPrimaryKey(); ?>"> <div> @@ -117,13 +125,21 @@ <div class="tabContent" id="editorCommentsContent"> - <?php foreach ($this->comments as $comment) { + <table class="comments"> + <tr> + <th class="who">Who</th> + <th class="when">When</th> + <th class="what">What</th> + </tr> + <?php foreach ($this->comments as $key => $comment) { if ($comment->visibility == 'editorial') { ?> - <div class="comment"> - <h3>Text:</h3> - <div><?php echo $comment->comment; ?></div> - </div> + <tr class="<?php echo ($key % 2) ? 'evenRow' : 'oddRow'; ?>"> + <td class="who"><?php echo $comment->user->userName; ?></td> + <td class="when"><?php echo $comment->postTime; ?></td> + <td class="what"><?php echo $comment->comment; ?></td> + </tr> <?php }} ?> + </table> <form method="post" action="/Request/AddComment/<?php echo $this->request->getPrimaryKey(); ?>"> <div> @@ -136,14 +152,22 @@ <div class="tabContent" id="privateCommentsContent"> - <?php foreach ($this->comments as $comment) { + <table class="comments"> + <tr> + <th class="who">Who</th> + <th class="when">When</th> + <th class="what">What</th> + </tr> + <?php foreach ($this->comments as $key => $comment) { if ($comment->visibility == 'self' && $comment->user->getPrimaryKey() == Nmc_User::getInstance()->getUser()->getPrimaryKey()) { ?> - <div class="comment"> - <h3>Text:</h3> - <div><?php echo $comment->comment; ?></div> - </div> + <tr class="<?php echo ($key % 2) ? 'evenRow' : 'oddRow'; ?>"> + <td class="who"><?php echo $comment->user->userName; ?></td> + <td class="when"><?php echo $comment->postTime; ?></td> + <td class="what"><?php echo $comment->comment; ?></td> + </tr> <?php }} ?> + </table> <form method="post" action="/Request/AddComment/<?php echo $this->request->getPrimaryKey(); ?>"> <div> diff --git a/document_root/css/request/view.oss b/document_root/css/request/view.oss index 759e81f5..4084cd43 100644 --- a/document_root/css/request/view.oss +++ b/document_root/css/request/view.oss @@ -84,11 +84,41 @@ div#comments { border: 1px solid #888; textarea { - width: 95%; + width: 682px; height: 3em; } } + table.comments { + width: 100%; + + th { + text-align: left; + } + + td { + padding: 2px; + } + + .who, + .when { + white-space: nowrap; + } + + .what { + width: 500px; + } + + tr.evenRow { + background-color: #eee; + } + + tr.oddRow { + background-color: #ccc; + } + + } + #editorCommentsContent, #privateCommentsContent { display: none; -- GitLab