Skip to content

Commit

Permalink
move static/ and .gitignore into dictionary/ before I plit this into …
Browse files Browse the repository at this point in the history
…its own repo.
  • Loading branch information
ivh committed Sep 23, 2011
1 parent 2db521b commit 4f4cbb9
Show file tree
Hide file tree
Showing 41 changed files with 3,993 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Below are common suffixes and things to be ignored by git.
# Feel free to add stuff here, e.g. temporary files that your editor
# creates.
#
*~
*.pyc
*.db
*.db-journal
dummy*
/.pydevproject
/.project
/.settings
\#*
.#*
*_c.xml
*.swp
*.swo
.DS_Store
doc*/build/*
*.json
*.dat
*.log
1 change: 1 addition & 0 deletions static/admin-media
204 changes: 204 additions & 0 deletions static/css/indigo.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
/*#############################################################
Name: Indigo
Description: A lightweight (7kb images), simple and professional design.
Date: 2006-07-27
Author: Viktor Persson
URL: http://arcsin.se
Feel free to use and modify but please provide credits.
#############################################################*/

/* standard elements */
* {
margin: 0;
padding: 0;
}
a {
color: #F70;
}
a:hover {
color: #C60;
}
body {
background: #0094D6 url(/img/bg.gif) repeat-x;
color: #466;
font: normal 62.5% "Lucida Sans Unicode",sans-serif;
margin: 0;
}
input {
color: #555;
font: normal 1.1em "Lucida Sans Unicode",sans-serif;
}
p,cite,code,ul {
font-size: 1.2em;
padding-bottom: 1.2em;
}
h1 {
font-size: 1.4em;
margin-bottom: 4px;
}
code {
background: url(/img/bgcode.gif);
border: 1px solid #F0F0F0;
border-left: 6px solid #39F;
color: #555;
display: block;
font: normal 1.1em "Lucida Sans Unicode",serif;
margin-bottom: 12px;
padding: 8px 10px;
white-space: pre;
}
cite {
background: url(/img/quote.gif) no-repeat;
color: #666;
display: block;
font: normal 1.3em "Lucida Sans Unicode",serif;
padding-left: 28px;
}
h1,h2,h3 {
color: #06C;
padding-top: 6px;
}
/* misc */
.clearer {
clear: both;
}

/* structure */
.container {
background: url(/img/topleft.gif) no-repeat;
}

.header {
height: 92px;
}

/* title */
.title {
float: left;
padding: 28px 0 0 200px;
}
.title h1 {
color: #FFF;
font: normal 2em Verdana,sans-serif;
}

/* navigation */
.navigation {
float: left;
height: 92px;
margin-left: 24px;
padding: 0 16px;
width: 200px;
}
.navigation a {
color: #FFF;
float: left;
font: bold 1.2em "Trebuchet MS",sans-serif;
margin-top: 56px;
padding: 8px 18px;
text-align: center;
text-decoration: none;
}
.navigation a:hover {
background-color: #4A91C3;
color: #FFF;
}

/* main */
.main {
background: #FFF url(/img/bgmain.gif) no-repeat;
clear: both;
padding: 12px 12px 0 52px;
}

/* main left */
.sidenav {
float: left;
width: 14%;
}
.sidenav h1 {
border-bottom: 1px dashed #DDD;
color: #E73;
font-size: 1.2em;
height: 20px;
margin-top: 1.2em;
}
.sidenav ul {
margin: 0;
padding: 0;
}
.sidenav li {
border-bottom: 1px dashed #EEE;
list-style: none;
margin: 0;
}
.sidenav li a {
color: #777;
display: block;
font-size: 0.9em;
padding: 3px 6px 3px 18px;
text-decoration: none;
}
.sidenav li a:hover {
color: #111;
background: url(/img/nav_li.gif) no-repeat;
}

/* content */
.content {
float: left;
margin-right: 4%;
width: 79%;
}
.content .descr {
color: #C60;
margin-bottom: 6px;
}
.content li {
list-style: url(/img/li.gif);
margin-left: 18px;
}

/* search form */
.styled {
border: 3px double #E5E5E5;
padding: 2px 3px;
}
.button {
border: 1px solid #AAA;
margin-left: 5px;
padding: 2px 3px;
}

/* footer */
.footer {
background: #0094D6 url(/img/bgfooter.gif) repeat-x;
color: #C1DEF0;
font-size: 1.1em;
line-height: 40px;
text-align: center;
}
.footer a {
color: #FFF;
text-decoration: none;
}
.footer a:hover {
color: #FFF;
text-decoration: underline;
}

table {
border-collapse:collapse;
}

table, th, td {
border: 1px solid #CCC;
padding: 3px;
}

th { background-color: #DDE;
}

.row2 td { background-color: #EEE;
}
Binary file added static/favicon.ico
Binary file not shown.
Binary file added static/img/bg.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/bgcode.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/bgfooter.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/bgmain.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/li.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/nav_li.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/quote.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/topleft.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added static/robots.txt
Empty file.
Empty file added static/templates/404.html
Empty file.
Empty file added static/templates/500.html
Empty file.
84 changes: 84 additions & 0 deletions static/templates/dictionary/bytype.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{% extends "indigo.html" %}
{% load i18n %}
{% block title %}VAMDC{% endblock %}
{% block addheader %}
<script language="javascript">
function toggleDiv(divid){
if(document.getElementById(divid).style.display == 'none'){
document.getElementById(divid).style.display = 'block';
}else{
document.getElementById(divid).style.display = 'none'
}}
</script>
{% endblock %}
{% block headline %}VAMDC Dictionary by type{% endblock %}

