diff --git a/pandora/home/models.py b/pandora/home/models.py
index 4031ab9a4..2ed266c9d 100644
--- a/pandora/home/models.py
+++ b/pandora/home/models.py
@@ -81,7 +81,7 @@ class Item(models.Model):
'index': self.index,
}
j.update(self.data)
- if 'contentid' in j and (not keys or 'content' in keys):
+ if 'contentid' in j:
content_keys = [
'description',
'modified',
diff --git a/static/js/home.indiancinema.js b/static/js/home.indiancinema.js
index 9f495c10b..dcf81b8fa 100644
--- a/static/js/home.indiancinema.js
+++ b/static/js/home.indiancinema.js
@@ -394,17 +394,7 @@ pandora.ui.home = function() {
}
function getHTML(item) {
- if (item.type == 'custom') {
- return '' + item.title + '
' + item.text;
- }
- return ''
- + (
- (lists && edits) || (lists && texts) || (edits && texts)
- ? Ox._(Ox.toTitleCase(item.type)) + ': '
- : ''
- )
- + Ox.encodeHTMLEntities(item.title) + '
'
- + item.text;
+ return '' + Ox.encodeHTMLEntities(item.title) + '
' + item.text;
}
function getTooltip(item) {
diff --git a/static/js/home.padma.js b/static/js/home.padma.js
index 6d275f096..15882b56c 100644
--- a/static/js/home.padma.js
+++ b/static/js/home.padma.js
@@ -289,321 +289,122 @@ pandora.ui.home = function() {
sort: [{key: 'position', operator: '+'}]
},
items, lists, edits, texts;
- pandora.api.findLists(find, function(result) {
- lists = result.data.items.length;
- items = result.data.items.map(function(item) {
- return Ox.extend(item, {type: 'list'});
- });
- pandora.api.findEdits(find, function(result) {
- edits = result.data.items.length;
- items = items.concat(result.data.items.map(function(item) {
- return Ox.extend(item, {type: 'edit'});
- }));
- pandora.api.findTexts(find, function(result) {
- texts = result.data.items.length;
- items = items.concat(result.data.items.map(function(item) {
- return Ox.extend(item, {type: 'text'});
- }));
- $features.empty();
- show();
- });
- });
+ pandora.api.getHomeItems({active: true}, function(result) {
+ items = result.data.items;
+ lists = 1;
+ edits = 1;
+ texts = 1;
+ show();
});
function show() {
var counter = 0, max = 8, mouse = false, position = 0, selected = 0,
color = Ox.Theme() == 'oxlight' ? 'rgb(0, 0, 0)'
: Ox.Theme() == 'oxmedium' ? 'rgb(0, 0, 0)'
: 'rgb(255, 255, 255)',
- $label, $icon, $text,
+ $label, $texts,
$featuresBox, $featuresContainer, $featuresContent,
$featureBox = [], $featureIcon = [],
$previousButton, $nextButton;
if (items.length) {
- $label = Ox.Label({
- textAlign: 'center',
- title: '' + Ox._('Featured ' + (
- lists == 1 && edits == 0 && texts == 0 ? 'List'
- : lists == 0 && edits == 1 && texts == 0 ? 'Edit'
- : lists == 0 && edits == 0 && texts == 1 ? 'Text'
- : edits == 0 && texts == 0 ? 'Lists'
- : lists == 0 && texts == 0 ? 'Edits'
- : lists == 0 && edits == 0 ? 'Texts'
- : texts == 0 ? 'Lists and Edits'
- : edits == 0 ? 'Lists and Texts'
- : lists == 0 ? 'Edits and Texts'
- : 'Lists, Edits and Texts'
- )) + '',
- width: 512
- })
- .css({
- position: 'absolute',
- left: 0,
- top: 0,
- right: 0,
- bottom: 0,
- margin: '0 auto 0 auto'
- })
- .appendTo($features);
- $text = Ox.Label({
- width: 386
- })
- .addClass('OxSelectable')
- .css({
- position: 'absolute',
- left: '24px',
- top: '24px',
- right: 0,
- height: '104px',
- borderTopLeftRadius: '32px',
- borderBottomLeftRadius: '32px',
- padding: '8px 8px 8px 130px',
- overflowY: 'auto',
- lineHeight: '14px',
- textOverflow: 'ellipsis',
- whiteSpace: 'normal'
- })
- .html(
- getHTML(items[selected])
- )
- .appendTo($features);
- pandora.createLinks($text);
- $icon = Ox.Element({
- element: '',
- tooltip: getTooltip(items[selected])
- })
- .attr({
- src: getImageURL(items[selected])
- })
- .css({
- position: 'absolute',
- left: 0,
- top: '24px',
- right: '390px',
- width: '122px',
- height: '122px',
- borderRadius: '32px',
- margin: '0 auto 0 auto',
- cursor: 'pointer'
- })
- .bindEvent({
- anyclick: function() {
- openItem(selected);
- }
- })
- .appendTo($features);
- if (items.length > 1) {
- $featuresBox = $('