2 Commits
V2 ... master

Author SHA1 Message Date
1ec5df85dd Fixed spelling 2015-03-02 16:05:36 +10:00
138494c4b1 Merge V2 branch 2015-02-24 14:05:43 +10:00
83 changed files with 8953 additions and 4986 deletions

View File

@@ -424,7 +424,8 @@ textarea {
vertical-align: top !important; vertical-align: top !important;
} }
input[type=text], input[type=password], textarea, select, .vTextField { input[type=text], input[type=password], input[type=email], input[type=url], input[type=number],
textarea, select, .vTextField {
border: 1px solid #ccc; border: 1px solid #ccc;
} }

View File

@@ -32,6 +32,10 @@
padding-right: 1em; padding-right: 1em;
} }
#changelist-form .results {
overflow-x: auto;
}
#changelist .toplinks { #changelist .toplinks {
border-bottom: 1px solid #ccc !important; border-bottom: 1px solid #ccc !important;
} }

View File

@@ -23,7 +23,7 @@ ul.actionlist li {
list-style-type: none; list-style-type: none;
} }
ul.actionlist li.changelink { ul.actionlist li {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
-o-text-overflow: ellipsis; -o-text-overflow: ellipsis;

View File

@@ -65,6 +65,7 @@ form ul.inline li {
padding: 3px 10px 0 0; padding: 3px 10px 0 0;
float: left; float: left;
width: 8em; width: 8em;
word-wrap: break-word;
} }
.aligned ul label { .aligned ul label {

View File

@@ -29,17 +29,20 @@ body.login {
} }
.login .form-row label { .login .form-row label {
float: left;
width: 9em;
padding-right: 0.5em; padding-right: 0.5em;
line-height: 2em; line-height: 2em;
text-align: right;
font-size: 1em; font-size: 1em;
clear: both;
color: #333; color: #333;
} }
.login .form-row #id_username, .login .form-row #id_password { .login .form-row #id_username, .login .form-row #id_password {
width: 14em; clear: both;
padding: 6px;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
} }
.login span.help { .login span.help {

View File

@@ -1,18 +1,18 @@
/* SELECTOR (FILTER INTERFACE) */ /* SELECTOR (FILTER INTERFACE) */
.selector { .selector {
width: 580px; width: 840px;
float: left; float: left;
} }
.selector select { .selector select {
width: 270px; width: 400px;
height: 17.2em; height: 17.2em;
} }
.selector-available, .selector-chosen { .selector-available, .selector-chosen {
float: left; float: left;
width: 270px; width: 400px;
text-align: center; text-align: center;
margin-bottom: 5px; margin-bottom: 5px;
} }
@@ -48,7 +48,7 @@
} }
.selector .selector-available input { .selector .selector-available input {
width: 230px; width: 360px;
} }
.selector ul.selector-chooser { .selector ul.selector-chooser {

View File

@@ -9,7 +9,7 @@
} else { } else {
reset(); reset();
} }
$(actionCheckboxes).attr("checked", checked) $(actionCheckboxes).prop("checked", checked)
.parent().parent().toggleClass(options.selectedClass, checked); .parent().parent().toggleClass(options.selectedClass, checked);
}, },
updateCounter = function() { updateCounter = function() {
@@ -19,7 +19,7 @@
sel: sel, sel: sel,
cnt: _actions_icnt cnt: _actions_icnt
}, true)); }, true));
$(options.allToggle).attr("checked", function() { $(options.allToggle).prop("checked", function() {
if (sel == actionCheckboxes.length) { if (sel == actionCheckboxes.length) {
value = true; value = true;
showQuestion(); showQuestion();
@@ -64,7 +64,7 @@
} }
}); });
$(options.allToggle).show().click(function() { $(options.allToggle).show().click(function() {
checker($(this).attr("checked")); checker($(this).prop("checked"));
updateCounter(); updateCounter();
}); });
$("div.actions span.question a").click(function(event) { $("div.actions span.question a").click(function(event) {
@@ -74,7 +74,7 @@
}); });
$("div.actions span.clear a").click(function(event) { $("div.actions span.clear a").click(function(event) {
event.preventDefault(); event.preventDefault();
$(options.allToggle).attr("checked", false); $(options.allToggle).prop("checked", false);
clearAcross(); clearAcross();
checker(0); checker(0);
updateCounter(); updateCounter();
@@ -85,14 +85,14 @@
var target = event.target ? event.target : event.srcElement; var target = event.target ? event.target : event.srcElement;
if (lastChecked && $.data(lastChecked) != $.data(target) && event.shiftKey === true) { if (lastChecked && $.data(lastChecked) != $.data(target) && event.shiftKey === true) {
var inrange = false; var inrange = false;
$(lastChecked).attr("checked", target.checked) $(lastChecked).prop("checked", target.checked)
.parent().parent().toggleClass(options.selectedClass, target.checked); .parent().parent().toggleClass(options.selectedClass, target.checked);
$(actionCheckboxes).each(function() { $(actionCheckboxes).each(function() {
if ($.data(this) == $.data(lastChecked) || $.data(this) == $.data(target)) { if ($.data(this) == $.data(lastChecked) || $.data(this) == $.data(target)) {
inrange = (inrange) ? false : true; inrange = (inrange) ? false : true;
} }
if (inrange) { if (inrange) {
$(this).attr("checked", target.checked) $(this).prop("checked", target.checked)
.parent().parent().toggleClass(options.selectedClass, target.checked); .parent().parent().toggleClass(options.selectedClass, target.checked);
} }
}); });

View File

@@ -1,6 +1,6 @@
(function(a){a.fn.actions=function(n){var b=a.extend({},a.fn.actions.defaults,n),e=a(this),g=false,k=function(c){c?i():j();a(e).attr("checked",c).parent().parent().toggleClass(b.selectedClass,c)},f=function(){var c=a(e).filter(":checked").length;a(b.counterContainer).html(interpolate(ngettext("%(sel)s of %(cnt)s selected","%(sel)s of %(cnt)s selected",c),{sel:c,cnt:_actions_icnt},true));a(b.allToggle).attr("checked",function(){if(c==e.length){value=true;i()}else{value=false;l()}return value})},i= (function(a){a.fn.actions=function(n){var b=a.extend({},a.fn.actions.defaults,n),e=a(this),g=false,k=function(c){c?i():j();a(e).prop("checked",c).parent().parent().toggleClass(b.selectedClass,c)},f=function(){var c=a(e).filter(":checked").length;a(b.counterContainer).html(interpolate(ngettext("%(sel)s of %(cnt)s selected","%(sel)s of %(cnt)s selected",c),{sel:c,cnt:_actions_icnt},true));a(b.allToggle).prop("checked",function(){if(c==e.length){value=true;i()}else{value=false;l()}return value})},i=
function(){a(b.acrossClears).hide();a(b.acrossQuestions).show();a(b.allContainer).hide()},m=function(){a(b.acrossClears).show();a(b.acrossQuestions).hide();a(b.actionContainer).toggleClass(b.selectedClass);a(b.allContainer).show();a(b.counterContainer).hide()},j=function(){a(b.acrossClears).hide();a(b.acrossQuestions).hide();a(b.allContainer).hide();a(b.counterContainer).show()},l=function(){j();a(b.acrossInput).val(0);a(b.actionContainer).removeClass(b.selectedClass)};a(b.counterContainer).show(); function(){a(b.acrossClears).hide();a(b.acrossQuestions).show();a(b.allContainer).hide()},m=function(){a(b.acrossClears).show();a(b.acrossQuestions).hide();a(b.actionContainer).toggleClass(b.selectedClass);a(b.allContainer).show();a(b.counterContainer).hide()},j=function(){a(b.acrossClears).hide();a(b.acrossQuestions).hide();a(b.allContainer).hide();a(b.counterContainer).show()},l=function(){j();a(b.acrossInput).val(0);a(b.actionContainer).removeClass(b.selectedClass)};a(b.counterContainer).show();
a(this).filter(":checked").each(function(){a(this).parent().parent().toggleClass(b.selectedClass);f();a(b.acrossInput).val()==1&&m()});a(b.allToggle).show().click(function(){k(a(this).attr("checked"));f()});a("div.actions span.question a").click(function(c){c.preventDefault();a(b.acrossInput).val(1);m()});a("div.actions span.clear a").click(function(c){c.preventDefault();a(b.allToggle).attr("checked",false);l();k(0);f()});lastChecked=null;a(e).click(function(c){if(!c)c=window.event;var d=c.target? a(this).filter(":checked").each(function(){a(this).parent().parent().toggleClass(b.selectedClass);f();a(b.acrossInput).val()==1&&m()});a(b.allToggle).show().click(function(){k(a(this).prop("checked"));f()});a("div.actions span.question a").click(function(c){c.preventDefault();a(b.acrossInput).val(1);m()});a("div.actions span.clear a").click(function(c){c.preventDefault();a(b.allToggle).prop("checked",false);l();k(0);f()});lastChecked=null;a(e).click(function(c){if(!c)c=window.event;var d=c.target?
c.target:c.srcElement;if(lastChecked&&a.data(lastChecked)!=a.data(d)&&c.shiftKey===true){var h=false;a(lastChecked).attr("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked);a(e).each(function(){if(a.data(this)==a.data(lastChecked)||a.data(this)==a.data(d))h=h?false:true;h&&a(this).attr("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked)})}a(d).parent().parent().toggleClass(b.selectedClass,d.checked);lastChecked=d;f()});a("form#changelist-form table#result_list tr").find("td:gt(0) :input").change(function(){g= c.target:c.srcElement;if(lastChecked&&a.data(lastChecked)!=a.data(d)&&c.shiftKey===true){var h=false;a(lastChecked).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked);a(e).each(function(){if(a.data(this)==a.data(lastChecked)||a.data(this)==a.data(d))h=h?false:true;h&&a(this).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked)})}a(d).parent().parent().toggleClass(b.selectedClass,d.checked);lastChecked=d;f()});a("form#changelist-form table#result_list tr").find("td:gt(0) :input").change(function(){g=
true});a('form#changelist-form button[name="index"]').click(function(){if(g)return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."))});a('form#changelist-form input[name="_save"]').click(function(){var c=false;a("div.actions select option:selected").each(function(){if(a(this).val())c=true});if(c)return g?confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action.")): true});a('form#changelist-form button[name="index"]').click(function(){if(g)return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."))});a('form#changelist-form input[name="_save"]').click(function(){var c=false;a("div.actions select option:selected").each(function(){if(a(this).val())c=true});if(c)return g?confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action.")):
confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button."))})};a.fn.actions.defaults={actionContainer:"div.actions",counterContainer:"span.action-counter",allContainer:"div.actions span.all",acrossInput:"div.actions input.select-across",acrossQuestions:"div.actions span.question",acrossClears:"div.actions span.clear",allToggle:"#action-toggle",selectedClass:"selected"}})(django.jQuery); confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button."))})};a.fn.actions.defaults={actionContainer:"div.actions",counterContainer:"span.action-counter",allContainer:"div.actions span.all",acrossInput:"div.actions input.select-across",acrossQuestions:"div.actions span.question",acrossClears:"div.actions span.clear",allToggle:"#action-toggle",selectedClass:"selected"}})(django.jQuery);

View File

@@ -6,6 +6,8 @@ var DateTimeShortcuts = {
calendars: [], calendars: [],
calendarInputs: [], calendarInputs: [],
clockInputs: [], clockInputs: [],
dismissClockFunc: [],
dismissCalendarFunc: [],
calendarDivName1: 'calendarbox', // name of calendar <div> that gets toggled calendarDivName1: 'calendarbox', // name of calendar <div> that gets toggled
calendarDivName2: 'calendarin', // name of <div> that contains calendar calendarDivName2: 'calendarin', // name of <div> that contains calendar
calendarLinkName: 'calendarlink',// name of the link that is used to toggle calendarLinkName: 'calendarlink',// name of the link that is used to toggle
@@ -39,6 +41,7 @@ var DateTimeShortcuts = {
addClock: function(inp) { addClock: function(inp) {
var num = DateTimeShortcuts.clockInputs.length; var num = DateTimeShortcuts.clockInputs.length;
DateTimeShortcuts.clockInputs[num] = inp; DateTimeShortcuts.clockInputs[num] = inp;
DateTimeShortcuts.dismissClockFunc[num] = function() { DateTimeShortcuts.dismissClock(num); return true; };
// Shortcut links (clock icon and "Now" link) // Shortcut links (clock icon and "Now" link)
var shortcuts_span = document.createElement('span'); var shortcuts_span = document.createElement('span');
@@ -76,7 +79,7 @@ var DateTimeShortcuts = {
clock_box.className = 'clockbox module'; clock_box.className = 'clockbox module';
clock_box.setAttribute('id', DateTimeShortcuts.clockDivName + num); clock_box.setAttribute('id', DateTimeShortcuts.clockDivName + num);
document.body.appendChild(clock_box); document.body.appendChild(clock_box);
addEvent(clock_box, 'click', DateTimeShortcuts.cancelEventPropagation); addEvent(clock_box, 'click', cancelEventPropagation);
quickElement('h2', clock_box, gettext('Choose a time')); quickElement('h2', clock_box, gettext('Choose a time'));
var time_list = quickElement('ul', clock_box, ''); var time_list = quickElement('ul', clock_box, '');
@@ -118,11 +121,11 @@ var DateTimeShortcuts = {
// Show the clock box // Show the clock box
clock_box.style.display = 'block'; clock_box.style.display = 'block';
addEvent(window.document, 'click', function() { DateTimeShortcuts.dismissClock(num); return true; }); addEvent(document, 'click', DateTimeShortcuts.dismissClockFunc[num]);
}, },
dismissClock: function(num) { dismissClock: function(num) {
document.getElementById(DateTimeShortcuts.clockDivName + num).style.display = 'none'; document.getElementById(DateTimeShortcuts.clockDivName + num).style.display = 'none';
window.document.onclick = null; removeEvent(document, 'click', DateTimeShortcuts.dismissClockFunc[num]);
}, },
handleClockQuicklink: function(num, val) { handleClockQuicklink: function(num, val) {
DateTimeShortcuts.clockInputs[num].value = val; DateTimeShortcuts.clockInputs[num].value = val;
@@ -134,6 +137,7 @@ var DateTimeShortcuts = {
var num = DateTimeShortcuts.calendars.length; var num = DateTimeShortcuts.calendars.length;
DateTimeShortcuts.calendarInputs[num] = inp; DateTimeShortcuts.calendarInputs[num] = inp;
DateTimeShortcuts.dismissCalendarFunc[num] = function() { DateTimeShortcuts.dismissCalendar(num); return true; };
// Shortcut links (calendar icon and "Today" link) // Shortcut links (calendar icon and "Today" link)
var shortcuts_span = document.createElement('span'); var shortcuts_span = document.createElement('span');
@@ -174,7 +178,7 @@ var DateTimeShortcuts = {
cal_box.className = 'calendarbox module'; cal_box.className = 'calendarbox module';
cal_box.setAttribute('id', DateTimeShortcuts.calendarDivName1 + num); cal_box.setAttribute('id', DateTimeShortcuts.calendarDivName1 + num);
document.body.appendChild(cal_box); document.body.appendChild(cal_box);
addEvent(cal_box, 'click', DateTimeShortcuts.cancelEventPropagation); addEvent(cal_box, 'click', cancelEventPropagation);
// next-prev links // next-prev links
var cal_nav = quickElement('div', cal_box, ''); var cal_nav = quickElement('div', cal_box, '');
@@ -241,11 +245,11 @@ var DateTimeShortcuts = {
cal_box.style.top = Math.max(0, findPosY(cal_link) - 75) + 'px'; cal_box.style.top = Math.max(0, findPosY(cal_link) - 75) + 'px';
cal_box.style.display = 'block'; cal_box.style.display = 'block';
addEvent(window.document, 'click', function() { DateTimeShortcuts.dismissCalendar(num); return true; }); addEvent(document, 'click', DateTimeShortcuts.dismissCalendarFunc[num]);
}, },
dismissCalendar: function(num) { dismissCalendar: function(num) {
document.getElementById(DateTimeShortcuts.calendarDivName1+num).style.display = 'none'; document.getElementById(DateTimeShortcuts.calendarDivName1+num).style.display = 'none';
window.document.onclick = null; removeEvent(document, 'click', DateTimeShortcuts.dismissCalendarFunc[num]);
}, },
drawPrev: function(num) { drawPrev: function(num) {
DateTimeShortcuts.calendars[num].drawPreviousMonth(); DateTimeShortcuts.calendars[num].drawPreviousMonth();
@@ -277,11 +281,6 @@ var DateTimeShortcuts = {
DateTimeShortcuts.calendarInputs[num].value = d.strftime(get_format('DATE_INPUT_FORMATS')[0]); DateTimeShortcuts.calendarInputs[num].value = d.strftime(get_format('DATE_INPUT_FORMATS')[0]);
DateTimeShortcuts.calendarInputs[num].focus(); DateTimeShortcuts.calendarInputs[num].focus();
DateTimeShortcuts.dismissCalendar(num); DateTimeShortcuts.dismissCalendar(num);
},
cancelEventPropagation: function(e) {
if (!e) e = window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
} }
} }

View File

@@ -32,9 +32,9 @@ function showRelatedObjectLookupPopup(triggeringLink) {
name = id_to_windowname(name); name = id_to_windowname(name);
var href; var href;
if (triggeringLink.href.search(/\?/) >= 0) { if (triggeringLink.href.search(/\?/) >= 0) {
href = triggeringLink.href + '&pop=1'; href = triggeringLink.href + '&_popup=1';
} else { } else {
href = triggeringLink.href + '?pop=1'; href = triggeringLink.href + '?_popup=1';
} }
var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes'); var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes');
win.focus(); win.focus();

View File

@@ -1,26 +1,8 @@
/* /*
calendar.js - Calendar functions by Adrian Holovaty calendar.js - Calendar functions by Adrian Holovaty
depends on core.js for utility functions like removeChildren or quickElement
*/ */
function removeChildren(a) { // "a" is reference to an object
while (a.hasChildNodes()) a.removeChild(a.lastChild);
}
// quickElement(tagType, parentReference, textInChildNode, [, attribute, attributeValue ...]);
function quickElement() {
var obj = document.createElement(arguments[0]);
if (arguments[2] != '' && arguments[2] != null) {
var textNode = document.createTextNode(arguments[2]);
obj.appendChild(textNode);
}
var len = arguments.length;
for (var i = 3; i < len; i += 2) {
obj.setAttribute(arguments[i], arguments[i+1]);
}
arguments[1].appendChild(obj);
return obj;
}
// CalendarNamespace -- Provides a collection of HTML calendar-related helper functions // CalendarNamespace -- Provides a collection of HTML calendar-related helper functions
var CalendarNamespace = { var CalendarNamespace = {
monthsOfYear: gettext('January February March April May June July August September October November December').split(' '), monthsOfYear: gettext('January February March April May June July August September October November December').split(' '),

View File

@@ -10,15 +10,15 @@
} }
}); });
// Add toggle to anchor tag // Add toggle to anchor tag
$("fieldset.collapse a.collapse-toggle").toggle( $("fieldset.collapse a.collapse-toggle").click(function(ev) {
function() { // Show if ($(this).closest("fieldset").hasClass("collapsed")) {
// Show
$(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset", [$(this).attr("id")]); $(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset", [$(this).attr("id")]);
return false; } else {
}, // Hide
function() { // Hide
$(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", [$(this).attr("id")]); $(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", [$(this).attr("id")]);
return false;
} }
); return false;
});
}); });
})(django.jQuery); })(django.jQuery);

View File

@@ -1,2 +1,2 @@
(function(a){a(document).ready(function(){a("fieldset.collapse").each(function(c,b){a(b).find("div.errors").length==0&&a(b).addClass("collapsed").find("h2").first().append(' (<a id="fieldsetcollapser'+c+'" class="collapse-toggle" href="#">'+gettext("Show")+"</a>)")});a("fieldset.collapse a.collapse-toggle").toggle(function(){a(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset",[a(this).attr("id")]);return false},function(){a(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", (function(a){a(document).ready(function(){a("fieldset.collapse").each(function(c,b){0==a(b).find("div.errors").length&&a(b).addClass("collapsed").find("h2").first().append(' (<a id="fieldsetcollapser'+c+'" class="collapse-toggle" href="#">'+gettext("Show")+"</a>)")});a("fieldset.collapse a.collapse-toggle").click(function(){a(this).closest("fieldset").hasClass("collapsed")?a(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset",[a(this).attr("id")]):a(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset",
[a(this).attr("id")]);return false})})})(django.jQuery); [a(this).attr("id")]);return!1})})})(django.jQuery);

View File

@@ -29,6 +29,12 @@ function removeEvent(obj, evType, fn) {
} }
} }
function cancelEventPropagation(e) {
if (!e) e = window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
}
// quickElement(tagType, parentReference, textInChildNode, [, attribute, attributeValue ...]); // quickElement(tagType, parentReference, textInChildNode, [, attribute, attributeValue ...]);
function quickElement() { function quickElement() {
var obj = document.createElement(arguments[0]); var obj = document.createElement(arguments[0]);
@@ -44,6 +50,11 @@ function quickElement() {
return obj; return obj;
} }
// "a" is reference to an object
function removeChildren(a) {
while (a.hasChildNodes()) a.removeChild(a.lastChild);
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Cross-browser xmlhttp object // Cross-browser xmlhttp object
// from http://jibbering.com/2002/4/httprequest.html // from http://jibbering.com/2002/4/httprequest.html

View File

@@ -22,8 +22,8 @@
var updateElementIndex = function(el, prefix, ndx) { var updateElementIndex = function(el, prefix, ndx) {
var id_regex = new RegExp("(" + prefix + "-(\\d+|__prefix__))"); var id_regex = new RegExp("(" + prefix + "-(\\d+|__prefix__))");
var replacement = prefix + "-" + ndx; var replacement = prefix + "-" + ndx;
if ($(el).attr("for")) { if ($(el).prop("for")) {
$(el).attr("for", $(el).attr("for").replace(id_regex, replacement)); $(el).prop("for", $(el).prop("for").replace(id_regex, replacement));
} }
if (el.id) { if (el.id) {
el.id = el.id.replace(id_regex, replacement); el.id = el.id.replace(id_regex, replacement);
@@ -32,9 +32,9 @@
el.name = el.name.replace(id_regex, replacement); el.name = el.name.replace(id_regex, replacement);
} }
}; };
var totalForms = $("#id_" + options.prefix + "-TOTAL_FORMS").attr("autocomplete", "off"); var totalForms = $("#id_" + options.prefix + "-TOTAL_FORMS").prop("autocomplete", "off");
var nextIndex = parseInt(totalForms.val(), 10); var nextIndex = parseInt(totalForms.val(), 10);
var maxForms = $("#id_" + options.prefix + "-MAX_NUM_FORMS").attr("autocomplete", "off"); var maxForms = $("#id_" + options.prefix + "-MAX_NUM_FORMS").prop("autocomplete", "off");
// only show the add button if we are allowed to add more items, // only show the add button if we are allowed to add more items,
// note that max_num = None translates to a blank string. // note that max_num = None translates to a blank string.
var showAddButton = maxForms.val() === '' || (maxForms.val()-totalForms.val()) > 0; var showAddButton = maxForms.val() === '' || (maxForms.val()-totalForms.val()) > 0;
@@ -43,7 +43,7 @@
}); });
if ($this.length && showAddButton) { if ($this.length && showAddButton) {
var addButton; var addButton;
if ($this.attr("tagName") == "TR") { if ($this.prop("tagName") == "TR") {
// If forms are laid out as table rows, insert the // If forms are laid out as table rows, insert the
// "add" button in a new table row: // "add" button in a new table row:
var numCols = this.eq(-1).children().length; var numCols = this.eq(-1).children().length;

View File

@@ -1,5 +1,5 @@
(function(b){b.fn.formset=function(d){var a=b.extend({},b.fn.formset.defaults,d),c=b(this),d=c.parent(),i=function(a,e,g){var d=RegExp("("+e+"-(\\d+|__prefix__))"),e=e+"-"+g;b(a).attr("for")&&b(a).attr("for",b(a).attr("for").replace(d,e));a.id&&(a.id=a.id.replace(d,e));a.name&&(a.name=a.name.replace(d,e))},f=b("#id_"+a.prefix+"-TOTAL_FORMS").attr("autocomplete","off"),g=parseInt(f.val(),10),e=b("#id_"+a.prefix+"-MAX_NUM_FORMS").attr("autocomplete","off"),f=""===e.val()||0<e.val()-f.val();c.each(function(){b(this).not("."+ (function(b){b.fn.formset=function(d){var a=b.extend({},b.fn.formset.defaults,d),c=b(this),d=c.parent(),i=function(a,e,g){var d=RegExp("("+e+"-(\\d+|__prefix__))"),e=e+"-"+g;b(a).prop("for")&&b(a).prop("for",b(a).prop("for").replace(d,e));a.id&&(a.id=a.id.replace(d,e));a.name&&(a.name=a.name.replace(d,e))},f=b("#id_"+a.prefix+"-TOTAL_FORMS").prop("autocomplete","off"),g=parseInt(f.val(),10),e=b("#id_"+a.prefix+"-MAX_NUM_FORMS").prop("autocomplete","off"),f=""===e.val()||0<e.val()-f.val();c.each(function(){b(this).not("."+
a.emptyCssClass).addClass(a.formCssClass)});if(c.length&&f){var h;"TR"==c.attr("tagName")?(c=this.eq(-1).children().length,d.append('<tr class="'+a.addCssClass+'"><td colspan="'+c+'"><a href="javascript:void(0)">'+a.addText+"</a></tr>"),h=d.find("tr:last a")):(c.filter(":last").after('<div class="'+a.addCssClass+'"><a href="javascript:void(0)">'+a.addText+"</a></div>"),h=c.filter(":last").next().find("a"));h.click(function(d){d.preventDefault();var f=b("#id_"+a.prefix+"-TOTAL_FORMS"),d=b("#"+a.prefix+ a.emptyCssClass).addClass(a.formCssClass)});if(c.length&&f){var h;"TR"==c.prop("tagName")?(c=this.eq(-1).children().length,d.append('<tr class="'+a.addCssClass+'"><td colspan="'+c+'"><a href="javascript:void(0)">'+a.addText+"</a></tr>"),h=d.find("tr:last a")):(c.filter(":last").after('<div class="'+a.addCssClass+'"><a href="javascript:void(0)">'+a.addText+"</a></div>"),h=c.filter(":last").next().find("a"));h.click(function(d){d.preventDefault();var f=b("#id_"+a.prefix+"-TOTAL_FORMS"),d=b("#"+a.prefix+
"-empty"),c=d.clone(true);c.removeClass(a.emptyCssClass).addClass(a.formCssClass).attr("id",a.prefix+"-"+g);c.is("tr")?c.children(":last").append('<div><a class="'+a.deleteCssClass+'" href="javascript:void(0)">'+a.deleteText+"</a></div>"):c.is("ul")||c.is("ol")?c.append('<li><a class="'+a.deleteCssClass+'" href="javascript:void(0)">'+a.deleteText+"</a></li>"):c.children(":first").append('<span><a class="'+a.deleteCssClass+'" href="javascript:void(0)">'+a.deleteText+"</a></span>");c.find("*").each(function(){i(this, "-empty"),c=d.clone(true);c.removeClass(a.emptyCssClass).addClass(a.formCssClass).attr("id",a.prefix+"-"+g);c.is("tr")?c.children(":last").append('<div><a class="'+a.deleteCssClass+'" href="javascript:void(0)">'+a.deleteText+"</a></div>"):c.is("ul")||c.is("ol")?c.append('<li><a class="'+a.deleteCssClass+'" href="javascript:void(0)">'+a.deleteText+"</a></li>"):c.children(":first").append('<span><a class="'+a.deleteCssClass+'" href="javascript:void(0)">'+a.deleteText+"</a></span>");c.find("*").each(function(){i(this,
a.prefix,f.val())});c.insertBefore(b(d));b(f).val(parseInt(f.val(),10)+1);g=g+1;e.val()!==""&&e.val()-f.val()<=0&&h.parent().hide();c.find("a."+a.deleteCssClass).click(function(d){d.preventDefault();d=b(this).parents("."+a.formCssClass);d.remove();g=g-1;a.removed&&a.removed(d);d=b("."+a.formCssClass);b("#id_"+a.prefix+"-TOTAL_FORMS").val(d.length);(e.val()===""||e.val()-d.length>0)&&h.parent().show();for(var c=0,f=d.length;c<f;c++){i(b(d).get(c),a.prefix,c);b(d.get(c)).find("*").each(function(){i(this, a.prefix,f.val())});c.insertBefore(b(d));b(f).val(parseInt(f.val(),10)+1);g=g+1;e.val()!==""&&e.val()-f.val()<=0&&h.parent().hide();c.find("a."+a.deleteCssClass).click(function(d){d.preventDefault();d=b(this).parents("."+a.formCssClass);d.remove();g=g-1;a.removed&&a.removed(d);d=b("."+a.formCssClass);b("#id_"+a.prefix+"-TOTAL_FORMS").val(d.length);(e.val()===""||e.val()-d.length>0)&&h.parent().show();for(var c=0,f=d.length;c<f;c++){i(b(d).get(c),a.prefix,c);b(d.get(c)).find("*").each(function(){i(this,
a.prefix,c)})}});a.added&&a.added(c)})}return this};b.fn.formset.defaults={prefix:"form",addText:"add another",deleteText:"remove",addCssClass:"add-row",deleteCssClass:"delete-row",emptyCssClass:"empty-row",formCssClass:"dynamic-form",added:null,removed:null};b.fn.tabularFormset=function(d){var a=b(this),c=function(){b(a.selector).not(".add-row").removeClass("row1 row2").filter(":even").addClass("row1").end().filter(":odd").addClass("row2")};a.formset({prefix:d.prefix,addText:d.addText,formCssClass:"dynamic-"+ a.prefix,c)})}});a.added&&a.added(c)})}return this};b.fn.formset.defaults={prefix:"form",addText:"add another",deleteText:"remove",addCssClass:"add-row",deleteCssClass:"delete-row",emptyCssClass:"empty-row",formCssClass:"dynamic-form",added:null,removed:null};b.fn.tabularFormset=function(d){var a=b(this),c=function(){b(a.selector).not(".add-row").removeClass("row1 row2").filter(":even").addClass("row1").end().filter(":odd").addClass("row2")};a.formset({prefix:d.prefix,addText:d.addText,formCssClass:"dynamic-"+

View File

@@ -3,6 +3,5 @@
* namespace (i.e. this preserves pre-existing values for both window.$ and * namespace (i.e. this preserves pre-existing values for both window.$ and
* window.jQuery). * window.jQuery).
*/ */
var django = { var django = django || {};
"jQuery": jQuery.noConflict(true) django.jQuery = jQuery.noConflict(true);
};

12559
admin/js/jquery.js vendored

File diff suppressed because it is too large Load Diff

159
admin/js/jquery.min.js vendored

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@@ -3,6 +3,8 @@ Configuration for the Django admin site
""" """
from django.contrib import admin from django.contrib import admin
from django.db import models
from django.forms import TextInput, Textarea
from three_d_viewer.models import Category, Sample, Question, Answer, Mineral, GlossaryEntry from three_d_viewer.models import Category, Sample, Question, Answer, Mineral, GlossaryEntry
admin.site.register(Category) admin.site.register(Category)
@@ -10,4 +12,12 @@ admin.site.register(Sample)
admin.site.register(Question) admin.site.register(Question)
admin.site.register(Answer) admin.site.register(Answer)
admin.site.register(Mineral) admin.site.register(Mineral)
admin.site.register(GlossaryEntry) #admin.site.register(GlossaryEntry)
class GlossaryEntryAdmin(admin.ModelAdmin):
formfield_overrides = {
models.TextField: {'widget': Textarea(attrs={'rows':4, 'cols':40})},
}
admin.site.register(GlossaryEntry, GlossaryEntryAdmin)

View File

@@ -133,10 +133,15 @@ body {
} }
#footer { #footer {
left: 0;
right: 0;
bottom: 0;
display: block;
position: fixed;
width: 100%; width: 100%;
margin-left: auto; /*margin-left: auto;*/
background-color: #CCCCCC; background-color: #CCCCCC;
z-index: 900; z-index: 1000;
} }
#footer ul { #footer ul {
@@ -197,13 +202,18 @@ body {
} }
#logo { #logo {
width: 10%; width: 20%;
height: 44px; height: 44px;
background-color: #FFFFFF; background-color: #CCCCCC;
text-align: center; text-align: left;
float: left; float: left;
} }
.logoImage {
width: auto;
height: 44px;
}
#logo p { #logo p {
padding-top: 5%; padding-top: 5%;
} }
@@ -270,8 +280,18 @@ body {
} }
/* TEXT STYLES */ /* TEXT STYLES */
ul.introList {
list-style-type: none;
}
td.term {
padding-right: 100px;
}
#mainText p { #mainText p {
font-size: 12pt; font-size: 12pt;
font-family: 'quicksandregular', Helvetica, sans-serif; font-family: 'quicksandregular', Helvetica, sans-serif;
@@ -280,6 +300,14 @@ body {
color: #000; color: #000;
} }
#theoryText p {
font-size: 12pt;
font-family: 'quicksandregular', Helvetica, sans-serif;
line-height: 16pt;
text-align: left;
color: #000;
}
#mineralContainer p { #mineralContainer p {
font-size: 12pt; font-size: 12pt;
font-family: 'quicksandregular', Helvetica, sans-serif; font-family: 'quicksandregular', Helvetica, sans-serif;
@@ -311,6 +339,17 @@ h2.theoryHeadings {
} }
h3.headings {
font-size: 14pt;
font-family: 'quicksandbold', Helvetica, sans-serif;
line-height: 18pt;
text-align: left;
color: #000;
padding-top: 5px;
padding-bottom: 5px;
}
img.example { img.example {
width: 100%; width: 100%;
height: auto; height: auto;
@@ -346,7 +385,7 @@ img.example {
padding: 0; padding: 0;
} }
#cssmenu > ul > li.mainitem { /*CUSTOM CLASS TEST*/ #cssmenu > ul > li.mainitem { /*CUSTOM CLASS TEST*/
width: 25%; width: 20%;
} }
#cssmenu > ul > #menu-button { #cssmenu > ul > #menu-button {
display: none; display: none;
@@ -628,7 +667,7 @@ img.example {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
/*CUSTOM CLASS TEST*/ /*CUSTOM CLASS TEST*/
#mineralMenu > ul > li.mainitem { #mineralMenu > ul > li.mainitem {
width: 100%; width: 100%;
} }
@@ -644,7 +683,7 @@ img.example {
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
padding: 15px 20px; padding: 15px 20px;
color: #7a8189; color: #7a8189 ;
text-transform: uppercase; text-transform: uppercase;
-webkit-transition: color 0.25s ease-out; -webkit-transition: color 0.25s ease-out;
-moz-transition: color 0.25s ease-out; -moz-transition: color 0.25s ease-out;
@@ -706,6 +745,7 @@ img.example {
z-index: -2; z-index: -2;
} }
#mineralMenu ul ul { #mineralMenu ul ul {
width: 84.5%; /* TESTING HERE!!!!!!!!!!!!!! */
position: absolute; position: absolute;
left: -9999px; left: -9999px;
top: 70px; top: 70px;
@@ -720,9 +760,11 @@ img.example {
#mineralMenu ul ul ul { #mineralMenu ul ul ul {
top: 37px; top: 37px;
padding-left: 5px; padding-left: 5px;
width: 100%;
} }
#mineralMenu ul ul li { #mineralMenu ul ul li {
position: relative; position: relative;
width: 100%;
} }
#mineralMenu > ul > li:hover > ul { #mineralMenu > ul > li:hover > ul {
left: auto; left: auto;
@@ -735,7 +777,7 @@ img.example {
opacity: 1; opacity: 1;
} }
#mineralMenu ul ul li a { #mineralMenu ul ul li a {
width: 130px; width: 100%;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
padding: 10px 20px; padding: 10px 20px;
font-size: 10px; font-size: 10px;
@@ -783,6 +825,7 @@ img.example {
-o-transform: rotateY(180deg); -o-transform: rotateY(180deg);
transform: rotateY(180deg); transform: rotateY(180deg);
} }
@media all and (max-width: 800px), only screen and (-webkit-min-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (min--moz-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (-o-min-device-pixel-ratio: 2/1) and (max-width: 1024px), only screen and (min-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (min-resolution: 192dpi) and (max-width: 1024px), only screen and (min-resolution: 2dppx) and (max-width: 1024px) { @media all and (max-width: 800px), only screen and (-webkit-min-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (min--moz-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (-o-min-device-pixel-ratio: 2/1) and (max-width: 1024px), only screen and (min-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (min-resolution: 192dpi) and (max-width: 1024px), only screen and (min-resolution: 2dppx) and (max-width: 1024px) {
#mineralMenu { #mineralMenu {
width: auto; width: auto;

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@@ -0,0 +1,77 @@
# -*- 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 field 'Sample.erb101_sample'
db.add_column(u'three_d_viewer_sample', 'erb101_sample',
self.gf('django.db.models.fields.BooleanField')(default=False),
keep_default=False)
def backwards(self, orm):
# Deleting field 'Sample.erb101_sample'
db.delete_column(u'three_d_viewer_sample', 'erb101_sample')
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'}),
'erb101_sample': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
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']"}),
'viewed_count': ('django.db.models.fields.IntegerField', [], {'default': '0'})
}
}
complete_apps = ['three_d_viewer']

View File

@@ -43,6 +43,10 @@ class Category(CommonInfo):
def active_samples(self): def active_samples(self):
return self.samples.select_subclasses(Sample, Mineral).filter(active=True).order_by('name') return self.samples.select_subclasses(Sample, Mineral).filter(active=True).order_by('name')
@property
def active_101_samples(self):
return self.samples.select_subclasses(Sample, Mineral).filter(active=True).filter(erb101_sample=True).order_by('name')
class Meta: class Meta:
verbose_name_plural = "Categories" verbose_name_plural = "Categories"
@@ -59,6 +63,7 @@ class Sample(CommonInfo):
on_delete=models.SET_NULL, on_delete=models.SET_NULL,
related_name="samples") related_name="samples")
viewed_count = models.IntegerField(default=0) viewed_count = models.IntegerField(default=0)
erb101_sample = models.BooleanField(default=False)
#Use the inheritance manager for handling subclasses #Use the inheritance manager for handling subclasses
objects = InheritanceManager() objects = InheritanceManager()
@@ -76,11 +81,11 @@ class Sample(CommonInfo):
self.viewed_count += 1 self.viewed_count += 1
if cat.name == 'Fossils': if cat.name == 'Fossils':
return 'three_d_viewer:fossil_detail' return 'fossil_detail'
elif cat.name == 'Rocks': elif cat.name == 'Rocks':
return 'three_d_viewer:rock_detail' return 'rock_detail'
else: else:
return 'three_d_viewer:sample_detail' return 'sample_detail'
class Mineral(Sample): class Mineral(Sample):
@@ -102,7 +107,7 @@ class Mineral(Sample):
@property @property
def url(self): def url(self):
self.viewed_count += 1 self.viewed_count += 1
return 'three_d_viewer:mineral_detail' return 'mineral_detail'
class Question(models.Model): class Question(models.Model):

View File

@@ -385,7 +385,7 @@ img.example {
padding: 0; padding: 0;
} }
#cssmenu > ul > li.mainitem { /*CUSTOM CLASS TEST*/ #cssmenu > ul > li.mainitem { /*CUSTOM CLASS TEST*/
width: 25%; width: 20%;
} }
#cssmenu > ul > #menu-button { #cssmenu > ul > #menu-button {
display: none; display: none;

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@@ -5,7 +5,7 @@
<div id="mainText"> <div id="mainText">
<h3 class="headings">Acknowledgements</h3><br><br> <h3 class="headings">Acknowledgements</h3><br><br>
<p> <p>
3DVOL has been been developed by Shane Frischkorn, Andy Bates, Christoph Shrank, Mark Barry, Linda Nothdurft, and Luke Nothdurft. 3DVOL has been been developed by Shane Frischkorn, Andy Bates, Christoph Schrank, Mark Barry, Linda Nothdurft, and Luke Nothdurft.
</p> </p>
<br /><br /> <br /><br />
<p>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. <p>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.

View File

@@ -18,27 +18,36 @@
<div id="container"> <div id="container">
<div id="header"> <div id="header">
<div id="logo"> <div id="logo">
<img src={% static "three_d_viewer/images/logo_main.png" %} class="logoImage"> <a href="{% url 'three_d_viewer:home' %}"><img src={% static "three_d_viewer/images/logo_main.png" %} class="logoImage"></a>
</div><!-- CLOSE LOGO !--> </div><!-- CLOSE LOGO !-->
<div id="menuContainer"> <div id="menuContainer">
<div id='cssmenu'> <div id='cssmenu'>
<ul> <ul>
{% block home %}
<li class='active mainitem'><a href="{% url 'three_d_viewer:home' %}"><span>Home</span></a></li> <li class='active mainitem'><a href="{% url 'three_d_viewer:home' %}"><span>Home</span></a></li>
<li class='active mainitem'><a href="{% url 'three_d_viewer:erb101_home' %}"><span>ERB101</span></a></li>
{% endblock %}
<li class='has-sub mainitem'><a href='#'><span>Minerals</span></a> <li class='has-sub mainitem'><a href='#'><span>Minerals</span></a>
<ul> <ul>
<li class='has-sub'><a><span>Theory</span></a> <li class='has-sub'><a><span>Theory</span></a>
<ul> <ul>
{% block theory %}
<li><a href="{% url 'three_d_viewer:theory_fd' %}"><span>Formation and differentiation of Earth</span></a></li>
<li><a href="{% url 'three_d_viewer:theory_structure' %}"><span>Structure of Earth</span></a></li> <li><a href="{% url 'three_d_viewer:theory_structure' %}"><span>Structure of Earth</span></a></li>
<li><a href="{% url 'three_d_viewer:theory_pt' %}"><span>Pressure and temperature</span></a></li> <li><a href="{% url 'three_d_viewer:theory_pt' %}"><span>Pressure and temperature</span></a></li>
<li class='last'><a href="{% url 'three_d_viewer:theory_bowen' %}"><span>Bowen's reaction series</span></a></li> <li><a href="{% url 'three_d_viewer:theory_bowen' %}"><span>Bowen's reaction series</span></a></li>
<li><a href="{% url 'three_d_viewer:theory_classification' %}"><span>Classification of minerals</span></a></li>
<li><a href="{% url 'three_d_viewer:theory_silicates' %}"><span>Silicates</span></a></li>
<li class='last'><a href="{% url 'three_d_viewer:theory_crystals' %}"><span>Crystals</span></a></li>
{% endblock %}
</ul> </ul>
</li> </li>
<li><a href="{% url 'three_d_viewer:minerals_practice' %}"><span>Practice</span></a></li> {% block mineral_practice %}<li><a href="{% url 'three_d_viewer:minerals_practice' %}"><span>Practice</span></a></li>{% endblock %}
<!--<li class='last'><a href="{% url 'three_d_viewer:minerals_selftest' %}"><span>Self Test</span></a></li>!--> <!--<li class='last'><a href="{% url 'three_d_viewer:minerals_selftest' %}"><span>Self Test</span></a></li>!-->
</ul> </ul>
</li> </li>
<li class="mainitem"><a href="{% url 'three_d_viewer:rocks_practice' %}"><span>Rocks</span></a></li> {% block rock_practice %}<li class="mainitem"><a href="{% url 'three_d_viewer:rocks_practice' %}"><span>Rocks</span></a></li>{% endblock %}
<li class='last mainitem'><a href="{% url 'three_d_viewer:fossil_practice' %}"><span>Fossils</span></a></li> {% block fossil_menu %}<li class='last mainitem'><a href="{% url 'three_d_viewer:fossil_practice' %}"><span>Fossils</span></a></li>{% endblock %}
</ul> </ul>
</div><!-- CLOSE CSSMENU !--> </div><!-- CLOSE CSSMENU !-->
</div><!-- CLOSE MENUCONTAINER !--> </div><!-- CLOSE MENUCONTAINER !-->

View File

@@ -0,0 +1,31 @@
{% extends "three_d_viewer/base.html" %}
{% block home %}
<li class='active mainitem'><a href="{% url 'three_d_viewer:erb101_home' %}"><span>ERB101 Home</span></a></li>
{% endblock %}
{% block mineral_practice %}
<li><a href="{% url 'three_d_viewer:erb101_minerals_practice' %}"><span>Practice</span></a></li>
{% endblock %}
{% block rock_practice %}
<li class="mainitem"><a href="{% url 'three_d_viewer:erb101_rocks_practice' %}"><span>Rocks</span></a></li>
{% endblock %}
{% block fossil_menu %}
{% endblock %}
{% block theory %}
<li><a href="{% url 'three_d_viewer:erb101_theory_fd' %}"><span>Formation and differentiation of Earth</span></a></li>
<li><a href="{% url 'three_d_viewer:erb101_theory_structure' %}"><span>Structure of Earth</span></a></li>
<li><a href="{% url 'three_d_viewer:erb101_theory_pt' %}"><span>Pressure and temperature</span></a></li>
<li><a href="{% url 'three_d_viewer:erb101_theory_bowen' %}"><span>Bowen's reaction series</span></a></li>
<li><a href="{% url 'three_d_viewer:erb101_theory_classification' %}"><span>Classification of minerals</span></a></li>
<li><a href="{% url 'three_d_viewer:erb101_theory_silicates' %}"><span>Silicates</span></a></li>
<li class='last'><a href="{% url 'three_d_viewer:erb101_theory_crystals' %}"><span>Crystals</span></a></li>
{% endblock %}
<script type="text/javascript">
alert("Hello world");
</script>

View File

@@ -0,0 +1,21 @@
{% extends "three_d_viewer/erb101/base.html" %}
{% block content %}
<div id="pushDownTwo"></div>
<div id="mainText">
<h3 class="headings">ERB101 - Earth Systems</h3><br><br>
<p>
Earth Science impacts every aspect of modern life. Hence, the concepts of Earth Science
are fundamental not only to the field of Geology, but also to Environmental Science, natural
resource management, civil engineering and society at large. Earth Systems provides an
introduction to Earth Science, including earth materials, geologic history, geological and
physical geography process at the Earth's surface, and the complex interplay between the
lithosphere and landscapes. Additionally, the unit provides readily accessible examples of
the use of scientific reasoning for understanding complex natural systems. Hence, Earth
Systems is a foundation unit for further studies in Geology and Environmental Science, but
more importantly, serves as a broad introduction to the very world we live on and to the ways
of science in general. Such a background is highly desirable for any informed citizenry for
understanding complex issues of resource, environment, and societal development.
</p>
</div>
{% endblock %}

View File

@@ -0,0 +1 @@
{% extends "three_d_viewer/mineral_detail.html" %}

View File

@@ -0,0 +1 @@
{% extends "three_d_viewer/minerals_practice.html" %}

View File

@@ -0,0 +1,3 @@
{% extends "three_d_viewer/rock_detail.html" %}

View File

@@ -0,0 +1 @@
{% extends "three_d_viewer/rock_practice.html" %}

View File

@@ -0,0 +1,26 @@
{% extends "three_d_viewer/base.html" %}
{% load static %}
{% block content %}
<div id="pushDownTwo"></div>
<div id="mainText">
<h1 class="subHeadings">Theory</h1>
<h2 class="theoryHeadings" id="bowensreactionseries">Bowen's Reaction Series</h2>
<p>
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,
<br /><br />
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.
<br/>
<img src="{% static "three_d_viewer/images/bowen.jpg" %}" style="padding-top:20px; text-align: left;" width="600px" height="auto">
</p>
<div id="pushDownThree"></div>
</div>
{% endblock %}

View File

@@ -0,0 +1,32 @@
{% extends "three_d_viewer/base.html" %}
{% load static %}
{% block content %}
<div id="pushDownTwo"></div>
<div id="mainText">
<h1 class="subHeadings">Theory</h1>
<h2 class="theoryHeadings" id="classification">Classification of Minerals</h2>
<p>
The classification of minerals is based on their chemistry. The following mineral classes are based on the character of their common anions:</p>
<li><p>Silicates (SiO<sub>4</sub><sup>4-</sup>)</p></li>
<li><p>Oxides (O<sup>2-</sup>)</p></li>
<li><p>Sulfides (S<sup>2-</sup>)</p></li>
<li><p>Sulfates (SO<sub>4</sub><sup>2-</sup>)</p></li>
<li><p>Halides (Cl<sup>-</sup>)</p></li>
<li><p>Fluorites (F<sup>-</sup>)</p></li>
<li><p>Phosphates (PO<sub>4</sub><sup>3-</sup>)</p></li>
<li><p>Carbonates (CO<sub>3</sub><sup>2-</sup>)</p></li>
<li><p>Native elements, e.g. Au.</p></li>
<p><br />
The relative abundance of elements in the Earths crust (? Composition and structure of Earth) determines which minerals form.
As we can see in table x, oxygen is the most abundant anion in the Earths crust.
Thus, the crust can be seen as a tight package of oxygen anions (O<sup>2-</sup>), which are bonded by larger cations,
such as Si<sup>4+</sup>, Mg<sup>2+</sup>, or Al<sup>3+</sup>.
The way atoms are packed together depends on the cation to anion radius ratio (Rx/Rz).
With oxygen as the major anion, specific coordination and coordination polyhedra can be expected for different cations.
<br /><br /><br />
<a href="{% url 'three_d_viewer:theory_silicates' %}"><span>Silicate minerals</span></a>
</p>
<div id="pushDownThree"></div>
</div>
{% endblock %}

View File

@@ -0,0 +1,56 @@
{% extends "three_d_viewer/base.html" %}
{% load static %}
{% block content %}
<div id="pushDownTwo"></div>
<div id="mainText">
<h1 class="subHeadings">Theory</h1>
<h2 class="theoryHeadings" id="pressureandtemp">Pressure and Temperature</h2>
<p>
The heat contained within the Earth is generated by two main sources: the formation of the Earth,
and the decay of radioactive isotopes. The Earth was formed by the accretion of a large number of
planitesimals as it cleared its orbit. The impact of those planitesimals generated a large amount
of heat which is still being lost from the Earths core today. The other source of heat comes
from the radioactive decay of elements within the crust and mantle of the Earth.
The primary radioactive isotopes in the Earth are uranium-235, uranium-238, thorium-232,
and potassium-40. Radioactive decay is the dominant form of heat flow at the surface of the Earth,
providing approximately 80% of the heat budget.
<br /><br />
The temperature of the Earth changes from around 0°C at the surface to over 5000°C in the core.
The geothermal gradient in the crust is approximately 30°C per kilometre in the crust on average,
however there is significant local variation due to things such as the conductive abilities of the
rocks at particular locations, as well as the presence of nearby magmatic intrusions.
The geothermal gradient in the mantle reduces significantly, down to approximately 0.3°C/km.
The base of the lithosphere is defined by the 1000°C isotherm. The base of the mantle is at
approximately 2800°C.
<br /><br />
The method of heat transfer changes throughout the Earth. There are three main mechanisms for
heat transfer in the Earth: conduction, convection, and radiation. Starting in the inner core,
the main method of heat transfer is by conduction through the solid material. In the liquid,
outer core heat transfer is by both conduction and convection. The mantle is dominated by convection,
which is the driver of plate tectonics. The crust is again dominated by conduction, and finally
energy escapes the Earth to the atmosphere by radiation.
<br /><br />
Pressure in the Earth continually increases with depth, according to the formula P = gρz,
where g is the gravitation field strength, ρ is the density and z is the depth. The main
difference in the pressure gradient is cause by the different lithologies in the layers
of the Earth. The average density of continental crust is approximately 2.7g/cm3 and
is ~3.0 g/cm3 in oceanic crust, and increases to about 3.3 g/cm3 in the mantle.
The increase of pressure with depth in the Earth affects the dominant mineralogy, as
well as the increase of the melting point of different minerals.
<br /><br />
The structure of minerals, such as olivine becomes unstable as pressure increases.
Below about 410km olivine becomes unstable and transforms into wadsleyite, which has the
same chemical composition as olivine, but has a different crystal structure. As depth
increases, wadsleyite transforms to ringwoodite, which subsequently transforms into
perovskite at about 600km.
<br /><br />
At higher pressure, minerals have a higher melting point. The effect is this phenomenon
is that the dominant method of melting in the mantle is not by increasing the temperature
past its melting point, but by decompression. Due to convective processes in the mantle,
as parts of the mantle rise the decrease in pressure lowers the melting temperature and
can cause the mantle to melt.
</p>
<div id="pushDownThree"></div>
</div>
{% endblock %}

View File

@@ -0,0 +1,37 @@
{% extends "three_d_viewer/base.html" %}
{% load static %}
{% block content %}
<div id="pushDownTwo"></div>
<div id="mainText">
<h1 class="subHeadings">Theory</h1>
<h2 class="theoryHeadings" id="structureofearth">Structure of Earth</h2>
<p>
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.
<br /><br />
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.
<br /><br />
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.
<br /><br />
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.</p>
<figure>
<img src="{% static "three_d_viewer/images/structure - usgs.gif" %}" style="padding-top:20px;">
<figcaption><p>Image sourced from <a href="http://pubs.usgs.gov/gip/dynamic/graphics/FigS1-1.gif">USGS</a>.</p></figcaption>
</figure>
</div>
<div id="pushDownThree"></div>
</div>
{% endblock %}

View File

@@ -8,7 +8,7 @@
{% for entry in entries %} {% for entry in entries %}
<tr> <tr>
<td class="term"><p>{{ entry.name }}</p></td> <td class="term"><p>{{ entry.name }}</p></td>
<td><p>{{ entry.definition }}</p></td> <td><p>{{ entry.definition|safe }}</p></td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>

View File

@@ -64,6 +64,10 @@ function load(){
</tr> </tr>
<tr> <tr>
<td><p>Streak:</p></td> <td><p>Streak:</p></td>
<td><p>{{ mineral.streak }}</p></td>
</tr>
<tr>
<td><p>Habit:</p></td>
<td><p>{{ mineral.habit }}</p></td> <td><p>{{ mineral.habit }}</p></td>
</tr> </tr>
<tr> <tr>

View File

@@ -0,0 +1,21 @@
{% block content %}
<div id="sidebar">
<div id='mineralMenu'>
<ul>
<li class="has-sub mainitem"><a href="#">{% block menu_header %}Select a sample{% endblock %}</a>
<ul>
{% for sample in active_samples %}
<li><a href={% url sample.url sample.id %}>{{ sample.name }}</a></li>
{% endfor %}
</ul>
</li>
</ul>
</div><!-- close MINERALMENU !-->
{% block sample_detail %}
{% endblock %}
</div>
{% block 3dcontent %}
{% endblock %}
{% endblock %}

View File

@@ -28,8 +28,9 @@ function load(){
} }
request.send(); request.send();
} }
{% endblock load %} {% endblock load %}
{% block menu_header %}Select a rock{% endblock %} {% block menu_header %}Select a rock {% endblock %}

