diff --git a/static/css/deepsouthsounds.css b/static/css/deepsouthsounds.css index 0c91650..aef21b2 100644 --- a/static/css/deepsouthsounds.css +++ b/static/css/deepsouthsounds.css @@ -471,4 +471,67 @@ input[type=submit] { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -} \ No newline at end of file +} + +.widget_woo_twitter +.back { + padding: 0px +} + +.widget_woo_twitter +ul { + background: none; + padding-left: 0 +} + +.widget_woo_twitter ul +li { + background: #fff; + border: 1px solid #BFD4D9; + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + padding: 5px 10px; + margin-bottom: 5px; + list-style: none +} + +.widget_woo_twitter ul li +a { + padding: 0px +} + +.widget_woo_twitter ul li +.time { + color: #999 +} + +.widget_woo_twitter +p { + padding-top: 10px +} + +.widget_woo_twitter p +a { + color: #222 +} + +.widget_woo_twitter ul li +.content { + font-size: 12px +} + +.widget_woo_twitter ul li +.time { + display: block +} + +.widget.widget_woo_twitter +h3 { + border-bottom: none; + padding: 0; + margin: 0; + padding: 15px 0 15px 70px; + background: url(/static/img/twitter-ico.png) no-repeat left; + margin-bottom: 10px +} diff --git a/static/img/twitter-ico.png b/static/img/twitter-ico.png new file mode 100644 index 0000000..69568a1 Binary files /dev/null and b/static/img/twitter-ico.png differ diff --git a/static/js/app/app.js b/static/js/app/app.js index 2165145..3151840 100644 --- a/static/js/app/app.js +++ b/static/js/app/app.js @@ -37,8 +37,8 @@ var AppRouter = Backbone.Router.extend({ var mixList = new MixCollection(); mixList.type = type || 'latest'; $('#site-content-fill').html(''); - //this.sidebarView = new SidebarView(); - //$('#sidebar').html(this.sidebarView.el); + this.sidebarView = new SidebarView(); + $('#sidebar').html(this.sidebarView.el); var data = type != undefined ? $.param({sort:type}) : null; mixList.fetch({ data:data, diff --git a/static/js/app/views/sidebar.js b/static/js/app/views/sidebar.js index e7c144f..d2587e2 100644 --- a/static/js/app/views/sidebar.js +++ b/static/js/app/views/sidebar.js @@ -1,10 +1,4 @@ -/** - * Created with PyCharm. - * User: fergalm - * Date: 08/08/12 - * Time: 22:10 - * To change this template use File | Settings | File Templates. - */ + window.SidebarView = Backbone.View.extend({ initialize: function(){ this.render(); diff --git a/templates/inc/twitter.html b/templates/inc/twitter.html index 558ac47..75327e8 100644 --- a/templates/inc/twitter.html +++ b/templates/inc/twitter.html @@ -1,41 +1,53 @@ -Follow - @DeepSouthSounds - - - \ No newline at end of file + document.getElementById('twitter_update_list_woo_twitter-3').innerHTML = statusHTML.join(''); + } + function relative_time(time_value) { + var values = time_value.split(" "); + time_value = values[1] + " " + values[2] + ", " + values[5] + " " + values[3]; + var parsed_date = Date.parse(time_value); + var relative_to = (arguments.length > 1) ? arguments[1] : new Date(); + var delta = parseInt((relative_to.getTime() - parsed_date) / 1000); + delta = delta + (relative_to.getTimezoneOffset() * 60); + if (delta < 60) { + return'less than a minute ago'; + } else if (delta < 120) { + return'about a minute ago'; + } else if (delta < (60 * 60)) { + return(parseInt(delta / 60)).toString() + ' minutes ago'; + } else if (delta < (120 * 60)) { + return'about an hour ago'; + } else if (delta < (24 * 60 * 60)) { + return'about ' + (parseInt(delta / 3600)).toString() + ' hours ago'; + } else if (delta < (48 * 60 * 60)) { + return'1 day ago'; + } else { + return(parseInt(delta / 86400)).toString() + ' days ago'; + } + } + /*]]>*/ + + + \ No newline at end of file diff --git a/templates/views/SidebarView.html b/templates/views/SidebarView.html index eec58de..5ab4901 100644 --- a/templates/views/SidebarView.html +++ b/templates/views/SidebarView.html @@ -1 +1,20 @@ -{% include 'inc/twitter.html' %} \ No newline at end of file + +