-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[refactor,templates][xs]: split some of dataset related templates int…
…o their own template files.
- Loading branch information
rgrp
committed
Jul 28, 2011
1 parent
82ee4d2
commit 2f65ab6
Showing
5 changed files
with
191 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
CKAN.Templates.datasetForm = ' \ | ||
<form class="dataset" action="" method="POST"> \ | ||
<fieldset> \ | ||
<legend> \ | ||
<h3>Basics</h3> \ | ||
</legend> \ | ||
<dl> \ | ||
<dt> \ | ||
<label class="field_opt" for="dataset--title"> \ | ||
Title * \ | ||
</label> \ | ||
</dt> \ | ||
<dd> \ | ||
<input id="Dataset--title" name="Dataset--title" type="text" value="${title}" placeholder="A title (not a description) ..."/> \ | ||
</dd> \ | ||
\ | ||
<dt> \ | ||
<label class="field_req" for="Dataset--name"> \ | ||
Slug * \ | ||
</label> \ | ||
</dt> \ | ||
<dd> \ | ||
<input id="Dataset--name" maxlength="100" name="Dataset--name" type="text" value="${name}" placeholder="A shortish name usable in urls ..." /> \ | ||
<img src="img/help.png" \ | ||
class="help" \ | ||
title="A unique lowercase name for the dataset for use in urls and therefore only containing alphanumeric characters plus - and _" \ | ||
> \ | ||
</dd> \ | ||
\ | ||
<dt> \ | ||
<label class="field_opt" for="Dataset--url"> \ | ||
Home Page \ | ||
</label> \ | ||
</dt> \ | ||
<dd> \ | ||
<input id="Dataset--url" name="Dataset--url" type="text" value="${url}" placeholder="http://mydataset.com/about/" /> \ | ||
</dd> \ | ||
\ | ||
<dt> \ | ||
<label class="field_opt" for="Dataset--license_id"> \ | ||
Licence \ | ||
</label> \ | ||
</dt> \ | ||
<dd> \ | ||
<select id="Dataset--license_id" name="Dataset--license_id"> \ | ||
<option selected="selected" value=""></option> \ | ||
<option value="notspecified">Other::License Not Specified</option> \ | ||
</select> \ | ||
</dd> \ | ||
\ | ||
<dt> \ | ||
<label class="field_opt" for="Dataset--notes"> \ | ||
Description and Notes \ | ||
</label> \ | ||
You can use <a href="http://daringfireball.net/projects/markdown/syntax">Markdown formatting</a> \ | ||
</dt> \ | ||
<dd> \ | ||
<div class="previewable-textarea"> \ | ||
<ul class="tabs"> \ | ||
<li><a href="#" action="write" class="selected">Write</a></li> \ | ||
<li><a href="#" action="preview">Preview</a></li> \ | ||
</ul> \ | ||
<textarea id="Dataset--notes" name="Dataset--notes" placeholder="Start with a summary sentence ...">${notes}</textarea> \ | ||
<div id="Dataset--notes-preview" class="preview" style="display: none;"> \ | ||
<div> \ | ||
</div> \ | ||
</dd> \ | ||
\ | ||
<dt> \ | ||
<label class="field_opt" for="Dataset--tags"> \ | ||
Tags \ | ||
</label> \ | ||
</dt> \ | ||
<dd> \ | ||
<input class="tagComplete" data-tagcomplete-queryparam="incomplete" data-tagcomplete-url="/api/2/util/tag/autocomplete" id="Dataset--tags" name="Dataset--tags" type="text" value="${tags}" placeholder="e.g. pollution rivers water-quality" /> \ | ||
</dd> \ | ||
</dl> \ | ||
</fieldset> \ | ||
\ | ||
<div class="submit"> \ | ||
<input id="save" name="save" type="submit" value="Save" /> \ | ||
</div> \ | ||
<p class="hints"> \ | ||
<strong>Important:</strong> By submitting content, you agree to release your contributions \ | ||
under the open license specified on the <a href="http://ckan.net/license">license page</a>. Please <strong>refrain</strong> from editing if you are <strong>not</strong> happy to do this. \ | ||
</p> \ | ||
</form> \ | ||
'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
CKAN.Templates.datasetFull = ' \ | ||
<div class="dataset view" dataset-id="${dataset.id}"> \ | ||
<div class="extract"> \ | ||
{{html dataset.snippet}} \ | ||
<a href="#anchor-notes">Read more</a> \ | ||
</div> \ | ||
<div class="tags"> \ | ||
{{if dataset.tags.length}} \ | ||
<ul class="dataset-tags"> \ | ||
{{each dataset.tags}} \ | ||
<li>${$value}</li> \ | ||
{{/each}} \ | ||
</ul> \ | ||
{{/if}} \ | ||
</div> \ | ||
<div class="resources subsection"> \ | ||
{{if dataset.resources.length }} \ | ||
<h3>Resources</h3> \ | ||
<table> \ | ||
<tr> \ | ||
<th>Description</th> \ | ||
<th>Format</th> \ | ||
</tr> \ | ||
{{each dataset.resources}} \ | ||
<tr> \ | ||
<td> \ | ||
{{if $value.description}} \ | ||
<a href="${$value.url}" target="_blank">${$value.description}</a> \ | ||
{{else}} \ | ||
<a href="${$value.url}" target="_blank">Download (no description)</a> \ | ||
{{/if}} \ | ||
</td> \ | ||
<td>${$value.format}</td> \ | ||
</tr> \ | ||
{{/each}} \ | ||
</table> \ | ||
{{/if}} \ | ||
<div class="add-resource"> \ | ||
<a href="#" class="action-add-resource">Add a resource</a> \ | ||
<div class="add-resource-form"></div> \ | ||
</div> \ | ||
</div> \ | ||
<div class="notes subsection"> \ | ||
<h3 id="anchor-notes">Notes</h3> \ | ||
{{html dataset.notesHtml}} \ | ||
</div> \ | ||
<div class="details subsection"> \ | ||
<h3>Additional Information</h3> \ | ||
<table> \ | ||
<thead> \ | ||
<tr> \ | ||
<th>Field</th> \ | ||
<th>Value</th> \ | ||
</tr> \ | ||
</thead> \ | ||
<tbody> \ | ||
<tr> \ | ||
<td>Creator</td> \ | ||
<td>${dataset.author}</td> \ | ||
</tr> \ | ||
<tr> \ | ||
<td>Maintainer</td> \ | ||
<td>${dataset.maintainer}</td> \ | ||
</tr> \ | ||
{{each dataset.extras}} \ | ||
<tr> \ | ||
<td class="package-label" property="rdfs:label">${$index}</td> \ | ||
<td class="package-details" property="rdf:value">${$value}</td> \ | ||
</tr> \ | ||
{{/each}} \ | ||
</tbody> \ | ||
</table> \ | ||
</div> \ | ||
</div> \ | ||
'; | ||
|
||
CKAN.Templates.sidebarDatasetView = ' \ | ||
<li class="widget-container widget_text"> \ | ||
<h3>Connections</h3> \ | ||
<ul> \ | ||
{{each dataset.relationships}} \ | ||
<li> \ | ||
<a href="...">${$value.package}</a> \ | ||
{{if $value.comment}} \ | ||
<span class="relationship_comment"> \ | ||
(${$value.comment}) \ | ||
</span> \ | ||
{{/if}} \ | ||
</li> \ | ||
{{/each}} \ | ||
</ul> \ | ||
{{if dataset.relationships.length == 0}} \ | ||
No connections to other datasets. \ | ||
{{/if}} \ | ||
</li> \ | ||
'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.