View File

@@ -403,4 +403,5 @@ function resizeCanvas() {
<canvas id="canvas" class="example"></canvas> <canvas id="canvas" class="example"></canvas>
<div><br><span id="progress" style="color: red"></span></div> <div><br><span id="progress" style="color: red"></span></div>
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends "three_d_viewer/base.html" %} {% extends base_template %}
{% block content %} {% block content %}
<div id="sidebar"> <div id="sidebar">
@@ -7,7 +7,11 @@
<li class="has-sub mainitem"><a href="#">{% block menu_header %}Select a sample{% endblock %}</a> <li class="has-sub mainitem"><a href="#">{% block menu_header %}Select a sample{% endblock %}</a>
<ul> <ul>
{% for sample in active_samples %} {% for sample in active_samples %}
<li><a href={% url sample.url sample.id %}>{{ sample.name }}</a></li> {% if base_template == 'three_d_viewer/base.html' %}
<li><a href={% url 'three_d_viewer:'|add:sample.url sample.id %}>{{ sample.name }}</a></li>
{% else %}
<li><a href={% url 'three_d_viewer:erb101_'|add:sample.url sample.id %}>{{ sample.name }}</a></li>
{% endif %}
{% endfor %} {% endfor %}
</ul> </ul>
</li> </li>

