Account pages, about page, fix note/user associations
authorCharles Connell <charles@connells.org>
Tue, 1 Apr 2014 01:06:51 +0000 (21:06 -0400)
committerCharles Connell <charles@connells.org>
Tue, 1 Apr 2014 01:06:51 +0000 (21:06 -0400)
17 files changed:
karmaworld/apps/document_upload/views.py
karmaworld/apps/notes/models.py
karmaworld/apps/users/templatetags/__init__.py [new file with mode: 0644]
karmaworld/apps/users/templatetags/social_account_list.py [new file with mode: 0644]
karmaworld/apps/users/views.py
karmaworld/assets/css/about.css
karmaworld/assets/css/dashboard.css
karmaworld/assets/css/global.css
karmaworld/assets/js/jquery.metadata.js [deleted file]
karmaworld/assets/js/note-detail.js
karmaworld/templates/about.html
karmaworld/templates/base.html
karmaworld/templates/control_panel.html [deleted file]
karmaworld/templates/header.html
karmaworld/templates/notes/note_detail.html
karmaworld/templates/user_profile.html
karmaworld/urls.py

index a8c85b28e66fdd668ecb9b70007526ac26b0b785..98b21e417097d49ba6162c202777962820e80c19 100644 (file)
@@ -24,7 +24,7 @@ def save_fp_upload(request):
 
         # note that .save() has the side-effect of kicking of a celery processing task
         if request.user.is_authenticated():
-            raw_document.save(user=request.user)
+            raw_document.save()
         else:
             anonymous_upload_urls = request.session.get(ANONYMOUS_UPLOAD_URLS, [])
             anonymous_upload_urls.append(request.POST['fp_file'])
@@ -36,7 +36,7 @@ def save_fp_upload(request):
         r_d_f.save_m2m()
         # Proccess document after the tags are saved so that it isn't converted
         # to a note before the tags are attached to the document
-        raw_document.process_document()
+        raw_document.process_document(user=request.user)
 
         return HttpResponse({'success'})
     else:
index dc25b961e2a5e3e5f1c76b8936633b391c2e17e2..84caec8533ec0d4a0350ad5bc605b726b723e99f 100644 (file)
@@ -435,7 +435,10 @@ def update_note_counts(note_instance):
     else:
         # course exists
         note_instance.course.update_note_count()
-        note_instance.course.school.update_note_count()
+        if note_instance.course.school:
+            note_instance.course.school.update_note_count()
+        elif note_instance.course.department.school:
+            note_instance.course.department.school.update_note_count()
 
 @receiver(pre_save, sender=Note, weak=False)
 def note_pre_save_receiver(sender, **kwargs):
diff --git a/karmaworld/apps/users/templatetags/__init__.py b/karmaworld/apps/users/templatetags/__init__.py
new file mode 100644 (file)
index 0000000..8be6577
--- /dev/null
@@ -0,0 +1 @@
+__author__ = 'charles'
diff --git a/karmaworld/apps/users/templatetags/social_account_list.py b/karmaworld/apps/users/templatetags/social_account_list.py
new file mode 100644 (file)
index 0000000..80cea1a
--- /dev/null
@@ -0,0 +1,30 @@
+from allauth.socialaccount.models import SocialAccount
+from django import template
+
+register = template.Library()
+
+
+class SocialAccountListNode(template.Node):
+    def __init__(self, user):
+        self.user_string = template.Variable(user)
+
+    def render(self, context):
+        try:
+            user = self.user_string.resolve(context)
+            accounts = [account.provider.title() for account in user.socialaccount_set.all()]
+            accounts_string = ', '.join(accounts)
+            return accounts_string
+        except template.VariableDoesNotExist:
+            return ''
+
+
+def do_social_account_list(parser, token):
+    try:
+        # split_contents() knows not to split quoted strings.
+        tag_name, user = token.split_contents()
+    except ValueError:
+        raise template.TemplateSyntaxError("social_account_list tag requires a single argument")
+    return SocialAccountListNode(user)
+
+register.tag('social_account_list', do_social_account_list)
+
index b2f17b64b290a1804729f81e99ff36aa398a481d..611920be30872810a8a150850ad2810e299f21c7 100644 (file)
@@ -30,7 +30,3 @@ class ProfileView(TemplateView, MultipleObjectMixin):
         kwargs['badge'] = self.request.user.get_profile().get_badge()
 
         return super(ProfileView, self).get_context_data(**kwargs)
