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).

1  
!7
2  
3  
concept MemberCompany {
4  
  S productName;
5  
  S description;
6  
  S funding;
7  
  S raised;
8  
  int payZonesSubscribed;
9  
  S ends;
10  
}
11  
12  
cm Pays5 > GazelleExamples {
13  
  void init {
14  
    super.init();
15  
    botName = heading = adminName = "PAYS5";
16  
    templateID = #1030430;
17  
    cssID = "396";
18  
    set enableVars;
19  
    set enableAvatars;
20  
    set showTalkToBotLink;
21  
    set enableRadioButtons;
22  
    set quickRadioButtons;
23  
    set newDialogAfterWindowClosed;
24  
    set showJoiningConversation;
25  
    timeZone = nyTimeZone_string();
26  
    unset phoneNumberSpecialInputField;
27  
  }
28  
  
29  
  L<Class> crudClasses(Req req) {
30  
    ret listPlus(super.crudClasses(req), MemberCompany);
31  
  }
32  
  
33  
  Set<Class> hiddenCrudClasses() { ret litset(); }
34  
  
35  
  L<Class> botCmdClasses() {
36  
    ret dynNewBot2_botCmdClasses();
37  
  }
38  
  
39  
  S authFormHeading() {
40  
    ret h3("pays5.com");
41  
  }
42  
  
43  
  void makeFramer(Req req) {
44  
    super.makeFramer(req);
45  
      req.framer.renderTitle = () -> h1(ahref(baseLink + "/", "Pays5.com")
46  
      + " " + htmlEncode2(req.framer.title));
47  
  }
48  
  
49  
  S calcVar(Conversation conv, S var) {
50  
    if (eqic(var, "hasUserName"))
51  
      ret str(nempty(calcVar(conv, "userName")));
52  
    ret super.calcVar(conv, var);
53  
  }
54  
  
55  
  S cssURL() {
56  
    ret "https://pays5.com/text/" + cssID;
57  
  }
58  
  
59  
  O serveOtherPage(Req req) {
60  
    if (eqOptSlash(req.uri, "/companies")) {
61  
      req.markNoSpam();
62  
      S template = getText(eq(req.params.get("dev"), "1") ? 2961 : 2559);
63  
      SmoothHTMLTemplater templater = new(template);
64  
      
65  
      templater.entriesByType.put("company", map(list(MemberCompany),
66  
        x -> templater.mapToEntry(litcimap(
67  
          "Wash  pebbles" := x.productName,
68  
          "spherical hydrogel sanitiser" := x.description,
69  
          "$ 435,000" := x.funding,
70  
          "% 1.245" := x.raised,
71  
          "6,432" := x.payZonesSubscribed,
72  
          "34 days" := x.ends
73  
        ))));
74  
75  
      ret templater.render();
76  
    }
77  
    
78  
    ret super.serveOtherPage(req);
79  
  }
80  
  
81  
  bool allowedTemplateID(S id) {
82  
    ret sameSnippetID(id, #1030498);
83  
  }
84  
} // end of module
85  
86  
!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: 455 / 1886
Version history: 34 change(s)
Referenced in: [show references]