View File

@@ -1,4 +1,4 @@
{% extends "three_d_viewer/base.html" %} {% extends base_template %}
{% load static %} {% load static %}
{% block content %} {% block content %}
@@ -7,17 +7,25 @@
<h1 class="subHeadings">Theory</h1> <h1 class="subHeadings">Theory</h1>
<h2 class="theoryHeadings" id="bowensreactionseries">Bowen's Reaction Series</h2> <h2 class="theoryHeadings" id="bowensreactionseries">Bowen's Reaction Series</h2>
<p> <p>
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 Bowen's Reaction Series arranges the <a href="{% url silicates_theory %}"><span>silicate minerals</span></a> in the order that they crystallize from magma. The minerals at the
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. top of the series crystallize from the melt at higher temperature than those lower down. It contains a continuous series, (right hand limb), a
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). discontinuous series (left hand limb), and the residual phases, which are listed in their relative sequence of crystallization. The discontinuous
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. series describes the sequence of minerals that crystallize as the temperature of the magma decreases. The discontinuity of each of the
with the minerals at the bottom of the series being more stable, and less susceptible to weathering. crystallization sequences reflects the different melting/crystallization temperatures of the minerals, and the change in composition of the
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, residual magma, as the early crystallizing phases are being fractionated from the melt. The continuous series always crystallizes <a href={% url url_extender|add:plag.url plag.id %}>plagioclase</a>,
but the composition of the plagioclase changes from more calcic (i.e. anorthite) at higher temperatures to more sodic (i.e. albite) as the
temperature decreases. The compositional change during mineral growth can be recorded in compositional zoning of plagioclase
crystals. The minerals at the bottom of Bowens reaction series crystallize last and are more stable,
and less susceptible to weathering. Thus, Bowen's reaction series also predicts the stability of minerals in the
low pressure conditions at the Earth's surface.
<br /><br /> <br /><br />
It should be noted that all reactions do not start crystallising olivine/anorthite-rich plagioclase and continue through until they crystallise quartz. It should be noted that all reactions do not start crystallizing olivine/anorthite-rich plagioclase and continue through until they
The actual reactions depend on many factors, such as the chemical composition of the melt, temperature, pressure, and amount of fractional crystallisation. crystallize <a href={% url url_extender|add:quartz.url quartz.id %}>quartz</a>. Which minerals actually form, depend on many factors, such as the chemical composition of the melt, temperature,
For example, basalts form from the crystallisation of olivine, pyroxene and calcic plagioclase meaning that crystallisation stopped without the series progressing. pressure, and amount of fractional crystallization. For example, basalts form from the crystallization of
If more fractional crystallisation were to occur, more intermediate and felsic minerals can crystallise. <a href={% url url_extender|add:olivine.url olivine.id %}>olivine</a>,
<a href={% url url_extender|add:diopside.url diopside.id %}>pyroxene</a> and
calcic plagioclase, meaning that crystallization stopped without the series progressing. If more fractional crystallization
were to occur, more intermediate and felsic minerals can crystallize.
<br/> <br/>
<img src="{% static "three_d_viewer/images/bowen.jpg" %}" style="padding-top:20px; text-align: left;" width="600px" height="auto"> <img src="{% static "three_d_viewer/images/bowen.jpg" %}" style="padding-top:20px; text-align: left;" width="600px" height="auto">
</p> </p>