-
-class ControlView(TemplateView):
-    template_name = 'control_panel.html'
-
index 23085575c83e360b7e152cf995f0ac71841e6a2b..3a5b4b9abe08685865267edaa6375e660946c347 100644 (file)
   background: url(../img/team_crop.jpg);
 }
 
-#hero_image_caption_container
-{
-  position: absolute;
-  z-index: 5;
-  bottom: 20px;
-}
-
-#hero_image_caption
-{
-  font-family: "MuseoSlab-700";
-  font-size: 17px;
-  color: #FFF;
-  line-height: 150%;
-}
-
 /* COPY */
 
 #about_copy_header
 {
   padding-top: 40px;
   color: #f05a28;
-  font-family: "MuseoSlab-700";
   font-size: 38px;
 }
 
@@ -50,7 +34,6 @@
 
 #about_copy_body p
 {
-  font-family: "MuseoSlab-500";
   font-size: 17px;
   margin: 20px 0 0;
   line-height: 150%;
 
 #donate_copy_header
 {
-  font-family: "MuseoSlab-700";
   font-size: 40px;
   color: #3a3a3a;
 }
 
 #donate_copy_body
 {
-  font-family: "MuseoSlab-700";
   font-size: 20px;
   color: #3a3a3a;
   padding-top: 10px;
@@ -99,8 +80,8 @@
 
 #donate_button
 {
-  font-family: "MuseoSlab-900";
 }
+
 #amazon-donate-form {
   margin: 1em 1em 0;
 }
 #leaderboard_header
 {
   padding-top: 75px;
-  font-family: "MuseoSlab-700";
   font-size: 25px;
 }
 
 #leaderboard_copy
 {
-  font-family: "MuseoSlab-500";
   font-size: 17px;
   padding-top: 3px;
   padding-bottom: 30px;
 
 .leaderboard_rank
 {
-  font-family: "MuseoSans-900";
   font-size: 14px;
-  /*width: 20px!important;*/
   padding-top: 4px;
 }
 
 .leaderboard_school, .leaderboard_score
 {
-  font-family: "MuseoSlab-500";
   font-size: 19px;
 }
 
 .bullets li
 {
-  font-family: "MuseoSlab-500";
   font-size: 17px;
 }
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..78413ed69c802b7077ba4d58ed9cff0b9ffa1847 100644 (file)
@@ -0,0 +1,61 @@
+#stats-container {
+  margin: 20px 0 20px 0;
+}
+
+#user-name {
+  font-size: 1.5em;
+}
+
+.stat-count {
+  font-size: 2.5em;
+}
+
+div.stat-container {
+  border-left: solid 1px #dfdfdf;
+}
+
+.activity_item {
+  margin: 15px 0 15px 0;
+}
+
+.activity_timestamp {
+  font-size: 0.7em;
+}
+
+.activity_details_action {
+  margin: 10px 0 5px 0;
+}
+
+.activity_details_object {
+  margin: 5px 0 5px 0;
+}
+
+.activity_details_points_positive,
+.activity_details_points_negative {
+  background: #f1592a;
+  padding: 0px 5px 0 5px;
+  border-radius: 2px;
+  color: #ffffff;
+}
+
+.account_settings_row {
+  padding: 15px 0 15px 0;
+  border-bottom: 1px solid #f0f0f0;
+}
+
+.account_settings_category {
+  text-align: right;
+  font-weight: normal;
+}
+
+.account_settings_edit {
+  text-align: right;
+  font: 0.8em 'museo700';
+}
+
+@media only screen and (max-width: 40.063em) {
+  .account_settings_category,
+  .account_settings_edit {
+    text-align: left;
+  }
+} /* medium screens and down */
index 422329da303def6d731b7110613bcc768898e2fc..1e25aa645413717d14ea23f77f34e1cdb9418743 100644 (file)
@@ -1,5 +1,6 @@
 body {
   font-family: 'adelle-sans';
+  font-weight: lighter;
 }
 
 .museo300 {
@@ -8,12 +9,21 @@ body {
 
 .museo700 {
   font-family: 'museo700';
+  font-weight: normal;
 }
 
 .adelle-sans {
   font-family: 'adelle-sans';
 }
 
+h1, h2, h3, h4, h5 {
+  font-family: 'museo700';
+}
+
+p {
+  font-weight: inherit;
+}
+
 .nav-list ul {
   list-style-type: none;
   margin: 0;
@@ -166,10 +176,10 @@ table.dataTable div.data-table-entry {
   margin: 20px 0 20px 0;
 }
 
-table.dataTable tr.even {
+.even {
   background: #fafafa;
-  border-top: 2px solid #f0f0f0;
-  border-bottom: 2px solid #f0f0f0;
+  border-top: 1px solid #f0f0f0;
+  border-bottom: 1px solid #f0f0f0;
 }
 
 ul.ui-autocomplete {
@@ -191,3 +201,27 @@ ul.ui-autocomplete {
   border: none;
 }
 
+dl.tabs dd.active {
+  border-radius: 3px;
+}
+
+dl.tabs dd {
+  margin: 0 10px 0px 10px;
+  border: 1px solid #dfdfdf;
+  border-bottom: none;
+}
+
+dl.tabs dd,
+dl.tabs dd a {
+  border-top-left-radius: 3px;
+  border-top-right-radius: 3px;
+}
+
+dl.tabs dd a {
+  padding: 5px 10px 5px 10px;
+}
+
+div.tabs-content {
+  margin-top: -1px;
+  border-top: 1px solid #dfdfdf;
+}
\ No newline at end of file
diff --git a/karmaworld/assets/js/jquery.metadata.js b/karmaworld/assets/js/jquery.metadata.js
deleted file mode 100755 (executable)
index dc4538e..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Metadata - jQuery plugin for parsing metadata from elements
- *
- * Copyright (c) 2006 John Resig, Yehuda Katz, Jörn Zaefferer, Paul McLanahan
- *
- * Dual licensed under the MIT and GPL licenses:
- *   http://www.opensource.org/licenses/mit-license.php
- *   http://www.gnu.org/licenses/gpl.html
- *
- */
-
-/**
- * Sets the type of metadata to use. Metadata is encoded in JSON, and each property
- * in the JSON will become a property of the element itself.
- *
- * There are three supported types of metadata storage:
- *
- *   attr:  Inside an attribute. The name parameter indicates *which* attribute.
- *
- *   class: Inside the class attribute, wrapped in curly braces: { }
- *
- *   elem:  Inside a child element (e.g. a script tag). The
- *          name parameter indicates *which* element.
- *
- * The metadata for an element is loaded the first time the element is accessed via jQuery.
- *
- * As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
- * matched by expr, then redefine the metadata type and run another $(expr) for other elements.
- *
- * @name $.metadata.setType
- *
- * @example <p id="one" class="some_class {item_id: 1, item_label: 'Label'}">This is a p</p>
- * @before $.metadata.setType("class")
- * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
- * @desc Reads metadata from the class attribute
- *
- * @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p>
- * @before $.metadata.setType("attr", "data")
- * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
- * @desc Reads metadata from a "data" attribute
- *
- * @example <p id="one" class="some_class"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p>
- * @before $.metadata.setType("elem", "script")
- * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
- * @desc Reads metadata from a nested script element
- *
- * @param String type The encoding type
- * @param String name The name of the attribute to be used to get metadata (optional)
- * @cat Plugins/Metadata
- * @descr Sets the type of encoding to be used when loading metadata for the first time
- * @type undefined
- * @see metadata()
- */
-
-(function($) {
-
-$.extend({
-       metadata : {
-               defaults : {
-                       type: 'class',
-                       name: 'metadata',
-                       cre: /(\{.*\})/,
-                       single: 'metadata'
-               },
-               setType: function( type, name ){
-                       this.defaults.type = type;
-                       this.defaults.name = name;
-               },
-               get: function( elem, opts ){
-                       var data, m, e, attr,
-                               settings = $.extend({},this.defaults,opts);
-                       // check for empty string in single property
-                       if ( !settings.single.length ) { settings.single = 'metadata'; }
-
-                       data = $.data(elem, settings.single);
-                       // returned cached data if it already exists
-                       if ( data ) { return data; }
-
-                       data = "{}";
-
-                       if ( settings.type === "class" ) {
-                               m = settings.cre.exec( elem.className );
-                               if ( m ) { data = m[1]; }
-                       } else if ( settings.type === "elem" ) {
-                               if( !elem.getElementsByTagName ) { return undefined; }
-                               e = elem.getElementsByTagName(settings.name);
-                               if ( e.length ) { data = $.trim(e[0].innerHTML); }
-                       } else if ( elem.getAttribute !== undefined ) {
-                               attr = elem.getAttribute( settings.name );
-                               if ( attr ) { data = attr; }
-                       }
-
-                       if ( data.indexOf( '{' ) <0 ) { data = "{" + data + "}"; }
-
-                       data = eval("(" + data + ")");
-
-                       $.data( elem, settings.single, data );
-                       return data;
-               }
-       }
-});
-
-/**
- * Returns the metadata object for the first member of the jQuery object.
- *
- * @name metadata
- * @descr Returns element's metadata object
- * @param Object opts An object contianing settings to override the defaults
- * @type jQuery
- * @cat Plugins/Metadata
- */
-$.fn.metadata = function( opts ){
-       return $.metadata.get( this[0], opts );
-};
-
-})(jQuery);
\ No newline at end of file
index 67da5344c28bbd99c906e6887e37aa2f7eefb22e..a178320debb557b19a42061335c48d4a8f75b4a8 100644 (file)
@@ -73,8 +73,6 @@ function writeNoteFrame(contents) {
 
 $(function() {
 
-  $("#tabs").tabs();
-
   $("#thank-button").click(function(event) {
     event.preventDefault();
 
index b08d05ff3862fd208ca7fe9b942857147a6a9399..08d72b59c1c7490384b4eadc973a1ea2a69a51c6 100644 (file)
   <section id="about_content">
 
     <div class="row">
-      {% comment %}
-      <div id="hero_image" class="twelve columns">
-        <div id="hero_image_caption_container">
-          <div class="row">
-            <div id="hero_image_caption" class="seven columns offset-by-one">
-            <!-- <p>Meet the KarmaNotes team: Andrew, Charles, Bob, & Seth.</p> -->
-            </div><!-- /hero_image_caption -->
-          </div>
-        </div><!-- /hero_image_caption_container -->
-      </div><!-- /hero_image -->
-      {% endcomment %}
       <div class="small-12 columns flex-video vimeo">
         <iframe src="//player.vimeo.com/video/66370775" title="0" width="960" height="436" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
       </div>
     </div>
 
     <div class="row">
-      <div id="about_copy_header" class="small-12 columns large-10 large-offset-1 ">
+      <div id="about_copy_header" class="small-12 columns museo700">
         Help us spread the academic wealth.
       </div>
     </div>
 
     <div class="row">
-      <div id="about_copy_body" class="small-12 columns large-10 large-offset-1">
+      <div id="about_copy_body" class="small-12 columns">
         <p>KarmaNotes empowers college students to share course notes, study guides, and other digital learning resources online. By exchanging knowledge on KarmaNotes, everyone benefits from access to a growing database of knowledge.</p>
         <p>All content on KarmaNotes is licensed Creative Commons and all code is <a href="https://github.com/FinalsClub/karmaworld">free and open source</a>. We also maintain full compliance with the Digital Millennium Copyright Act.</p>
         <p>Beyond the ivory tower, KarmaNotes is a network with the potential to digitize education, one lecture at a time.  Like a give-a-penny jar, KarmaNotes collects knowledge for the common good. Best of all, our capacity is practically limitless, and withdrawals are entirely free. </p>
         <p>KarmaNotes is improving access to learning resources thanks to support from the William and Flora Hewlett Foundation and generous scholars like you. Want to get involved or learn more? Please <a href="mailto:info@finalsclub.org?Subject=Karma%20question">contact us</a> or support our mission with a tax-deductible charitable donation to the FinalsClub Foundation.</p>
       </div> <!--/about_copy_body-->
-
-
     </div>
 
 
@@ -53,7 +40,7 @@
 
       <div id="donate-text" class="small-12 small-centered columns large-6 large-uncentered">
         <div class="row">
-          <div id="donate_copy_header" class="">Love KarmaNotes?</div>
+          <div id="donate_copy_header" class="museo300">Love KarmaNotes?</div>
           <!-- /donate_copy_header -->
         </div> <!--.row-->
         <div class="row">
@@ -83,7 +70,7 @@
           <!-- Default donation amount -->
           <input type="hidden" name="amount" value="USD 20" >
 
-          <button id="donate_button" class="button large round expand"  type="submit">
+          <button id="donate_button" class="button large round expand museo700"  type="submit">
             DONATE
           </button>
         </form>
@@ -92,7 +79,7 @@
     </div> <!-- donate button container-->
 
     <div class="row">
-      <div class="small-12 columns large-10 large-offset-1">
+      <div class="small-12 columns">
         <div id="leaderboard_header">
           University Karma Leaderboard
         </div><!-- /leaderboard_header -->
     </div>
 
     <div class="row">
-      <div class="small-12 columns large-10 large-offset-1">
+      <div class="small-12 columns">
         <div id="leaderboard_copy">
           These schools are aces at sharing the academic wealth
         </div>
 
 
     <div class="row">
-      <div id="leaderboard_table" class="small-10 columns small-offset-1">
+      <div id="leaderboard_table" class="small-12 columns">
 
         {% for school in schools %}
         <div class="row leaderboard_item">
index 01e9ed0cdb17d08f74e47d9e2604f5b7a0219e10..7a2e817fe3989818107c2aeab8b9e290aaed1013 100644 (file)
@@ -9,7 +9,7 @@
   <link rel="shortcut icon" href="{{ STATIC_URL }}img/favicon.ico">
   <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/fontface/fontface.css">
   <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/foundation.min.css">
-  <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/jquery-ui.css">
+  <link rel="stylesheet" type="text/css" media="all" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
   <link rel="stylesheet" href="{{ STATIC_URL }}css/vendor/opentip.css">
   <link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css">
   <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/global.css">
diff --git a/karmaworld/templates/control_panel.html b/karmaworld/templates/control_panel.html
deleted file mode 100644 (file)
index c549ccf..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-{% extends "account/base.html" %}
-
-{% load i18n %}
-{% load account %}
-
-{% block title %}Control Panel{% endblock %}
-
-{% block content %}
-  <h1>Hello {% user_display user %}!</h1>
-  <p>Your account control panel:</p>
-  <ul>
-    <li><a href="{% url 'account_email' %}"><button>Add/Remove Emails</button></a></li>
-    <li><a href="{% url 'account_change_password' %}"><button>Change Password</button></a></li>
-    <li><a href="{% url 'socialaccount_connections' %}"><button>Social Accounts</button></a></li>
-  </ul>
-{% endblock %}
-
index 35873e1250375e7869541229c6b4b86e5cb7c365..ba4333eb006fcbee1e69b880e2515fa47b2b6b53 100644 (file)
@@ -9,7 +9,6 @@
         <div class="large-12 columns">
           <ul>
             <li><a href="{% url 'accounts_profile' %}">{{ request.user.get_profile.get_points }} Karma Points</a></li>
-            <li><a href="{% url 'control_panel' %}">My Account</a></li>
             <li><a href="{% url 'account_logout' %}">Log Out</a></li>
           </ul>
         </div>
@@ -54,7 +53,8 @@
     <li><div class="mobile-nav-item"><a href="/">Courses</a></div></li>
     {% if request.user.is_authenticated %}
       <li><div class="mobile-nav-item">My Notes</div></li>
-      <li><div class="mobile-nav-item"><a href="{% url 'control_panel' %}">My Account</a></div></li>
+      <li><div class="mobile-nav-item"><a href="{% url 'accounts_profile' %}">Dashboard</a></div></li>
+      <li><div class="mobile-nav-item"><a href="{% url 'accounts_profile' %}#control_panel">My Account</a></div></li>
       <li><div class="mobile-nav-item"><a href="{% url 'account_logout' %}">Log Out</a></div></li>
     {% else %}
       <li><div class="mobile-nav-item"><a href="{% url 'account_login' %}">Log In</a></div></li>
index c47f50d15a069480f97eb35a82fb3084bdd4d3c2..b1e10f3456437326397573d45b2e29b486b4d76a 100644 (file)
@@ -70,7 +70,7 @@
                     <i class="fa fa-thumbs-up"></i> Thank Note</button>
                 {% else %}
                   <button id="thank-button" class="modify-button"><i class="fa fa-thumbs-up"></i> Thank Note</button>
-                  <button id="thank-button-disabled" class="show-for-large-up modify-button disabled opentip hide"
+                  <button id="thank-button-disabled" class="modify-button disabled opentip hide"
                           data-ot="You've already thanked this note"
                            {% include 'partial/opentip_settings.html' %}>
                     <i class="fa fa-thumbs-up"></i> Thank Note</button>
 
     <div class="row">
       <div id="tabs" class="small-12 columns">
-        <ul>
-          <li><a href="#note_container">Note</a></li>
-        </ul>
-        <div id="note_container">
-          {% if pdf_controls %}
-            <div id="zoom-buttons" class="row show-for-medium-up">
-              <div id="outline-btn-wrapper" class="small-1 columns hide show-for-medium-up">
-                <i id="outline-btn" class="zoom-button fa fa-bars fa-2x"></i>
-              </div>
-              <div class="small-4 columns">
-                <span>Jump to page:
-                <input id="scroll-to" type="text" style="width: 3em; display: inline" /></span>
-              </div>
-              <div class="small-2 small-centered columns center">
-                <i id="minus-btn" class="zoom-button fa fa-search-minus fa-2x"></i>
-                <i id="plus-btn" class="zoom-button fa fa-search-plus fa-2x"></i>
+        <dl class="tabs show-for-large-up" data-tab>
+          <dd class="active"><a href="#note_container">Note</a></dd>
+        </dl>
+        <div class="tabs-content">
+          <div id="note_container" class="content active">
+            {% if pdf_controls %}
+              <div id="zoom-buttons" class="row show-for-medium-up">
+                <div id="outline-btn-wrapper" class="small-1 columns hide show-for-medium-up">
+                  <i id="outline-btn" class="zoom-button fa fa-bars fa-2x"></i>
+                </div>
+                <div class="small-4 columns">
+                  <span>Jump to page:
+                  <input id="scroll-to" type="text" style="width: 3em; display: inline" /></span>
+                </div>
+                <div class="small-2 small-centered columns center">
+                  <i id="minus-btn" class="zoom-button fa fa-search-minus fa-2x"></i>
+                  <i id="plus-btn" class="zoom-button fa fa-search-plus fa-2x"></i>
+                </div>
               </div>
+            {% endif %}
+
+            <div class="row">
+              <div class="small-12 small-centered columns medium-12 large-12 body_copy">
+                {% if note.static_html %}
+                  <div class="note-text">
+                    {% if note.has_markdown %}
+                      <span id="note-markdown" data-markdown="{{note.notemarkdown.markdown}}"></span>
+                    {% else %}
+                      <iframe style="border:none; width:100%; min-height: 1000px;"
+                            id="noteframe"></iframe>
+                      <noscript>
+                        {{ note.text }}
+                      </noscript>
+                    {% endif %}
+                  </div> <!-- .note-text -->
+
+                {% else %} {# note.static_html #}
+                  <div class="note-error">
+                    This document's content is currently unavailable. Please try again later.
+                  </div>
+                {% endif %} {# note.static_html #}
+              </div><!-- /body_copy -->
             </div>
-          {% endif %}
-
-          <div class="row">
-            <div class="small-12 small-centered columns medium-12 large-12 body_copy">
-              {% if note.static_html %}
-                <div class="note-text">
-                  {% if note.has_markdown %}
-                    <span id="note-markdown" data-markdown="{{note.notemarkdown.markdown}}"></span>
-                  {% else %}
-                    <iframe style="border:none; width:100%; min-height: 1000px;"
-                          id="noteframe"></iframe>
-                    <noscript>
-                      {{ note.text }}
-                    </noscript>
-                  {% endif %}
-                </div> <!-- .note-text -->
-
-              {% else %} {# note.static_html #}
-                <div class="note-error">
-                  This document's content is currently unavailable. Please try again later.
-                </div>
-              {% endif %} {# note.static_html #}
-            </div><!-- /body_copy -->
           </div>
-
         </div><!-- /note_container -->
       </div>
     </div>
index 31c62c0640508702160c0c4463e8d114bc8ad2c7..49e35cf36465b64dedf3f2c9a3a664c92355bb4b 100644 (file)
@@ -1,60 +1,32 @@
 {% extends "base.html" %}
 {% load url from future %}
 {% load account %}
+{% load social_account_list %}
 
 {% block pagescripts %}
   <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/dashboard.css">
 {% endblock %}
 
-{% block bodyscripts %}
-  <script>
-    $(function() {
-      $("#tabs").tabs();
-    });
-  </script>
-{% endblock %}
-
 {% block title %}
   Your KarmaNotes Profile
 {% endblock %}
 
 {% block raw_content %}
   <section id="dashboard_content">
-    <div id="stats_container" class="hero_gradient_bar">
-      <div class="row">
-        <div class="small-10 columns small-centered center header_title">
+    <div id="stats-container">
+      <div class="row museo700">
+        <div id="user-name" class="small-12 large-3 columns">
           {% user_display user %}
-          {% if badge %}
-            <br/><span class="badge">{{ badge }}</span>
-          {% endif %}
-      </div>
         </div>
-      <div class="row">
-        <div class="small-12 medium-8 large-4 columns small-centered">
-          <div class="row">
-            <div class="small-6 columns center  stat_lead_in">
-              you've earned
-            </div>
-            <div class="small-6 columns center  stat_lead_in">
-              you've uploaded
-            </div>
-          </div>
-          <div class="row">
-            <div class="small-6 columns center  stat_number stat_earned">
-             {{ user.get_profile.get_points }}
-            </div>
-            <div class="small-6 columns  center stat_number stat_uploaded">
-              {{ user.note_set.count }}
-            </div>
-          </div>
-          <div class="row">
-            <div class="small-6 columns center  stat_object stat_earned">
-              karma points
-            </div>
-            <div class="small-6 columns center  stat_object stat_uploaded">
-              notes
-            </div>
-          </div>
+        <div class="small-12 large-3 columns stat-container">
+          <span class="stat-count">{{ user.get_profile.get_points }}</span>
+          <br/>
+          Karma Points
+        </div>
+        <div class="small-12 large-3 columns end stat-container">
+          <span class="stat-count">{{ user.note_set.count }}</span>
+          <br/>
+          Notes Uploaded
         </div>
       </div>
 
     <div id="activity_container">
       <div class="row">
         <div id="tabs" class="small-12 columns">
-          <ul>
-            <li><a href="#activity">Karma Point Activity</a></li>
-          </ul>
-          <div id="activity">
-            {% for item in object_list %}
-
-              <div class="row">
-                <div class="small-10 columns small-centered {% cycle '' 'row_alt_on'%}">
-
-                  <div class="activity_item">
+          <dl class="tabs show-for-large-up" data-tab data-options="deep_linking: true">
+            <dd class="active"><a href="#activity">Karma Point Activity</a></dd>
+            <dd><a href="#control_panel">My Account</a></dd>
+          </dl>
+          <div class="tabs-content">
+            <div id="activity" class="content active">
+              {% for item in object_list %}
+
+                <div class="row  {% cycle '' 'even'%}">
+                  <div class="small-12 columns small-centered activity_item">
                     {% if 'KarmaEvent' in item.0 %}
                       {% with event=item.1 %}
                         <div class="row">
                           <div class="small-12 columns activity_timestamp">
-                            <span class="activity_date">{{ event.timestamp|date:"D b j Y" }}</span>
+                            <span class="activity_date">{{ event.timestamp|date:"l, F j, Y" }}</span>
                           </div>
-                          <div class="small-12 columns activity_details_action">
+                          <div class="small-12 columns activity_details_action museo700">
                             {% if event.points > 0 %}
-                            <span class="activity_details_points_positive">+{{ event.points }}</span>
+                              <span class="activity_details_points_positive">+{{ event.points }}</span>
                             {% else %}
-                            <span class="activity_details_points_negative">{{ event.points }}</span>
+                              <span class="activity_details_points_negative">{{ event.points }}</span>
                             {% endif %}
                             {{ event.get_message }}
                           </div>
                           {% if item.0 == 'NoteKarmaEvent' %}
-                            <div class="small-12 columns activity_details_action">
+                            <div class="small-12 columns activity_details_object">
                               <a href="{{ event.note.get_absolute_url }}" class="activity_target">{{ event.note.name }}</a>
                             </div>
                             <div class="small-12 columns activity_details_context">
-                              <a href="{{ event.note.course.get_absolute_url }}" class="course_link">{{ event.note.course.name }} // {{ event.note.course.school.name }}</a>
+                              <a href="{{ event.note.course.get_absolute_url }}" class="course_link">{{ event.note.course.name }} &bull;
+                                {% if event.note.course.school %}
+                                  {{ event.note.course.school.name }}
+                                {% else %}
+                                  {{ event.note.course.department.school.name }}
+                                {% endif %}
+                              </a>
                             </div>
                           {% endif %}
                           {% if item.0 == 'CourseKarmaEvent' %}
-                            <div class="small-12 columns activity_details_action">
+                            <div class="small-12 columns activity_details_object">
                               <a href="{{ event.course.get_absolute_url }}" class="activity_target">{{ event.course.name }}</a>
                             </div>
                             <div class="small-12 columns activity_details_context">
 
                     {% endif %}
 
-
                   </div>
+                </div>
 
+              {% endfor %}
+            </div>
+            <div id="control_panel" class="content">
+              <div class="account_settings_row">
+                <div class="row">
+                  <div class="small-12 large-2 columns account_settings_category">
+                    Name:
+                  </div>
+                  <div class="small-12 large-8 columns account_settings_value end">
+                    {{ user.get_full_name }}
+                  </div>
                 </div>
               </div>
-
-            {% endfor %}
+              <div class="account_settings_row">
+                <div class="row">
+                  <div class="small-12 large-2 columns account_settings_category">
+                    Username:
+                  </div>
+                  <div class="small-12 large-8 columns account_settings_value end">
+                    {{ user.username }}
+                  </div>
+                </div>
+              </div>
+              <div class="account_settings_row">
+                <div class="row">
+                  <div class="small-12 large-2 columns account_settings_category">
+                    Email:
+                  </div>
+                  <div class="small-12 large-8 columns account_settings_value">
+                    {{ user.email }}
+                  </div>
+                  <div class="small-12 large-8 columns account_settings_edit">
+                    <a href="{% url 'account_email' %}"><i class="fa fa-pencil"></i> Edit</a>
+                  </div>
+                </div>
+              </div>
+              <div class="account_settings_row">
+                <div class="row">
+                  <div class="small-12 large-2 columns account_settings_category">
+                    Password:
+                  </div>
+                  <div class="small-12 large-8 columns account_settings_value">
+                    ********
+                  </div>
+                  <div class="small-12 large-2 columns account_settings_edit">
+                    <a href="{% url 'account_change_password' %}"><i class="fa fa-pencil"></i> Edit</a>
+                  </div>
+                </div>
+              </div>
+              <div class="account_settings_row">
+                <div class="row">
+                  <div class="small-12 large-2 columns account_settings_category">
+                    Social accounts:
+                  </div>
+                  <div class="small-12 large-8 columns account_settings_value">
+                    {% social_account_list request.user %}
+                  </div>
+                  <div class="small-12 large-2 columns account_settings_edit">
+                    <a href="{% url 'socialaccount_connections' %}"><i class="fa fa-pencil"></i> Edit</a>
+                  </div>
+                </div>
+              </div>
+            </div>
           </div>
         </div>
       </div>
 
-      <div class="row">
-        <div class="small-10 columns small-centered column_header">
-            latest activity
-        </div>
-      </div>
-
       {% if not object_list %}
         <div class="row">
-          <div id="no_activity" class="small-10 columns small-centered center">
+          <div id="no_activity" class="small-12 columns">
             <h4>Nothing to show here yet.</h4>
           </div>
         </div>
index 00a83a2585aeb93a479a6c685dfc174b37ed1ff4..ccc7defe1b7b94e57d4852a9902bf98e9045d2f6 100644 (file)
@@ -16,12 +16,10 @@ from karmaworld.apps.courses.views import school_list
 from karmaworld.apps.courses.views import school_course_list
 from karmaworld.apps.courses.views import school_course_instructor_list
 from karmaworld.apps.notes.views import NoteView, thank_note, NoteSearchView, flag_note, downloaded_note, edit_note_tags
-from karmaworld.apps.notes.views import RawNoteDetailView
 from karmaworld.apps.moderation import moderator
 from karmaworld.apps.document_upload.views import save_fp_upload
 from karmaworld.apps.quizzes.views import QuizView, KeywordEditView, quiz_answer
 from karmaworld.apps.users.views import ProfileView
-from karmaworld.apps.users.views import ControlView
 
 # See: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf
 
@@ -66,7 +64,6 @@ urlpatterns = patterns('',
     # All Auth
     url(r'^accounts/', include('allauth.urls')),
     url(r'^accounts/profile/', ProfileView.as_view(), name='accounts_profile'),
-    url(r'^accounts/control_panel', ControlView.as_view(), name='control_panel'),
 
     # Media handling
     url(r'^media/(?P<path>.*)$', 'django.views.static.serve',