chamesle

chamesle.org: the site of Chamesle, a small Linux distribution
git clone https://github.com/tortr-rs/chamesle
Log | Files | Refs | README

submit.html (3937B)


      1 <!doctype html>
      2 <html lang="en">
      3 <head>
      4 <meta charset="utf-8">
      5 <meta name="viewport" content="width=device-width, initial-scale=1">
      6 <title>New post - Chamesle</title>
      7 <meta name="robots" content="noindex">
      8 <link rel="stylesheet" href="style.css?25">
      9 <link rel="icon" href="img/logo.png">
     10 </head>
     11 <body>
     12 
     13 <div id="page">
     14 
     15 <div id="top">
     16 <h1><a href="./"><img src="img/banner.png" alt="Chamesle Linux" width="223" height="56"></a></h1>
     17 </div>
     18 
     19 <div id="nav">
     20 <a href="./">Home</a> |
     21 <a href="download.html">Download</a> |
     22 <a href="docs.html">Handbook</a> |
     23 <a href="packages.html">Packages</a> |
     24 <a href="new.html">News</a> |
     25 <b>Board</b> |
     26 <a href="chat.html">Chat</a> |
     27 <a href="source.html">Source</a> |
     28 <a href="https://x22.chamesle.org/">X22</a> |
     29 <a href="https://github.com/tortr-rs/mag">mag</a> |
     30 <a href="about.html">About</a>
     31 </div>
     32 
     33 <main>
     34 <p class="small"><a href="board.html">&larr; Board</a></p>
     35 <h2>New post</h2>
     36 
     37 <form class="form" id="form">
     38   <label for="cat">Where does it go?</label>
     39   <select id="cat">
     40     <option value="q-a">Help</option>
     41     <option value="show-and-tell">Show your desktop</option>
     42     <option value="ideas">Ideas</option>
     43     <option value="general" selected>General</option>
     44   </select>
     45   <label for="title">Title</label>
     46   <input id="title" maxlength="120" required placeholder="What's it about?">
     47   <p><button class="button" type="submit">Next</button></p>
     48 </form>
     49 <div id="write" hidden>
     50   <p><b id="shown"></b></p>
     51   <p class="small">Write your post in the box below and send it. Log in with GitHub first if you haven't.</p>
     52   <div class="giscus" id="box"></div>
     53 </div>
     54 </main>
     55 
     56 <hr>
     57 <div id="foot">
     58 Something wrong on this page? Tell us on the <a href="board.html">board</a>.<br>
     59 Chamesle installs with <code>chamesle-install</code>, or by hand from the <a href="docs.html">handbook</a>.<br>
     60 <a href="https://ko-fi.com/L6N725GI1V">Ko-fi</a><br>
     61 <a href="#" id="edit-link">Edit text</a><br>
     62 $Date: 2026-11-14 $
     63 </div>
     64 
     65 </div>
     66 
     67 </main>
     68 
     69 <script>
     70 var CATS = {
     71   'q-a': ['Help', 'DIC_kwDOShHmjc4DJQSa', 'Q&A'],
     72   'show-and-tell': ['Show your desktop', 'DIC_kwDOShHmjc4DJQSc', 'Show and tell'],
     73   'ideas': ['Ideas', 'DIC_kwDOShHmjc4DJQSb', 'Ideas'],
     74   'general': ['General', 'DIC_kwDOShHmjc4DJQSZ', 'General'],
     75   'announcements': ['Announcements', 'DIC_kwDOShHmjc4DJQSY', 'Announcements']
     76 };
     77 function esc(s) { var d = document.createElement('div'); d.textContent = s || ''; return d.innerHTML; }
     78 function ago(t) {
     79   var s = (Date.now() - new Date(t)) / 1000;
     80   if (s < 3600) return Math.max(1, Math.round(s / 60)) + ' min ago';
     81   if (s < 86400) return Math.round(s / 3600) + ' h ago';
     82   if (s < 86400 * 30) return Math.round(s / 86400) + ' d ago';
     83   return new Date(t).toLocaleDateString();
     84 }
     85 function giscus(el, cat, mapping, term) {
     86   var s = document.createElement('script'), c = CATS[cat] || CATS.general;
     87   var a = {src: 'https://giscus.app/client.js', 'data-repo': 'tortr-rs/chamesle', 'data-repo-id': 'R_kgDOShHmjQ',
     88     'data-category': c[2], 'data-category-id': c[1], 'data-mapping': mapping, 'data-term': term, 'data-strict': '1',
     89     'data-reactions-enabled': '1', 'data-emit-metadata': '0', 'data-input-position': 'top',
     90     'data-theme': 'preferred_color_scheme', 'data-lang': 'en', crossorigin: 'anonymous', async: ''};
     91   for (var k in a) s.setAttribute(k, a[k]);
     92   el.appendChild(s);
     93 }
     94 
     95 document.getElementById('form').addEventListener('submit', function (e) {
     96   e.preventDefault();
     97   var title = document.getElementById('title').value.trim(), cat = document.getElementById('cat').value;
     98   if (!title) return;
     99   document.getElementById('form').hidden = true;
    100   document.getElementById('write').hidden = false;
    101   document.getElementById('shown').textContent = title;
    102   // giscus makes the discussion, titled like this, with the first message as the post
    103   giscus(document.getElementById('box'), cat, 'specific', title);
    104 });
    105 </script>
    106 <script src="edit.js"></script>
    107 </body>
    108 </html>