View File

@@ -0,0 +1,31 @@
{% extends base_template %}
{% load static %}
{% block content %}
<div id="pushDownTwo"></div>
<div id="mainText">
<h1 class="subHeadings">Theory</h1>
<h2 class="theoryHeadings" id="classification">Classification of Minerals</h2>
<p>
The classification of minerals is based on their chemistry. The following mineral classes are based on the character of their common anions:</p>
<li><p><a href="{% url silicates_theory %}"><span>Silicates</span></a> (SiO<sub>4</sub><sup>4-</sup>)</p></li>
<li><p>Oxides (O<sup>2-</sup>)</p></li>
<li><p>Sulfides (S<sup>2-</sup>)</p></li>
<li><p>Sulfates (SO<sub>4</sub><sup>2-</sup>)</p></li>
<li><p>Halides (Cl<sup>-</sup>)</p></li>
<li><p>Fluorites (F<sup>-</sup>)</p></li>
<li><p>Phosphates (PO<sub>4</sub><sup>3-</sup>)</p></li>
<li><p>Carbonates (CO<sub>3</sub><sup>2-</sup>)</p></li>
<li><p>Native elements, e.g. Au.</p></li>
<p><br />
<img src="{% static "three_d_viewer/images/element abundance.png" %}" align="right" width="412" height="324">
The relative abundance of elements in the Earths crust (see <a href="{% url structure_theory %}"><span>Structure of Earth</span></a>) determines which minerals form.
Oxygen is the most abundant anion in the Earths crust.
Thus, the crust can be seen as a tight package of oxygen anions (O<sup>2-</sup>), which are bonded by larger cations,
such as Si<sup>4+</sup>, Mg<sup>2+</sup>, or Al<sup>3+</sup>.
The way atoms are packed together depends on the cation to anion radius ratio (Rx/Rz).
With oxygen as the major anion, specific coordination and coordination polyhedra can be expected for different cations.
</p>
<div id="pushDownThree"></div>
</div>
{% endblock %}

