From 5657a9cb385f987627b9db06a94a53e01f3d8df2 Mon Sep 17 00:00:00 2001 From: Shane Frischkorn Date: Sat, 1 Mar 2014 23:08:25 +1000 Subject: [PATCH] Added glossary and acknowledgement pages, and reworked the structure of the theory pages. --- db.sqlite3 | Bin 172032 -> 176128 bytes three_d_viewer/admin.py | 3 +- .../0007_auto__add_glossaryentry.py | 78 ++++++++++++++++++ three_d_viewer/models.py | 16 ++++ .../three_d_viewer/acknowledgements.html | 10 +++ .../templates/three_d_viewer/base.html | 12 +-- .../templates/three_d_viewer/glossary.html | 16 ++++ .../templates/three_d_viewer/home.html | 4 - .../three_d_viewer/theory/bowen.html | 25 ++++++ .../three_d_viewer/theory/pressure_temp.html | 13 +++ .../three_d_viewer/theory/structure.html | 37 +++++++++ three_d_viewer/urls.py | 5 ++ three_d_viewer/views.py | 13 ++- 13 files changed, 219 insertions(+), 13 deletions(-) create mode 100644 three_d_viewer/migrations/0007_auto__add_glossaryentry.py create mode 100644 three_d_viewer/templates/three_d_viewer/acknowledgements.html create mode 100644 three_d_viewer/templates/three_d_viewer/glossary.html create mode 100644 three_d_viewer/templates/three_d_viewer/theory/bowen.html create mode 100644 three_d_viewer/templates/three_d_viewer/theory/pressure_temp.html create mode 100644 three_d_viewer/templates/three_d_viewer/theory/structure.html diff --git a/db.sqlite3 b/db.sqlite3 index c29f708daddc8164893569a49238bc83b8d85c76..b6ecf4afd2b8cc789553bb05df1bf46b8ef8a76d 100644 GIT binary patch delta 984 zcmaJ=O-vI(7~OCCvuy3oP=X>A%&Ld7OAE7<^3xchnnsO;UNGET7rKQS(wcU~keG;` zyip~x5`rG^qQQgN!-ks);b0)>!GkfD-~|&C)QiTDn7C~zv4Jqj%;CNL=6&DWd6REk zlbf#G36GzmsAg-I*Wg2c5d5#NKgTwaRi>Hhn3G*)XIRBhsvYdzpy;4_Aap@V@o{xb z)l`0DES=3NnF(G^X_*OBLgg}A1cSm}(eS8}8rfG=LMw{`O%AFXS_?`_JiaUA-P5tK z%I}SxdY98Cx~HZYKIU|-b422K6`@MDu!GVp5CF&q~q0SDifcD8W8F{~Nfk!Ar z;V*a%FX1Vi!PjsE*P#iC z(MKdB#4TG*z2dH1W~`>7k;)4QA)T^vOH0f0zLDFA)E*$g0Fijo9S(JcNmol}uwCku zOmq%@gH6O$I@1d=C$7Z^S6MQPsK#LfKw|L}if5DQjls8G@aT>loT0gsrkI1tBQ%Vg zi*t~HOZNtwnYw5c?n|07WWB8lpDKU$VO+DmHVchhg|RxB1)u(I2GFrKLIl1)Ho*5^ z?d$XNr{iiOnM&&U95jGn{+S2&d0T>8*O^UNrMY!$m>svXFaVt}KWqb`Ep}dKeiqny zi+x*SQNmpK3(6xK&*XI`NB7W7-ipj)=4?2@QV{?gV!8jElt`FJVX3`EA|2gr9W;_I z?glAZ$Pu3&x}gqhX8jZTE92st#7)F#U~DK{gip|H z$^@bazwei*GG%xvf*DNuVDV&EIX+aAoUf^q22>z$TJSKz7}wR;5$MaBXY>LQLN_XN mL-j^b;8E5N#QR@%r>piixCh$&R5}noUy`nQFI4)FKZ_q_k6g$A diff --git a/three_d_viewer/admin.py b/three_d_viewer/admin.py index bf974a8..79016a1 100644 --- a/three_d_viewer/admin.py +++ b/three_d_viewer/admin.py @@ -3,10 +3,11 @@ Configuration for the Django admin site """ from django.contrib import admin -from three_d_viewer.models import Category, Sample, Question, Answer, Mineral +from three_d_viewer.models import Category, Sample, Question, Answer, Mineral, GlossaryEntry admin.site.register(Category) admin.site.register(Sample) admin.site.register(Question) admin.site.register(Answer) admin.site.register(Mineral) +admin.site.register(GlossaryEntry) diff --git a/three_d_viewer/migrations/0007_auto__add_glossaryentry.py b/three_d_viewer/migrations/0007_auto__add_glossaryentry.py new file mode 100644 index 0000000..13b5d01 --- /dev/null +++ b/three_d_viewer/migrations/0007_auto__add_glossaryentry.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding model 'GlossaryEntry' + db.create_table(u'three_d_viewer_glossaryentry', ( + (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('name', self.gf('django.db.models.fields.CharField')(max_length=200)), + ('definition', self.gf('django.db.models.fields.CharField')(max_length=2000)), + )) + db.send_create_signal(u'three_d_viewer', ['GlossaryEntry']) + + + def backwards(self, orm): + # Deleting model 'GlossaryEntry' + db.delete_table(u'three_d_viewer_glossaryentry') + + + models = { + u'three_d_viewer.answer': { + 'Meta': {'object_name': 'Answer'}, + 'correct': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'question': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'answers'", 'to': u"orm['three_d_viewer.Question']"}), + 'text': ('django.db.models.fields.CharField', [], {'max_length': '2000'}) + }, + u'three_d_viewer.category': { + 'Meta': {'object_name': 'Category'}, + 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['three_d_viewer.Category']"}) + }, + u'three_d_viewer.glossaryentry': { + 'Meta': {'object_name': 'GlossaryEntry'}, + 'definition': ('django.db.models.fields.CharField', [], {'max_length': '2000'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}) + }, + u'three_d_viewer.mineral': { + 'Meta': {'object_name': 'Mineral', '_ormbases': [u'three_d_viewer.Sample']}, + 'chemical_formula': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), + 'cleavage_fracture': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), + 'colour': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), + 'crystallography': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), + 'habit': ('django.db.models.fields.CharField', [], {'max_length': '1000', 'blank': 'True'}), + 'hardness': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '3', 'decimal_places': '2', 'blank': 'True'}), + 'identifying_features': ('django.db.models.fields.CharField', [], {'max_length': '1000', 'blank': 'True'}), + 'lustre': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), + 'occurance': ('django.db.models.fields.CharField', [], {'max_length': '1000', 'blank': 'True'}), + u'sample_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['three_d_viewer.Sample']", 'unique': 'True', 'primary_key': 'True'}), + 'specific_gravity': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '4', 'decimal_places': '2', 'blank': 'True'}), + 'streak': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}) + }, + u'three_d_viewer.question': { + 'Meta': {'object_name': 'Question'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sample': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'questions'", 'to': u"orm['three_d_viewer.Sample']"}), + 'text': ('django.db.models.fields.CharField', [], {'max_length': '2000'}) + }, + u'three_d_viewer.sample': { + 'Meta': {'object_name': 'Sample'}, + 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'description': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '2000', 'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model_filename': ('django.db.models.fields.CharField', [], {'max_length': '1000'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'samples'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['three_d_viewer.Category']"}) + } + } + + complete_apps = ['three_d_viewer'] \ No newline at end of file diff --git a/three_d_viewer/models.py b/three_d_viewer/models.py index bb97ec9..587cd71 100644 --- a/three_d_viewer/models.py +++ b/three_d_viewer/models.py @@ -43,6 +43,9 @@ class Category(CommonInfo): def active_samples(self): return self.samples.select_subclasses(Sample, Mineral).filter(active=True).order_by('name') + class Meta: + verbose_name_plural = "Categories" + class Sample(CommonInfo): """ @@ -135,3 +138,16 @@ class Answer(models.Model): def __unicode__(self): return self.text + +class GlossaryEntry(models.Model): + """ + A glossary entry + """ + name = models.CharField(max_length=200) + definition = models.CharField(max_length=2000) + + def __unicode__(self): + return self.name + + class Meta: + verbose_name_plural = "Glossary Entries" diff --git a/three_d_viewer/templates/three_d_viewer/acknowledgements.html b/three_d_viewer/templates/three_d_viewer/acknowledgements.html new file mode 100644 index 0000000..59c605d --- /dev/null +++ b/three_d_viewer/templates/three_d_viewer/acknowledgements.html @@ -0,0 +1,10 @@ +{% extends "three_d_viewer/base.html" %} + +{% block content %} +
+
+

