removing is_preview since it's no longer needed
parent
2241134e92
commit
d652db5c03
|
@ -83,15 +83,9 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{% if is_preview %}
|
||||
<div class="preview_top">
|
||||
Welcome to the almost-beta version of Unglue.it. Thanks to everyone who helped us with <a href="https://unglue.it/work/82028/">our test campaign.</a> Real campaigns coming Thursday at noon EDT. See you then.
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="launch_top">
|
||||
Unglue.it has launched! Please consider supporting our <a href="/campaigns/ending#2">five active campaigns</a>.
|
||||
</div>
|
||||
{% endif %}
|
||||
{% block topsection %}{% endblock %}
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
|
|
|
@ -79,13 +79,6 @@ location.hash = "#2";
|
|||
</div>
|
||||
</div>
|
||||
<div id="content-block-content">
|
||||
{% if is_preview == 1 %}
|
||||
<div class="preview_content">
|
||||
We're not running campaigns during our alpha phase.<br /><br />
|
||||
After we've implemented a few more features and improved the site based on <a href="/feedback">your feedback</a>, you'll see a list of active campaigns here.<br /><br />
|
||||
If you're a rights holder and you'd like us to run campaigns to unglue your works, please contact us at <a href="mailto:rights@gluejar.com">rights@gluejar.com</a>. Want more info? We have a <a href="/faq/rightsholders">rights holder FAQ</a>.
|
||||
</div>
|
||||
{% else %}
|
||||
{% ifequal campaign_list.count 0 %}
|
||||
There aren't any ungluing campaigns active yet. If you're a rights holder, you can <a href="/faq/rightsholders">start one</a>.
|
||||
{% else %}
|
||||
|
@ -108,7 +101,6 @@ location.hash = "#2";
|
|||
{% endfor %}
|
||||
</div>
|
||||
{% endifequal %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -13,13 +13,9 @@
|
|||
{% else %}
|
||||
<li class="first">
|
||||
{% endif %}
|
||||
{% if not is_preview %}
|
||||
<a href="{% url campaign_list 'ending' %}"><span>Active Campaigns</span></a></li>
|
||||
<li><a href="{% url comment %}"><span>Latest Comments</span></a></li>
|
||||
<li><a href="{% url work_list 'popular' %}"><span>Most Wished</span></a></li>
|
||||
{% else %}
|
||||
<a href="{% url work_list 'popular' %}"><span>Most Wishes</span></a></li>
|
||||
{% endif %}
|
||||
<li><a href="{% url work_list 'new' %}"><span>Newly Wished</span></a></li>
|
||||
<li><a href="{% url work_list 'recommended' %}"><span>Staff Picks</span></a></li>
|
||||
<li class="last"><a href="{% url unglued_list 'recent' %}"><span>Recently Unglued</span></a></li>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{% with request.user.wishlist.works.all as wishlist %}
|
||||
<h3><span>{% if is_preview %}Most wishlisted{% else %}{% if faqmenu %}You might also like...{% else %}Top ungluing campaigns{% endif %}{% endif %}</span></h3>
|
||||
<h3><span>{% if faqmenu %}You might also like...{% else %}Top ungluing campaigns{% endif %}</span></h3>
|
||||
<div class="jsmod-content">
|
||||
<div id="js-slideshow">
|
||||
<div class="slides_container">
|
||||
|
|
|
@ -61,7 +61,7 @@ $j(document).ready(function(){
|
|||
<span>
|
||||
{% if work.first_ebook %}
|
||||
AVAILABLE!
|
||||
{% else %}{% if work.last_campaign and not is_preview %}
|
||||
{% else %}{% if work.last_campaign %}
|
||||
{% if status == 'ACTIVE' %}
|
||||
Unglue it! <br />
|
||||
${{ work.last_campaign.current_total|floatformat:0|intcomma }}/${{ work.last_campaign.target|floatformat:0|intcomma }} <br />
|
||||
|
|
|
@ -63,29 +63,24 @@ logger = logging.getLogger(__name__)
|
|||
def slideshow(max):
|
||||
ending = models.Campaign.objects.filter(status='ACTIVE').order_by('deadline')
|
||||
count = ending.count()
|
||||
is_preview = settings.IS_PREVIEW
|
||||
j = 0
|
||||
|
||||
if is_preview:
|
||||
# on the preview site there are no active campaigns, so we should show most-wished books instead
|
||||
worklist = models.Work.objects.order_by('-num_wishes')[:max]
|
||||
worklist = []
|
||||
if max > count:
|
||||
# add all the works with active campaigns
|
||||
for campaign in ending:
|
||||
worklist.append(campaign.work)
|
||||
|
||||
# then fill out the rest of the list with popular but inactive works
|
||||
remainder = max - count
|
||||
remainder_works = models.Work.objects.exclude(campaigns__status='ACTIVE').order_by('-num_wishes')[:remainder]
|
||||
worklist.extend(remainder_works)
|
||||
else:
|
||||
worklist = []
|
||||
if max > count:
|
||||
# add all the works with active campaigns
|
||||
for campaign in ending:
|
||||
worklist.append(campaign.work)
|
||||
|
||||
# then fill out the rest of the list with popular but inactive works
|
||||
remainder = max - count
|
||||
remainder_works = models.Work.objects.exclude(campaigns__status='ACTIVE').order_by('-num_wishes')[:remainder]
|
||||
worklist.extend(remainder_works)
|
||||
else:
|
||||
# if the active campaign list has more works than we can fit
|
||||
# in our slideshow, it's the only source we need to draw from
|
||||
while j < max:
|
||||
worklist.append(ending[j].work)
|
||||
j +=1
|
||||
# if the active campaign list has more works than we can fit
|
||||
# in our slideshow, it's the only source we need to draw from
|
||||
while j < max:
|
||||
worklist.append(ending[j].work)
|
||||
j +=1
|
||||
|
||||
return worklist
|
||||
|
||||
|
@ -354,9 +349,7 @@ def manage_campaign(request, id):
|
|||
alerts.append(_('Campaign data has NOT been saved'))
|
||||
if 'launch' in request.POST.keys():
|
||||
activetab = '#3'
|
||||
# only staff should be allowed to launch a campaign before site launch
|
||||
# this line can be removed after site launch
|
||||
if (campaign.launchable and form.is_valid()) and (not settings.IS_PREVIEW or request.user.is_staff):
|
||||
if (campaign.launchable and form.is_valid()):
|
||||
campaign.activate()
|
||||
alerts.append(_('Campaign has been launched'))
|
||||
else:
|
||||
|
@ -1272,7 +1265,6 @@ def supporter(request, supporter_username, template_name):
|
|||
works_unglued = []
|
||||
works_active = []
|
||||
works_wished = []
|
||||
is_preview = settings.IS_PREVIEW
|
||||
|
||||
if (wishlist.works.all()):
|
||||
# querysets for tabs
|
||||
|
@ -1361,7 +1353,6 @@ def supporter(request, supporter_username, template_name):
|
|||
"works_wished": works_wished,
|
||||
"works": works,
|
||||
"works2": works2,
|
||||
"is_preview": is_preview,
|
||||
"backed": backed,
|
||||
"backing": backing,
|
||||
"wished": wished,
|
||||
|
|
Loading…
Reference in New Issue