View File

@@ -0,0 +1,35 @@
{% extends base_template %}
{% load static %}
{% block content %}
<div id="pushDownTwo"></div>
<div id="mainText">
<h1 class="subHeadings">Theory</h1>
<h2 class="theoryHeadings" id="classification">Crystals</h2>
<p>
<a href="{% static "three_d_viewer/images/crystal axes.png" %}"><img width="150" height="150" src="{% static "three_d_viewer/images/crystal axes.png" %}" align="right"></a>
<a href="{% static "three_d_viewer/images/crystal systems.png" %}"><img height="220" width="153" src="{% static "three_d_viewer/images/crystal systems.png" %}" align="left"></a>
An important characteristic of minerals is their crystallinity that is defined by the 3-dimensional, periodic structure of their atomic/ionic
components. (Note that some substances, e.g. opal or obsidian, do not form crystals, but are amorphous.
We sometimes refer to them as mineraloids)
<br /><br />
The smallest translatable unit cell of a crystal is defined by the crystal axes a, b and c and corresponding angles a, ß and γ.
There are seven systems of crystal axes called the seven crystal systems.
There are 14 crystal lattices, called the Bravais lattices that describe different possibilities of
distributing lattice points in the unit cells of the seven crystal systems. Among the seven crystal systems, 32 crystallographic
point groups (or crystal classes) are distinguished based on the possible combination of symmetry operations, such as reflection,
rotation, inversion and rotoinversion, within 3-dimensional space. Combination of the 14 Bravais lattices and the 32 point groups result in 230 space groups,
when further glide plane and screw axes symmetry elements are included. The space groups describe all possibly existing crystal and 3-dimensional structures.
<br /><br />
The crystal form arises from the symmetry elements that define the shape of the unit cell. Length and angle of the
unit vectors describe the shape of the unit cell for each crystal system. The external shape of a particular crystal is called crystal
habit and essentially dependent on the physical-chemical framework conditions during crystal growth.
<br />
<a href="{% static "three_d_viewer/images/bravais lattices.png" %}"><img height="300" width="163" src="{% static "three_d_viewer/images/bravais lattices.png" %}" align="right"></a>
<a href="{% static "three_d_viewer/images/bravais lattices.png" %}"><img height="300" width="163" src="{% static "three_d_viewer/images/bravais lattices.png" %}" align="left"></a>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<a href="{% static "three_d_viewer/images/crystal morphology.png" %}"><img height="150" width="309" src="{% static "three_d_viewer/images/crystal morphology.png" %}"></a>
</p>
<div id="pushDownThree"></div>
</div>
{% endblock %}

