Commit 20f605eb by Ernie Park

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

parent b2e1ba74
<%inherit file="marketing.html" /> <%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"> <section class="copyright">
<div> <div>
......
<%inherit file="marketing.html" /> <%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"> <section class="honor-code">
<div> <div>
<h1> Honor Code </h1> <h1> Honor Code </h1>
......
<%inherit file="marketing.html" /> <%inherit file="marketing.html" />
<%block name="header">
<header class="announcement course"> <header class="announcement course">
<div class="anouncement-wrapper"> <div class="anouncement-wrapper">
<nav> ${parent.header_nav()}
<h1><a href="/t/mitx_global.html">MITx</a></h1>
<a class="" rel="leanModal" href="#login">Log In</a>
</nav>
<section class="course"> <section class="course">
<section> <section>
...@@ -16,9 +14,8 @@ ...@@ -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> <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> </section>
</div> </div>
</header> </header>
</%block>
<section class="index-content"> <section class="index-content">
<section class="about-course"> <section class="about-course">
...@@ -102,14 +99,9 @@ ...@@ -102,14 +99,9 @@
</section> </section>
<div id="enroll" class="leanModal_box" name="enroll"><%include file="create_account.html" /></div> <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> <script>
$(function() { $(function() {
/* Set up FancyBox pop-ups */
// TODO: Clean up as per http://stackoverflow.com/questions/169506/obtain-form-input-fields-using-jquery // TODO: Clean up as per http://stackoverflow.com/questions/169506/obtain-form-input-fields-using-jquery
...@@ -137,34 +129,6 @@ $(function() { ...@@ -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 */ /* Activate stupid spinner drop-downs in enrollment form */
var spinner_array=$("[id^=spinner_]"); var spinner_array=$("[id^=spinner_]");
spinner_array.each(function(i) { spinner_array.each(function(i) {
......
...@@ -29,6 +29,24 @@ ...@@ -29,6 +29,24 @@
</head> </head>
<body> <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()} ${self.body()}
<%block name="bodyextra"/> <%block name="bodyextra"/>
...@@ -39,63 +57,48 @@ ...@@ -39,63 +57,48 @@
<p> Copyright (c). 2011. MIT. <a href="/t/copyright.html">Some rights reserved.</a></p> <p> Copyright (c). 2011. MIT. <a href="/t/copyright.html">Some rights reserved.</a></p>
<ul> <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/privacy.html">Privacy Policy</a></li>
<li><a href="/t/honor.html">Honor Code</a></li> <li><a href="/t/honor.html">Honor Code</a></li>
</ul> </ul>
</div> </div>
</footer> </footer>
<div style="display:none"> <div id="login" class="leanModal_box"><%include file="login.html" /></div>
<div id="feedback_div"> <div id="pwd_reset" class="leanModal_box"><%include file="password_reset_form.html" /></div>
Found a bug? Got an idea for improving our system? Let us know. <div id="reset_done" class="leanModal_box"></div>
<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>
<script> <script>
// Feedback form $(document).ready(function(){
$(function() { /* Handles when the user tries to log in. Grabs form data. Does AJAX.
$("#feedback_button").click(function(){ Either shows error, or redirects. */
postJSON("/send_feedback", {"subject":$("#feedback_subject").attr("value"), $('#login_button').click(function() {
"url":document.URL, var submit_data={};
"message":$("#feedback_message").attr("value")}, $.each($("[id^=li_]"), function(index,value){
function(data){ submit_data[value.name]=value.value;
$("#feedback_subject").attr("value","");
$("#feedback_message").attr("value","");
$("#feedback_div").html("Feedback submitted. Thank you");
});
}); });
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 $('#pwd_reset_button').click(function() {
$(function() { $.post('/password_reset/',{ "csrfmiddlewaretoken" : "${ csrf }",
$("#calculator_button").click(function(){ "email" : $('#id_email').val()}, function(data){
$.getJSON("/calculate", {"equation":$("#calculator_input").attr("value")}, $('#pwd_reset').html(data);
function(data){
$("#calculator_output").attr("value",data.result);
});
}); });
}); });
});
</script> </script>
</body> </body>
......
<%inherit file="marketing.html" /> <%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="index-content">
<section class="about"> <section class="about">
<h1><em>MITx</em> is MIT&rsquo;s online learning initiative.</h1> <h1><em>MITx</em> is MIT&rsquo;s online learning initiative.</h1>
...@@ -49,25 +36,10 @@ ...@@ -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> <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> </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> </section>
<script> <script>
$(function() { $(function() {
/* Set up FancyBox pop-ups */
// TODO: Clean up as per http://stackoverflow.com/questions/169506/obtain-form-input-fields-using-jquery // TODO: Clean up as per http://stackoverflow.com/questions/169506/obtain-form-input-fields-using-jquery
...@@ -95,34 +67,6 @@ $(function() { ...@@ -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 */ /* Activate stupid spinner drop-downs in enrollment form */
var spinner_array=$("[id^=spinner_]"); var spinner_array=$("[id^=spinner_]");
spinner_array.each(function(i) { spinner_array.each(function(i) {
......
<%inherit file="marketing.html" /> <%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"> <section class="privacy-policy">
<div> <div>
<h1> Privacy Policy </h1> <h1> Privacy Policy </h1>
......
<%inherit file="marketing.html" /> <%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"> <section class="tos">
<div> <div>
<h1>MITx Terms of Service</h1> <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