Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Specimen template #108 #168

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 41 additions & 2 deletions src/pattypan/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
import java.util.Properties;
import java.util.logging.Level;

import pattypan.Util;

public final class Settings {

private Settings() {};
Expand Down Expand Up @@ -445,6 +443,47 @@ public final class Settings {
)
);


TEMPLATES.put("Specimen",
new Template("Specimen",
new TemplateField[]{
new TemplateField("taxon", "Taxon"),
new TemplateField("authority", "Authority"),
new TemplateField("institution", "Institution"),
new TemplateField("accession number", "Accession number"),
new TemplateField("gender", "Gender"),
new TemplateField("cultivar", "Cultivar"),
new TemplateField("photographer", "Photographer"),
new TemplateField("source", "Source"),
new TemplateField("date", "Date"),
new TemplateField("description", "Description"),
new TemplateField("permission", "Permission"),
}, "=={{int:filedesc}}==\n"
+ "{{Specimen\n"
+ " |taxon = ${taxon}\n"
+ " |authority = ${authority}\n"
+ " |institution = ${institution}\n"
+ " |accession number = ${accession_number}\n"
+ " |gender = ${gender}\n"
+ " |cultivar = ${cultivar}\n"
+ " |photographer = ${photographer}\n"
+ " |source = ${source}\n"
+ " |date = ${date}\n"
+ " |description = ${description}\n"
+ " |permission = ${permission}\n"
+ "}}\n\n"
+ "=={{int:license-header}}==\n"
+ "${license}${partnership}"
+ "\n\n"
+ "<#if categories ? has_content>\n"
+ "<#list categories ? split(\";\") as category>\n"
+ "[[Category:${category?trim}]]\n"
+ "</#list>\n"
+ "<#else>{{subst:unc}}\n"
+ "</#if>"
)
);

/*
TEMPLATES.put("Name",
new Template("Name",
Expand Down