View File

@@ -0,0 +1,33 @@
{% extends base_template %}
{% load static %}
{% block content %}
<div id="pushDownTwo"></div>
<div id="mainText">
<h1 class="subHeadings">Theory</h1>
<h2 class="theoryHeadings" id="formationdiff">Formation and differentiation of Earth</h2>
<p>
Earth, like the Sun and the other planets of our Solar System formed around 4.6 billion years ago from part of a giant molecular
cloud - the cosmic debris of a massive supernova. Out of matter that coalesced in the center of the molecular cloud due to
gravitational collapse emerged the proto-Sun and a surrounding disk of dust and gas. Attraction forces within this rotating
protoplanetary disk that fed the young Sun, led to the accretion of progressively growing objects and planetesimals.
Increasing mass and gravitational forces of the growing planetary bodies resulted in interactions and disturbance in their orbits,
ultimately giving rise to larger collisions.
<br /><br />
Earth, as a terrestrial inner planet formed relatively close to the Sun through the
accumulation of rather heavier matter, whereas the outer planets formed from gas that had been blown away in more distal
regions of the solar system (solar wind). Continuous bombardment and larger impacts including one that led to the
formation of the Moon -, and the radioactive decay within the Earth heated the planet resulting in partial melting.
Different melting temperatures and density contrasts led to gravitational segregation of a heavier iron core and a lighter
silicate mantle. Further chemical differentiation by partial melting of the mantle led to the formation of Earths proto-crust.
The Earths layering into core, mantle and crust due to this early differentiation remains an essential
feature of the Earths structure.
<br /><br />
</p>
<figure>
<a href="{% static "three_d_viewer/images/earth differentiation.png" %}"><img width=600 height=350 src="{% static "three_d_viewer/images/earth differentiation.png" %}">
<figcaption>Differentiation of minerals within the earth</figcaption>
</figure>
<div id="pushDownThree"></div>
</div>
{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends "three_d_viewer/base.html" %} {% extends base_template %}
{% load static %} {% load static %}
{% block content %} {% block content %}
@@ -7,49 +7,57 @@
<h1 class="subHeadings">Theory</h1> <h1 class="subHeadings">Theory</h1>
<h2 class="theoryHeadings" id="pressureandtemp">Pressure and Temperature</h2> <h2 class="theoryHeadings" id="pressureandtemp">Pressure and Temperature</h2>
<p> <p>
The heat contained within the Earth is generated by two main sources: the formation of the Earth, The heat contained within the Earth is generated by two main sources: the formation of the Earth, and the decay of radioactive isotopes.
and the decay of radioactive isotopes. The Earth was formed by the accretion of a large number of The Earth was formed by the accretion of a large number of planetesimals as it cleared its orbit.
planitesimals as it cleared its orbit. The impact of those planitesimals generated a large amount The impact of those planetesimals generated a large amount of heat which is still being lost from the Earths core today.
of heat which is still being lost from the Earths core today. The other source of heat comes The other source of heat comes from the radioactive decay of elements within the crust and mantle of the Earth.
from the radioactive decay of elements within the crust and mantle of the Earth. The primary radioactive isotopes in the Earth are uranium-235, uranium-238, thorium-232, and potassium-40.
The primary radioactive isotopes in the Earth are uranium-235, uranium-238, thorium-232, Radioactive decay is the dominant form of heat flow at the surface of the Earth, providing approximately 80% of the heat budget.
and potassium-40. Radioactive decay is the dominant form of heat flow at the surface of the Earth,
providing approximately 80% of the heat budget.
<br /><br /> <br /><br />
</p>
<figure>
<a href='{% static "three_d_viewer/images/seismic earth.png" %}'><img height=300 width=300 src='{% static "three_d_viewer/images/seismic earth.png" %}'></a>
<figcaption>The seismic profile of the earth</figcaption>
</figure>
<p>
<br />
The temperature of the Earth changes from around 0°C at the surface to over 5000°C in the core. The temperature of the Earth changes from around 0°C at the surface to over 5000°C in the core.
The geothermal gradient in the crust is approximately 30°C per kilometre in the crust on average, The geothermal gradient in the crust is approximately 30°C per kilometre in the crust on average, however there is significant local
however there is significant local variation due to things such as the conductive abilities of the variation due to things such as the conductive abilities of the rocks at particular locations, as well as the presence of nearby magmatic
rocks at particular locations, as well as the presence of nearby magmatic intrusions. intrusions. The geothermal gradient in the mantle reduces significantly, down to approximately 0.3°C/km. The base of the lithosphere
The geothermal gradient in the mantle reduces significantly, down to approximately 0.3°C/km. is defined by the 1000°C isotherm. The base of the mantle is at approximately 2800°C.
The base of the lithosphere is defined by the 1000°C isotherm. The base of the mantle is at
approximately 2800°C.
<br /><br /> <br /><br />
The method of heat transfer changes throughout the Earth. There are three main mechanisms for The method of heat transfer changes throughout the Earth. There are three main mechanisms for heat transfer in the Earth:
heat transfer in the Earth: conduction, convection, and radiation. Starting in the inner core, conduction, convection, and radiation. Starting in the inner core, the main method of heat transfer is by conduction through the
the main method of heat transfer is by conduction through the solid material. In the liquid, solid material. In the liquid, outer core heat transfer is by both conduction and convection. The mantle is dominated by convection,
outer core heat transfer is by both conduction and convection. The mantle is dominated by convection, which is the driver of plate tectonics. The crust is again dominated by conduction, and finally energy escapes the
which is the driver of plate tectonics. The crust is again dominated by conduction, and finally Earth to the atmosphere by radiation.
energy escapes the Earth to the atmosphere by radiation.
<br /><br /> <br /><br />
Pressure in the Earth continually increases with depth, according to the formula P = gρz, Pressure in the Earth continually increases with depth, according to the formula P = gρz, where g is the gravitation field strength,
where g is the gravitation field strength, ρ is the density and z is the depth. The main ρ is the density and z is the depth. The main difference in the pressure gradient is cause by the different lithologies in the layers
difference in the pressure gradient is cause by the different lithologies in the layers of the Earth. The average density of continental crust is approximately 2.7g/cm<sup>3</sup> and is ~3.0 g/cm<sup>3</sup> in oceanic crust,
of the Earth. The average density of continental crust is approximately 2.7g/cm3 and and increases to about 3.3 g/cm<sup>3</sup> in the mantle. The increase of pressure with depth in the Earth affects the dominant mineralogy,
is ~3.0 g/cm3 in oceanic crust, and increases to about 3.3 g/cm3 in the mantle. as well as the increase of the melting point of different minerals.
The increase of pressure with depth in the Earth affects the dominant mineralogy, as
well as the increase of the melting point of different minerals.
<br /><br /> <br /><br />
The structure of minerals, such as olivine becomes unstable as pressure increases. The structure of minerals, such as <a href={% url url_extender|add:olivine.url olivine.id %}>olivine</a> becomes unstable as pressure increases.
Below about 410km olivine becomes unstable and transforms into wadsleyite, which has the Below about 410 km olivine (Mg<sub>2</sub>SiO<sub>4</sub>) becomes unstable and transforms into wadsleyite (Mg<sub>2</sub>SiO<sub>4</sub>),
same chemical composition as olivine, but has a different crystal structure. As depth which has the same chemical composition as olivine, but has a different crystal structure. As depth increases,
increases, wadsleyite transforms to ringwoodite, which subsequently transforms into wadsleyite transforms to ringwoodite (Mg<sub>2</sub>SiO<sub>4</sub>) at ~520 km, which subsequently transforms into silicate perovskite
perovskite at about 600km. (MgSiO<sub>3</sub>) and magnesiowuestite (MgO) at about 660km depth. The increase in density is observed in an increase in the
velocity of P- and S-waves.
<br /><br /> <br /><br />
At higher pressure, minerals have a higher melting point. The effect is this phenomenon </p>
is that the dominant method of melting in the mantle is not by increasing the temperature <figure>
past its melting point, but by decompression. Due to convective processes in the mantle, <a href='{% static "three_d_viewer/images/depth profile.png" %}' align="right"><img height=300 width=270 src='{% static "three_d_viewer/images/depth profile.png" %}'></a>
as parts of the mantle rise the decrease in pressure lowers the melting temperature and <figcaption>The depth profile of the earth</figcaption>
can cause the mantle to melt. </figure>
<p>
<br />
At higher pressure, minerals have a higher melting point. The effect of this phenomenon is that the dominant method of
melting in the mantle is not by increasing the temperature past its melting point, but by decompression.
Due to convective processes in the mantle, as parts of the mantle rise the decrease in pressure lowers the melting temperature
and can cause the mantle to melt. Such process is observed at oceanic spreading centres, where partial decompression melting of the
mantle produces juvenile oceanic crust.
</p> </p>
<div id="pushDownThree"></div> <div id="pushDownThree"></div>
</div> </div>

