mirror of
				https://github.com/osmarks/mycorrhiza.git
				synced 2025-10-31 07:33:00 +00:00 
			
		
		
		
	Finally rename binary part to attachment
How could we have missed it
This commit is contained in:
		| @@ -101,7 +101,7 @@ func (h *Hypha) MergeIn(oh *Hypha) { | |||||||
| 	} | 	} | ||||||
| 	if oh.BinaryPath != "" { | 	if oh.BinaryPath != "" { | ||||||
| 		if h.BinaryPath != "" { | 		if h.BinaryPath != "" { | ||||||
| 			log.Println("There is a file collision for binary part of a hypha:", h.BinaryPath, "and", oh.BinaryPath, "-- going on with the latter") | 			log.Println("There is a file collision for attachment of a hypha:", h.BinaryPath, "and", oh.BinaryPath, "-- going on with the latter") | ||||||
| 		} | 		} | ||||||
| 		h.BinaryPath = oh.BinaryPath | 		h.BinaryPath = oh.BinaryPath | ||||||
| 	} | 	} | ||||||
|   | |||||||
| @@ -44,7 +44,7 @@ func UploadText(h *hyphae.Hypha, data []byte, message string, u *user.User) (hop | |||||||
|  |  | ||||||
| func UploadBinary(h *hyphae.Hypha, mime string, file multipart.File, u *user.User) (*history.HistoryOp, string) { | func UploadBinary(h *hyphae.Hypha, mime string, file multipart.File, u *user.User) (*history.HistoryOp, string) { | ||||||
| 	var ( | 	var ( | ||||||
| 		hop       = history.Operation(history.TypeEditBinary).WithMsg(fmt.Sprintf("Upload binary part for ‘%s’ with type ‘%s’", h.Name, mime)) | 		hop       = history.Operation(history.TypeEditBinary).WithMsg(fmt.Sprintf("Upload attachment for ‘%s’ with type ‘%s’", h.Name, mime)) | ||||||
| 		data, err = io.ReadAll(file) | 		data, err = io.ReadAll(file) | ||||||
| 	) | 	) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -114,7 +114,7 @@ If `contents` == "", a helpful message is shown instead. | |||||||
| <div class="layout"> | <div class="layout"> | ||||||
| <main class="main-width"> | <main class="main-width"> | ||||||
| 	<article> | 	<article> | ||||||
| 		<p>Please note that viewing binary parts of hyphae is not supported in history for now.</p> | 		<p>Please note that viewing attachments of hyphae is not supported in history for now.</p> | ||||||
| 		{%s= NaviTitleHTML(h) %} | 		{%s= NaviTitleHTML(h) %} | ||||||
| 		{%s= contents %} | 		{%s= contents %} | ||||||
| 	</article> | 	</article> | ||||||
|   | |||||||
| @@ -383,7 +383,7 @@ func StreamRevisionHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hyphae.H | |||||||
| <div class="layout"> | <div class="layout"> | ||||||
| <main class="main-width"> | <main class="main-width"> | ||||||
| 	<article> | 	<article> | ||||||
| 		<p>Please note that viewing binary parts of hyphae is not supported in history for now.</p> | 		<p>Please note that viewing attachments of hyphae is not supported in history for now.</p> | ||||||
| 		`) | 		`) | ||||||
| //line views/readers.qtpl:118 | //line views/readers.qtpl:118 | ||||||
| 	qw422016.N().S(NaviTitleHTML(h)) | 	qw422016.N().S(NaviTitleHTML(h)) | ||||||
|   | |||||||
| @@ -211,7 +211,7 @@ func handlerUploadText(w http.ResponseWriter, rq *http.Request) { | |||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
| // handlerUploadBinary uploads a new binary part for the hypha. | // handlerUploadBinary uploads a new attachment for the hypha. | ||||||
| func handlerUploadBinary(w http.ResponseWriter, rq *http.Request) { | func handlerUploadBinary(w http.ResponseWriter, rq *http.Request) { | ||||||
| 	util.PrepareRq(rq) | 	util.PrepareRq(rq) | ||||||
| 	rq.ParseMultipartForm(10 << 20) // Set upload limit | 	rq.ParseMultipartForm(10 << 20) // Set upload limit | ||||||
|   | |||||||
| @@ -102,7 +102,7 @@ func handlerText(w http.ResponseWriter, rq *http.Request) { | |||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
| // handlerBinary serves binary part of the hypha. | // handlerBinary serves attachment of the hypha. | ||||||
| func handlerBinary(w http.ResponseWriter, rq *http.Request) { | func handlerBinary(w http.ResponseWriter, rq *http.Request) { | ||||||
| 	util.PrepareRq(rq) | 	util.PrepareRq(rq) | ||||||
| 	hyphaName := util.HyphaNameFromRq(rq, "binary") | 	hyphaName := util.HyphaNameFromRq(rq, "binary") | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Timur Ismagilov
					Timur Ismagilov