all repos

mugit @ 6e88b48c21e672351799572fe3a7b74cebe7178e

馃惍 git server that your cow will love
1 files changed, 11 insertions(+), 7 deletions(-)
ui: fix the multi line commit indicator
Author: Oleksandr Smirnov olexsmir@gmail.com
Committed at: 2026-01-28 18:40:04 +0200
Authored at: 2026-01-28 16:45:35 +0200
Change ID: kwurpnoypmzvmvyvsxvxyqrnsslrmsns
Parent: d1a0743
M internal/handlers/handlers.go
路路路
        1
        1
         package handlers

      
        2
        2
         

      
        3
        3
         import (

      
        4
        
        -	"fmt"

      
        5
        4
         	"html/template"

      
        6
        5
         	"net/http"

      
        7
        6
         	"path/filepath"

      路路路
        49
        48
         

      
        50
        49
         var templateFuncs = template.FuncMap{

      
        51
        50
         	"humanizeTime": func(t time.Time) string { return humanize.Time(t) },

      
        52
        
        -	"commitSummary": func(v any) string {

      
        53
        
        -		s := fmt.Sprint(v)

      
        54
        
        -		if i := strings.IndexByte(s, '\n'); i >= 0 {

      
        55
        
        -			s = strings.TrimSuffix(s[:i], "\r")

      
        56
        
        -			return s + "..."

      
        
        51
        +	"commitSummary": func(s string) string {

      
        
        52
        +		before, after, found := strings.Cut(s, "\n")

      
        
        53
        +		first := strings.TrimSuffix(before, "\r")

      
        
        54
        +		if !found {

      
        
        55
        +			return first

      
        
        56
        +		}

      
        
        57
        +

      
        
        58
        +		if strings.Contains(after, "\n") {

      
        
        59
        +			return first + "..."

      
        57
        60
         		}

      
        58
        
        -		return strings.TrimSuffix(s, "\r")

      
        
        61
        +

      
        
        62
        +		return first

      
        59
        63
         	},

      
        60
        64
         }