xaizek / rocketgit (License: AGPLv3+) (since 2018-12-09)
Light and fast Git hosting solution suitable to serve both as a hub or as a personal code storage with its tickets, pull requests, API and much more.
Commit 9770087d9479e2853e2054adbe51174f0e64440f

Show labels on bug page.
Author: Catalin(ux) M. BOIE
Author date (UTC): 2012-07-05 20:14
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2012-07-05 20:14
Parent(s): 1f015ea792b00f3ba52cf88a7bb5b9975828fd8f
Signing key:
Tree: 11d81b0460ee03f2ee3c7c2e3562adb53cf0aaf6
File Lines added Lines deleted
inc/bug.inc.php 38 1
inc/user/repo/bug/show.php 7 0
root/themes/default/main.css 14 0
root/themes/default/repo/bug/list_labels/footer.html 0 0
root/themes/default/repo/bug/list_labels/header.html 2 0
root/themes/default/repo/bug/list_labels/line.html 1 0
root/themes/default/repo/bug/list_labels/nodata.html 0 0
root/themes/default/repo/bug/list_note/nodata.html 0 3
root/themes/default/repo/bug/show.html 1 0
File inc/bug.inc.php changed (mode: 100644) (index f3976a7..411a5cd)
... ... function rg_bug_next_id($db, $repo_id)
30 30 rg_prof_start("bug_next_id"); rg_prof_start("bug_next_id");
31 31
32 32 $next_bug_id = FALSE; $next_bug_id = FALSE;
33
34 33 do { do {
35 34 $sql = "UPDATE bugs_max SET last_bug_id = last_bug_id + 1" $sql = "UPDATE bugs_max SET last_bug_id = last_bug_id + 1"
36 35 . " WHERE repo_id = $repo_id" . " WHERE repo_id = $repo_id"
 
... ... function rg_bug_next_id($db, $repo_id)
59 58 break; break;
60 59 } }
61 60
61 /*
62 * Here, another client may just did the insert and commited
63 * and we obtain the lock. So, we have to check if a insert
64 * took place. if we
65 */
66 $sql = "SELECT 1 FROM bugs_max WHERE repo_id = $repo_id";
67 $res = rg_sql_query($db, $sql);
68 if ($res === FALSE) {
69 rg_bug_set_error("cannot select 1 from max table (" . rg_sql_error() . ")");
70 break;
71 }
72 $rows = rg_sql_num_rows($res);
73 rg_sql_free_result($res);
74
75 if ($rows == 1) {
76 /*
77 * The other client was faster than us. Just try to update
78 */
79 continue;
80 }
81
82 // We was faster, just insert.
62 83 $sql = "INSERT INTO bugs_max (repo_id, last_bug_id)" $sql = "INSERT INTO bugs_max (repo_id, last_bug_id)"
63 84 . " VALUES ($repo_id, 1)"; . " VALUES ($repo_id, 1)";
64 85 $res = rg_sql_query($db, $sql); $res = rg_sql_query($db, $sql);
 
... ... function rg_bug_label_insert($db, $repo_id, $bug_id, $labels)
548 569 return $ret; return $ret;
549 570 } }
550 571
572 /*
573 * Returns labels as HTML
574 */
575 function rg_bug_label_html($db, $repo_id, $bug_id)
576 {
577 $labels = rg_bug_label_get($db, $repo_id, $bug_id);
578
579 if (!empty($labels)) {
580 $a = array();
581 foreach ($labels as $label)
582 $a[] = array("label" => $label);
583 }
584
585 return rg_template_table("repo/bug/list_labels", $a, array());
586 }
587
551 588 ?> ?>
File inc/user/repo/bug/show.php changed (mode: 100644) (index dc97f45..b3e9ace)
... ... if ($doit == 0) {
45 45 } }
46 46 } }
47 47
48 // load labels
49 $labels = rg_bug_label_get($db, $ri['repo_id'], $bug_id);
50 if ($labels === FALSE)
51 $_tmp['HTML:labels'] = "Cannot load labels!";
52 else
53 $_tmp['HTML:labels'] = rg_bug_label_html($db, $ri['repo_id'], $bug_id);
54
48 55 // load notes // load notes
49 56 $notes = rg_bug_note_list($db, $ri['repo_id'], $bug_id, 0); $notes = rg_bug_note_list($db, $ri['repo_id'], $bug_id, 0);
50 57 if ($notes === FALSE) if ($notes === FALSE)
File root/themes/default/main.css changed (mode: 100644) (index 92ea39b..68706a8)
... ... label {
189 189 .error b { color: #ff0000; font-weight: bold; font-size: 11pt; } .error b { color: #ff0000; font-weight: bold; font-size: 11pt; }
190 190 .error ul { padding-left: 15pt; } .error ul { padding-left: 15pt; }
191 191 .error ul li {} .error ul li {}
192
193 .labels { padding: 3px 0px; margin: 3px 0px; }
194 .labels ul { list-style-type: none; }
195 .labels ul li {
196 display: inline;
197 padding: 3px 3px;
198 text-decoration: none;
199 color: black;
200 border: 1px solid #cccccc;
201 border-radius: 4px 4px 4px 4px;
202 font-size: 9pt;
203 background-color: #a0d0ff;
204 }
205
File root/themes/default/repo/bug/list_labels/footer.html copied from file root/themes/default/errmsg/footer.html (similarity 100%)
File root/themes/default/repo/bug/list_labels/header.html added (mode: 100644) (index 0000000..71233bc)
1 <div class="labels">
2 <ul>
File root/themes/default/repo/bug/list_labels/line.html added (mode: 100644) (index 0000000..9141356)
1 <li>@@label@@</li>
File root/themes/default/repo/bug/list_labels/nodata.html copied from file root/themes/default/errmsg/nodata.html (similarity 100%)
File root/themes/default/repo/bug/list_note/nodata.html changed (mode: 100644) (index 7d61d82..e69de29)
1 <div class="warning">
2 No notes found.
3 </div>
File root/themes/default/repo/bug/show.html changed (mode: 100644) (index 413f3d7..83acfb4)
... ... Body:<br />
10 10 @@body@@ @@body@@
11 11 <br /> <br />
12 12
13 @@labels@@
13 14 @@notes@@ @@notes@@
14 15
15 16 @@note_add@@ @@note_add@@
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/rocketgit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master