2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 07:11:52 +00:00

[svn] Survey table improvements, added calendar to urls

Copied from http://cucc@cucc.survex.com/svn/trunk/expoweb/troggle/, rev. 8201 by aaron @ 1/19/2009 7:19 AM
This commit is contained in:
substantialnoninfringinguser 2009-05-13 05:40:35 +01:00
parent 8de2573385
commit aeef470c6d
5 changed files with 73 additions and 108 deletions

View File

@ -18,6 +18,10 @@ table, caption, tbody, tfoot, thead, tr, th, td
vertical-align: baseline;
}
html, body {
height: 100%
}
.caption { font-size: 8pt; margin-bottom: 0pt; }
.centre { text-align: center; }
@ -45,6 +49,9 @@ div#content
margin: 50px;
}
div#footer
{
clear:both;
@ -160,6 +167,8 @@ p.indent
opacity:.90; */
}
hr{
margin:0;
padding:0;
@ -184,7 +193,7 @@ div.centre img { vertical-align: middle; }
h1 { text-align: center; font-size: 210%; display: inline;}
h2 { color: #009900; }
h3 { color: #2c105e; }
h3 { color: #2c105e; text-align:left; border-bottom:thin solid black; margin-bottom:1em; margin-top:1em }
h4 { color: #0d664c; }
h4.navbar {line-height: 0px;}
img.onright, div.onright { vertical-align: top; float: right;
@ -249,6 +258,7 @@ div.main {
margin-bottom: 3em;
}
/* You are not expected to understand this. It is necessary. */
table.centre { margin-left: auto; margin-right: auto; }
table.centre td { text-align: left; }
@ -262,17 +272,6 @@ table#cavepage th#status { text-align: right; width: 25%; }
.command { color: #FF0000; }
.comment { color: #888888; font-style:italic;}
/* Fron dreamweaver template */
body {
}
.twoColHybLtHdr #container {
width: 80%; /* this will create a container 80% of the browser width */
background: #FFFFFF;
margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
border: 1px solid #000000;
text-align: left; /* this overrides the text-align: center on the body element. */
}
.thumbnail {
width: 300px;
}
@ -285,52 +284,12 @@ td {
padding:0px;
border: thin solid silver;
}
.twoColHybLtHdr #header h1 {
margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
}
/* Tips for sidebar1:
1. Since we are working in relative units, it's best not to use padding on the sidebar. It will be added to the overall width for standards compliant browsers creating an unknown actual width.
2. Since em units are used for the sidebar value, be aware that its width will vary with different default text sizes.
3. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".twoColHybLtHdr #sidebar1 p" rule.
*/
.twoColHybLtHdr #sidebar1 {
float: left;
width: 12em; /* since this element is floated, a width must be given */
background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 15px 0; /* top and bottom padding create visual space within this div */
}
.twoColHybLtHdr #sidebar1 h3, .twoColHybLtHdr #sidebar1 p {
margin-left: 10px; /* the left and right margin should be given to every element that will be placed in the side columns */
margin-right: 10px;
#nav {
}
.twoColHybLtHdr #mainContent {
margin: 0 20px 0 13em; /* the right margin can be given in percentages or pixels. It creates the space down the right side of the page. */
}
.twoColHybLtHdr #footer {
padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background:#DDDDDD;
}
.twoColHybLtHdr #footer p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}
/* Miscellaneous classes for reuse */
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page */
float: left;
margin-right: 8px;
}
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
.menuBarItem {
font-variant: small-caps;
text-align: right;
@ -347,8 +306,7 @@ td {
display: none;
}
div.figure {
float: left;
width: 25%;
width: 20%;
border: thin silver solid;
margin: 0.5em;
padding: 0.5em;
@ -361,13 +319,3 @@ div.figure p {
img.thumbnail {
width: 100%;
}
</style>
[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment */
.twoColHybLtHdr #sidebar1 { padding-top: 30px; }
.twoColHybLtHdr #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it may need to avoid several bugs */
</style>
<![endif]

View File

@ -1,10 +1,9 @@
div#nav {
width: 12em;
float: left;
width: 12em;
background: #EBEBEB;
background: rgb(153, 153, 153);
padding: 15px 0;
height:100%
}
div#content { style="margin-left:13em"}
div#content { margin-left:13em }

View File

@ -7,7 +7,7 @@
<title>{% block title %}THE TITLE{% endblock %}</title>
<script src="{{ settings.MEDIA_URL }}js/base.js" type="text/javascript"></script>
{% block javascript %}{% endblock %}
{% block head %}{% endblock %}
</head>
<body>
@ -29,17 +29,22 @@
</div>
</div>
</a>
<div id="nav" style="float:left; top:200; background:#999; width:200; height:100%"> {% block nav %}
{% endblock %} </div>
<div id="content">
{% block nav %}
<!-- Use id="nav" for the left side menu -->
{% endblock %}
<div id="content" >
{% block content %}
REPLACE : The content
{% endblock %}
</div>
<div id="footer">
{% block footer %}
THE FOOTER

View File

@ -3,26 +3,31 @@
{% block title %}CUCC Virtual Survey Binder: {{ current_expedition }}{{ current_survey }}{%endblock%}
{% block javascript %}
{% block head %}
<link rel="stylesheet" type="text/css" href="{{ settings.MEDIA_URL }}css/nav.css" />
<script language="javascript">
blankColor = "rgb(153, 153, 153)"
highlightedColor = "rgb(125, 125, 125)"
chosenColor = "rgb(102, 102, 102)"
chosenColor = "rgb(255, 255, 255)"
mnuItmLst=document.getElementsByClassName("menuBarItem")
function highlight(div){
for (var i = 0, divIter; divIter = mnuItmLst[i]; i++) {
if (divIter.style.backgroundColor!="rgb(102, 102, 102)"){
/*loop though all menuitems. blank them except for the chosen one*/
if (divIter.style.backgroundColor!=chosenColor){
divIter.style.backgroundColor=blankColor;
}
}
if (div.style.backgroundColor!="rgb(102, 102, 102)"){
div.style.backgroundColor="#B0B0B0";
/*highlight the mouseovered div unless it is the chosen one*/
if (div.style.backgroundColor!=chosenColor){
div.style.backgroundColor=highlightedColor;
}
}
function unhighlight(div){
if (div.style.backgroundColor!=blankColor){
/*highlight the mouseovered div unless it is the chosen one*/
if (div.style.backgroundColor!=chosenColor){
div.style.backgroundColor=blankColor;
}
}
@ -40,12 +45,11 @@
}
function redirectSurvey(){
window.location = "{{ settings.URL_ROOT }}survey/" + document.getElementById("expeditionChooser").value + "%23" + document.getElementById("surveyChooser").value;
document.getElementById("progressTableContent").style.display='hidden'
window.location = "{% url survey %}" + '/' + document.getElementById("expeditionChooser").value + "%23" + document.getElementById("surveyChooser").value;
}
function redirectYear(){
window.location = "{{ settings.URL_ROOT }}survey/" + document.getElementById("expeditionChooser").value + "%23"
window.location = "{% url survey %}" + '/' + document.getElementById("expeditionChooser").value + "%23";
}
</script>
{% endblock %}
@ -61,27 +65,28 @@
</div>
{% block nav %}
<div id="sidebar1">
<div id="nav">
<br />
<select id="expeditionChooser" onchange="redirectYear()">
<h3>Choose a year</h3>
<select id="expeditionChooser" class="centre" onChange="redirectYear()">
{% for expedition in expeditions.reverse %}
<option label="{{ expedition }}" value="{{ expedition }}"
{% ifequal expedition current_expedition %}
selected
{% endifequal %} >
<option label="{{ expedition }}" value="{{ expedition }}" {% ifequal expedition current_expedition %}selected{% endifequal %}>
{{ expedition }}
{{ expedition }}
</option>
{% endfor %}
</select>
<select id="surveyChooser" onchange="redirectSurvey()">
<br>
<h3>Choose a wallet number</h3>
<select id="surveyChooser" class="centre" onChange="redirectSurvey()">
<option label="show all" value=""> {% for survey in current_expedition.survey_set.all %}
<option label="{{ survey }}" value="{{ survey.wallet_number }}"
{% ifequal survey current_survey %}
@ -89,30 +94,33 @@
{% endifequal %} >
{{ survey }} </option>
{% endfor %}
<option label="add" value="add">
</select>
<div id="status">
<div id="notes" class="menuBarItem" onmouseover="highlight(this)" onmouseout="unhighlight(this)" onclick="choose(this)"> {% if notes %}&#10003;{% endif %}
<div id="notes" class="menuBarItem" onMouseOver="highlight(this)" onMouseOut="unhighlight(this)" onClick="choose(this)"> {% if notes %}&#10003;{% endif %}
scanned notes </div>
<div id="survexFile" class="menuBarItem" onmouseover="highlight(this)" onmouseout="unhighlight(this)" onclick="choose(this)"> {% if current_survey.survex_file %}&#10003;{% endif %}
<div id="survexFile" class="menuBarItem" onMouseOver="highlight(this)" onMouseOut="unhighlight(this)" onClick="choose(this)"> {% if current_survey.survex_file %}&#10003;{% endif %}
survex file </div>
<div id="printedCentreline" class="menuBarItem" onmouseover="highlight(this)" onmouseout="unhighlight(this)" onclick="choose(this)"> {% if current_survey.centreline_printed_on %}&#10003;{% endif %}
<div id="printedCentreline" class="menuBarItem" onMouseOver="highlight(this)" onMouseOut="unhighlight(this)" onClick="choose(this)"> {% if current_survey.centreline_printed_on %}&#10003;{% endif %}
printed centreline </div>
<div id="scannedPassageSketch" class="menuBarItem" onmouseover="highlight(this)" onmouseout="unhighlight(this)" onclick="choose(this)"> {% if planSketches %}&#10003;{% endif %}
<div id="scannedPassageSketch" class="menuBarItem" onMouseOver="highlight(this)" onMouseOut="unhighlight(this)" onClick="choose(this)"> {% if planSketches %}&#10003;{% endif %}
scanned passage sketch </div>
<div id="tunnelXMLfile" class="menuBarItem" onmouseover="highlight(this)" onmouseout="unhighlight(this)" onclick="choose(this)">tunnel xml file</div>
<div id="mainSketchIntegration" class="menuBarItem" onmouseover="highlight(this)" onmouseout="unhighlight(this)" onclick="choose(this)">add to main sketch</div>
<div id="tunnelXMLfile" class="menuBarItem" onMouseOver="highlight(this)" onMouseOut="unhighlight(this)" onClick="choose(this)">tunnel xml file</div>
<div id="mainSketchIntegration" class="menuBarItem" onMouseOver="highlight(this)" onMouseOut="unhighlight(this)" onClick="choose(this)">add to main sketch</div>
</div>
</div>
{% endblock %}
</div>
{% endblock %}
{% block content %}
<div id="mainContent">
<div id="progressTableContent" class="behind" style="display:block;">
<table>
<div id="progressTableContent" style="display:block; overflow:auto">
<h3>Survey progress table for {{ current_expedition }}</h3>
{% if current_expedition.survey_set.all %} <!-- if there are any surveys in the expedition, make the table -->
<table class="centre">
<tr>
<th> </th>
{% for survey in current_expedition.survey_set.all %}
@ -147,6 +155,9 @@
{% endif %} </td>
{% endfor %} </tr>
</table>
{% else %}
<center>[ There are no surveys in the database for this year. ]</center>
{% endif %}
</div>
<div id="notesContent" class="behind">
<h3>Scanned notes for {{ current_survey }}.</h3>

View File

@ -33,7 +33,9 @@ urlpatterns = patterns('',
url(r'^statistics/?$', stats, name="stats"),
(r'^survey/?$', surveyindex),
url(r'^calendar/(?P<year>\d\d\d\d)?$', calendar, name="calendar"),
url(r'^survey/?$', surveyindex, name="survey"),
(r'^survey/(?P<year>\d\d\d\d)\#(?P<wallet_number>\d*)$', survey),
(r'^admin/doc/?', include('django.contrib.admindocs.urls')),