From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by gnuweeb.org (Postfix) with ESMTPS id CC2CC7E5AE for ; Sun, 12 Jun 2022 12:06:35 +0000 (UTC) Authentication-Results: gnuweeb.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=EAd6YZiP; dkim-atps=neutral Received: by mail-lf1-f48.google.com with SMTP id be31so4931427lfb.10 for ; Sun, 12 Jun 2022 05:06:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to:cc; bh=OpXtxmSuvr78xOEY82h8fx+sA8NoFXTlZJDiy70zQBk=; b=EAd6YZiPdgSLs6eGYxVbHE51MaQNcIitli7lGUk8cXgW/TziQjTAiGpN7mXp+mKXAV DsFvBq1OvPMqP8eK8mTGwci0qiaVccypxbs+u2edDGWaJNJpFXDo1lBk1tvkC+MtyHvA MMue0GhDNSTuWYEAIoODwEGzkMtwcJr4v5iMNhnlEOKrFzjcVchJfNfs7ylaMJjDZ1py 02dkXYFvHL+tQnUdUctZQa7diNJZ8wqEoN1fRsJ771Jfab5miXmlwXL6yEMfGjhEiYOM abpM2iWFk64jCZpxyiH0Qdxx1yhAkua4RkZ4BRMsKnQqP5XzFBwv2Zo5X5ar0g51RWLr MNdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=OpXtxmSuvr78xOEY82h8fx+sA8NoFXTlZJDiy70zQBk=; b=TrHRbsVWV5RMXmGQnUhtaeoTiaKEcVaCSNQT1CbkXAUgNEZBwjVA3khJ89bG/4EDGd ULdDQ4vqb1gluUIG9CGcrUiIixMsozcWEYmpdOyDsjtnWqvLT3Mn4rGZ9p3E/xP+0mue R1KaA4oIoF+gKqFIh+pVRguSqEj8Uc8rtWS3mpH5pmAlL519G4x7mFB5CdJR2Sfx8tIJ +ZqP0jzjb3JEYt01PdogRNbZ/PejdPB+zMr3tW8mPu/1k3LXNeEsj4g5tDSjJfk8/Ci6 OsgoNfBvEN0jsKVXFZnb+xyzAzKrI2ju6Dn09GbcYc+vw+jP2eeKKD2hFPnxlhG3Ruv4 L+VA== X-Gm-Message-State: AOAM530miVD926+1W8wF0HHQ/TVJ7HK8gTGdHJe+sbDETAbwMUBT0+2p 8kvh2FNTW9z96eoc3rQoYc6o9+FcuOCp3ZFp+7U= X-Google-Smtp-Source: ABdhPJxg1b4Ys+VhwKI2FNpDfxJjIneUNXVvRdbEmRcPtXu8F5aA0Va9zGcNmRDJQcok9KXF1C8Nm2YzuiFGKWNrBQM= X-Received: by 2002:a05:6512:1115:b0:479:36b5:b8e2 with SMTP id l21-20020a056512111500b0047936b5b8e2mr22620346lfg.522.1655035593693; Sun, 12 Jun 2022 05:06:33 -0700 (PDT) MIME-Version: 1.0 From: Alviro Iskandar Setiawan Date: Sun, 12 Jun 2022 19:06:22 +0700 Message-ID: Subject: [PATCH buubuu v1 00/10] Frontend updates To: "Fernanda Ma'rouf" , Akiekano Cc: "GNU/Weeb Mailing List" , Ammar Faizi , Ammar Alifian Fahdan , Alviro Iskandar Setiawan , Irvan Malik Azantha , Khoiri , Muhammad Irvan Hakim Content-Type: text/plain; charset="UTF-8" List-Id: Hi, This series contains frontend updates for buubuu, it has been deploy-tested with onion domain ( See: https://fb.com133993429248737 ). There are 10 patches in this series. Please review! # Patch 1 We will have many JavaScript helper functions that will be used all over the place. Create a single file that we can include this from all HTML pages to reduce the burden of rewriting those functions again and again. # Patch 2 Create assets/common.css to place common used CSS rules. We will include this CSS file from many places later. # Patch 3 A previous patch creates assets/common.js which is intended to be loaded from all HTML pages where they need our common JavaScript function helpers. Use this JavaScript file instead of redefining the same function again and again. # Patch 4 The index.html file was just a garbage, let's craft something better to allow user to at least navigate to login and register page. # Patch 5 This is just a preparation to add the index page in authController. Just load the index.html from this method when we receive HTTP GET request. Nothing complex here in particular. # Patch 6 In order to make the static assets available via HTTP URL, create a new route for static assets. We will use it to include JavaScript and CSS files from the HTML. # Patch 7 Make the root URI show our index page. # Patch 8 This makes sure we load the CSS and JS first before the HTML. While in there, also fix up the tag placement in register.html. And also, remove unnecessary indentation. # Patch 9 This adds several links to allow user to navigate between pages. Such as, from login to register, register to login, and from they both to index. # Patch 10 Add meta "og:*" tags to make the Facebook link preview beautiful. tq Signed-off-by: Alviro Iskandar Setiawan --- Alviro Iskandar Setiawan (10): assets: Create common.js to place common used helpers assets: Create common.css to place common used CSS rules view: Avoid redefining `get_eid()` function view: Rework index.html view controller: Crate Index() method in authController server: Load `./assets` directory for `/assets` route server: Add route '/' to load the Index view: Put the style and JS preload script to top view: Allow user to navigate between pages view: index: Add meta tags for Facebook link preview assets/bgp.jpg | Bin 0 -> 159144 bytes assets/common.css | 13 +++++ assets/common.js | 12 +++++ controller/auth-controller.go | 8 +++ server.go | 2 + view/index.html | 43 +++++++++++++--- view/login.html | 74 ++++++++++++++------------- view/register.html | 92 ++++++++++++++++++---------------- 8 files changed, 160 insertions(+), 84 deletions(-) create mode 100644 assets/bgp.jpg create mode 100644 assets/common.css create mode 100644 assets/common.js base-commit: 809ef478a7161c3d5298123d1ac1433f5290425a -- Alviro Iskandar Setiawan