Skip to content

Commit

Permalink
Adding iphone and android apps, along with necessary migration for hi…
Browse files Browse the repository at this point in the history
…ding mobile.
  • Loading branch information
samuelclay committed Aug 8, 2011
1 parent 79ab2d8 commit d4dddf4
Show file tree
Hide file tree
Showing 13 changed files with 145 additions and 6 deletions.
76 changes: 76 additions & 0 deletions apps/profile/migrations/0014_hide_mobile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

def forwards(self, orm):

# Adding field 'Profile.hide_mobile'
db.add_column('profile_profile', 'hide_mobile', self.gf('django.db.models.fields.BooleanField')(default=False), keep_default=False)


def backwards(self, orm):

# Deleting field 'Profile.hide_mobile'
db.delete_column('profile_profile', 'hide_mobile')


models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'profile.profile': {
'Meta': {'object_name': 'Profile'},
'collapsed_folders': ('django.db.models.fields.TextField', [], {'default': "'[]'"}),
'feed_pane_size': ('django.db.models.fields.IntegerField', [], {'default': '240'}),
'hide_mobile': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_premium': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_seen_ip': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
'last_seen_on': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'preferences': ('django.db.models.fields.TextField', [], {'default': "'{}'"}),
'secret_token': ('django.db.models.fields.CharField', [], {'max_length': '12', 'null': 'True', 'blank': 'True'}),
'timezone': ('vendor.timezones.fields.TimeZoneField', [], {'default': "'America/New_York'", 'max_length': '100'}),
'tutorial_finished': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}),
'view_settings': ('django.db.models.fields.TextField', [], {'default': "'{}'"})
}
}

complete_apps = ['profile']
1 change: 1 addition & 0 deletions apps/profile/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Profile(models.Model):
collapsed_folders = models.TextField(default="[]")
feed_pane_size = models.IntegerField(default=240)
tutorial_finished = models.BooleanField(default=False)
hide_mobile = models.BooleanField(default=False)
last_seen_on = models.DateTimeField(default=datetime.datetime.now)
last_seen_ip = models.CharField(max_length=50, blank=True, null=True)
timezone = TimeZoneField(default="America/New_York")
Expand Down
2 changes: 1 addition & 1 deletion apps/profile/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from apps.profile.models import Profile, change_password
from apps.reader.models import UserSubscription

SINGLE_FIELD_PREFS = ('timezone','feed_pane_size','tutorial_finished')
SINGLE_FIELD_PREFS = ('timezone','feed_pane_size','tutorial_finished','hide_mobile')
SPECIAL_PREFERENCES = ('old_password', 'new_password',)

@ajax_login_required
Expand Down
26 changes: 24 additions & 2 deletions media/css/reader.css
Original file line number Diff line number Diff line change
Expand Up @@ -3552,8 +3552,8 @@ background: transparent;
}

.NB-module-mobile .NB-module-mobile-image img {
width: 57px;
height: 57px;
width: 100px;
height: 50px;
overflow: hidden;
margin: 0 8px 2px 12px;
}
Expand Down Expand Up @@ -3584,6 +3584,11 @@ background: transparent;
font-size: 12px;
}

.NB-module-mobile .NB-module-mobile-freeforpremium {
font-size: 11px;
color: #606060;
}

/* ================ */
/* = Stats Module = */
/* ================ */
Expand Down Expand Up @@ -5140,6 +5145,23 @@ background: transparent;
padding: 4px;
margin: 6px 0 0 0;
}
.NB-modal-goodies .NB-goodies-mobile-link {
float: right;
}
.NB-modal-goodies .NB-goodies-iphone {
float: right;
width: 28px;
height: 28px;
margin: 0 6px 0 0;
background: transparent url('../img/mobile/iphone.png') no-repeat 0 0;
}
.NB-modal-goodies .NB-goodies-android {
float: right;
width: 28px;
height: 28px;
margin: 0 6px 0 0;
background: transparent url('../img/mobile/android.png') no-repeat 0 0;
}

/* ============================ */
/* = Keyboard Shortcuts Modal = */
Expand Down
Binary file added media/img/mobile/android-icon-blar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/img/mobile/android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/img/mobile/app-store.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/img/mobile/iphone-icon-newsblur.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/img/mobile/iphone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions media/js/newsblur/reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3067,6 +3067,20 @@
});
},

