You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by sh...@apache.org on 2025/12/01 04:28:33 UTC

(answer) branch test updated (59b21984 -> d67c7e2c)

This is an automated email from the ASF dual-hosted git repository.

shuai pushed a change to branch test
in repository https://gitbox.apache.org/repos/asf/answer.git


    from 59b21984 fix: Optimization of request parameters
     add 666ab706 feat(ui): add min values for inputs and context-based keyboards for inputs
     add 157dbfd0 feat(ui): add types, logic and defaults for min, max value of input component of form
     add 54e602c5 fix(ui): refactor number input props (min,max)
     add 9a7eb0f4 fix(service): set default language to "en_US" if invalid language is provided
     add 09b6b34b fix(comment): decode CommentID using DeShortID for consistency
     add a15dd415 refactor(internal): compile regex once while clearing text
     add ce053ccf fix: multi byte run boundary for cut long title
     add 0777291e fix(ui): null pointer access if get branding fails
     add bc629db1 chore(deps): bump mockgen to 0.6.0 for go1.25 support
     add fc2a1d8a fix(answer): update QuestionID handling in answer update process
     new 5c2c63f8 Merge branch 'dev' into test
     new b54e734e fix: footer layout adjustment
     new d67c7e2c fix: footer layout adjustment

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Makefile                                           |  4 +-
 README.md                                          |  2 +-
 cmd/wire_gen.go                                    |  8 +--
 docs/docs.go                                       | 32 ++++++++----
 docs/swagger.json                                  | 32 ++++++++----
 docs/swagger.yaml                                  | 28 ++++++----
 go.mod                                             | 14 ++---
 go.sum                                             | 36 ++++++-------
 i18n/en_US.yaml                                    |  5 +-
 i18n/zh_CN.yaml                                    |  4 +-
 internal/controller/answer_controller.go           |  1 -
 internal/controller/comment_controller.go          |  1 +
 internal/router/ui.go                              |  6 +--
 .../siteinfo_service_test.go => router/ui_test.go} | 48 +++++++++--------
 internal/schema/answer_schema.go                   |  1 -
 internal/service/content/answer_service.go         | 19 ++++---
 internal/service/siteinfo/siteinfo_service.go      |  6 +--
 pkg/htmltext/htmltext.go                           | 60 +++++++++++-----------
 pkg/htmltext/htmltext_test.go                      | 22 ++++++++
 ui/src/common/sideNavLayout.scss                   | 10 ++--
 ui/src/components/Footer/index.tsx                 | 56 ++++++++++----------
 ui/src/components/SchemaForm/components/Input.tsx  | 21 ++++++++
 ui/src/components/SchemaForm/index.tsx             | 12 +++++
 ui/src/components/SchemaForm/types.ts              | 12 +++++
 ui/src/index.scss                                  |  2 -
 ui/src/pages/Admin/Privileges/index.tsx            |  2 +
 ui/src/pages/Admin/Write/index.tsx                 | 10 ++++
 ui/src/pages/Admin/index.tsx                       |  8 ++-
 ui/src/pages/SideNavLayout/index.tsx               |  8 ++-
 ui/template/footer.html                            | 34 ++++++------
 30 files changed, 321 insertions(+), 183 deletions(-)
 copy internal/{service/siteinfo_common/siteinfo_service_test.go => router/ui_test.go} (56%)


(answer) 03/03: fix: footer layout adjustment

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/answer.git

commit d67c7e2c60c8e8ceb6919dcbfbc72fa114e17218
Author: shuai <li...@sifou.com>
AuthorDate: Mon Dec 1 12:28:16 2025 +0800

    fix: footer layout adjustment
---
 ui/src/common/sideNavLayout.scss     | 10 ++++++----
 ui/src/pages/Admin/index.tsx         |  8 ++++++--
 ui/src/pages/SideNavLayout/index.tsx |  7 +++++--
 ui/template/footer.html              | 34 +++++++++++++++++++---------------
 4 files changed, 36 insertions(+), 23 deletions(-)

