From 1316f7657f54f94c3c097291e8767fca99a1e506 Mon Sep 17 00:00:00 2001 From: aaron Date: Sat, 17 Jan 2009 08:11:01 +0100 Subject: [PATCH] [svn r8164] Got rid of ugly old design; brought in ugly new design. This one works a little better, still needs a lot of work. --- troggle/expo/admin.py | 9 +- troggle/expo/views_other.py | 6 +- troggle/media/css/main2.css | 169 ++++++++++++++- troggle/templates/base.html | 81 ++----- troggle/templates/survey.html | 382 ++++++++++------------------------ troggle/urls.py | 2 +- 6 files changed, 301 insertions(+), 348 deletions(-) diff --git a/troggle/expo/admin.py b/troggle/expo/admin.py index ce083348d..2f7fd4a3c 100644 --- a/troggle/expo/admin.py +++ b/troggle/expo/admin.py @@ -8,12 +8,15 @@ class RoleInline(admin.TabularInline): class SurvexBlockAdmin(admin.ModelAdmin): inlines = (RoleInline,) -class SurveyInline(admin.TabularInline): +class ScannedImageInline(admin.TabularInline): model = ScannedImage extra = 4 class SurveyAdmin(admin.ModelAdmin): - inlines = (SurveyInline,) + inlines = (ScannedImageInline,) + +class LogbookEntryAdmin(admin.ModelAdmin): + search_fields = ('title',) admin.site.register(Photo) admin.site.register(Cave) @@ -28,7 +31,7 @@ admin.site.register(Person) admin.site.register(PersonRole) admin.site.register(PersonExpedition) admin.site.register(Role) -admin.site.register(LogbookEntry) +admin.site.register(LogbookEntry, LogbookEntryAdmin) admin.site.register(PersonTrip) admin.site.register(QM) admin.site.register(Survey, SurveyAdmin) diff --git a/troggle/expo/views_other.py b/troggle/expo/views_other.py index 6ff16739d..88a855912 100644 --- a/troggle/expo/views_other.py +++ b/troggle/expo/views_other.py @@ -4,7 +4,7 @@ import troggle.settings as settings from django import forms from django.db.models import Q import re -#import randSent (it's not ready yet) +import randSent def stats(request): statsDict={} @@ -14,6 +14,6 @@ def stats(request): statsDict['logbookEntryCount'] = int(LogbookEntry.objects.count()) return render_to_response('statistics.html', statsDict) -#def frontPage(request): +def frontPage(request): -# return render_to_response('index.html', {'randSent':randSent.randomLogbookSentence(),'settings':settings}) \ No newline at end of file + return render_to_response('index.html', {'randSent':randSent.randomLogbookSentence(),'settings':settings}) \ No newline at end of file diff --git a/troggle/media/css/main2.css b/troggle/media/css/main2.css index 6ac3a3ece..e0023eadc 100644 --- a/troggle/media/css/main2.css +++ b/troggle/media/css/main2.css @@ -3,27 +3,66 @@ .plus2pt { font-size: 160%; } body, td, center, ul, p, input { - color: rgb(204, 204, 102); + color: rgb(0, 0, 0); font-family: sans-serif; } body { - background-color: #000; + background-color: #FFFFFF; + font: 100% Verdana, Arial, Helvetica, sans-serif; + background: #666666; + margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */ + padding: 0; + text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */ + color: #000000; } #expoHeader { - position: relative; - display: inline; - top:60px; + width:100%; + position:relative; + left:0; + right:0; + height:100px; } +#currentLocation { + float:right; + background:#999; + line-height: 80%; + font-variant: small-caps; + margin: 0px; + padding: 0px; +} +#expoHeaderText { + background:#999; + position:absolute; + bottom:0px; + clip:rect(10px auto auto auto) +/* filter:alpha(opacity=90); + -moz-opacity:.90; + opacity:.90; */ +} + +hr{ + margin:0; + padding:0; + height:1px; + border:thin solid #000; + border:#000; + color:#000; + background:#000; +} + +#expoHeader h1{ + position:relative; + bottom:-8px; + vertical-align:top; +} + #expoFinalDate { display: inline; } -h1 { - display: inline; -} -a:link, a:visited { text-decoration: none; } + div.centre img { vertical-align: middle; } -h1 { text-align: center; font-size: 210%; opacity:0.7; filter:alpha(opacity=70);} +h1 { text-align: center; font-size: 210%; display: inline;} h2 { color: #009900; } h3 { color: #2c105e; } h4 { color: #0d664c; } @@ -105,3 +144,113 @@ 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; +} + +table { + border: thin solid silver; + border-collapse: collapse; +} +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; +} + +.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; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + border-top-width: thin; + border-right-width: thin; + border-bottom-width: thin; + border-left-width: thin; +} +.behind { + display: none; +} +div.figure { + float: left; + width: 25%; + border: thin silver solid; + margin: 0.5em; + padding: 0.5em; +} +div.figure p { + text-align: left; + font-size: smaller; + text-indent: 0; +} +img.thumbnail { + width: 100%; +} + + +[if IE]> + + {% block title %}{% endblock %} - + +{% block javascript %}{% endblock %} - - - -
-

