@import controllers.workspace.routes.Assets @import org.silkframework.runtime.plugin.PluginRegistry @import org.silkframework.workbench.WorkbenchPlugin.{TaskActions, TaskType} @import org.silkframework.workbench.WorkbenchPlugins @import org.silkframework.workspace.activity.ProjectExecutor @import org.silkframework.workspace.{Project, Workspace} @import org.silkframework.runtime.activity.UserContext @import org.silkframework.runtime.plugin.PluginContext @(workspace: Workspace)(implicit userContext: UserContext)
@* Either a link opening a new tab if linkUrl is set or a button executing the onClick JavaScript *@ @button(title: String, tooltip: String, icon: String, onClick: String, linkUrl: String = "") = { @if(linkUrl.trim.isEmpty) {
@title
} else {
@title
} } @project(project: Project) = {
  • @project.config.metaData.formattedLabel(project.id, maxLength = 100) @button("Prefixes", "Edit prefixes", "wrench-screwdriver.png", s"editPrefixes('${project.id}')") @button("Resources", "Manage resources", "wrench.png", s"editResources('${project.id}')") @button("Link Spec", "Import link specification", "document--plus.png", s"importLinkSpec('${project.id}')") @button("Export", "Export project", "document-export.png", s"exportProject('${project.id}')") @if(PluginRegistry.availablePlugins[ProjectExecutor].nonEmpty) { @button("Execute", "Execute project", "document-export.png", s"executeProject('${project.id}')") } @button("Clone", "Clone project", "clone.png", s"cloneProject('${project.id}')") @button("Remove", "Remove project", "cross.png", s"deleteProjectConfirm('${project.id}')")
  • } @projectIcon(project: Project) = @{ if(project.loadingErrors.isEmpty) "img/project.png" else "img/project-error.png" } @taskTypeNode(project: Project, taskType: TaskType, taskActions: Seq[TaskActions]) = {
  • @{taskType.typeName}s @for(path <- taskType.createDialog(project.id)) { @button("Add", "Add " + taskType.typeName, "plus.png", s"workspaceDialog('$path')") }
  • } @task(project: Project, taskType: TaskType, actions: TaskActions) = {
  • @actions.task.label() @for(path <- actions.propertiesDialog) { @button("Properties", "Edit task properties", "wrench.png", s"workspaceDialog('$path')") } @for(path <- actions.openPath(None, None)) { @button("Open", "Open task", "document--pencil.png", s"window.location = '${config.baseUrl}/$path'", config.baseUrl + "/" + path) } @button("Clone", "Clone task", "clone.png", s"cloneTask('${project.id}', '${actions.task.id}')") @button("Remove", "Remove task", "cross.png", s"deleteTaskConfirm('${project.id}', '${actions.task.id}')")
  • }