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

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


The following commit(s) were added to refs/heads/ui-optimization by this push:
     new 91f831a0 fix: Optimize template code
91f831a0 is described below

commit 91f831a02a9c8ad2917553996c051210673400f7
Author: shuai <[email protected]>
AuthorDate: Mon Apr 7 15:56:49 2025 +0800

    fix: Optimize template code
---
 ui/template/question.html | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/ui/template/question.html b/ui/template/question.html
index 7680e705..f8aff896 100644
--- a/ui/template/question.html
+++ b/ui/template/question.html
@@ -53,9 +53,9 @@
 
               <h5 class="text-wrap text-break">
                 {{if $.useTitle }}
-                <a class="link-dark d-block" 
href="{{$.baseURL}}/questions/{{.ID}}/{{urlTitle .Title}}"
-                  >{{.Title}}</a
-                >
+                <a class="link-dark d-block" 
href="{{$.baseURL}}/questions/{{.ID}}/{{urlTitle .Title}}">
+                  {{.Title}}
+                </a>
                 {{else}}
                 <a class="link-dark d-block" 
href="{{$.baseURL}}/questions/{{.ID}}">{{.Title}}</a>
                 {{end}}
@@ -63,9 +63,8 @@
 
               <div class="text-truncate-2 mb-2">
                 {{if $.useTitle }}
-                <a class="d-block small text-body" 
href="{{$.baseURL}}/questions/{{.ID}}/{{urlTitle .Title}}"
-                  >{{.Description}}</a
-                >
+                <a class="d-block small text-body" 
href="{{$.baseURL}}/questions/{{.ID}}/{{urlTitle .Title}}">{{.Description}}
+                </a>
                 {{else}}
                 <a class="d-block small text-body" 
href="{{$.baseURL}}/questions/{{.ID}}">{{.Description}}</a>
                 {{end}}
@@ -75,8 +74,7 @@
                 {{range .Tags }}
                 <a
                   href="{{$.baseURL}}/tags/{{.SlugName}}"
-                  class="badge-tag rounded-1 {{if 
.Reserved}}badge-tag-reserved{{end}} {{if .Recommend}}badge-tag-required{{end}} 
me-1"
-                >
+                  class="badge-tag rounded-1 {{if 
.Reserved}}badge-tag-reserved{{end}} {{if .Recommend}}badge-tag-required{{end}} 
me-1">
                   <span class="">{{.SlugName}}</span>
                 </a>
                 {{end}}

Reply via email to