Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

86
LINES

< > BotCompany Repo | #1030422 // pays5.com [LIVE]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 1113K of libraries. Click here for Pure Java version (40739L/253K).

!7

concept MemberCompany {
  S productName;
  S description;
  S funding;
  S raised;
  int payZonesSubscribed;
  S ends;
}

cm Pays5 > GazelleExamples {
  void init {
    super.init();
    botName = heading = adminName = "PAYS5";
    templateID = #1030430;
    cssID = "396";
    set enableVars;
    set enableAvatars;
    set showTalkToBotLink;
    set enableRadioButtons;
    set quickRadioButtons;
    set newDialogAfterWindowClosed;
    set showJoiningConversation;
    timeZone = nyTimeZone_string();
    unset phoneNumberSpecialInputField;
  }
  
  L<Class> crudClasses(Req req) {
    ret listPlus(super.crudClasses(req), MemberCompany);
  }
  
  Set<Class> hiddenCrudClasses() { ret litset(); }
  
  L<Class> botCmdClasses() {
    ret dynNewBot2_botCmdClasses();
  }
  
  S authFormHeading() {
    ret h3("pays5.com");
  }
  
  void makeFramer(Req req) {
    super.makeFramer(req);
      req.framer.renderTitle = () -> h1(ahref(baseLink + "/", "Pays5.com")
      + " " + htmlEncode2(req.framer.title));
  }
  
  S calcVar(Conversation conv, S var) {
    if (eqic(var, "hasUserName"))
      ret str(nempty(calcVar(conv, "userName")));
    ret super.calcVar(conv, var);
  }
  
  S cssURL() {
    ret "https://pays5.com/text/" + cssID;
  }
  
  O serveOtherPage(Req req) {
    if (eqOptSlash(req.uri, "/companies")) {
      req.markNoSpam();
      S template = getText(eq(req.params.get("dev"), "1") ? 2961 : 2559);
      SmoothHTMLTemplater templater = new(template);
      
      templater.entriesByType.put("company", map(list(MemberCompany),
        x -> templater.mapToEntry(litcimap(
          "Wash  pebbles" := x.productName,
          "spherical hydrogel sanitiser" := x.description,
          "$ 435,000" := x.funding,
          "% 1.245" := x.raised,
          "6,432" := x.payZonesSubscribed,
          "34 days" := x.ends
        ))));

      ret templater.render();
    }
    
    ret super.serveOtherPage(req);
  }
  
  bool allowedTemplateID(S id) {
    ret sameSnippetID(id, #1030498);
  }
} // end of module

!include early #1029913 // gazelle.rocks

Author comment

Began life as a copy of #1029913

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030422
Snippet name: pays5.com [LIVE]
Eternal ID of this version: #1030422/35
Text MD5: 3a5c89ecc9b5f9f89ac95f639025c9f7
Transpilation MD5: bc91577a9dd5b2fb3448fb60a65cfd4c
Author: stefan
Category: javax
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-06 20:06:32
Source code size: 2158 bytes / 86 lines
Pitched / IR pitched: No / No
Views / Downloads: 375 / 1789
Version history: 34 change(s)
Referenced in: [show references]