Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
ef85a567
Commit
ef85a567
authored
Jan 06, 2003
by
gerv%gerv.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 187837 - Unify showing and editing of quips. Patch by gerv; r=timeless, a=justdave.
parent
ed5513d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
54 deletions
+42
-54
quips.cgi
quips.cgi
+1
-18
quips.html.tmpl
template/en/default/list/quips.html.tmpl
+41
-36
No files found.
quips.cgi
View file @
ef85a567
...
...
@@ -46,23 +46,6 @@ my $action = $::FORM{'action'} || "";
if
(
$action
eq
"show"
)
{
# Read in the entire quip list
SendSQL
(
"SELECT quip FROM quips"
);
my
@quips
;
while
(
MoreSQLData
())
{
my
(
$quip
)
=
FetchSQLData
();
push
(
@quips
,
$quip
);
}
$vars
->
{
'quips'
}
=
\
@quips
;
$vars
->
{
'show_quips'
}
=
1
;
}
if
(
$action
eq
"edit"
)
{
if
(
!
UserInGroup
(
'admin'
))
{
ThrowUserError
(
"quips_edit_denied"
);
}
# Read in the entire quip list
SendSQL
(
"SELECT quipid,userid,quip FROM quips"
);
my
$quips
;
...
...
@@ -83,7 +66,7 @@ if ($action eq "edit") {
$vars
->
{
'quipids'
}
=
\
@quipids
;
$vars
->
{
'quips'
}
=
$quips
;
$vars
->
{
'users'
}
=
$users
;
$vars
->
{
'
edit
_quips'
}
=
1
;
$vars
->
{
'
show
_quips'
}
=
1
;
}
if
(
$action
eq
"add"
)
{
...
...
template/en/default/list/quips.html.tmpl
View file @
ef85a567
...
...
@@ -62,46 +62,51 @@
</form>
[% IF show_quips %]
<h2>
Existing quips:
</h2>
<ul>
[% FOREACH quip = quips %]
<li>[% quip FILTER html %]</li>
[% END %]
</ul>
[% ELSIF edit_quips %]
<h2>Edit existing quips:</h2>
<table border="1">
<thead><tr>
<th>Action</th>
<th>User</th>
<th>Quip</th>
</tr></thead><tbody>
[% FOREACH quipid = quipids %]
<tr>
<td>
<a href="quips.cgi?action=delete&quipid=[% quipid FILTER uri%]">
Delete
</a>
</td>
<td>
[% userid = quips.$quipid.userid %]
[% users.$userid FILTER html %]
[% "Unknown" IF NOT users.$userid %]
</td>
<td>[% quips.$quipid.quip FILTER html %]</td>
</tr>
[% END %]
</tbody></table>
[% IF !UserInGroup('admin') %]
<h2>
Existing quips:
</h2>
<ul>
[% FOREACH quip = quips %]
<li>[% quip FILTER html %]</li>
[% END %]
</ul>
[% ELSE %]
<h2>Edit existing quips:</h2>
<table border="1">
<thead><tr>
<th>Quip</th>
<th>Author</th>
<th>Action</th>
</tr></thead><tbody>
[% FOREACH quipid = quipids %]
<tr>
<td>[% quips.$quipid.quip FILTER html %]</td>
<td>
[% userid = quips.$quipid.userid %]
[% users.$userid FILTER html %]
[% "Unknown" IF NOT users.$userid %]
</td>
<td>
<a href="quips.cgi?action=delete&quipid=[% quipid FILTER uri%]">
Delete
</a>
</td>
</tr>
[% END %]
</tbody>
</table>
<br>
[% END %]
[% ELSE %]
<p>
Those who like their wisdom in large doses can
<a href="quips.cgi?action=show">view the whole quip list</a>.
<a href="quips.cgi?action=show">view
[% IF UserInGroup('admin') %]
and edit
[% END %]
the whole quip list</a>.
</p>
[% IF UserInGroup('admin') %]
<p><a href="quips.cgi?action=edit">Edit</a> the quip list.</p>
[% END %]
[% END %]
[% PROCESS global/footer.html.tmpl %]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment