Fossil SCM

Remove the superfluous Close Post option from the forum edit page.

stephan 2023-06-10 19:03 trunk
Commit b2f007178a3027ce290556fcc3cd8d74d5e4df644e2286562094503e960a80cb
1 file changed +1 -61
+1 -61
--- src/forum.c
+++ src/forum.c
@@ -288,66 +288,11 @@
288288
return permClose = 1;
289289
}else if( g.perm.ModForum ){
290290
return permClose = forumpost_close_policy()>0 ? -1 : 0;
291291
}else{
292292
return permClose = 0;
293
- }
294
-}
295
-
296
-/*
297
-** If iClosed is true and the current user forumpost-close privileges,
298
-** this renders either a checkbox to unlock forum post fpid (if
299
-** iClosed>0) or a SPAN.warning element that the given post inherits
300
-** the CLOSED status from a parent post (if iClosed<0). If neither of
301
-** the initial conditions is true, this is a no-op.
302
-*/
303
-static void forumpost_emit_closed_state(int fpid, int iClosed){
304
- const char *zCommon;
305
- int iHead = forumpost_head_rid(fpid);
306
- const int permClose = forumpost_may_close();
307
-
308
- zCommon = forumpost_close_policy()==0
309
- ? "Admins may close or re-open posts, or respond to closed posts."
310
- : "Admins or moderators "
311
- "may close or re-open posts, or respond to closed posts.";
312
- /*@ forumpost_emit_closed_state(%d(fpid), %d(iClosed))<br/>*/
313
- if( iHead != fpid ){
314
- iClosed = forum_rid_is_closed(iHead, 1);
315
- /*@ forumpost_emit_closed_state() %d(iHead), %d(iClosed)*/
316
- }
317
- if( iClosed<0 ){
318
- @ <div class="warning forumpost-closure-warning">\
319
- @ This post is CLOSED via a parent post. %s(zCommon)\
320
- @ </div>
321
- return;
322
- }
323
- else if( iClosed==0 ){
324
- if( permClose==0 ) return;
325
- @ <div class="warning forumpost-closure-warning">
326
- @ <form method="post" action="%R/forumpost_close">
327
- @ <input type="hidden" name="fpid" value="%z(rid_to_uuid(iHead))" />
328
- @ <input type="submit" value="CLOSE this post and its responses" />
329
- @ <span>%s(zCommon)</span>
330
- @ <span>This does NOT save any pending changes in
331
- @ the editor!</span>
332
- @ </form></div>
333
- return;
334
- }
335
- assert( iClosed>0 );
336
- /* Only show the "unlock" option on a post which is actually
337
- ** closed, not on a post which inherits that state. */
338
- @ <div class="warning forumpost-closure-warning">\
339
- @ This post is CLOSED. %s(zCommon)
340
- if( permClose ){
341
- @ <form method="post" action="%R/forumpost_reopen">
342
- @ <input type="hidden" name="fpid" value="%z(rid_to_uuid(iHead))" />
343
- @ <input type="submit" value="Re-open this post and its responses" />
344
- @ <span>This does NOT save any pending changes in
345
- @ the editor!</span>
346
- @ </form>
347
- }
348
- @ </div>
293
+ }
349294
}
350295
351296
/*
352297
** Emits a warning that the current forum post is CLOSED and can only
353298
** be edited or responded to by an administrator. */
@@ -1726,11 +1671,10 @@
17261671
if( pPost->zThreadTitle ) zTitle = "";
17271672
style_header("Delete %s", zTitle ? "Post" : "Reply");
17281673
@ <h1>Original Post:</h1>
17291674
forum_render(pPost->zThreadTitle, pPost->zMimetype, pPost->zWiki,
17301675
"forumEdit", 1);
1731
- forumpost_emit_closed_state(fpid, iClosed);
17321676
@ <h1>Change Into:</h1>
17331677
forum_render(zTitle, zMimetype, zContent,"forumEdit", 1);
17341678
@ <form action="%R/forume2" method="POST">
17351679
@ <input type="hidden" name="fpid" value="%h(P("fpid"))">
17361680
@ <input type="hidden" name="nullout" value="1">
@@ -1803,14 +1747,10 @@
18031747
}
18041748
}
18051749
forum_render_debug_options();
18061750
@ </form>
18071751
forum_emit_js();
1808
- if( bReply==0 ){
1809
- /* Do not show CLOSE option for new posts/responses. */
1810
- forumpost_emit_closed_state(fpid, iClosed);
1811
- }
18121752
style_finish_page();
18131753
}
18141754
18151755
/*
18161756
** WEBPAGE: setup_forum
18171757
--- src/forum.c
+++ src/forum.c
@@ -288,66 +288,11 @@
288 return permClose = 1;
289 }else if( g.perm.ModForum ){
290 return permClose = forumpost_close_policy()>0 ? -1 : 0;
291 }else{
292 return permClose = 0;
293 }
294 }
295
296 /*
297 ** If iClosed is true and the current user forumpost-close privileges,
298 ** this renders either a checkbox to unlock forum post fpid (if
299 ** iClosed>0) or a SPAN.warning element that the given post inherits
300 ** the CLOSED status from a parent post (if iClosed<0). If neither of
301 ** the initial conditions is true, this is a no-op.
302 */
303 static void forumpost_emit_closed_state(int fpid, int iClosed){
304 const char *zCommon;
305 int iHead = forumpost_head_rid(fpid);
306 const int permClose = forumpost_may_close();
307
308 zCommon = forumpost_close_policy()==0
309 ? "Admins may close or re-open posts, or respond to closed posts."
310 : "Admins or moderators "
311 "may close or re-open posts, or respond to closed posts.";
312 /*@ forumpost_emit_closed_state(%d(fpid), %d(iClosed))<br/>*/
313 if( iHead != fpid ){
314 iClosed = forum_rid_is_closed(iHead, 1);
315 /*@ forumpost_emit_closed_state() %d(iHead), %d(iClosed)*/
316 }
317 if( iClosed<0 ){
318 @ <div class="warning forumpost-closure-warning">\
319 @ This post is CLOSED via a parent post. %s(zCommon)\
320 @ </div>
321 return;
322 }
323 else if( iClosed==0 ){
324 if( permClose==0 ) return;
325 @ <div class="warning forumpost-closure-warning">
326 @ <form method="post" action="%R/forumpost_close">
327 @ <input type="hidden" name="fpid" value="%z(rid_to_uuid(iHead))" />
328 @ <input type="submit" value="CLOSE this post and its responses" />
329 @ <span>%s(zCommon)</span>
330 @ <span>This does NOT save any pending changes in
331 @ the editor!</span>
332 @ </form></div>
333 return;
334 }
335 assert( iClosed>0 );
336 /* Only show the "unlock" option on a post which is actually
337 ** closed, not on a post which inherits that state. */
338 @ <div class="warning forumpost-closure-warning">\
339 @ This post is CLOSED. %s(zCommon)
340 if( permClose ){
341 @ <form method="post" action="%R/forumpost_reopen">
342 @ <input type="hidden" name="fpid" value="%z(rid_to_uuid(iHead))" />
343 @ <input type="submit" value="Re-open this post and its responses" />
344 @ <span>This does NOT save any pending changes in
345 @ the editor!</span>
346 @ </form>
347 }
348 @ </div>
349 }
350
351 /*
352 ** Emits a warning that the current forum post is CLOSED and can only
353 ** be edited or responded to by an administrator. */
@@ -1726,11 +1671,10 @@
1726 if( pPost->zThreadTitle ) zTitle = "";
1727 style_header("Delete %s", zTitle ? "Post" : "Reply");
1728 @ <h1>Original Post:</h1>
1729 forum_render(pPost->zThreadTitle, pPost->zMimetype, pPost->zWiki,
1730 "forumEdit", 1);
1731 forumpost_emit_closed_state(fpid, iClosed);
1732 @ <h1>Change Into:</h1>
1733 forum_render(zTitle, zMimetype, zContent,"forumEdit", 1);
1734 @ <form action="%R/forume2" method="POST">
1735 @ <input type="hidden" name="fpid" value="%h(P("fpid"))">
1736 @ <input type="hidden" name="nullout" value="1">
@@ -1803,14 +1747,10 @@
1803 }
1804 }
1805 forum_render_debug_options();
1806 @ </form>
1807 forum_emit_js();
1808 if( bReply==0 ){
1809 /* Do not show CLOSE option for new posts/responses. */
1810 forumpost_emit_closed_state(fpid, iClosed);
1811 }
1812 style_finish_page();
1813 }
1814
1815 /*
1816 ** WEBPAGE: setup_forum
1817
--- src/forum.c
+++ src/forum.c
@@ -288,66 +288,11 @@
288 return permClose = 1;
289 }else if( g.perm.ModForum ){
290 return permClose = forumpost_close_policy()>0 ? -1 : 0;
291 }else{
292 return permClose = 0;
293 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294 }
295
296 /*
297 ** Emits a warning that the current forum post is CLOSED and can only
298 ** be edited or responded to by an administrator. */
@@ -1726,11 +1671,10 @@
1671 if( pPost->zThreadTitle ) zTitle = "";
1672 style_header("Delete %s", zTitle ? "Post" : "Reply");
1673 @ <h1>Original Post:</h1>
1674 forum_render(pPost->zThreadTitle, pPost->zMimetype, pPost->zWiki,
1675 "forumEdit", 1);
 
1676 @ <h1>Change Into:</h1>
1677 forum_render(zTitle, zMimetype, zContent,"forumEdit", 1);
1678 @ <form action="%R/forume2" method="POST">
1679 @ <input type="hidden" name="fpid" value="%h(P("fpid"))">
1680 @ <input type="hidden" name="nullout" value="1">
@@ -1803,14 +1747,10 @@
1747 }
1748 }
1749 forum_render_debug_options();
1750 @ </form>
1751 forum_emit_js();
 
 
 
 
1752 style_finish_page();
1753 }
1754
1755 /*
1756 ** WEBPAGE: setup_forum
1757

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button