Acknowledgements



+ 3DVOL is funded by the QUT Teaching and Learning Unit and the School of Earth, Environmental, and Biological Sciences. QUT High Performance Computing provides technical support. +

+
+{% endblock %} \ No newline at end of file diff --git a/three_d_viewer/templates/three_d_viewer/base.html b/three_d_viewer/templates/three_d_viewer/base.html index dc40b7e..aeb7f33 100644 --- a/three_d_viewer/templates/three_d_viewer/base.html +++ b/three_d_viewer/templates/three_d_viewer/base.html @@ -26,11 +26,11 @@
  • Home
  • Minerals
      -
    • Theory +
    • Theory
    • Practice
    • @@ -52,9 +52,9 @@ diff --git a/three_d_viewer/templates/three_d_viewer/glossary.html b/three_d_viewer/templates/three_d_viewer/glossary.html new file mode 100644 index 0000000..a8886d5 --- /dev/null +++ b/three_d_viewer/templates/three_d_viewer/glossary.html @@ -0,0 +1,16 @@ +{% extends "three_d_viewer/base.html" %} + +{% block content %} +
      +
      +

      Glossary



      + + {% for entry in entries %} + + + + + {% endfor %} +

      {{ entry.name }}

      {{ entry.definition }}

      +
      +{% endblock %} \ No newline at end of file diff --git a/three_d_viewer/templates/three_d_viewer/home.html b/three_d_viewer/templates/three_d_viewer/home.html index 6e658f5..b60215b 100644 --- a/three_d_viewer/templates/three_d_viewer/home.html +++ b/three_d_viewer/templates/three_d_viewer/home.html @@ -19,10 +19,6 @@ We hope that you enjoy using 3DVOL.

      Your 3DVOL team -

      - Acknowledgements -
      - 3DVOL is funded by the QUT Teaching and Learning Unit and the School of Earth, Environmental, and Biological Sciences. QUT High Performance Computing provides technical support.

      {% endblock %} \ No newline at end of file diff --git a/three_d_viewer/templates/three_d_viewer/theory/bowen.html b/three_d_viewer/templates/three_d_viewer/theory/bowen.html new file mode 100644 index 0000000..770fcf9 --- /dev/null +++ b/three_d_viewer/templates/three_d_viewer/theory/bowen.html @@ -0,0 +1,25 @@ +{% extends "three_d_viewer/base.html" %} +{% load static %} + +{% block content %} +
      +
      +

      Theory

      +

      Bowen's Reaction Series

      +

      + Bowen's Reaction Series arranges the silicate minerals in the order that they crystallise from a magma. The minerals at the top of the series crystallise from the melt at higher temperature than those + lower down. It contains a continuous series, (right hand limb), discontinuous series (left hand limb), and the residual phases that describe the reaction pathway of different silicate minerals. + The discontinuous series crystallises different minerals, with abrupt changes separating the different minerals due to a mineral reacting with the melt to form a different mineral (eg. Olivine reacting to crystallise pyroxene). + The continuous series always crystallises plagioclase, but the composition of the plagioclase varies from more calcic at higher temperatures and more sodic as the temperature decreases. + with the minerals at the bottom of the series being more stable, and less susceptible to weathering. + The residual phases are the minerals at the bottom and crystallise last. Bowen's reaction series also predicts the stability of minerals in the low pressure conditions at the Earth's surface, +

      + It should be noted that all reactions do not start crystallising olivine/anorthite-rich plagioclase and continue through until they crystallise quartz. + The actual reactions depend on many factors, such as the chemical composition of the melt, temperature, pressure, and amount of fractional crystallisation. + For example, basalts form from the crystallisation of olivine, pyroxene and calcic plagioclase meaning that crystallisation stopped without the series progressing. + If more fractional crystallisation were to occur, more intermediate and felsic minerals can crystallise. + +

      +
      +
      +{% endblock %} diff --git a/three_d_viewer/templates/three_d_viewer/theory/pressure_temp.html b/three_d_viewer/templates/three_d_viewer/theory/pressure_temp.html new file mode 100644 index 0000000..7d04504 --- /dev/null +++ b/three_d_viewer/templates/three_d_viewer/theory/pressure_temp.html @@ -0,0 +1,13 @@ +{% extends "three_d_viewer/base.html" %} +{% load static %} + +{% block content %} +
      +
      +

      Theory

      +

      Pressure and Temperature

      +

      +

      +
      +
      +{% endblock %} diff --git a/three_d_viewer/templates/three_d_viewer/theory/structure.html b/three_d_viewer/templates/three_d_viewer/theory/structure.html new file mode 100644 index 0000000..a441db6 --- /dev/null +++ b/three_d_viewer/templates/three_d_viewer/theory/structure.html @@ -0,0 +1,37 @@ +{% extends "three_d_viewer/base.html" %} +{% load static %} + +{% block content %} +
      +
      +

      Theory

      +

      Structure of Earth

      +

      + The Earth's structure is differentiated in three distinct layers: the core, mantle, and crust. The layers are distinguished by a change in the velocity of seismic waves at their boundaries. + The crust is the upper most part of the earth, with depths ranging from an average of 7km in in the oceans, to an average of 38km in continental crust. + The crust thickens underneath mountain ranges, and can reach depths of 90km underneath the Himalayas. The composition of the crust also differs between oceanic and + continental environments. Ocean crust is young mafic crust dominated by basalts and gabbros that is recycled regularly(~300Ma) due to subduction processes. + Continental crust is much more varied in structure and composition than oceanic, but has an overall average composition of granodiorite. +

      + The boundary of the crust and mantle is defined by the Mohorovi?i? discontinuity, commonly referred to as the Moho. + It is defined by a sharp increase in seismic wave velocity, due to a change in material properties between crustal rocks and mantle rocks. The mantle is dominated by + silicate minerals that are rich in iron and magnesium, chiefly pyroxenes and polymorphs of olivine, forming peridotite. The mantle, while solid, behaves plastically, + allowing to flow at very slow rates. +

      + The core is distinguished by the absence of S waves, leading to the inference that the core is liquid. The core is separated into the outer core and the inner core. + The outer core is liquid dominated by iron and nickel. The inner core is solid, as determined by the strong refraction of P waves at the inner core-outer core boundary, + and was formed by crystalizing minerals from the liquid part of the core as the Earth cools. +

      + The crust and mantle are also further distinguished by material properties into the lithosphere, asthenosphere, and mesosphere. The chemical composition is + uniform throughout the mantle though, but changes in pressure and temperature determine which polymorphs will exist at different depths. + The lithosphere contains the crust, and the upper part of the mantle down to ~100km under oceanic crust, and 200-300km under continental crust (Twiss & Moores, 2007). + The lithosphere-asthenosphere boundary is defined by the 1300K isotherm, which is the temperature where olivine starts to behave viscously. + The rocks in the mesosphere are under more pressure than those in the asthenosphere, so no longer behave viscously. +

      + +
      Image sourced from USGS.
      +
      +

      +
      +
      +{% endblock %} diff --git a/three_d_viewer/urls.py b/three_d_viewer/urls.py index 5918a3e..0083bd6 100644 --- a/three_d_viewer/urls.py +++ b/three_d_viewer/urls.py @@ -8,6 +8,9 @@ urlpatterns = patterns( url(r'^$', views.HomeView.as_view(), name='home'), url(r'^$', generic.TemplateView.as_view(template_name="three_d_viewer/home.html"), name='home'), url(r'^minerals_theory/$', generic.TemplateView.as_view(template_name="three_d_viewer/minerals_theory.html"), name='minerals_theory'), + url(r'^theory/structure/$', generic.TemplateView.as_view(template_name="three_d_viewer/theory/structure.html"), name='theory_structure'), + url(r'^theory/bowen/$', generic.TemplateView.as_view(template_name="three_d_viewer/theory/bowen.html"), name='theory_bowen'), + url(r'^theory/pressure_temp/$', generic.TemplateView.as_view(template_name="three_d_viewer/theory/pressure_temp.html"), name='theory_pt'), url(r'^minerals_practice/$', views.MineralPracticeView.as_view(template_name="three_d_viewer/minerals_practice.html"), name='minerals_practice'), url(r'^minerals/(?P\d+)/$', views.MineralDetailView.as_view(), name='mineral_detail'), url(r'^minerals_selftest/$', generic.TemplateView.as_view(template_name="three_d_viewer/minerals_selftest.html"), name='minerals_selftest'), @@ -15,6 +18,8 @@ urlpatterns = patterns( url(r'^rocks/(?P\d+)/$', views.RockDetailView.as_view(), name='rock_detail'), url(r'^fossil_practice/$', views.FossilPracticeView.as_view(), name='fossil_practice'), url(r'^fossils/(?P\d+)/$', views.FossilDetailView.as_view(), name='fossil_detail'), + url(r'^glossary/$', views.GlossaryView.as_view(), name='glossary'), + url(r'^acknowledgements/$', generic.TemplateView.as_view(template_name='three_d_viewer/acknowledgements.html'), name='acknowledgements'), url(r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) diff --git a/three_d_viewer/views.py b/three_d_viewer/views.py index 5c3d860..f619bd3 100644 --- a/three_d_viewer/views.py +++ b/three_d_viewer/views.py @@ -7,7 +7,7 @@ from django.views import generic from itertools import chain from operator import attrgetter -from three_d_viewer.models import Sample, Category, Mineral +from three_d_viewer.models import Sample, Category, Mineral, GlossaryEntry register = template.Library() @@ -137,4 +137,13 @@ class FossilDetailView(generic.DetailView): result = chain(result, child.active_samples) context['active_samples'] = sorted(result, key=attrgetter('name')) - return context \ No newline at end of file + return context + +class GlossaryView(generic.ListView): + model = GlossaryEntry + template_name = 'three_d_viewer/glossary.html' + + def get_context_data(self, **kwargs): + context = super(GlossaryView, self).get_context_data(**kwargs) + context['entries'] = GlossaryEntry.objects.all() + return context