Преглед на файлове

[GinR] Datacite type field

cgars преди 7 години
родител
ревизия
1a4f85e3aa
променени са 2 файла, в които са добавени 7 реда и са изтрити 1 реда
  1. 1 1
      routes/repo/view.go
  2. 6 0
      templates/repo/doifile.tmpl

+ 1 - 1
routes/repo/view.go

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

+ 6 - 0
templates/repo/doifile.tmpl

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