mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Trainer and Chooser now update homepage feed counts dynamically.
This commit is contained in:
parent
482c752ec4
commit
b22075e5cb
4 changed files with 43 additions and 5 deletions
|
@ -2507,6 +2507,9 @@ background: transparent;
|
|||
box-shadow: 1px 1px 0 #303030;
|
||||
}
|
||||
|
||||
.NB-account .NB-module .NB-modal-submit-close {
|
||||
color: #505050;
|
||||
}
|
||||
.NB-account .NB-module .NB-module-account .NB-module-account-title {
|
||||
margin: 0 0 4px 128px;
|
||||
}
|
||||
|
|
|
@ -651,6 +651,30 @@ var classifier = {
|
|||
});
|
||||
},
|
||||
|
||||
update_homepage_counts: function() {
|
||||
var $count = $('.NB-module-account-trainer-count');
|
||||
|
||||
$count.text(_.size(this.model.get_feeds()) - (this.trainer_data.length - this.trainer_iterator) - 1);
|
||||
},
|
||||
|
||||
end: function() {
|
||||
_.defer(function() {
|
||||
$('.NB-module-account-trainer').animate({
|
||||
'opacity': 0
|
||||
}, {
|
||||
'duration': 1000,
|
||||
'complete': function() {
|
||||
$('.NB-module-account-trainer').slideUp(350);
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
$.modal.close();
|
||||
},
|
||||
|
||||
// ==========
|
||||
// = Events =
|
||||
// ==========
|
||||
|
||||
handle_text_highlight: function() {
|
||||
var $title_highlight = $('.NB-classifier-title-highlight', this.$modal);
|
||||
var $title = $('.NB-classifier-title-text', this.$modal);
|
||||
|
@ -726,6 +750,7 @@ var classifier = {
|
|||
e.preventDefault();
|
||||
self.save_publisher(true);
|
||||
self.load_next_feed_in_trainer();
|
||||
self.update_homepage_counts();
|
||||
});
|
||||
|
||||
$.targetIs(e, { tagSelector: '.NB-modal-submit-back' }, function($t, $p){
|
||||
|
@ -740,7 +765,7 @@ var classifier = {
|
|||
|
||||
$.targetIs(e, { tagSelector: '.NB-modal-submit-end' }, function($t, $p){
|
||||
e.preventDefault();
|
||||
$.modal.close();
|
||||
self.end();
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -316,6 +316,7 @@ NEWSBLUR.ReaderFeedchooser.prototype = {
|
|||
var approve_list = this.approve_list;
|
||||
var $submit = $('.NB-modal-submit-save', this.$modal);
|
||||
$submit.addClass('NB-disabled').val('Saving...');
|
||||
this.update_homepage_count();
|
||||
|
||||
this.model.save_feed_chooser(approve_list, function() {
|
||||
self.flags['has_saved'] = true;
|
||||
|
@ -325,6 +326,15 @@ NEWSBLUR.ReaderFeedchooser.prototype = {
|
|||
});
|
||||
},
|
||||
|
||||
update_homepage_count: function() {
|
||||
var $count = $('.NB-module-account-feedcount');
|
||||
var $button = $('.NB-module-account-upgrade');
|
||||
var approve_list = this.approve_list;
|
||||
|
||||
$count.text(approve_list.length);
|
||||
$button.removeClass('NB-modal-submit-green').addClass('NB-modal-submit-close');
|
||||
},
|
||||
|
||||
// ===========
|
||||
// = Actions =
|
||||
// ===========
|
||||
|
|
|
@ -200,7 +200,7 @@
|
|||
Premium Account
|
||||
{% else %}
|
||||
<span class="NB-module-account-subtitle">
|
||||
{{ feed_count }} of 64 sites
|
||||
<span class="NB-module-account-feedcount">{{ feed_count }}</span> of 64 sites
|
||||
</span>
|
||||
Standard Account
|
||||
{% endif %}
|
||||
|
@ -211,19 +211,19 @@
|
|||
{% else %}
|
||||
|
||||
<div class="NB-modal-submit">
|
||||
<div class="NB-modal-submit-green NB-modal-submit-button NB-module-account-upgrade">Choose Your 64</div>
|
||||
<div class="{% if feed_count == 0 %}NB-modal-submit-green{% else %}NB-modal-submit-close{% endif %} NB-modal-submit-button NB-module-account-upgrade">Choose Your 64</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if train_count != feed_count %}
|
||||
<div class="NB-module-account NB-last">
|
||||
<div class="NB-module-account NB-module-account-trainer NB-last">
|
||||
<div class="NB-module-account-image">
|
||||
<img src="{{ MEDIA_URL }}/img/reader/account_trainer.jpg" />
|
||||
</div>
|
||||
<h3>
|
||||
<span class="NB-module-account-subtitle">
|
||||
{{ train_count }} of {{ feed_count }} site{{ feed_count|pluralize }}
|
||||
<span class="NB-module-account-trainer-count">{{ train_count }}</span> of {{ feed_count }} site{{ feed_count|pluralize }}
|
||||
</span>
|
||||
Intelligence Trainer
|
||||
</h3>
|
||||
|
|
Loading…
Add table
Reference in a new issue