View File

@@ -0,0 +1,79 @@
{% extends base_template %}
{% load static %}
{% block content %}
<div id="pushDownTwo"></div>
<div id="mainText">
<h1 class="subHeadings">Silicates</h1>
<figure>
<img src="{% static "three_d_viewer/images/SiO4 tetraedra.png" %}">
<figcaption>The silica tetrahedron, [SiO<sub>4</sub>]<sup>4-</sup></figcaption>
</figure>
<br />
<table>
<tr><td>
<h2 class="theoryHeadings" id="cyclosilicates">Cyclosilicates</h2>
<p>
<img src="{% static "three_d_viewer/images/cyclosilicates.png" %}" align="right">
The cyclosilicates form rings of linked [SiO<sub>4</sub>]<sup>4-</sup> tedrahedra with either [Si<sub>3</sub>O<sub>9</sub>]<sup>6-</sup>,
[Si<sub>4</sub>O<sub>12</sub>]<sup>8-</sup>, or [Si<sub>6</sub>O<sub>18</sub>]<sup>12-</sup> configurations. Cordierite with the
chemical formula (Mg,Fe)<sub>2</sub>Al<sub>4</sub>Si<sub>5</sub>O<sub>18</sub> represents an example of the cyclosilicate group.
</p>
</tr></td>
<tr><td>
<h2 class="theoryHeadings" id="inosilicates">Inosilicates</h2>
<p>
<img src="{% static "three_d_viewer/images/inosilicates.png" %}" align="right">
In the inosilicates, [SiO<sub>4</sub>]<sup>4-</sup> tedrahedra are linked as chains, which in turn are linked together by cations.
Single-chain inosilicates form [Si<sub>2</sub>O<sub>6</sub>]<sup>4-</sup> groups, and double-chain inosilicates
form [Si<sub>4</sub>O<sub>11</sub>]<sup>6-</sup> groups. Pyroxenes, e.g. <a href={% url url_extender|add:diopside.url diopside.id %}>diopside</a> with the chemical formula
CaMgSi<sub>2</sub>O<sub>6</sub>, are single-chain, and amphiboles, e.g. hornblende
(Ca<sub>2</sub>(Mg,Fe,Al)<sub>5</sub>(Al,Si)<sub>8</sub>O<sub>22</sub>(OH)) or <a href={% url url_extender|add:actinolite.url actinolite.id %}>actinolite</a>
(Ca<sub>2</sub>(Fe,Mg)<sub>5</sub>Si<sub>8</sub>O<sub>22</sub>(OH)<sub>2</sub>) are double-chain inosilicates.
</p>
</tr></td>
<tr><td>
<h2 class="theoryHeadings" id="nesosilicates">Nesosilicates</h2>
<p>
<img src="{% static "three_d_viewer/images/nesosilicates.png" %}" align="right">
In the nesosilicate group, [SiO<sub>4</sub>]<sup>4-</sup> tedrahedra are isolated from each other and share their oxygens
with octahedral groups, which contain cations, such as Mg<sup>2+</sup>, Fe<sup>2+</sup>, or Ca<sup>2+</sup>. A common
rock-forming mineral of the nesosilicate group is
<a href={% url url_extender|add:olivine.url olivine.id %}>olivine</a> with the chemical formula
(Mg,Fe)<sub>2</sub>SiO<sub>4</sub>.
</p>
</tr></td>
<tr><td>
<h2 class="theoryHeadings" id="phyllosilicates">Phyllosilicates</h2>
<p>
<img src="{% static "three_d_viewer/images/phyllosilicates.png" %}" align="right">
Phyllosilicates comprise sheets of [SiO<sub>4</sub>]<sup>4-</sup> tedrahedra rings, where three of the four oxygens of
each tedrahedrons are shared resulting in [Si<sub>4</sub>O<sub>10</sub>]<sup>4-</sup> groups. Biotite with the
chemical formula K(Mg,Fe)<sub>3</sub>(AlSi<sub>3</sub>O<sub>10</sub>)(F,OH)<sub>2</sub> is a common rock-forming phyllosilicate.
</p>
</tr></td>
<tr><td>
<h2 class="theoryHeadings" id="sorosilicates">Sorosilicates</h2>
<p>
<img src="{% static "three_d_viewer/images/sorosilicates.png" %}" align="right">
Two [SiO<sub>4</sub>]<sup>4-</sup> tedrahedra are linked by a shared corner oxygen to form
[Si<sub>2</sub>O<sub>7</sub>]<sup>6-</sup> groups. An example for the sorosilicate group is the mineral epidote with the
chemical formula Ca<sub>2</sub>Al<sub>2</sub>(Fe<sup>3+</sup>,Al)(SiO<sub>4</sub>)(Si<sub>2</sub>O<sub>7</sub>)O(OH).
</p>
</tr></td>
<tr><td>
<h2 class="theoryHeadings" id="tectosilicates">Tectosilicates</h2>
<p>
<img src="{% static "three_d_viewer/images/tectosilicates.png" %}" align="right">
Complete linkage of [SiO<sub>4</sub>]<sup>4-</sup> tedrahedra results in the 3-dimensional framework of the tectosilicates.
<a href={% url url_extender|add:quartz.url quartz.id %}>Quartz</a> (SiO<sub>2</sub>) and the feldspars
(<a href={% url url_extender|add:plag.url plag.id %}>plagioclase</a>,
<a href={% url url_extender|add:microcline.url microcline.id %}>microcline</a>)
(e.g. anorthite, CaAl<sub>2</sub>Si<sub>2</sub>O<sub>8</sub>) are tectosilicates.
</p>
</tr></td>
</table>
<br /><br /><br /><br />
<div id="pushDownThree"></div>
</div>
{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends "three_d_viewer/base.html" %} {% extends base_template %}
{% load static %} {% load static %}
{% block content %} {% block content %}
@@ -6,30 +6,47 @@
<div id="mainText"> <div id="mainText">
<h1 class="subHeadings">Theory</h1> <h1 class="subHeadings">Theory</h1>
<h2 class="theoryHeadings" id="structureofearth">Structure of Earth</h2> <h2 class="theoryHeadings" id="structureofearth">Structure of Earth</h2>
<p>
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. <figure align="left">
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. <img src="{% static "three_d_viewer/images/structure - usgs.gif" %}" >
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 <figcaption align="left"><p>Image sourced from <a href="http://pubs.usgs.gov/gip/dynamic/graphics/FigS1-1.gif">USGS</a>.</p></figcaption>
continental environments. Ocean crust is young mafic crust dominated by basalts and gabbros that is recycled regularly(~300Ma) due to subduction processes. </figure>
Continental crust is much more varied in structure and composition than oceanic, but has an overall average composition of granodiorite. <br />
<p>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 7 km in the oceans, to an average of 38 km in continental crust. The crust thickens underneath mountain
ranges, and can reach depths of 90 km 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 (~300 Ma) due to subduction
processes. Continental crust is much more varied in structure and composition than oceanic, but has an overall average
composition of granodiorite.
</p>
<p>
<br /><br />
<img src="{% static "three_d_viewer/images/element abundance.png" %}" align="right" width="412" height="324">
The boundary of the crust and mantle is defined by the Mohorovicic 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
<a href={% url url_extender|add:diopside.url diopside.id %}>pyroxenes</a> and polymorphs of
<a href={% url url_extender|add:olivine.url olivine.id %}>olivine</a>,
forming peridotite. The mantle, while solid, behaves plastically, allowing to flow at very slow rates.
<br /><br /> <br /><br />
The boundary of the crust and mantle is defined by the Mohorovi?i? discontinuity, commonly referred to as the Moho. The core is distinguished by the absence of S waves, leading to the inference that the core is liquid.
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 The core is separated into the outer core and the inner core. The outer core is liquid dominated by iron and nickel.
silicate minerals that are rich in iron and magnesium, chiefly pyroxenes and polymorphs of olivine, forming peridotite. The mantle, while solid, behaves plastically, 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
allowing to flow at very slow rates. crystallizing minerals from the liquid part of the core as the Earth cools.
<br /><br /> <br /><br />
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 crust and mantle are also further distinguished by material properties into the lithosphere, asthenosphere, and
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, mesosphere. The chemical composition is uniform throughout the mantle though, but changes in pressure and temperature
and was formed by crystalizing minerals from the liquid part of the core as the Earth cools. determine which polymorphs will exist at different depths. The lithosphere contains the crust, and the upper part of the mantle down
<br /><br /> to ~100 km under oceanic crust, and 200-300 km under continental crust (Twiss & Moores, 2007). The lithosphere-asthenosphere boundary
The crust and mantle are also further distinguished by material properties into the lithosphere, asthenosphere, and mesosphere. The chemical composition is is defined by the 1300 K isotherm, which is the temperature where olivine starts to behave viscously. The rocks in the mesosphere are
uniform throughout the mantle though, but changes in pressure and temperature determine which polymorphs will exist at different depths. under more pressure than those in the asthenosphere, so no longer behave viscously.
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). </p>
The lithosphere-asthenosphere boundary is defined by the 1300K isotherm, which is the temperature where olivine starts to behave viscously. <figure align="left" >
The rocks in the mesosphere are under more pressure than those in the asthenosphere, so no longer behave viscously.</p> <a href='{% static "three_d_viewer/images/depth profile.png" %}' align="right"><img height=494 width=412 src='{% static "three_d_viewer/images/depth profile.png" %}'></a>
<figure> <figcaption>The seismic profile of the Earth.</figcaption>
<img src="{% static "three_d_viewer/images/structure - usgs.gif" %}" style="padding-top:20px;">
<figcaption><p>Image sourced from <a href="http://pubs.usgs.gov/gip/dynamic/graphics/FigS1-1.gif">USGS</a>.</p></figcaption>
</figure> </figure>
</div> </div>
<div id="pushDownThree"></div> <div id="pushDownThree"></div>

View File