{% block content %}
<p>The columns' meaning is described <a href="#descr">below</a>.</p>

{% for bloc in blocs %}
<h3>{{ bloc.desc }}</h3>
<div id="block{{ bloc.tag}}" style="display:none">
<p><a href="javascript:;" onmousedown="toggleDiv('block{{ bloc.tag }}');">Show/Hide</a></p>
<table>
<tr><th>Keyword</th><th>Short Description</th><th>Long Description</th><th>Type</th><th>Constraint</th><th>Unit</th><th>*</th><th>Usage</th></tr>
{% for keyword in bloc %}
<tr class="{% cycle 'row1' 'row2' %}">
<td>{{ keyword.name }}</td>
<td>{{ keyword.sdescr }}</td>
<td>{{ keyword.ldescr }}</td>
<td>{% if keyword.type %}{{ keyword.get_type_display }}{% endif %}</td>
<td>{% if keyword.constr %}{{ keyword.constr }}{% endif %}</td>
<td>{% if keyword.unit %}{{ keyword.unit }}{% endif %}</td>
<td>{% if keyword.datatype %}*{% endif %}</td>
<td>{% for use in keyword.usage.iterator %}{{ use.name }}, {% endfor %}</td>
{% endfor %}
</table>
</div>
<p><a href="javascript:;" onmousedown="toggleDiv('block{{ bloc.tag }}');">Show/Hide</a></p>
{% endfor %}

<br/>
<br/>
<br/>

<p>
<a name="descr"></a>Description of the columns in the table above:
</p>

<ul>
<li><strong>Keyword</strong>: The actual name of the dictionary entry. These are what is used in the query language and when you fill Restrictables and Returnables.</li>
<li><strong>Short Description</strong>: Human-readable short text about the meaning. To be used e.g. as label text for a web-form</li>
<li><strong>Long Description</strong>: Human-readable longer text, to be used eg. in a help-box.</li>
<li><strong>Type</strong>: What type of data are associated with the keyword. choices are: string, float, integer, boolean.</li>
<li><strong>Constraint</strong>: Possible contraints on the content, like ranges for a number, only certain strings (regular expression) etc.</li>
<li><strong>Unit</strong>: The default unit, if any, for the keyword. This unit is the one used at query-time. You may however use another unit when returning data.</li>

<li><strong>*</strong>: This column marks if a keyword corresponds to a
"DataType" in the XSAMS schema. If SomeKeyword is marked here, it means that
there are also the corresponding keywords
<ul>
<li>SomeKeywordUnit</li>
<li>SomeKeywordRef</li>
<li>SomeKeywordComment</li>
<li>SomeKeywordMethod</li>
<li>SomeKeywordAccuracyCalibration</li>
<li>SomeKeywordAccuracyQuality</li>
<li>SomeKeywordAccuracySystematic</li>
<li>SomeKeywordAccuracySystematicConfidence</li>
<li>SomeKeywordAccuracySystematicRelative</li>
<li>SomeKeywordAccuracyStatistical</li>
<li>SomeKeywordAccuracyStatisticalConfidence</li>
<li>SomeKeywordAccuracyStatisticalRelative</li>
<li>SomeKeywordAccuracyStatLow</li>
<li>SomeKeywordAccuracyStatLowConfidence</li>
<li>SomeKeywordAccuracyStatLowRelative</li>
<li>SomeKeywordAccuracyStatHigh</li>
<li>SomeKeywordAccuracyStatHighConfidence</li>
<li>SomeKeywordAccuracyStatHighRelative</li>
</ul> which for the sake of overview are not listed above for each keyword. Please refer to the schema documentation on detail how these are to be filled.</li>

<li><strong>Usage</strong>: Tells whether a keyword can be used as Returnable, Restrictable and/or Requestable.</li>
</ul>
</p>
{% endblock %}
56 changes: 56 additions & 0 deletions static/templates/dictionary/check.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{% extends "indigo.html" %}
{% load i18n %}

{% block content %}
<h1>Check your dictionaries</h1>

<p>Paste your dictionary into the field
below, including the variable assignment. Examples and more information below.</p>

<form action="." method="post">
{% csrf_token %}
<p>{{ form.content }}</p>
<p><input type="submit" value="Check" /></p>

{% if form.content.errors %}
<p>Check result:</p>
{{ form.content.errors }}
{% else %}
<p>No errors found.</p>
{% endif %}
</form>

<h2>Examples</h2>

<p>
<code>
RETURNABLES = {'AtomSymbol':'AtomState.species.name',
'AtomIonCharge':'AtomState.species.ion',
'RadTransWavelength':'RadTran.vacwave',
'RadTransWavelengthUnit':'cm',
}
</code>
</p>

<p>
<code>
RESTRICTABLES = {'AtomSymbol':'species__name',
'AtomNuclearCharge':'species__atomic',
'RadTransWavelength':'vacwave'
}
</code>
</p>

<p>This tool warns you of
<ul>
<li>syntax errors</li>
<li>keywords you use which are not in the dictionary</li>
<li>keywords that cannot be used as Returnable or Restrictable as you do</li>
<li>values (right-hand-side) which probably will not be replaced by something from your database but treated as constant strings instead.</li>
<li>forgetting the Unit-keyword when you fill a DataType.</li>
</ul>
</p>
<p>This tool <strong>does not</strong> check whether the values you put into the right-hand-side match your data model or not.
</p>
{% endblock %}

Loading

0 comments on commit 4f4cbb9

Please sign in to comment.