Fix license notice, make ticket rows clickable, and get data from variables

develop
Sven Slootweg 11 years ago
parent 5bf96a8d02
commit 30de910e73

@ -1,6 +1,6 @@
<?php
/*
* projectname is more free software. It is licensed under the WTFPL, which
* Cryto Team is more free software. It is licensed under the WTFPL, which
* allows you to do pretty much anything with it, without having to
* ask permission. Commercial use is allowed, and no attribution is
* required. We do politely request that you share your modifications
@ -15,4 +15,47 @@ if(!isset($_APP)) { die("Unauthorized."); }
$sPageTitle = "Tickets";
$sCurrentPage = "tickets";
$sPageContents = NewTemplater::Render("project/tickets/index", $locale->strings, array());
$sPageContents = NewTemplater::Render("project/tickets/index", $locale->strings, array(
"tickets" => array(
array(
"id" => 4,
"title" => "This is a sample ticket about some kind of bug.",
"priority" => "High",
"priority-lowercase" => "high",
"status" => "Open",
"status-lowercase" => "open"
),
array(
"id" => 3,
"title" => "Some kind of feature suggestion",
"priority" => "Normal",
"priority-lowercase" => "normal",
"status" => "Open",
"status-lowercase" => "open"
),
array(
"id" => 5,
"title" => "Aaaaaabsolutely unimportant.",
"priority" => "Low",
"priority-lowercase" => "low",
"status" => "Open",
"status-lowercase" => "open"
),
array(
"id" => 1,
"title" => "This is an urgent ticket about something that has been resolved.",
"priority" => "High",
"priority-lowercase" => "high",
"status" => "Closed",
"status-lowercase" => "closed"
),
array(
"id" => 2,
"title" => "This is a normal ticket about something that has been resolved.",
"priority" => "Normal",
"priority-lowercase" => "normal",
"status" => "Closed",
"status-lowercase" => "closed"
),
)
));

File diff suppressed because one or more lines are too long

@ -0,0 +1,42 @@
/*
* Cryto Team is more free software. It is licensed under the WTFPL, which
* allows you to do pretty much anything with it, without having to
* ask permission. Commercial use is allowed, and no attribution is
* required. We do politely request that you share your modifications
* to benefit other developers, but you are under no enforced
* obligation to do so :)
*
* Please read the accompanying LICENSE document for the full WTFPL
* licensing text.
*/
$(function(){
$('.clickable').click(function(event)
{
if($(this).data('url'))
{
url = $(this).data('url');
if(event.which == 1)
{
if($(this).hasClass('external'))
{
window.open(url);
}
else
{
window.location = url;
}
event.stopPropagation();
return false;
}
else if(event.which == 2)
{
window.open(url);
event.stopPropagation();
return false;
}
}
});
});

@ -4,6 +4,8 @@
<title>Cryto Team</title>
<link href='http://fonts.googleapis.com/css?family=Nobile:400,400italic,700,700italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="/static/style.css">
<script src="/static/jquery.js"></script>
<script src="/static/script.js"></script>
</head>
<body>
<div class="wrapper">

@ -6,35 +6,13 @@
<th>Priority</th>
<th>Status</th>
</tr>
<tr class="clickable priority-high status-open">
<td class="empty">#4</td>
<td class="title"><a href="{%?project-url}/ticket/4">This is a sample ticket about some kind of bug.</a></td>
<td class="priority">High</td>
<td class="status">Open</td>
</tr>
<tr class="clickable priority-normal status-open">
<td class="empty">#3</td>
<td class="title"><a href="{%?project-url}/ticket/3">Some kind of feature suggestion</a></td>
<td class="priority">Normal</td>
<td class="status">Open</td>
</tr>
<tr class="clickable priority-low status-open">
<td class="empty">#5</td>
<td class="title"><a href="{%?project-url}/ticket/5">Aaaaaabsolutely unimportant.</a></td>
<td class="priority">Low</td>
<td class="status">Open</td>
</tr>
<tr class="clickable priority-high status-closed">
<td class="empty">#1</td>
<td class="title"><a href="{%?project-url}/ticket/1">This is an urgent ticket about something that has been resolved..</a></td>
<td class="priority">High</td>
<td class="status">Closed</td>
</tr>
<tr class="clickable priority-normal status-closed">
<td class="empty">#2</td>
<td class="title"><a href="{%?project-url}/ticket/2">This is a normal ticket about something that has been resolved..</a></td>
<td class="priority">Normal</td>
<td class="status">Closed</td>
</tr>
{%foreach ticket in tickets}
<tr class="clickable priority-{%?ticket[priority-lowercase]} status-{%?ticket[status-lowercase]}" data-url="{%?project-url}/ticket/{%?ticket[id]}">
<td class="id">#{%?ticket[id]}</td>
<td class="title"><a href="{%?project-url}/ticket/{%?ticket[id]}">{%?ticket[title]}</a></td>
<td class="priority">{%?ticket[priority]}</td>
<td class="status">{%?ticket[status]}</td>
</tr>
{%/foreach}
</table>
</section>

Loading…
Cancel
Save