diff --git a/ui/src/common/sideNavLayout.scss b/ui/src/common/sideNavLayout.scss
index 0308c167..53194759 100644
--- a/ui/src/common/sideNavLayout.scss
+++ b/ui/src/common/sideNavLayout.scss
@@ -16,13 +16,15 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
-.answer-container {
+.main-mx-with {
   width: 100%;
-  min-height: calc(100vh - 95px - 62px);
   max-width: 1072px;
 }
 
+.answer-container {
+  min-height: calc(100vh - 53px - 62px);
+}
+
 .page-right-side {
   flex: none;
   width: 300px;
@@ -31,7 +33,7 @@
 
 // lg
 @media screen and (max-width: 1199.9px) {
-  .answer-container {
+  .main-mx-with {
     padding-left: 12px;
     padding-right: 12px;
   }
diff --git a/ui/src/pages/Admin/index.tsx b/ui/src/pages/Admin/index.tsx
index 1c89333c..27503296 100644
--- a/ui/src/pages/Admin/index.tsx
+++ b/ui/src/pages/Admin/index.tsx
@@ -54,7 +54,7 @@ const Index: FC = () => {
       </div>
       <div className="flex-fill w-100">
         <div className="d-flex justify-content-center px-0 px-md-4">
-          <div className="answer-container">
+          <div className="answer-container main-mx-with">
             <Row className="py-4">
               <Col className="page-main flex-auto">
                 <Outlet />
@@ -65,7 +65,11 @@ const Index: FC = () => {
             </Row>
           </div>
         </div>
-        <Footer />
+        <div className="d-flex justify-content-center px-0 px-md-4">
+          <div className="main-mx-with">
+            <Footer />
+          </div>
+        </div>
       </div>
     </div>
   );
diff --git a/ui/src/pages/SideNavLayout/index.tsx b/ui/src/pages/SideNavLayout/index.tsx
index 3ace2165..907b9b28 100644
--- a/ui/src/pages/SideNavLayout/index.tsx
+++ b/ui/src/pages/SideNavLayout/index.tsx
@@ -34,9 +34,12 @@ const Index: FC = () => {
       </div>
       <div className="flex-fill w-100 overflow-x-hidden">
         <div className="d-flex justify-content-center px-0 px-md-4">
-          <div className="answer-container">
+          <div className="answer-container main-mx-with">
             <Outlet />
-
+          </div>
+        </div>
+        <div className="d-flex justify-content-center">
+          <div className="main-mx-with">
             <Footer />
           </div>
         </div>
diff --git a/ui/template/footer.html b/ui/template/footer.html
index c5e97736..97ba72ba 100644
--- a/ui/template/footer.html
+++ b/ui/template/footer.html
@@ -19,21 +19,25 @@
 
 -->
 {{define "footer"}}
-        <footer class="py-3 bg-light w-100">
-          <p class="text-center mb-0 small">
-            <a class="me-3" href="{{$.baseURL}}/tos" data-discover="true">
-              {{translator $.language "ui.admin.legal.terms_of_service.label"}}
-            </a>
-            <a href="{{$.baseURL}}/privacy" data-discover="true">
-              {{translator $.language "ui.admin.legal.privacy_policy.label"}}
-            </a>
-          </p>
-          <p class="text-center mb-0 small text-secondary">
-            {{$cc := (join " " .siteinfo.Year .siteinfo.General.Name) -}}
-            {{- $ft := translator $.language "ui.footer.build_on" "cc" $cc -}}
-            {{templateHTML (replaceHTMLTag $ft "<a href=\"https://answer.apache.org/\" target=\"_blank\"> Answer </a>")}}
-          </p>
-        </footer>
+        <div class="main-mx-with">
+          <div class="row">
+            <footer class="py-3 d-flex flex-wrap align-items-center justify-content-between text-secondary small">
+              <div class="d-flex align-items-center">
+                {{$cc := (join " " .siteinfo.General.Name .siteinfo.Year)}}
+                <div className="me-3">{{- $ft := translator $.language "ui.footer.build_on" "cc" $cc -}}</div>
+                <a class="me-3" href="{{$.baseURL}}/tos" data-discover="true" class="link-secondary">
+                  {{translator $.language "ui.admin.legal.terms_of_service.label"}}
+                </a>
+                <a href="{{$.baseURL}}/privacy" data-discover="true" class="link-secondary">
+                  {{translator $.language "ui.admin.legal.privacy_policy.label"}}
+                </a>
+              </div>
+              <div class="text-center mb-0 small text-secondary link-secondary">
+                {{templateHTML (replaceHTMLTag $ft "<a href=\"https://answer.apache.org/\" target=\"_blank\"> Answer </a>")}}
+              </div>
+            </footer>
+          </div>
+        </div>
       </div>
     </div>
   </div>


(answer) 02/03: fix: footer layout adjustment

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/answer.git

commit b54e734e60b5553353f6f1313072cf9d4be8165b
Author: shuai <li...@sifou.com>
AuthorDate: Mon Dec 1 11:37:48 2025 +0800

    fix: footer layout adjustment
---
 i18n/en_US.yaml                      |  5 ++--
 i18n/zh_CN.yaml                      |  4 +--
 ui/src/components/Footer/index.tsx   | 56 +++++++++++++++++++-----------------
 ui/src/index.scss                    |  2 --
 ui/src/pages/SideNavLayout/index.tsx |  3 +-
 5 files changed, 36 insertions(+), 34 deletions(-)

diff --git a/i18n/en_US.yaml b/i18n/en_US.yaml
index 40017b75..b9cbccfa 100644
--- a/i18n/en_US.yaml
+++ b/i18n/en_US.yaml
@@ -1208,9 +1208,7 @@ ui:
     search:
       placeholder: Search
   footer:
-    build_on: >-
-      Powered by <1> Apache Answer </1>- the open-source software that powers Q&A
-      communities.<br />Made with love © {{cc}}.
+    build_on: Powered by <1> Apache Answer </1>
   upload_img:
     name: Change
     loading: loading...
@@ -1807,6 +1805,7 @@ ui:
     branding: Branding
     legal: Legal
     write: Write
+    terms: Terms
     tos: Terms of Service
     privacy: Privacy
     seo: SEO
diff --git a/i18n/zh_CN.yaml b/i18n/zh_CN.yaml
index 0f7a2515..9d6605a1 100644
--- a/i18n/zh_CN.yaml
+++ b/i18n/zh_CN.yaml
@@ -1190,8 +1190,7 @@ ui:
     search:
       placeholder: 搜索
   footer:
-    build_on: >-
-      由 <1>Apache Answer</1> 提供动力 - 驱动问答社区的开源软件。<br />用爱制造 © {{cc}}.
+    build_on: 由 <1>Apache Answer</1> 提供动力
   upload_img:
     name: 更改
     loading: 加载中...
@@ -1768,6 +1767,7 @@ ui:
     branding: 品牌
     legal: 法律条款
     write: 撰写
+    terms: 服务条款
     tos: 服务条款
     privacy: 隐私政策
     seo: SEO
diff --git a/ui/src/components/Footer/index.tsx b/ui/src/components/Footer/index.tsx
index ad6e2755..340264b9 100644
--- a/ui/src/components/Footer/index.tsx
+++ b/ui/src/components/Footer/index.tsx
@@ -21,6 +21,7 @@ import React from 'react';
 import { Link } from 'react-router-dom';
 import { Trans, useTranslation } from 'react-i18next';
 
+import Row from 'react-bootstrap/Row';
 import dayjs from 'dayjs';
 
 import { siteInfoStore } from '@/stores';
@@ -29,34 +30,37 @@ const Index = () => {
   const { t } = useTranslation('translation', { keyPrefix: 'footer' }); // Scoped translations for footer
   const fullYear = dayjs().format('YYYY');
   const siteName = siteInfoStore((state) => state.siteInfo.name);
-  const cc = `${fullYear} ${siteName}`;
+  const cc = `${siteName} © ${fullYear}`;
 
   return (
-    <footer className="py-3 w-100">
-      <p className="text-center mb-0 small">
-        {/* Link to Terms of Service with right margin */}
-        <Link to="/tos" className="me-3">
-          {t('label', { keyPrefix: 'admin.legal.terms_of_service' })}
-        </Link>
-
-        {/* Link to Privacy Policy with right margin for spacing */}
-        <Link to="/privacy">
-          {t('label', { keyPrefix: 'admin.legal.privacy_policy' })}
-        </Link>
-      </p>
-      <p className="text-center mb-0 small">
-        <Trans i18nKey="footer.build_on" values={{ cc }}>
-          Powered by
-          {/* eslint-disable-next-line react/jsx-no-target-blank */}
-          <a href="https://answer.apache.org" target="_blank">
-            Apache Answer
-          </a>
-          - the open-source software that powers Q&A communities.
-          <br />
-          Made with love. © 2022 Answer.
-        </Trans>
-      </p>
-    </footer>
+    <Row>
+      <footer className="py-3 d-flex flex-wrap align-items-center justify-content-between text-secondary small">
+        <div className="d-flex align-items-center">
+          <div className="me-3">{cc}</div>
+
+          <Link to="/tos" className="me-3 link-secondary">
+            {t('terms', { keyPrefix: 'nav_menus' })}
+          </Link>
+
+          {/* Link to Privacy Policy with right margin for spacing */}
+          <Link to="/privacy" className="link-secondary">
+            {t('privacy', { keyPrefix: 'nav_menus' })}
+          </Link>
+        </div>
+        <div>
+          <Trans i18nKey="footer.build_on" values={{ cc }}>
+            Powered by
+            <a
+              href="https://answer.apache.org"
+              target="_blank"
+              className="link-secondary"
+              rel="noreferrer">
+              Apache Answer
+            </a>
+          </Trans>
+        </div>
+      </footer>
+    </Row>
   );
 };
 
diff --git a/ui/src/index.scss b/ui/src/index.scss
index 92f143d5..13526113 100644
--- a/ui/src/index.scss
+++ b/ui/src/index.scss
@@ -127,8 +127,6 @@ img[src=''] {
   margin-top: auto !important;
   padding-bottom: constant(safe-area-inset-bottom);
   padding-bottom: env(safe-area-inset-bottom);
-  padding-left: 12px !important;
-  padding-right: 12px !important;
 }
 
 .bg-f5 {
diff --git a/ui/src/pages/SideNavLayout/index.tsx b/ui/src/pages/SideNavLayout/index.tsx
index 0db8593e..3ace2165 100644
--- a/ui/src/pages/SideNavLayout/index.tsx
+++ b/ui/src/pages/SideNavLayout/index.tsx
@@ -36,9 +36,10 @@ const Index: FC = () => {
         <div className="d-flex justify-content-center px-0 px-md-4">
           <div className="answer-container">
             <Outlet />
+
+            <Footer />
           </div>
         </div>
-        <Footer />
       </div>
     </div>
   );


(answer) 01/03: Merge branch 'dev' into test

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/answer.git

commit 5c2c63f8526b2f0fdc836a2fba71938fbec2e419
Merge: 59b21984 fc2a1d8a
Author: shuai <li...@sifou.com>
AuthorDate: Mon Dec 1 11:00:11 2025 +0800

    Merge branch 'dev' into test

 Makefile                                          |  4 +-
 README.md                                         |  2 +-
 cmd/wire_gen.go                                   |  8 +--
 docs/docs.go                                      | 32 ++++++++----
 docs/swagger.json                                 | 32 ++++++++----
 docs/swagger.yaml                                 | 28 +++++++----
 go.mod                                            | 14 +++---
 go.sum                                            | 36 +++++++-------
 internal/controller/answer_controller.go          |  1 -
 internal/controller/comment_controller.go         |  1 +
 internal/router/ui.go                             |  6 +--
 internal/router/ui_test.go                        | 59 ++++++++++++++++++++++
 internal/schema/answer_schema.go                  |  1 -
 internal/service/content/answer_service.go        | 19 ++++---
 internal/service/siteinfo/siteinfo_service.go     |  6 +--
 pkg/htmltext/htmltext.go                          | 60 ++++++++++++-----------
 pkg/htmltext/htmltext_test.go                     | 22 +++++++++
 ui/src/components/SchemaForm/components/Input.tsx | 21 ++++++++
 ui/src/components/SchemaForm/index.tsx            | 12 +++++
 ui/src/components/SchemaForm/types.ts             | 12 +++++
 ui/src/pages/Admin/Privileges/index.tsx           |  2 +
 ui/src/pages/Admin/Write/index.tsx                | 10 ++++
 22 files changed, 281 insertions(+), 107 deletions(-)