Просмотр исходного кода

Merge pull request #3987 from weseek/feat/4836-6632-display-tos-page

Feat/4836 6632 display tos page
itizawa 4 лет назад
Родитель
Сommit
8eaec77362

+ 20 - 0
packages/slackbot-proxy/src/controllers/term.ts

@@ -0,0 +1,20 @@
+import { Controller, PlatformRouter } from '@tsed/common';
+import { Request, Response } from 'express';
+
+const isOfficialMode = process.env.OFFICIAL_MODE === 'true';
+
+@Controller('/term')
+export class TermCtrl {
+
+  constructor(router: PlatformRouter) {
+    if (isOfficialMode) {
+      router.get('/', this.getTerm);
+    }
+  }
+
+  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
+  getTerm(req: Request, res: Response): string|void {
+    res.render('term.ejs');
+  }
+
+}

+ 7 - 0
packages/slackbot-proxy/src/views/term.ejs

@@ -0,0 +1,7 @@
+<head>
+  <meta name="viewport" content="width=device-width,initial-scale=1">
+</head>
+
+<body style="max-width: 600px; padding-top:100px; margin: 0 auto;">
+  <h1 style="text-align:center;">Terms of Service </h1>
+</body>

+ 7 - 2
packages/slackbot-proxy/src/views/top.ejs

@@ -7,14 +7,19 @@
   <div>
     <img height="300" width="300" alt="GROWi Bot" src="/images/growi-bot.png" />
   </div>
-  <div style="display:flex; justify-content: space-around; max-width: 500px; margin:30px auto;">
-    <a href=<%- url %>>
+  <div style="margin-top:24px;">
+    <a  href=<%- url %>>
       <img alt="Add to Slack" height="40" width="139" src="/images/add-to-slack.png"/>
     </a>
+  </div>
+  <div style="display:flex; justify-content: space-around; max-width: 500px; margin:30px auto;">
     <% if (isOfficialMode) { %>
       <a href="/privacy">
         Privacy Policy
       </a>
+      <a href="/term">
+        Term of Service
+      </a>
     <% } %>
   </div>
 </body>