@@ -7,9 +7,20 @@ urlpatterns = patterns(
'', '',
url(r'^$', views.HomeView.as_view(), name='home'), 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'^$', generic.TemplateView.as_view(template_name="three_d_viewer/home.html"), name='home'),
url(r'^theory/structure/$', generic.TemplateView.as_view(template_name="three_d_viewer/theory/structure.html"), name='theory_structure'), url(r'^theory/structure/$', views.TheoryTemplateView.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/erb101_structure/$', views.ERB101TheoryTemplateView.as_view(template_name="three_d_viewer/theory/structure.html"), name='erb101_theory_structure'),
url(r'^theory/pressure_temp/$', generic.TemplateView.as_view(template_name="three_d_viewer/theory/pressure_temp.html"), name='theory_pt'), url(r'^theory/bowen/$', views.TheoryTemplateView.as_view(template_name="three_d_viewer/theory/bowen.html"), name='theory_bowen'),
url(r'^theory/erb101_bowen/$', views.ERB101TheoryTemplateView.as_view(template_name="three_d_viewer/theory/bowen.html" ), name='erb101_theory_bowen'),
url(r'^theory/pressure_temp/$', views.TheoryTemplateView.as_view(template_name="three_d_viewer/theory/pressure_temp.html"), name='theory_pt'),
url(r'^theory/erb101_pressure_temp/$', views.ERB101TheoryTemplateView.as_view(template_name="three_d_viewer/theory/pressure_temp.html"), name='erb101_theory_pt'),
url(r'^theory/formationdiff/$', views.TheoryTemplateView.as_view(template_name="three_d_viewer/theory/formationdiff.html"), name='theory_fd'),
url(r'^theory/erb101_formationdiff/$', views.ERB101TheoryTemplateView.as_view(template_name="three_d_viewer/theory/formationdiff.html"), name='erb101_theory_fd'),
url(r'^theory/silicates/$', views.TheoryTemplateView.as_view(template_name="three_d_viewer/theory/silicates.html"), name='theory_silicates'),
url(r'^theory/erb101_silicates/$', views.ERB101TheoryTemplateView.as_view(template_name="three_d_viewer/theory/silicates.html"), name='erb101_theory_silicates'),
url(r'^theory/classification/$', views.TheoryTemplateView.as_view(template_name="three_d_viewer/theory/classification.html"), name='theory_classification'),
url(r'^theory/erb101_classification/$', views.ERB101TheoryTemplateView.as_view(template_name="three_d_viewer/theory/classification.html"), name='erb101_theory_classification'),
url(r'^theory/crystals/$', views.TheoryTemplateView.as_view(template_name="three_d_viewer/theory/crystals.html"), name='theory_crystals'),
url(r'^theory/erb101_crystals/$', views.ERB101TheoryTemplateView.as_view(template_name="three_d_viewer/theory/crystals.html"), name='erb101_theory_crystals'),
url(r'^minerals_practice/$', views.MineralPracticeView.as_view(template_name="three_d_viewer/minerals_practice.html"), name='minerals_practice'), url(r'^minerals_practice/$', views.MineralPracticeView.as_view(template_name="three_d_viewer/minerals_practice.html"), name='minerals_practice'),
url(r'^minerals/(?P<pk>\d+)/$', views.MineralDetailView.as_view(), name='mineral_detail'), url(r'^minerals/(?P<pk>\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'), url(r'^minerals_selftest/$', generic.TemplateView.as_view(template_name="three_d_viewer/minerals_selftest.html"), name='minerals_selftest'),
@@ -19,6 +30,12 @@ urlpatterns = patterns(
url(r'^fossils/(?P<pk>\d+)/$', views.FossilDetailView.as_view(), name='fossil_detail'), url(r'^fossils/(?P<pk>\d+)/$', views.FossilDetailView.as_view(), name='fossil_detail'),
url(r'^glossary/$', views.GlossaryView.as_view(), name='glossary'), 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'^acknowledgements/$', generic.TemplateView.as_view(template_name='three_d_viewer/acknowledgements.html'), name='acknowledgements'),
url(r'^erb101/$', views.ERB101HomeView.as_view(), name='erb101_home'),
url(r'^erb101/$', generic.TemplateView.as_view(template_name="three_d_viewer/erb101/home.html"), name='erb101_home'),
url(r'^erb101_rock_practice/$', views.ERB101RockPracticeView.as_view(), name='erb101_rocks_practice'),
url(r'^erb101_minerals_practice/$', views.ERB101MineralPracticeView.as_view(), name='erb101_minerals_practice'),
url(r'^erb101_minerals/(?P<pk>\d+)/$', views.ERB101MineralDetailView.as_view(), name='erb101_mineral_detail'),
url(r'^erb101_rocks/(?P<pk>\d+)/$', views.ERB101RockDetailView.as_view(), name='erb101_rock_detail'),
url(r'^media/(?P<path>.*)$', 'django.views.static.serve', url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}), {'document_root': settings.MEDIA_ROOT}),
) )

View File

@@ -39,6 +39,7 @@ class MineralPracticeView(generic.ListView):
result = chain(result, child.active_samples) result = chain(result, child.active_samples)
context['active_samples'] = sorted(result, key=attrgetter('name')) context['active_samples'] = sorted(result, key=attrgetter('name'))
context['base_template'] = 'three_d_viewer/base.html'
return context return context
class MineralDetailView(generic.DetailView): class MineralDetailView(generic.DetailView):
@@ -61,6 +62,7 @@ class MineralDetailView(generic.DetailView):
result = chain(result, child.active_samples) result = chain(result, child.active_samples)
context['active_samples'] = sorted(result, key=attrgetter('name')) context['active_samples'] = sorted(result, key=attrgetter('name'))
context['base_template'] = 'three_d_viewer/base.html'
return context return context
def get_object(self, queryset=None): def get_object(self, queryset=None):
@@ -86,6 +88,7 @@ class RockPracticeView(generic.ListView):
result = chain(result, child.active_samples) result = chain(result, child.active_samples)
context['active_samples'] = sorted(result, key=attrgetter('name')) context['active_samples'] = sorted(result, key=attrgetter('name'))
context['base_template'] = 'three_d_viewer/base.html'
return context return context
class RockDetailView(generic.DetailView): class RockDetailView(generic.DetailView):
@@ -105,6 +108,7 @@ class RockDetailView(generic.DetailView):
result = chain(result, child.active_samples) result = chain(result, child.active_samples)
context['active_samples'] = sorted(result, key=attrgetter('name')) context['active_samples'] = sorted(result, key=attrgetter('name'))
context['base_template'] = 'three_d_viewer/base.html'
return context return context
def get_object(self, queryset=None): def get_object(self, queryset=None):
@@ -130,6 +134,7 @@ class FossilPracticeView(generic.ListView):
result = chain(result, child.active_samples) result = chain(result, child.active_samples)
context['active_samples'] = sorted(result, key=attrgetter('name')) context['active_samples'] = sorted(result, key=attrgetter('name'))
context['base_template'] = 'three_d_viewer/base.html'
return context return context
class FossilDetailView(generic.DetailView): class FossilDetailView(generic.DetailView):
@@ -149,6 +154,7 @@ class FossilDetailView(generic.DetailView):
result = chain(result, child.active_samples) result = chain(result, child.active_samples)
context['active_samples'] = sorted(result, key=attrgetter('name')) context['active_samples'] = sorted(result, key=attrgetter('name'))
context['base_template'] = 'three_d_viewer/base.html'
return context return context
def get_object(self, queryset=None): def get_object(self, queryset=None):
@@ -165,3 +171,144 @@ class GlossaryView(generic.ListView):
context = super(GlossaryView, self).get_context_data(**kwargs) context = super(GlossaryView, self).get_context_data(**kwargs)
context['entries'] = GlossaryEntry.objects.all().order_by("name") context['entries'] = GlossaryEntry.objects.all().order_by("name")
return context return context
class ERB101HomeView(generic.ListView):
"""
Show the home page
"""
template_name = 'three_d_viewer/erb101/home.html'
model = Sample
def get_context_data(self, **kwargs):
context = super(ERB101HomeView, self).get_context_data(**kwargs)
context['active_samples'] = Sample.objects.select_subclasses(Mineral).filter(active=True).filter(erb101_sample=True).order_by('name')
context['parent_categories'] = Category.objects.filter(parent=None). \
filter(active=True).order_by('name')
return context
class ERB101MineralPracticeView(generic.ListView):
model = Mineral
template_name = 'three_d_viewer/erb101/minerals_practice.html'
def get_context_data(self, **kwargs):
context = super(ERB101MineralPracticeView, self).get_context_data(**kwargs)
cat = Category.objects.get(name='Minerals')
result = cat.active_101_samples
for child in cat.active_children:
result = chain(result, child.active_101_samples)
context['active_samples'] = sorted(result, key=attrgetter('name'))
context['base_template'] = 'three_d_viewer/erb101/base.html'
return context
class ERB101MineralDetailView(generic.DetailView):
"""
Add extra functionality for mineral details
"""
model = Mineral
template_name = 'three_d_viewer/erb101/mineral_detail.html'
parent_categories = Category.objects.filter(parent=None). \
filter(active=True).order_by("name")
def get_context_data(self, **kwargs):
context = super(ERB101MineralDetailView, self).get_context_data(**kwargs)
cat = Category.objects.get(name='Minerals')
result = cat.active_samples
for child in cat.active_children:
result = chain(result, child.active_samples)
context['active_samples'] = sorted(result, key=attrgetter('name'))
context['base_template'] = 'three_d_viewer/erb101/base.html'
return context
def get_object(self, queryset=None):
object = super(ERB101MineralDetailView, self).get_object()
object.viewed_count += 1
object.save()
return object
class ERB101RockPracticeView(generic.ListView):
model = Sample
template_name = 'three_d_viewer/erb101/rock_practice.html'
parent_categories = Category.objects.filter(parent=None). \
filter(active=True).order_by("name")
def get_context_data(self, **kwargs):
context = super(ERB101RockPracticeView, self).get_context_data(**kwargs)
cat = Category.objects.get(name='Rocks')
result = cat.active_101_samples
for child in cat.active_children:
result = chain(result, child.active_101_samples)
context['active_samples'] = sorted(result, key=attrgetter('name'))
context['base_template'] = 'three_d_viewer/erb101/base.html'
return context
class ERB101RockDetailView(generic.DetailView):
model = Sample
template_name = 'three_d_viewer/erb101/rock_detail.html'
parent_categories = Category.objects.filter(parent=None). \
filter(active=True).order_by("name")
def get_context_data(self, **kwargs):
context = super(ERB101RockDetailView, self).get_context_data(**kwargs)
cat = Category.objects.get(name='Rocks')
result = cat.active_samples
for child in cat.active_children:
result = chain(result, child.active_samples)
context['active_samples'] = sorted(result, key=attrgetter('name'))
context['base_template'] = 'three_d_viewer/erb101/base.html'
return context
def get_object(self, queryset=None):
object = super(ERB101RockDetailView, self).get_object()
object.viewed_count += 1
object.save()
return object
class TheoryTemplateView(generic.TemplateView):
def get_context_data(self, **kwargs):
context = super(TheoryTemplateView, self).get_context_data(**kwargs)
context['base_template'] = 'three_d_viewer/base.html'
context['url_extender'] = 'three_d_viewer:'
context['olivine'] = Mineral.objects.filter(name='Olivine')[0]
context['quartz'] = Mineral.objects.filter(name='Quartz')[0]
context['microcline'] = Mineral.objects.filter(name='Microcline')[0]
context['plag'] = Mineral.objects.filter(name='Plagioclase')[0]
context['diopside'] = Mineral.objects.filter(name='Diopside')[0]
context['actinolite'] = Mineral.objects.filter(name='Actinolite')[0]
context['silicates_theory'] = 'three_d_viewer:theory_silicates'
context['structure_theory'] = 'three_d_viewer:theory_structure'
return context
class ERB101TheoryTemplateView(generic.TemplateView):
def get_context_data(self, **kwargs):
context = super(ERB101TheoryTemplateView, self).get_context_data(**kwargs)
context['base_template'] = 'three_d_viewer/erb101/base.html'
context['url_extender'] = 'three_d_viewer:erb101_'
context['olivine'] = Mineral.objects.filter(name='Olivine')[0]
context['quartz'] = Mineral.objects.filter(name='Quartz')[0]
context['microcline'] = Mineral.objects.filter(name='Microcline')[0]
context['plag'] = Mineral.objects.filter(name='Plagioclase')[0]
context['diopside'] = Mineral.objects.filter(name='Diopside')[0]
context['actinolite'] = Mineral.objects.filter(name='Actinolite')[0]
context['silicates_theory'] = 'three_d_viewer:erb101_theory_silicates'
context['structure_theory'] = 'three_d_viewer:erb101_theory_structure'
return context