Added comments to report detail page
This commit is contained in:
@@ -60,7 +60,7 @@ class Comments
|
||||
<div style="float: left; display: inline-block; ">
|
||||
<img style="border-radius: 5px; margin-top: 3px; border: 1px solid #444; filter: alpha(opacity=80); opacity: 0.8;" src="<?php echo $avatar ?>" />
|
||||
</div>
|
||||
<div class="ui-corner-all" style="margin: 2em 0; background-color: #252525; margin-left: 60px; margin-right: 20px;">
|
||||
<div class="ui-corner-all" style="margin: 1em 0; background-color: #252525; margin-left: 60px; margin-right: 20px;">
|
||||
<div style="padding: 5px; border-bottom: 1px solid #444; vertical-align: middle;">
|
||||
<?php echo $del . htmlentities($from) ?>
|
||||
</div>
|
||||
@@ -152,12 +152,12 @@ class Comments
|
||||
</script>
|
||||
|
||||
<div id="comments_frame">
|
||||
<div id="comments_scroller" style="height: 300px; overflow-y: auto;"><?php echo self::renderComments($id) ?></div>
|
||||
<div id="new_comment" style="height: 100px;">
|
||||
<p>Comments for crash signature <?php echo $id ?></p>
|
||||
<div id="comments_scroller" style="max-height: 300px; overflow-y: auto;"><?php echo self::renderComments($id) ?></div>
|
||||
<div id="new_comment">
|
||||
<a id="add_comment">Add comment</a>
|
||||
<textarea id="comment_input" class="ui-widget-content" style="display: block; width: 100%; height: 100%; margin-top: 5px;"></textarea>
|
||||
<textarea id="comment_input" class="ui-widget-content" style="width: 100%; display: block; height: 100px; margin-top: 5px;"></textarea>
|
||||
</div>
|
||||
<div style="height: 30px;"></div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
@@ -27,7 +27,7 @@ class CrashStats
|
||||
$where = $this->filter->getWhere();
|
||||
$q = "select count(r.id) as nr, s.id as signature_id, s.signature as signature_text, s.has_comments from reports r join signature s on r.signature_id = s.id $where group by signature_id order by nr desc";
|
||||
$q .= kl_str_sql(" limit !i", 100);
|
||||
if (false !== $cached = Memc::getq($q)) return $cached;
|
||||
// if (false !== $cached = Memc::getq($q)) return $cached;
|
||||
|
||||
if (!$res = DBH::$db->query($q))
|
||||
{
|
||||
@@ -41,7 +41,7 @@ class CrashStats
|
||||
$ret[] = $r;
|
||||
}
|
||||
|
||||
Memc::setq($q, $ret);
|
||||
// Memc::setq($q, $ret);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ Layout::header();
|
||||
<?php if (strlen($full["SettingsXml"])): ?>
|
||||
<li><a href="#tabs-5">Settings</a></li>
|
||||
<?php endif ?>
|
||||
<li><a href="#tabs-6">Comments</a></li>
|
||||
</ul>
|
||||
|
||||
<!-- Stacks tab -->
|
||||
@@ -179,7 +180,17 @@ $(function() {
|
||||
<?php endif ?>
|
||||
<!-- Settings tab -->
|
||||
|
||||
|
||||
<!-- comments tab -->
|
||||
<div id="tabs-6">
|
||||
</div>
|
||||
<!-- comments tab -->
|
||||
|
||||
<div id="tabs_footer" style="max-width: 800px; padding: 10px;">
|
||||
<?php Comments::renderCommentPanel($report->signature_id) ?>
|
||||
</div>
|
||||
|
||||
</div> <!-- end of tabs panel -->
|
||||
|
||||
<?php
|
||||
Layout::footer();
|
||||
|
||||
@@ -20,15 +20,17 @@ $filter->render();
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
width: 800,
|
||||
height: 500,
|
||||
height: "auto",
|
||||
});
|
||||
|
||||
$(".comment_link").each(function() {
|
||||
var $link = $(this);
|
||||
var signature_id = $link.data("signature-id");
|
||||
|
||||
$link.on("click", function() {
|
||||
$dialog.dialog("option", "title", "Crash signature " + signature_id);
|
||||
$link.on("click", function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
//$dialog.dialog("option", "title", "Crash signature " + signature_id);
|
||||
$dialog.dialog("open");
|
||||
|
||||
$.ajax({
|
||||
@@ -83,10 +85,15 @@ $filter->render();
|
||||
if ($txt) $txt .= "<br/><br/>";
|
||||
if ($parts[2]) $txt .= preg_replace("/((::|<|>|,|\\(|\\)))/", "<wbr/>\\1<wbr/>", htmlentities($parts[2]));
|
||||
if (!$txt) $txt = " ";
|
||||
$ctext = "Comments";
|
||||
if ($r->has_comments)
|
||||
{
|
||||
$ctext .= " ({$r->has_comments})";
|
||||
}
|
||||
?>
|
||||
<tr class="rowhighlight">
|
||||
<td style="text-align: right"><a href="<?php echo rl_s($r) ?>"><?php echo htmlentities($r->nr) ?></a></td>
|
||||
<td><a href="#" class="comment_link" data-signature-id="<?php echo htmlentities($r->signature_id) ?>">Comments</a></td>
|
||||
<td><a href="<?php echo URL_ROOT . "/comments.php?signature_id=" . $r->signature_id ?>" class="comment_link" data-signature-id="<?php echo htmlentities($r->signature_id) ?>"><?php echo $ctext ?></a></td>
|
||||
<td><a href="<?php echo rl_s($r) ?>"><?php echo htmlentities($parts[0]) ?></a></td>
|
||||
<td><a href="<?php echo rl_s($r) ?>"><?php echo $txt ?></a></td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user