CUCC Expeditions to Austria: 1976 -

-
-

1976

+
+
+
+

CUCC Expeditions to Austria: 1976 -

+
+

1976

+
+
+
+
+
-

 

-

 

-

 

-
+ - - - -
- -{% block lgbkQuote %}{% endblock %} -
- -
-

-
+


{% block currentLocation %} Welcome to the website of the Cambridge University Caving Club's expeditions to Austria. - {% endblock %} -

-
-
-
{% block content %}{% endblock %}
+ {% endblock %}
+
{% block content %} + {% endblock %}
{% block footer %} - -

{% endblock %}

- \ No newline at end of file diff --git a/troggle/templates/survey.html b/troggle/templates/survey.html index b611d78a8..acd9d3c84 100644 --- a/troggle/templates/survey.html +++ b/troggle/templates/survey.html @@ -1,137 +1,19 @@ - - - - -Untitled Document - - +{% extends "base.html" %} +{% load wiki_markup %} + + +{% block title %}CUCC Virtual Survey Binder: {{ current_expedition }}{{ current_survey }}{%endblock%} +{% block javascript %} - +{% endblock %} + - +{% block currentLocation %} + CUCC Expo virtual survey binder: + {% if current_survey %} + {{current_survey}} + {% else %} + {{current_year }} + {% endif %} +{% endblock %} + +{% block nav %}
-

Survey Stages for {{ current_survey }}


- + -
@@ -216,137 +106,83 @@ img.thumbnail {
- - -
+
+ {% endblock %} + +{% block content %}
-
-

- Status of surveys from {{ current_expedition }} -

- - - - {% for survey in current_expedition.survey_set.all %} - - {% endfor %} - - - - {% for survey in current_expedition.survey_set.all %} - - {% endfor %} - - - - {% for survey in current_expedition.survey_set.all %} - - {% endfor %} - - - - {% for survey in current_expedition.survey_set.all %} - - {% endfor %} - - - - {% for survey in current_expedition.survey_set.all %} - - {% endfor %} - -
- - {{ survey.wallet_number }} -
- Notes - - {% if survey.notes %} - ✓ - {% endif %} -
- Survex file - - {% if survey.survex_file %} - ✓ - {% endif %} -
- Plans - - {% if survey.plans %} - ✓ - {% endif %} -
- Elevations - - {% if survey.elevations %} - ✓ - {% endif %} -
- - - +
+ + + + {% for survey in current_expedition.survey_set.all %} + + {% endfor %} + + + {% for survey in current_expedition.survey_set.all %} + + {% endfor %} + + + {% for survey in current_expedition.survey_set.all %} + + {% endfor %} + + + {% for survey in current_expedition.survey_set.all %} + + {% endfor %} + + + {% for survey in current_expedition.survey_set.all %} + + {% endfor %} +
{{ survey.wallet_number }}
Notes {% if survey.notes %} + ✓ + {% endif %}
Survex file {% if survey.survex_file %} + ✓ + {% endif %}
Plans {% if survey.plans %} + ✓ + {% endif %}
Elevations {% if survey.elevations %} + ✓ + {% endif %}
- -
-

Scanned notes for {{ current_survey }}.

- - {% for noteItem in notes %} -
-

- -

- File at: - - {{ noteItem.file.name }} -
- Scanned by: {{ noteItem.scanned_by }}
- On: {{ noteItem.scanned_on }}
-

-
- {% endfor %} - +
+

Scanned notes for {{ current_survey }}.

+ {% for noteItem in notes %} +
+

+

File at: {{ noteItem.file.name }}
+ Scanned by: {{ noteItem.scanned_by }}
+ On: {{ noteItem.scanned_on }}
+

+

+
+ {% endfor %} +
-
survex file editor, keeping file in original structure
who entered by
centreline
-

Scanned plan sketch files for {{ current_survey }}.

- - {% for sketchItem in planSketches %} -
-

- -

- File at: - - {{ sketchItem.file.name }} -
- Scanned by: {{ sketchItem.scanned_by }}
- On: {{ sketchItem.scanned_on }}
-

-
- {% endfor %} - -
+

Scanned plan sketch files for {{ current_survey }}.

+ {% for sketchItem in planSketches %} +
+

+

File at: {{ sketchItem.file.name }}
+ Scanned by: {{ sketchItem.scanned_by }}
+ On: {{ sketchItem.scanned_on }}
+

+

+
+ {% endfor %} + +
link to tunnel xml file. potentially instance of tunnel applet...
link to main sketch file

- - +{% endblock %} \ No newline at end of file diff --git a/troggle/urls.py b/troggle/urls.py index f1ea86442..eb9a82565 100644 --- a/troggle/urls.py +++ b/troggle/urls.py @@ -6,7 +6,7 @@ admin.autodiscover() urlpatterns = patterns('', - #(r'^$', frontPage), + (r'^$', frontPage), (r'^cave/?$', caveindex), (r'^cave/(?P[^/]+)/?$', cave), (r'^cave/(?P[^/]+)/?(?P[^/])$', ent),