Diff
Not logged in

Differences From Artifact [872627bd24]:

To Artifact [55c85a4788]:


53
54
55
56
57
58
59
60

61
62

63
64
65





66
67
68
69
70
71
72
53
54
55
56
57
58
59

60
61

62
63
64

65
66
67
68
69
70
71
72
73
74
75
76







-
+

-
+


-
+
+
+
+
+







    if( i>0 ){
      @ <hr>
    }
    i++;
    if( pPost->zThreadTitle ){
      @ <h1>%h(pPost->zThreadTitle)</h1>
    }
    @ <p>By %h(pPost->zUser) on %h(zDate)
    @ <p>By %h(pPost->zUser) on %h(zDate) (%d(fpid))
    if( fprev ){
      @ edit of %d(fprev) %h(pPost->azParent[0])
      @ edit of %d(fprev)
    }
    if( firt ){
      @ in reply to %d(firt) %h(pPost->zInReplyTo)
      @ reply to %d(firt)
    }
    if( g.perm.Debug ){
      @ <span class="debug">\
      @ <a href="%R/artifact/%h(zUuid)">raw artifact</a></span>
    }
    forum_render(pPost->zMimetype, pPost->zWiki);
    if( g.perm.WrForum ){
      int sameUser = login_is_individual()
                     && fossil_strcmp(pPost->zUser, g.zLogin)==0;
      int isPrivate = content_is_private(fpid);
      @ <p><form action="%R/forumedit" method="POST">
230
231
232
233
234
235
236
237
238
239

240
241
242
243
244
245
246
247
248
234
235
236
237
238
239
240

241

242


243
244
245
246
247
248
249







-

-
+
-
-







  mimetype_option_menu(zMimetype);
  @ <br><textarea name="content" class="wikiedit" cols="80" \
  @ rows="25" wrap="virtual">%h(zContent)</textarea><br>
}

/*
** WEBPAGE: forumnew
** WEBPAGE: test-forumnew
**
** Start a new forum thread.  The /test-forumnew works just like
** Start a new forum thread.
** /forumnew except that it provides additional controls for testing
** and debugging.
*/
void forumnew_page(void){
  const char *zTitle = PDT("title","");
  const char *zMimetype = PD("mimetype","text/x-fossil-wiki");
  const char *zContent = PDT("content","");
  login_check_credentials();
  if( !g.perm.WrForum ){
262
263
264
265
266
267
268
269

270

271

272
273
274

275
276
277
278
279
280
281
263
264
265
266
267
268
269

270
271
272

273
274
275
276
277
278
279
280
281
282
283
284







-
+

+
-
+



+







  forum_entry_widget(zTitle, zMimetype, zContent);
  @ <input type="submit" name="preview" value="Preview">
  if( P("preview") ){
    @ <input type="submit" name="submit" value="Submit">
  }else{
    @ <input type="submit" name="submit" value="Submit" disabled>
  }
  if( g.zPath[0]=='t' ){
  if( g.perm.Debug ){
    /* For the test-forumnew page add these extra debugging controls */
    @ <div class="debug">
    @ <br><label><input type="checkbox" name="dryrun" %s(PCK("dryrun"))> \
    @ <label><input type="checkbox" name="dryrun" %s(PCK("dryrun"))> \
    @ Dry run</label>
    @ <br><label><input type="checkbox" name="domod" %s(PCK("domod"))> \
    @ Require moderator approval</label>
    @ </div>
  }
  @ </form>
  style_footer();
}

/*
** WEBPAGE: forumreply
358
359
360
361
362
363
364
365
366
367









368
369
370
371
372
361
362
363
364
365
366
367



368
369
370
371
372
373
374
375
376
377
378
379
380
381







-
-
-
+
+
+
+
+
+
+
+
+





    @ <form action="%R/forumedit" method="POST">
    @ <input type="hidden" name="fpid" value="%h(P("fpid"))">
    @ <input type="hidden" name="reply" value="1">
    forum_entry_widget(0, zMimetype, zContent);
    @ <input type="submit" name="preview" value="Preview">
    if( P("preview") ){
      @ <input type="submit" name="submit" value="Submit">
      if( g.perm.Setup ){
        @ <input type="submit" name="submitdryrun" value="Dry Run">
      }
    }
    if( g.perm.Debug ){
      /* For the test-forumnew page add these extra debugging controls */
      @ <div class="debug">
      @ <label><input type="checkbox" name="dryrun" %s(PCK("dryrun"))> \
      @ Dry run</label>
      @ <br><label><input type="checkbox" name="domod" %s(PCK("domod"))> \
      @ Require moderator approval</label>
      @ </div>
    }
    @ </form>
  }
  style_footer();
}