Commit 20f605eb by Ernie Park

move duplicate code in static marketing sites to marketing.html block templates

parent b2e1ba74
<%inherit file="marketing.html" />
<header class="announcement">
<div class="anouncement-wrapper">
<nav>
<h1><a href="/t/mitx_global.html">MITx</a></h1>
<a class="modal login" href="#login">Log In</a>
</nav>
<section>
<h1>MITx</h1>
<h2>An MIT Education Anywhere. For free.</h2>
</section>
</div>
</header>
<section class="copyright">
<div>
......
<%inherit file="marketing.html" />
<header class="announcement">
<div class="anouncement-wrapper">
<nav>
<h1><a href="/t/mitx_global.html">MITx</a></h1>
<a class="modal login" href="#login">Log In</a>
</nav>
<section>
<h1>MITx</h1>
<h2>An MIT Education Anywhere. For free.</h2>
</section>
</div>
</header>
<section class="honor-code">
<div>
<h1> Honor Code </h1>
......
<%inherit file="marketing.html" />
<%block name="header">
<header class="announcement course">
<div class="anouncement-wrapper">
<nav>
<h1><a href="/t/mitx_global.html">MITx</a></h1>
<a class="" rel="leanModal" href="#login">Log In</a>
</nav>
${parent.header_nav()}
<section class="course">
<section>
......@@ -16,9 +14,8 @@
<p> Taught by Anant Agarwal, with Gerald Sussman, Piotr Mitros, and Chris Terman, &ldquo;6.002x Circuits and Electronics&rdquo; is an experimental on-line adaption of MIT's first undergraduate analog design course 6.002. This course will run, free of charge, for students worldwide from February 21, 2012 through June&nbsp;10,&nbsp;2012.</p>
</section>
</div>
</header>
</%block>
<section class="index-content">
<section class="about-course">
......@@ -102,14 +99,9 @@
</section>
<div id="enroll" class="leanModal_box" name="enroll"><%include file="create_account.html" /></div>
<div id="login" class="leanModal_box"><%include file="login.html" /></div>
<div id="pwd_reset" class="leanModal_box"><%include file="password_reset_form.html" /></div>
<div id="reset_done" class="leanModal_box"></div>
<script>
$(function() {
/* Set up FancyBox pop-ups */
// TODO: Clean up as per http://stackoverflow.com/questions/169506/obtain-form-input-fields-using-jquery
......@@ -137,34 +129,6 @@ $(function() {
);
});
/* Handles when the user tries to log in. Grabs form data. Does AJAX.
Either shows error, or redirects. */
$('#login_button').click(function() {
var submit_data={};
$.each($("[id^=li_]"), function(index,value){
submit_data[value.name]=value.value;
});
submit_data["remember"] = ($('#remember').attr("checked")? true : false);
postJSON('/login',
submit_data,
function(json) {
if(json.success) {
location.href="/courseware";
} else {
$('#login_error').html("Invalid Login");
}
}
);
});
$('#pwd_reset_button').click(function() {
$.post('/password_reset/',{ "csrfmiddlewaretoken" : "${ csrf }",
"email" : $('#id_email').val()}, function(data){
$('#pwd_reset').html(data);
});
});
/* Activate stupid spinner drop-downs in enrollment form */
var spinner_array=$("[id^=spinner_]");
spinner_array.each(function(i) {
......
......@@ -29,6 +29,24 @@
</head>
<body>
<%block name="header">
<header class="announcement">
<div class="anouncement-wrapper">
<%block name="header_nav">
<nav>
<h1><a href="/t/mitx_global.html">MITx</a></h1>
<a rel="leanModal" class="login" href="#login">Log In</a>
</nav>
</%block>
<%block name="header_text">
<section>
<h1>MITx</h1>
<h2>An MIT Education Anywhere. For free.</h2>
</section>
</%block>
</div>
</header>
</%block>
${self.body()}
<%block name="bodyextra"/>
......@@ -39,63 +57,48 @@
<p> Copyright (c). 2011. MIT. <a href="/t/copyright.html">Some rights reserved.</a></p>
<ul>
<li><a href="/t/tos.html">Terms of service</a></li>
<li><a href="/t/tos.html">Terms of Service</a></li>
<li><a href="/t/privacy.html">Privacy Policy</a></li>
<li><a href="/t/honor.html">Honor Code</a></li>
</ul>
</div>
</footer>
<div style="display:none">
<div id="feedback_div">
Found a bug? Got an idea for improving our system? Let us know.
<form>
<ol>
<li><label>Subject:</label> <input id="feedback_subject" size=40></li>
<li><label>Feedback: </label><textarea id="feedback_message" cols="40" rows="5"></textarea></li>
<li><input id="feedback_button" type="button" value="Submit"></li>
</ol>
</form>
</div>
</div>
<div style="display:none">
<div id="calculator_div">
<input id="calculator_input" >
<input id="calculator_button" type=button value="=&gt;">
<input id="calculator_output" readonly>
<p>Supported operations: ^ * / + - || ()</p>
<p>Supported suffixes: %kMGTcmunp</p>
</div>
</div>
<div id="login" class="leanModal_box"><%include file="login.html" /></div>
<div id="pwd_reset" class="leanModal_box"><%include file="password_reset_form.html" /></div>
<div id="reset_done" class="leanModal_box"></div>
<script>
// Feedback form
$(function() {
$("#feedback_button").click(function(){
postJSON("/send_feedback", {"subject":$("#feedback_subject").attr("value"),
"url":document.URL,
"message":$("#feedback_message").attr("value")},
function(data){
$("#feedback_subject").attr("value","");
$("#feedback_message").attr("value","");
$("#feedback_div").html("Feedback submitted. Thank you");
});
$(document).ready(function(){
/* Handles when the user tries to log in. Grabs form data. Does AJAX.
Either shows error, or redirects. */
$('#login_button').click(function() {
var submit_data={};
$.each($("[id^=li_]"), function(index,value){
submit_data[value.name]=value.value;
});
submit_data["remember"] = ($('#remember').attr("checked")? true : false);
postJSON('/login',
submit_data,
function(json) {
if(json.success) {
location.href="/courseware";
} else {
$('#login_error').html("Invalid Login");
}
}
);
});
// Calculator
$(function() {
$("#calculator_button").click(function(){
$.getJSON("/calculate", {"equation":$("#calculator_input").attr("value")},
function(data){
$("#calculator_output").attr("value",data.result);
});
$('#pwd_reset_button').click(function() {
$.post('/password_reset/',{ "csrfmiddlewaretoken" : "${ csrf }",
"email" : $('#id_email').val()}, function(data){
$('#pwd_reset').html(data);
});
});
});
</script>
</body>
......
<%inherit file="marketing.html" />
<header class="announcement home">
<div class="anouncement-wrapper">
<nav>
<a class="modal login" href="#login">Log In</a>
</nav>
<section>
<h1><em>MITx</em></h1>
<h2>An MIT Education Anywhere. For free.</h2>
</section>
</div>
</header>
<section class="index-content">
<section class="about">
<h1><em>MITx</em> is MIT&rsquo;s online learning initiative.</h1>
......@@ -49,25 +36,10 @@
<p>Taught by Anant Agarwal, with Gerald Sussman, Piotr Mitros, and Chris Terman, &ldquo;6.002 Circuits and Electronics&rdwuo; is an on-line adaption of MIT's first undergraduate analog design course. This prototype course will run, free of charge, for students worldwide from February 21, 2012 through June 10, 2012. Students will be given the opportunity to demonstrate their mastery of the material and earn a certificate from <em>MITx</em>.</p>
</section>
<div style="display:none">
<div id="login"><%include file="login.html" /></div>
</div>
<div style="display:none">
<div id="pwd_reset"><%include file="password_reset_form.html" /></div>
</div>
<div style="display:none">
<div id="reset_done"></div>
</div>
</section>
<script>
$(function() {
/* Set up FancyBox pop-ups */
// TODO: Clean up as per http://stackoverflow.com/questions/169506/obtain-form-input-fields-using-jquery
......@@ -95,34 +67,6 @@ $(function() {
);
});
/* Handles when the user tries to log in. Grabs form data. Does AJAX.
Either shows error, or redirects. */
$('#login_button').click(function() {
var submit_data={};
$.each($("[id^=li_]"), function(index,value){
submit_data[value.name]=value.value;
});
submit_data["remember"] = ($('#remember').attr("checked")? true : false);
postJSON('/login',
submit_data,
function(json) {
if(json.success) {
location.href="/courseware";
} else {
$('#login_error').html("Invalid Login");
}
}
);
});
$('#pwd_reset_button').click(function() {
$.post('/password_reset/',{ "csrfmiddlewaretoken" : "${ csrf }",
"email" : $('#id_email').val()}, function(data){
$('#pwd_reset').html(data);
});
});
/* Activate stupid spinner drop-downs in enrollment form */
var spinner_array=$("[id^=spinner_]");
spinner_array.each(function(i) {
......
<%inherit file="marketing.html" />
<header class="announcement">
<div class="anouncement-wrapper">
<nav>
<h1><a href="/t/mitx_global.html">MITx</a></h1>
<a class="modal login" href="#login">Log In</a>
</nav>
<section>
<h1>MITx</h1>
<h2>An MIT Education Anywhere. For free.</h2>
</section>
</div>
</header>
<section class="privacy-policy">
<div>
<h1> Privacy Policy </h1>
......
<%inherit file="marketing.html" />
<header class="announcement">
<div class="anouncement-wrapper">
<nav>
<h1><a href="/t/mitx_global.html">MITx</a></h1>
<a class="modal login" href="#login">Log In</a>
</nav>
<section>
<h1>MITx</h1>
<h2>An MIT Education Anywhere. For free.</h2>
</section>
</div>
</header>
<section class="tos">
<div>
<h1>MITx Terms of Service</h1>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment