Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
Conflicts:
	mchp/landing/static/landing/css/landing.css
  • Loading branch information
Adaptification committed Sep 6, 2014
2 parents a040ee7 + f0da199 commit d70667a
Show file tree
Hide file tree
Showing 235 changed files with 3,507 additions and 1,347 deletions.
7 changes: 6 additions & 1 deletion mchp/calendar_mchp/static/calendar_mchp/css/calendar.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@
-o-transition: 0.6s;
}
.flip-holder .back {
background: none;
background: #fff;
position: relative;
height: 680px;
z-index:0;
-webkit-transition: 0.6s;
-moz-transition: 0.6s;
Expand Down Expand Up @@ -144,3 +145,7 @@
.event-last-edit {
font-size: 8pt;
}

.datepicker {
z-index: 1061!important;
}
147 changes: 122 additions & 25 deletions mchp/calendar_mchp/static/calendar_mchp/js/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,91 @@
*
* This file handles the functionality of the calendar page.
*/

$(function() {

/*
/*
/* TOUR FUNCTIONS
/*
*/

// Instance the tour
var tour = new Tour({

name: "calendar-tour",
backdrop: true,
storage: false,
path: "/calendar/",
template: "<div class='popover tour'><div class='arrow'></div><h3 class='popover-title'></h3><div class='popover-content'></div><nav class='popover-navigation'><div class='btn-group'><button class='btn btn-default btn-sm' data-role='prev'>« prev</button><button class='btn btn-default btn-sm' data-role='next'>next »</button></div><button class='btn btn-default btn-end btn-sm tour-btn-end' data-role='end'>end tour</button></nav></div>",
steps: [
{
orphan: true,
title: "<strong>this is your calendar, " + MCHP_USERNAME + "!</strong>",
content: 'here\'s how mchp calendars work: let\'s say you want to make an "econ 200" calendar, and put assignment due dates, tests, and projects in it...'
},
{
orphan: true,
title: "<strong>private calendar</strong>",
content: "if you want to make it private, only you will be able to see the events you add to it. it's just like a regular calendar- for your eyes only."
},
{
orphan: true,
title: "<strong>selling a calendar</strong>",
content: "if you choose to sell it, your classmates will be able to subscribe to it by paying you a subscription fee every 14 days. in return, they'll get to see the events you add, and get notified whenever you change or add events."
},
{
orphan: true,
title: "<strong>selling a calendar cont.</strong>",
content: "your classmates will get to rate and review your calendar, just like they would if they bought a document from you. so, it's up to you to keep your calendar up-to-date and accurate, so you can get higher ratings and get more subscribers."
},
{
element: ".owned-cals-section",
title: "<strong>calendars you own</strong>",
content: "the calendars <em>you create</em> will appear here.",
placement: "right"
},
{
element: ".following-cals-section",
title: "<strong>calendars you follow</strong>",
content: "the calendars <em>you subscribe to</em> will appear here.",
placement: "right",
onhide: function() {
$('.flip-holder').toggleclass("flip");
}
},
{
element: ".view-cals-btn",
title: "<strong>browse calendars to follow</strong>",
content: "this is where your classmates' calendars that they choose to sell will appear.",
placement: "left",
// reflex: true,
// onhide: function() {
// $('.flip-holder').toggleclass("flip");
// }
},
{
element: ".back",
title: "<strong>here are the calendars for your classes</strong>",
content: "cool, right?",
placement: "left"
},
{
element: ".step-2",
title: "<strong>what would you like to do next?</strong>",
content: "click the <i class='fa fa-home'></i> (home) icon above to go to your homepage, or the <i class='fa fa-book'></i> (book) to go to your classes.",
placement: "bottom",
reflex: true
}

]});

// initialize the tour
tour.init();
// start the tour
tour.start();


/************************
* for rating calendars *
************************/
Expand Down Expand Up @@ -220,6 +304,12 @@ $(function() {
**************************/
$('.manage-calendar-tab').click(function(){
$('.manage-calendar-tab').removeClass('active');
$('.prompt-delete-message').addClass('hidden');
$('.not-delete-button').addClass('hidden');
$('.confirm-delete-button').addClass('hidden');
$('.end-subscription').addClass('hidden');
$('.prompt-delete-button').removeClass('hidden');

});

$('.prompt-delete-button').on('click', function () {
Expand Down Expand Up @@ -384,31 +474,31 @@ $(function() {
* CALENDAR INTRODUCTION STUFF *
*******************************/

if($('#calStepOne').length) {
$('#yourCalList').hide();
}
// show calendar step three when clicked
$('.stepOneNext').on('click', function () {
$('#calStepOne').fadeOut(250, function () {
$('#calStepTwo').fadeIn(500);
$('#calStepTwo').removeClass("hidden");
});
});
// show calendar step three when clicked
$('.stepTwoNext').on('click', function () {
$('#calStepTwo').fadeOut(250, function () {
$('#calStepThree').fadeIn(500);
$('#calStepThree').removeClass("hidden");
});
});
// switch to your cal list when clicked and close intro
$('.stepThreeNext').on('click', function () {
$('.cal-intro').fadeOut(250, function () {
$('#yourCalList').fadeIn(500);
});
var event = $(this).data('event');
toggle_flag(event);
});
// if($('#calStepOne').length) {
// $('#yourCalList').hide();
// }
// // show calendar step three when clicked
// $('.stepOneNext').on('click', function () {
// $('#calStepOne').fadeOut(250, function () {
// $('#calStepTwo').fadeIn(500);
// $('#calStepTwo').removeClass("hidden");
// });
// });
// // show calendar step three when clicked
// $('.stepTwoNext').on('click', function () {
// $('#calStepTwo').fadeOut(250, function () {
// $('#calStepThree').fadeIn(500);
// $('#calStepThree').removeClass("hidden");
// });
// });
// // switch to your cal list when clicked and close intro
// $('.stepThreeNext').on('click', function () {
// $('.cal-intro').fadeOut(250, function () {
// $('#yourCalList').fadeIn(500);
// });
// var event = $(this).data('event');
// toggle_flag(event);
// });

// using jquery.cookie plugin
var csrftoken = $.cookie('csrftoken');
Expand Down Expand Up @@ -655,6 +745,13 @@ $(function() {
$(this).parents('.list-group-item').remove();
});
});
var clearPopovers = function () {
if(!$('.popover:hover').length && !$('.canvas-day:hover').length && !$('.fc-day:hover').length) {
$('.popover').remove();
}
setTimeout(clearPopovers, 2000);
};
clearPopovers();
$('#calendar').on('mouseleave', '.canvas-day', function(jsEvent) {
var $canvas = $(this);
setTimeout(function () {
Expand Down
43 changes: 37 additions & 6 deletions mchp/calendar_mchp/static/calendar_mchp/js/calendar_preview.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$(function() {
// http or https needs to match the site requesting this resource
if (typeof ZeroClipboard !== 'undefined') {
ZeroClipboard.config( { swfPath: "http://ajax.cdnjs.com/ajax/libs/zeroclipboard/2.1.5/ZeroClipboard.swf" } );
ZeroClipboard.config( { swfPath: "https://ajax.cdnjs.com/ajax/libs/zeroclipboard/2.1.5/ZeroClipboard.swf" } );

var client = new ZeroClipboard($("#copy-button") );
client.on("aftercopy", function(){
Expand All @@ -13,7 +13,7 @@ $(function() {
/* fb stuff */
window.fbAsyncInit = function(){
FB.init({
appId: '1488225931413638',
appId: '369999156462705',
status: true,
cookie: true,
xfbml: true
Expand All @@ -37,7 +37,7 @@ $(function() {
link: url,
name: title,
description: desc,
picture: 'https://s3-us-west-2.amazonaws.com/mchpstatic/Circle+Icons+/Custom/calendar-blank.svg',
picture: 'https://s3-us-west-2.amazonaws.com/mchpstatic/calenda-default.svg',
};
console.log(obj);
function callback(response){
Expand All @@ -50,7 +50,38 @@ $(function() {

return false;
});
$('.alert').on('close.bs.alert', function () {
toggle_flag($(this).data('event'));
});

// show email sign up input when clicked
$('#show-signup').on('click', function () {
$('#login-options').fadeOut(250, function () {
$('#email-signup').fadeIn(500).removeClass('hidden');
});
});

//validate signup form
$('#email-signup').bootstrapValidator({
message: 'This value is not valid',
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
email: {
trigger: 'keyup',
validators: {
notEmpty: {
message: 'This field is required'
},
emailAddress: {
message: 'Please enter a valid email address'
},
regexp: {
regexp: /(\.edu)$/,
message: 'Only .edu emails allowed'
}
}
}
}
});
});
55 changes: 15 additions & 40 deletions mchp/calendar_mchp/templates/calendar_mchp/calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@
{% block extra_head %}
<link href="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap3-editable/css/bootstrap-editable.css" rel="stylesheet"/>
<script src="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap3-editable/js/bootstrap-editable.min.js"></script>

<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.7.0/moment.min.js"></script>
<!-- <script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script> -->


{% load staticfiles %}
<link rel="stylesheet" type="text/css" href="{% static 'calendar_mchp/css/fullcalendar.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'calendar_mchp/css/datepicker.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'calendar_mchp/css/bootstrap-clockpicker.min.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'calendar_mchp/css/bootstrap-slider.min.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'calendar_mchp/css/calendar.css' %}">

<link rel="stylesheet" type="text/css" href="{% static 'lib/css/bootstrap-tour.min.css' %}">

<script src="{% static 'lib/js/bootstrap-tour.min.js' %}"></script>
<script src="{% static 'lib/js/jquery.cookie.js' %}"></script>
<script src="{% static 'calendar_mchp/js/calendar.js' %}?v=001"></script>
<script src="{% static 'calendar_mchp/js/calendar.js' %}"></script>
<script type="text/javascript" src="{% static 'calendar_mchp/js/bootstrap-datepicker.js' %}"></script>
<script type="text/javascript" src="{% static 'calendar_mchp/js/bootstrap-clockpicker.min.js' %}"></script>
<script type="text/javascript" src="{% static 'calendar_mchp/js/bootstrap-slider.min.js' %}"></script>
Expand All @@ -33,7 +32,7 @@
<div class="modal-content text-center">
<div class="modal-body">
<p class="lead">How <em>accurate</em> is this calendar?</p>
<img class="animated delayed-xs bounceIn" src="https://s3-us-west-2.amazonaws.com/mchpstatic/Flat+Icon+SVG/SVG/goal.svg" width="64px" alt="rate calendar accuracy">
<img class="animated delayed-xs bounceIn" src="{% static 'lib/img/goal.svg' %}" width="64px" alt="rate calendar accuracy">
<p></p>
</br>
<input id="ex1" data-slider-id='ex1Slider' type="text" data-slider-min="0" data-slider-max="10" data-slider-step="1" data-slider-value="8"/>
Expand Down Expand Up @@ -177,7 +176,7 @@ <h3 class="panel-title">Calendar Options
<span class="prompt-delete-message small hidden">Are you sure?</span> &nbsp;
<span class="btn btn-danger btn-xs confirm-delete-button hidden" data-cal="{{calendar.pk}}">Yes</span>
<span class=" btn btn-default btn-xs not-delete-button hidden">Cancel</span>
<span class="pull-right btn btn-danger btn-xs prompt-delete-button">Delete</span>
<span class="btn btn-danger btn-xs prompt-delete-button">Delete</span>
</span>
</h3>
</div>
Expand Down Expand Up @@ -208,7 +207,7 @@ <h3 class="panel-title">Calendar Options
>
<label class="col-sm-4 control-label">Price:</label>
<div class="col-sm-8">
<span class="calendar-price" data-pk="{{calendar.pk}}" data-name="price">{{calendar.price}}</span> &nbsp;<span><i class="fa fa-info-circle small" data-toggle="tooltip" data-placement="right" data-original-title="This is the price per fortnight (2 weeks) that your classmates pay to subscribe to your calendar"></i></span>
<span class="calendar-price" data-pk="{{calendar.pk}}" data-name="price">{{calendar.price}}</span> &nbsp;<span><i class="fa fa-info-circle small" data-toggle="tooltip" data-placement="right" data-original-title="This is the price per fortnight (14 days) that your classmates pay to subscribe to your calendar"></i></span>
</div>
</div>
<div class="form-group form-group-sm">
Expand Down Expand Up @@ -319,35 +318,8 @@ <h3 >My Calendars
</h3>
<hr style="margin-top:12px;">
<p></p>
{% if not turtorial_flag.0 %}
<div class="panel panel-default cal-intro">
<div class="panel-body">
<div id="calStepOne">
<p><strong>Yoohoo!</strong><small class="pull-right"><small>1/3</small></small></p>
<p>The calendars you create and the calendars you subscribe to will show up here.</p>
<hr/>
<button href="#" class="btn btn-primary btn-xs btn-block stepOneNext">Next</button>
</div>
<div id="calStepTwo" class="hidden">
<p><strong>Did you know...</strong><small class="pull-right"><small>2/3</small></small></p>
<p>Once you create a class calendar, your classmates can <em>subscribe</em> to your calendar, and for every one of them that does, you'll make money!</p>
<hr>
<button type="button" class="btn btn-primary btn-xs btn-block stepTwoNext">Next</button>
</div>
<div id="calStepThree" class="hidden">
<p><strong>This is because...</strong><small class="pull-right"><small>3/3</small></small></p>
<p>You can also <em>subscribe</em> one of your classmate's class calendars, and for every calendar you subscribe to, you'll fork over some points!</p>
<p>What would you like to do?</p>
<hr>
<p>
<button data-event="{{turtorial_flag.1}}" class="btn btn-success btn-xs btn-block stepThreeNext view-cals">View Others</button>
<a data-event="{{turtorial_flag.1}}" type="button" href="#" class="btn btn-primary btn-xs btn-block stepThreeNext">Create my Own</a>
</p>
</div>
</div>
</div><!-- end panel -->
{% endif %}
<div id="yourCalList" class="">
<div id="yourCalList">
<div class="owned-cals-section">
<h5>School<span class="badge pull-right" id="owned-calendar-count">{{owned_calendars|length}}</span></h5>
<li role="presentation" class="dropdown-header" style="margin:0px; padding:0px;">You Own</li>
<!-- don't delete this again -->
Expand Down Expand Up @@ -393,6 +365,8 @@ <h5>School<span class="badge pull-right" id="owned-calendar-count">{{owned_calen
</div>
</p>
{% endfor %}
</div>
<div class="following-cals-section">
<li role="presentation" class="dropdown-header" style="margin:0px; padding:0px;">You Follow</li>
<p></p>
{% for calendar in subscriptions %}
Expand Down Expand Up @@ -435,6 +409,7 @@ <h5>School<span class="badge pull-right" id="owned-calendar-count">{{owned_calen
{% endfor %}
</div>
</div>
</div>
<div id="col_2" class="col-sm-9 animated bounceInUp delayed-sm">
<div class="flip-holder">
<div class="front">
Expand All @@ -450,8 +425,8 @@ <h5>School<span class="badge pull-right" id="owned-calendar-count">{{owned_calen
<span class="cal-date text-center center-block h3 margin-top-none"></span>
</div>
<div class="col-xs-4">
<span class="pull-right">
<a href="#" class=" view-cals margin-btm-none text-default btn btn-default btn-xs"> Browse Calendars</a>
<span class="pull-right view-cals-btn">
<a href="#" class="view-cals margin-btm-none btn btn-primary btn-xs"> Browse Calendars</a>
</span>
</div>
</div>
Expand Down Expand Up @@ -510,7 +485,7 @@ <h4 class="margin-top-none">{{course}} Calendars <span class="badge" id="calenda
<span class="pull-left" href="#">
<a href="#" class='calendar-picture-link'>
<div class="media-object img-thumbnail">
<img src="https://s3-us-west-2.amazonaws.com/mchpstatic/Flat+Icon+SVG/SVG/calendar-blank.svg" style="width:64px">
<img src="{% static 'lib/img/calendar-blank.svg' %}" style="width:64px">
</div>
<div class="assignment-number text-center text-default h4 calendar-event-count">15</div>
</a>
Expand Down
Loading

0 comments on commit d70667a

Please sign in to comment.