Skip to content
This repository has been archived by the owner on Jul 25, 2018. It is now read-only.

Commit

Permalink
Merge pull request #246 from glogiotatidis/1159515
Browse files Browse the repository at this point in the history
 [bug 1159515] Remove news items and milestones.
  • Loading branch information
glogiotatidis committed Aug 5, 2015
2 parents bd13fc9 + 58baa7c commit dfa8692
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 43 deletions.
30 changes: 0 additions & 30 deletions affiliates/base/templates/base/dashboard.html
Expand Up @@ -44,36 +44,6 @@ <h2 class="section-title">{{ _('My Banners') }}</h2>
</section>
{% endif %}

<section id="mymilestones" class="section">
<div class="contain">
<h2 class="section-title">{{ _('My Milestones') }}</h2>
{{ milestone_timeline(milestones) }}
</div>
</section>

{% if newsitem %}
<section id="news" class="section hfeed">
<div class="contain">
<h2 class="section-title">{{ _('Affiliates News') }}</h2>

{{ newsitem.render(LOCALE) }}

<aside class="sidebar aside">
<h2>{{ _('Become a Mozillian') }}</h2>
<p>
{% trans %}
At Mozilla, doing good is part of our code. Our mission is to promote
openness, innovation and opportunity on the Web, and we can only do it
with awesome people like you. If you’d like to do even more to help our
mission, we have volunteer opportunities available in a number of areas.
{% endtrans %}
</p>
<p><strong><a href="https://www.mozilla.org/contribute/" class="go">{{ _('Learn more') }}</a></strong></p>
</aside>
</div>
</section>
{% endif %}

<div id="smartbanners">
<h3>{{ _('What are smart banners?') }}</h3>
<p>
Expand Down
4 changes: 0 additions & 4 deletions affiliates/base/tests/test_views.py
Expand Up @@ -135,8 +135,6 @@ def test_latest_newsitem(self):
views.dashboard(request)

render.assert_called_with(request, 'base/dashboard.html', {
'newsitem': visible_newsitem,
'milestones': ANY,
'links': ANY,
})

Expand All @@ -152,8 +150,6 @@ def test_no_available_newsitem(self):
views.dashboard(request)

render.assert_called_with(request, 'base/dashboard.html', {
'newsitem': None,
'milestones': ANY,
'links': ANY,
})

Expand Down
9 changes: 0 additions & 9 deletions affiliates/base/views.py
Expand Up @@ -13,8 +13,6 @@

from affiliates.base.forms import NewsletterSubscriptionForm
from affiliates.base.http import JSONResponse
from affiliates.base.milestones import MilestoneDisplay
from affiliates.base.models import NewsItem
from affiliates.base.utils import redirect
from affiliates.facebook.utils import in_facebook_app
from affiliates.links.models import Link
Expand All @@ -41,11 +39,6 @@ def terms(request):

@login_required
def dashboard(request):
try:
newsitem = NewsItem.objects.filter(visible=True).latest('created')
except NewsItem.DoesNotExist:
newsitem = None

# Replace request.user and prefetch related items that we need.
request.user = (User.objects
.prefetch_related('link_set__datapoint_set',
Expand All @@ -56,8 +49,6 @@ def dashboard(request):
links = sorted(request.user.link_set.all(), lambda x, y: cmp(x.created, y.created))

return render(request, 'base/dashboard.html', {
'newsitem': newsitem,
'milestones': MilestoneDisplay(request.user),
'links': links,
})

Expand Down

0 comments on commit dfa8692

Please sign in to comment.