Browse Source

[GinR] Datacite type field

cgars 7 năm trước cách đây
mục cha
commit
1a4f85e3aa

+ 1 - 1
routes/repo/view.go

@@ -87,7 +87,7 @@ func renderDirectory(c *context.Context, treeLink string) {
 			if err != nil {
 			if err != nil {
 				log.Trace("Doi Blob could not be unmarshalled:%v", err)
 				log.Trace("Doi Blob could not be unmarshalled:%v", err)
 			}
 			}
-			c.Data["DoiInfo"] = doiInfo
+			c.Data["DoiInfo"] = &doiInfo
 
 
 			doi := GDoiRepo(c, setting.Doi.DoiBase)
 			doi := GDoiRepo(c, setting.Doi.DoiBase)
 			//ddata, err := ginDoi.GDoiMData(doi, "https://api.datacite.org/works/") //todo configure URL?
 			//ddata, err := ginDoi.GDoiMData(doi, "https://api.datacite.org/works/") //todo configure URL?

+ 6 - 0
templates/repo/doifile.tmpl

@@ -66,6 +66,12 @@
 								{{end}}
 								{{end}}
 						</td>
 						</td>
 				</tr>
 				</tr>
+				<tr>
+					<td>Resource Type</td>
+					<td>
+						<i>{{.DoiInfo.GetType}}</i><br>
+					</td>
+				</tr>
 				{{end}}
 				{{end}}
 				</tbody>
 				</tbody>
 		</table>
 		</table>