Renaming NC- to NB-. Fixing paging. Lots of small tweaks.

This commit is contained in:
Samuel Clay 2013-01-10 17:32:05 -08:00
parent 8ef612b840
commit 0e7d729aa6
10 changed files with 408 additions and 396 deletions

View file

@ -334,7 +334,6 @@ def load_social_page(request, user_id, username=None, **kwargs):
has_next_page = False
feed_id = kwargs.get('feed_id') or request.REQUEST.get('feed_id')
if page: offset = limit * (int(page) - 1)
user_social_profile = None
user_social_services = None
user_following_social_profile = None

File diff suppressed because it is too large Load diff

View file

@ -32,7 +32,7 @@ $default-box-shadow-blur: 1px;
// = Mixins =
// ==========
@mixin NC-default-button {
@mixin NB-default-button {
border: 1px solid $border-color;
@include border-radius(4px, 4px);
@include single-box-shadow(white, 0px, 0px, 2px, false, true);
@ -59,7 +59,7 @@ $default-box-shadow-blur: 1px;
}
}
@mixin NC-blue-button {
@mixin NB-blue-button {
border: 1px solid #4388b5;
@include border-radius(4px, 4px);
@include single-box-shadow(#80c5f2, 0px, 0px, 2px, false, true);
@ -142,6 +142,20 @@ blockquote {
.NB-spinner.NB-active {
display: block;
}
.tipsy {
.tipsy-arrow {
display: none;
}
}
// ========
// = Page =
// ========
.NB-container {
width: 100%;
height: 100%;
}
// ==========
// = Header =
@ -154,11 +168,7 @@ blockquote {
padding: 0 10px;
}
.NB-header {
display: none;
}
.NC-watermark-logo {
.NB-watermark-logo {
margin: 20px auto;
max-width: $page-width;
min-width: 300px;
@ -176,18 +186,18 @@ blockquote {
}
}
.NC-blue-button {
@include NC-blue-button;
.NB-blue-button {
@include NB-blue-button;
}
.NC-header {
.NB-header {
@include single-box-shadow(#7d7d7d, 0px, 0px, 10px, false, false);
width: 100%;
left: 0;
z-index: 10;
.NC-header-inner {
.NB-header-inner {
padding: 0 10px;
max-width: $page-width;
min-width: 300px;
@ -196,7 +206,7 @@ blockquote {
}
}
.NB-authenticated .NC-header {
.NB-authenticated .NB-header {
background: #f2f2f2 image-url('header_background_logged_in.png') repeat 0 0;
height: 44px;
bottom: 0;
@ -219,22 +229,22 @@ blockquote {
cursor: pointer;
&.NC-active {
&.NB-active {
cursor: default;
background: image-url('header_highlight_border.png') no-repeat center bottom;
div.NC-tab-inner {
div.NB-tab-inner {
color: $highlight-text-color;
}
}
&:hover {
div.NC-tab-inner {
div.NB-tab-inner {
color: $highlight-text-color;
}
}
div.NC-tab-inner {
div.NB-tab-inner {
display: inline-block;
line-height: 44px;
}
@ -243,46 +253,46 @@ blockquote {
border-left: 1px solid #cdcdcd;
}
&.NC-user-tab img {
&.NB-user-tab img {
height: 16px;
width: 16px;
@include border-radius(3px, 3px);
}
img,
.NC-icon {
.NB-icon {
float: left;
margin-top: 13px;
margin-right: 7px;
}
&.NC-trending-tab .NC-icon {
&.NB-trending-tab .NB-icon {
width: 17px;
height: 17px;
background: image-url('header/icon_trending.png') no-repeat center bottom;
}
&.NC-active.NC-trending-tab .NC-icon,
&.NC-trending-tab:hover .NC-icon {
&.NB-active.NB-trending-tab .NB-icon,
&.NB-trending-tab:hover .NB-icon {
background: image-url('header/icon_trending_active.png') no-repeat center bottom;
}
&.NC-following-tab .NC-icon {
&.NB-following-tab .NB-icon {
width: 17px;
height: 17px;
background: image-url('header/icon_follow.png') no-repeat center bottom;
}
&.NC-active.NC-following-tab .NC-icon,
&.NC-following-tab:hover .NC-icon {
&.NB-active.NB-following-tab .NB-icon,
&.NB-following-tab:hover .NB-icon {
background: image-url('header/icon_follow_active.png') no-repeat center bottom;
}
}
}
}
.NB-unauthenticated .NC-header {
.NB-unauthenticated .NB-header {
background: image-url('header_background_transparent.png') repeat 0 0;
height: 72px;
top: 0;
@ -291,7 +301,7 @@ blockquote {
height: 40px;
}
h1.NC-logo a {
h1.NB-logo a {
display: block;
float: left;
padding-top: 16px;
@ -308,29 +318,29 @@ blockquote {
}
}
.NC-request-toggle-button {
.NB-request-toggle-button {
float: right;
@include NC-blue-button;
@include NB-blue-button;
margin-top: 20px;
margin-left: 10px;
}
.NC-logout-button,
.NC-login-toggle-button {
.NB-logout-button,
.NB-login-toggle-button {
float: right;
@include NC-default-button;
@include NB-default-button;
margin-top: 20px;
margin-left: 10px;
}
.NC-button {
.NB-button {
@media screen and ( max-width: 480px) {
display: none;
}
}
}
.NC-popover {
.NB-popover {
position: absolute;
top: 50px;
left: 200px;
@ -338,27 +348,27 @@ blockquote {
opacity: 0;
display: none;
&.NC-request-popover {
&.NB-request-popover {
top: 50px;
left: 329px;
}
&.NC-login-popover {
&.NB-login-popover {
top: 50px;
left: 456px;
}
&.NC-active {
&.NB-active {
display: block;
}
.NC-popover-inner {
.NB-popover-inner {
width: 240px;
padding: 45px 38px 0 30px;
background: transparent image-url('popover_top.png') no-repeat 0 0;
}
.NC-popover-bottom {
.NB-popover-bottom {
background: transparent image-url('popover_bottom.png') no-repeat left bottom;
height: 40px;
}
@ -513,7 +523,7 @@ blockquote {
color: $more-text-color-active;
}
.NC-story-cutoff {
.NB-story-cutoff {
position: absolute;
top: -14px;
left: 0;
@ -573,6 +583,9 @@ blockquote {
}
// ==========
// = Shares =
// ==========
.NB-story-shares-container {
text-align: right;
@ -697,11 +710,6 @@ blockquote {
font-size: $smallest-font-size;
color: $light-text-color;
@include single-text-shadow;
@media screen and ( max-width: 480px) {
float: left;
clear: both;
margin-top: 4px;
}
}
.NB-story-comment-location {
@ -773,7 +781,7 @@ blockquote {
top: 16px;
right: 0;
width: 140px;
@include NC-default-button;
@include NB-default-button;
}
.NB-story-comment-delete {
@ -789,13 +797,29 @@ blockquote {
}
}
// ==========
// = Footer =
// ==========
.NB-page-controls {
margin: 0 auto 54px;
border-top: 2px solid #626262;
border-bottom: 2px solid #626262;
padding: 1px 0;
text-align: center;
max-width: 800px;
overflow: hidden;
}
.NB-page-controls-next,
.NB-page-controls-end {
background-color: #6eb4e3;
@include NC-blue-button;
height: 20px;
padding: 20px 28px 20px;
position: relative;
overflow: hidden;
text-shadow: 0 1px 0 #141F48;
-webkit-transition: all .12s ease-out;
-moz-transition: all .12s ease-out;
@ -806,17 +830,36 @@ blockquote {
position: absolute;
left: 0;
width: 100%;
margin-bottom: -15px;
height: 20px;
bottom: 20px;
font-size: 20px;
color: white;
}
&:hover {
background-color: #2B478C;
background-image: none;
cursor: pointer;
}
&.NB-loaded {
cursor: default;
}
&.NB-loading {
cursor: wait;
}
}
.NB-page-controls-end {
@include NC-default-button;
background-color: #3B3E49;
cursor: default;
&:hover {
background-color: #3B3E49;
background-image: none;
cursor: default;
}
}
.tipsy {
.tipsy-arrow {
display: none;
}
}
footer {
overflow: hidden;
}

View file

@ -72,11 +72,14 @@ NEWSBLUR.Views.SocialPage = Backbone.View.extend({
return;
}
var page_control_y = this.$('.NB-page-controls').last().offset().top - 500;
if (viewport_y > page_control_y) {
this.cached_page_control_y = page_control_y;
this.flags.loading_page = true;
this.next_page();
var $controls = this.$('.NB-page-controls');
if ($controls.length) {
var page_control_y = $controls.last().offset().top - 500;
if (viewport_y > page_control_y) {
this.cached_page_control_y = page_control_y;
this.flags.loading_page = true;
this.next_page();
}
}
},
@ -100,7 +103,7 @@ NEWSBLUR.Views.SocialPage = Backbone.View.extend({
scroll_to_story: function(story_view, run) {
$('html,body').stop().animate({
scrollTop: story_view.$mark.offset().top - 8
scrollTop: story_view.$mark.offset().top - 12
}, {
duration: run == 1 ? 1000 : 500,
easing: run == 1 ? 'easeInQuint' : 'easeOutQuint',

View file

@ -1,11 +1,11 @@
NEWSBLUR.Views.SocialPageLoginSignupView = Backbone.View.extend({
events: {
"click .NC-login-toggle-button" : "toggle_login_dialog",
"click .NC-request-toggle-button" : "toggle_request_dialog",
"click .NC-logout-button" : "logout",
"click .NC-login-button" : "login",
"click .NC-request-button" : "request_invite"
"click .NB-login-toggle-button" : "toggle_login_dialog",
"click .NB-request-toggle-button" : "toggle_request_dialog",
"click .NB-logout-button" : "logout",
"click .NB-login-button" : "login",
"click .NB-request-button" : "request_invite"
},
initialize: function() {
@ -14,14 +14,14 @@ NEWSBLUR.Views.SocialPageLoginSignupView = Backbone.View.extend({
toggle_login_dialog: function(options) {
console.log('open');
options = options || {};
var $popover = this.$('.NC-login-popover');
var $other_popover = this.$('.NC-request-popover');
var $popover = this.$('.NB-login-popover');
var $other_popover = this.$('.NB-request-popover');
var $login_username = this.$('input[name=login_username]');
var $login_password = this.$('input[name=login_password]');
if (options.open != true &&
(options.close ||
($popover.hasClass('NC-active')))) {
($popover.hasClass('NB-active')))) {
// Close
$popover.animate({
'opacity': 0
@ -31,15 +31,15 @@ NEWSBLUR.Views.SocialPageLoginSignupView = Backbone.View.extend({
'queue': false,
'complete': _.bind(function() {
this.$('.NB-error').remove();
$popover.removeClass('NC-active');
$popover.removeClass('NB-active');
}, this)
});
$(document).unbind('mousedown.loginView');
} else {
// Open/resize
this.$('.NB-error').remove();
$other_popover.removeClass('NC-active');
$popover.addClass('NC-active');
$other_popover.removeClass('NB-active');
$popover.addClass('NB-active');
$popover.animate({
'opacity': 1
}, {
@ -70,12 +70,12 @@ NEWSBLUR.Views.SocialPageLoginSignupView = Backbone.View.extend({
toggle_request_dialog: function(options) {
options = options || {};
var $popover = this.$('.NC-request-popover');
var $other_popover = this.$('.NC-login-popover');
var $popover = this.$('.NB-request-popover');
var $other_popover = this.$('.NB-login-popover');
var $request_email = this.$('input[name=request_email]');
if (options.close ||
($popover.hasClass('NC-active'))) {
($popover.hasClass('NB-active'))) {
// Close
$popover.animate({
'opacity': 0
@ -84,14 +84,14 @@ NEWSBLUR.Views.SocialPageLoginSignupView = Backbone.View.extend({
'easing': 'easeInOutQuint',
'queue': false,
'complete': _.bind(function() {
$popover.removeClass('NC-active');
$popover.removeClass('NB-active');
}, this)
});
$(document).unbind('mousedown.loginView');
} else {
$other_popover.removeClass('NC-active');
$popover.addClass('NC-active');
$other_popover.removeClass('NB-active');
$popover.addClass('NB-active');
$popover.animate({
'opacity': 1
}, {
@ -121,10 +121,10 @@ NEWSBLUR.Views.SocialPageLoginSignupView = Backbone.View.extend({
},
hide_popovers: function(e) {
var $popover = this.$('.NC-popover');
var $popover = this.$('.NB-popover');
if (e) {
if (($(e.target).closest(".NC-popover").length) || ($(e.target).closest(".NC-button").length)) return;
if (($(e.target).closest(".NB-popover").length) || ($(e.target).closest(".NB-button").length)) return;
}
$(document).unbind('mousedown.loginView');
@ -136,7 +136,7 @@ NEWSBLUR.Views.SocialPageLoginSignupView = Backbone.View.extend({
'easing': 'easeInOutQuint',
'queue': false
});
$popover.removeClass('NC-active');
$popover.removeClass('NB-active');
},
// ==========
@ -165,7 +165,7 @@ NEWSBLUR.Views.SocialPageLoginSignupView = Backbone.View.extend({
this.clean();
var error = _.first(_.values(data.errors))[0];
this.$('.NC-login-popover .NC-popover-inner').append($.make('div', { className: 'NB-error' }, error));
this.$('.NB-login-popover .NB-popover-inner').append($.make('div', { className: 'NB-error' }, error));
},
logout: function() {
@ -190,7 +190,7 @@ NEWSBLUR.Views.SocialPageLoginSignupView = Backbone.View.extend({
post_request_invite: function(data) {
NEWSBLUR.log(["request data", data]);
this.hide_popovers();
this.$('.NC-request-toggle-button').html('Invite Requested');
this.$('.NB-request-toggle-button').html('Invite Requested');
},
request_invite_error: function(data) {

View file

@ -90,7 +90,7 @@ NEWSBLUR.Views.SocialPageStory = Backbone.View.extend({
truncate_story_height: function() {
var $expander = this.$(".NB-story-content-expander");
var $expander_cutoff = this.$(".NC-story-cutoff");
var $expander_cutoff = this.$(".NB-story-cutoff");
var $wrapper = this.$(".NB-story-content-wrapper");
var $content = this.$(".NB-story-content");
@ -247,7 +247,7 @@ NEWSBLUR.Views.SocialPageStory = Backbone.View.extend({
expand_story: function(options) {
options = options || {};
var $expander = this.$(".NB-story-content-expander");
var $expander_cutoff = this.$(".NC-story-cutoff");
var $expander_cutoff = this.$(".NB-story-cutoff");
var $wrapper = this.$(".NB-story-content-wrapper");
var $content = this.$(".NB-story-content");
var max_height = parseInt($wrapper.css('maxHeight'), 10) || this.STORY_CONTENT_MAX_HEIGHT;

View file

@ -4,14 +4,14 @@
<html>
<head>
<title>Circular</title><!--{{ social_profile.title }}-->
<title>{{ social_profile.title }}</title>
<link rel="alternate" type="application/rss+xml" href="{% url shared-stories-rss-feed social_profile.user_id social_profile.username|slugify %}" title="{{ social_profile.feed_title }} RSS feed">
<link rel="shortcut icon" href="{{ social_profile.photo_url }}">
<link rel="icon" href="{{ social_profile.photo_url }}">
<meta name="viewport" content="initial-scale=1, maximum-scale=1.5">
<link rel="apple-touch-icon" href="{{ MEDIA_URL }}img/circular/circular_apple_icon.png"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width; initial-scale = 1.0; maximum-scale=1.0; user-scalable=no" />
<meta name="viewport" content="width=device-width, initial-scale = 1.0; maximum-scale=1.0, user-scalable=no" />
{% if active_story %}
<meta property="fb:app_id" content="{{ facebook_app_id }}">
@ -89,55 +89,56 @@
</head>
<body class="{% if user.is_authenticated %}NB-authenticated{% else %}NB-unauthenticated{% endif %}">
<header class="NC-header">
<div class="NC-header-inner">
<div class="NB-container" style="background-color: {% if social_profile.custom_bgcolor %}{{ social_profile.custom_bgcolor|rgb2rgba:".1 " }}{% else %}#EBC55F{% endif %}">
<header class="NB-header">
<div class="NB-header-inner">
{% if user.is_authenticated %}
<ul>
<li class="NC-user-tab NC-active">
<div class="NC-tab-inner">
<li class="NB-user-tab NB-active">
<div class="NB-tab-inner">
<span><img src="{{ social_profile.large_photo_url }}" /></span>
{{ social_profile.username }}
</div>
</li>
<li class="NC-trending-tab">
<div class="NC-tab-inner">
<span class="NC-icon"></span>
<li class="NB-trending-tab">
<div class="NB-tab-inner">
<span class="NB-icon"></span>
Trending
</div>
</li>
<li class="NC-following-tab">
<div class="NC-tab-inner">
<span class="NC-icon"></span>
<li class="NB-following-tab">
<div class="NB-tab-inner">
<span class="NB-icon"></span>
Following
</div>
</li>
<li class="NC-activity-tab NC-logout-button">
<div class="NC-tab-inner">
<li class="NB-activity-tab NB-logout-button">
<div class="NB-tab-inner">
Logout
</div>
</li>
</ul>
{% else %}
<h1 class="NC-logo"><a href="{% url index %}"><img src="{{ MEDIA_URL }}img/circular/circular_logo.png" width="180" height="45"></a></h1>
<div class="NC-button NC-login-toggle-button">Sign In</div>
<h1 class="NB-logo"><a href="{% url index %}"><img src="{{ MEDIA_URL }}img/circular/circular_logo.png" width="180" height="45"></a></h1>
<div class="NB-button NB-login-toggle-button">Sign In</div>
<div class="NC-button NC-request-toggle-button">Request an Invite</div>
<div class="NB-button NB-request-toggle-button">Request an Invite</div>
<div class="NC-login-popover NC-popover">
<div class="NC-popover-inner">
<input type="text" placeholder="Username or email" name="login_username" class="NC-input" />
<input placeholder="Password" type="password" name="login_password" class="NC-input" />
<div class="NC-login-button NC-blue-button">Login</div>
</div>
<div class="NC-popover-bottom"></div>
<div class="NB-login-popover NB-popover">
<div class="NB-popover-inner">
<input type="text" placeholder="Username or email" name="login_username" class="NB-input" />
<input placeholder="Password" type="password" name="login_password" class="NB-input" />
<div class="NB-login-button NB-blue-button">Login</div>
</div>
<div class="NC-request-popover NC-popover">
<div class="NC-popover-inner">
<input type="text" placeholder="Email Address" name="request_email" class="NC-input" />
<div class="NC-request-button NC-blue-button">Request</div>
</div>
<div class="NC-popover-bottom"></div>
<div class="NB-popover-bottom"></div>
</div>
<div class="NB-request-popover NB-popover">
<div class="NB-popover-inner">
<input type="text" placeholder="Email Address" name="request_email" class="NB-input" />
<div class="NB-request-button NB-blue-button">Request</div>
</div>
<div class="NB-popover-bottom"></div>
</div>
{% endif %}
</div>
@ -170,6 +171,8 @@
</div>
</footer>
</div>
{% include_javascripts "blurblog" %}
<script type="text/javascript" charset="utf-8">
@ -182,6 +185,7 @@
// }
</script>
</body>
</html>

View file

@ -63,7 +63,7 @@
</div>
<div class="NB-story-content-expander">
<div class="NB-story-content-expander-inner">
<div class="NC-story-cutoff"></div>
<div class="NB-story-cutoff"></div>
<div class="NB-story-content-expander-text">Read the whole story</div>
<div class="NB-story-content-expander-pages"></div>
</div>

View file

@ -1,3 +1,4 @@
import struct
from django.contrib.sites.models import Site
from django.conf import settings
from django import template
@ -82,6 +83,17 @@ def render_activities_module(context, page=1):
def get(h, key):
print h, key
return h[key]
@register.filter
def hex2rgba(hex, alpha):
colors = struct.unpack('BBB', hex.decode('hex'))
return "rgba(%s, %s, %s, %s)" % (colors[0], colors[1], colors[2], alpha)
@register.filter
def rgb2rgba(rgb, alpha):
rgb = rgb.replace('rgb', 'rgba')
rgb = rgb.replace(')', ", %s)" % alpha)
return rgb
@register.filter
def get_range( value ):