Permalink
Browse files

Merge pull request #95 from KuiKui/master

Git logs are now available in admin section (sketchy version)
  • Loading branch information...
2 parents 4086255 + d06cb8b commit dfd95a37dc5c315fffad98c2d25a0d48f28b74dc @KuiKui KuiKui committed Jun 3, 2012
View
@@ -1 +1,2 @@
-.idea
+.idea
+*.sublime-*
@@ -15,9 +15,11 @@ default:
stylesheets:
- reset.min.css
- main.css
+ - vendor/jquery.qtip.min.css
javascripts:
- vendor/jquery-1.6.4.min.js
+ - vendor/jquery.qtip.min.js
- tooltip.js
has_layout: true
@@ -0,0 +1,23 @@
+<?php
+
+class logGitComponent extends sfComponent
+{
+ const DISPLAY_COUNT = 15;
+
+ /**
+ * @param sfWebRequest $request
+ * @return void
+ */
+ public function execute($request)
+ {
+ $nbLog = $request->getParameter('gitlog', self::DISPLAY_COUNT);
+
+ $this->logs = LogGitQuery::create()
+ ->orderById(Criteria::ASC)
+ ->limit($nbLog)
+ ->find()
+ ;
+
+ $this->moreLogs = $nbLog + self::DISPLAY_COUNT;
+ }
+}
@@ -0,0 +1,19 @@
+<div class="list">
+ <div class="list_head">
+ <span class="title">Log Git</span>
+ </div>
+ <div class="list_body" id="log">
+ <table>
+ <?php foreach ($logs as $log): ?>
+ <tr class="<?php if($log->getCode()) echo 'error' ?>">
+ <td class="code repository_infos tooltip" title="<?php echo $log->getMessage() ?>"><?php echo $log->getCode() ?></td>
+ <td class="command"><?php echo $log->getCommand() ?></td>
+ <td class="date"><?php echo $log->getCreatedAt('d/m/Y H:m:i') ?></td>
+ </tr>
+ <?php endforeach; ?>
+ </table>
+ </div>
+ <div class="list_footer">
+ <?php echo link_to('More...', 'default/repositoryList', array('title' => 'More...', 'query_string' => 'gitlog='.$moreLogs)) ?>
+ </div>
+</div>
@@ -54,3 +54,5 @@
</table>
</div>
</div>
+
+<?php include_component('default', 'logGit') ?>
@@ -283,6 +283,46 @@
}
}
+ .list_footer {
+ background-color: whitesmoke;
+ color: @grey;
+ font-size: @normalFont;
+ height: 32px;
+ line-height: 30px;
+ padding: 0 5px;
+ text-align: center;
+
+ a {
+ color: @blue;
+ }
+ }
+
+ #log {
+ td {
+ color: @grey;
+ &.code {
+ cursor: help;
+ }
+ &.date {
+ color: @lightGrey;
+ width: 130px;
+ }
+ }
+
+ tr {
+ &.error {
+ .command,
+ .date {
+ background-color: #fcd;
+ }
+ .code {
+ color: @red + #222;
+ font-weight: bold;
+ }
+ }
+ }
+ }
+
#file_list {
h3 {
font-weight: normal;
View
@@ -217,6 +217,27 @@
-webkit-border-radius:15px;
-moz-border-radius:15px;
}
+.list .list_footer {
+ background-color:whitesmoke;
+ color:#666666;
+ font-size:13px;
+ height:32px;
+ line-height:30px;
+ padding:0 5px;
+ text-align:center;
+}
+.list .list_footer a { color:#4183c4; }
+.list #log td { color:#666666; }
+.list #log td.code { cursor:help; }
+.list #log td.date {
+ color:#999999;
+ width:130px;
+}
+.list #log tr.error .command, .list #log tr.error .date { background-color:#ffccdd; }
+.list #log tr.error .code {
+ color:#e42222;
+ font-weight:bold;
+}
.list #file_list h3 {
font-weight:normal;
font-size:12px;

0 comments on commit dfd95a3

Please sign in to comment.