Added comments to report detail page
This commit is contained in:
@@ -60,7 +60,7 @@ class Comments
|
|||||||
<div style="float: left; display: inline-block; ">
|
<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 ?>" />
|
<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>
|
||||||
<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;">
|
<div style="padding: 5px; border-bottom: 1px solid #444; vertical-align: middle;">
|
||||||
<?php echo $del . htmlentities($from) ?>
|
<?php echo $del . htmlentities($from) ?>
|
||||||
</div>
|
</div>
|
||||||
@@ -152,12 +152,12 @@ class Comments
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="comments_frame">
|
<div id="comments_frame">
|
||||||
<div id="comments_scroller" style="height: 300px; overflow-y: auto;"><?php echo self::renderComments($id) ?></div>
|
<p>Comments for crash signature <?php echo $id ?></p>
|
||||||
<div id="new_comment" style="height: 100px;">
|
<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>
|
<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>
|
||||||
<div style="height: 30px;"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class CrashStats
|
|||||||
$where = $this->filter->getWhere();
|
$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 = "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);
|
$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))
|
if (!$res = DBH::$db->query($q))
|
||||||
{
|
{
|
||||||
@@ -41,7 +41,7 @@ class CrashStats
|
|||||||
$ret[] = $r;
|
$ret[] = $r;
|
||||||
}
|
}
|
||||||
|
|
||||||
Memc::setq($q, $ret);
|
// Memc::setq($q, $ret);
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ Layout::header();
|
|||||||
<?php if (strlen($full["SettingsXml"])): ?>
|
<?php if (strlen($full["SettingsXml"])): ?>
|
||||||
<li><a href="#tabs-5">Settings</a></li>
|
<li><a href="#tabs-5">Settings</a></li>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
<li><a href="#tabs-6">Comments</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<!-- Stacks tab -->
|
<!-- Stacks tab -->
|
||||||
@@ -179,7 +180,17 @@ $(function() {
|
|||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<!-- Settings tab -->
|
<!-- Settings tab -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- comments tab -->
|
||||||
|
<div id="tabs-6">
|
||||||
</div>
|
</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
|
<?php
|
||||||
Layout::footer();
|
Layout::footer();
|
||||||
|
|||||||
@@ -20,15 +20,17 @@ $filter->render();
|
|||||||
modal: true,
|
modal: true,
|
||||||
autoOpen: false,
|
autoOpen: false,
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 500,
|
height: "auto",
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".comment_link").each(function() {
|
$(".comment_link").each(function() {
|
||||||
var $link = $(this);
|
var $link = $(this);
|
||||||
var signature_id = $link.data("signature-id");
|
var signature_id = $link.data("signature-id");
|
||||||
|
|
||||||
$link.on("click", function() {
|
$link.on("click", function(e) {
|
||||||
$dialog.dialog("option", "title", "Crash signature " + signature_id);
|
e.preventDefault();
|
||||||
|
|
||||||
|
//$dialog.dialog("option", "title", "Crash signature " + signature_id);
|
||||||
$dialog.dialog("open");
|
$dialog.dialog("open");
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -83,10 +85,15 @@ $filter->render();
|
|||||||
if ($txt) $txt .= "<br/><br/>";
|
if ($txt) $txt .= "<br/><br/>";
|
||||||
if ($parts[2]) $txt .= preg_replace("/((::|<|>|,|\\(|\\)))/", "<wbr/>\\1<wbr/>", htmlentities($parts[2]));
|
if ($parts[2]) $txt .= preg_replace("/((::|<|>|,|\\(|\\)))/", "<wbr/>\\1<wbr/>", htmlentities($parts[2]));
|
||||||
if (!$txt) $txt = " ";
|
if (!$txt) $txt = " ";
|
||||||
|
$ctext = "Comments";
|
||||||
|
if ($r->has_comments)
|
||||||
|
{
|
||||||
|
$ctext .= " ({$r->has_comments})";
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<tr class="rowhighlight">
|
<tr class="rowhighlight">
|
||||||
<td style="text-align: right"><a href="<?php echo rl_s($r) ?>"><?php echo htmlentities($r->nr) ?></a></td>
|
<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 htmlentities($parts[0]) ?></a></td>
|
||||||
<td><a href="<?php echo rl_s($r) ?>"><?php echo $txt ?></a></td>
|
<td><a href="<?php echo rl_s($r) ?>"><?php echo $txt ?></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user