hide_mobile: function() {
var $mobile = $('.NB-module-mobile');

this.model.preference('hide_mobile', true);
$mobile.animate({
'opacity': 0
}, {
'duration': 500,
'complete': function() {
$mobile.slideUp(350);
}
});
},

// ==========================
// = Story Pane - Feed View =
// ==========================
Expand Down Expand Up @@ -5558,6 +5572,12 @@
self.hide_tutorial();
}
});
$.targetIs(e, { tagSelector: '.NB-module-mobile-hide' }, function($t, $p){
e.preventDefault();
if (!$t.hasClass('NB-disabled')) {
self.hide_mobile();
}
});

$.targetIs(e, { tagSelector: '.NB-menu-manage-story-unread' }, function($t, $p){
e.preventDefault();
Expand Down
17 changes: 17 additions & 0 deletions media/js/newsblur/reader_goodies.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,23 @@ NEWSBLUR.ReaderGoodies.prototype = {
}),
$.make('div', { className: 'NB-goodies-custom' }),
$.make('div', { className: 'NB-goodies-title' }, 'Custom Add Site URL')
]),

$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
$.make('a', {
className: 'NB-goodies-mobile-link NB-modal-submit-button NB-modal-submit-green',
href: 'mailto:samuel@ofbrooklyn.com?subject=iPhone Beta! Yeah!&body=My username is: '+NEWSBLUR.Globals.username+', and my iTunes/iPhone UUID is: [http://www.ispeeddial.com/how-to-find-your-iphone-uuid/]'
}, 'Request Beta'),
$.make('div', { className: 'NB-goodies-iphone' }),
$.make('div', { className: 'NB-goodies-title' }, 'Official NewsBlur iPhone App')
]),
$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
$.make('a', {
className: 'NB-goodies-mobile-link NB-modal-submit-button NB-modal-submit-green',
href: 'https://market.android.com/details?id=bitwrit.Blar'
}, 'View in Android Market'),
$.make('div', { className: 'NB-goodies-android' }),
$.make('div', { className: 'NB-goodies-title' }, 'Blar: User-Created Android App')
])
]);
},
Expand Down
1 change: 1 addition & 0 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
'lock_mouse_indicator' : 0,
'feed_pane_size' : {% firstof user_profile.feed_pane_size 240 %},
'tutorial_finished' : {{ user_profile.tutorial_finished|yesno:"true,false" }},
'hide_mobile' : {{ user_profile.hide_mobile|yesno:"true,false" }},
'story_titles_pane_size' : 168,
'new_window' : 1,
'default_view' : 'page',
Expand Down
8 changes: 5 additions & 3 deletions templates/reader/feeds.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ $(document).ready(function() {
</h5>
<div class="NB-module-item {% if user_profile.hide_mobile %}NB-hidden{% endif %}">
<div class="NB-module-mobile-image">
<img src="{{ MEDIA_URL }}/img/mobile/blar-icon-57.png" />
<img src="{{ MEDIA_URL }}/img/mobile/iphone-icon-newsblur.png" />
</div>
<h3 class="NB-module-content-header">
<span class="NB-module-content-subtitle">
Expand All @@ -376,12 +376,14 @@ $(document).ready(function() {
</h3>
<div class="NB-module-item-title">
<span class="NB-raquo">&raquo;</span>
<a href="#" class="NB-splash-link">Download NewsBlur on the App Store</a>
<!-- <a href="#" class="NB-splash-link">Download NewsBlur on the App Store</a> -->
<a href="mailto:samuel@ofbrooklyn.com?subject=iPhone Beta! Yeah!&amp;body=My username is: {{ user.username }}, and my iTunes/iPhone UUID is: [http://www.ispeeddial.com/how-to-find-your-iphone-uuid/]" class="NB-splash-link">Request access to the beta</a>
<span class="NB-module-mobile-freeforpremium">(free for premiums)</span>
</div>
</div>
<div class="NB-module-item NB-last {% if user_profile.hide_mobile %}NB-hidden{% endif %}">
<div class="NB-module-mobile-image">
<img src="{{ MEDIA_URL }}/img/mobile/blar-icon-57.png" />
<img src="{{ MEDIA_URL }}/img/mobile/android-icon-blar.png" />
</div>
<h3 class="NB-module-content-header">
<span class="NB-module-content-subtitle">
Expand Down

0 comments on commit d4dddf4

Please sign in to comment.