Merge lp:~dholbach/harvest/530098 into lp:harvest

Proposed by Daniel Holbach
Status: Merged
Merged at revision: 248
Proposed branch: lp:~dholbach/harvest/530098
Merge into: lp:harvest
Diff against target: 55 lines (+25/-2)
2 files modified
harvest/common/views.py (+2/-2)
harvest/templates/index.html (+23/-0)
To merge this branch: bzr merge lp:~dholbach/harvest/530098
Reviewer Review Type Date Requested Status
harvest-dev Pending
Review via email: mp+33799@code.launchpad.net

Description of the change

It's not pretty and I have a hard time linking to the opportunity list without hard-coding. Dylan, can you help? :-D

To post a comment you must log in.
Revision history for this message
Dylan McCall (dylanmccall) wrote :

I sure can! I just need to finish off the installer slideshow stuff, first :)

Revision history for this message
Daniel Holbach (dholbach) wrote :

I think I'll work on a mainpage branch that includes this change as well. As you might have noted I don't have a great plan for the mainpage, but it'd be nice to have something like description on the left hand side, stats + latest action + latest featured opportunities + links on the right hand side. Not sure how to do it though. I'll make sure I put everything into separate <div>s and get all the content there.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'harvest/common/views.py'
2--- harvest/common/views.py 2010-08-23 16:44:10 +0000
3+++ harvest/common/views.py 2010-08-26 16:17:43 +0000
4@@ -4,9 +4,8 @@
5 from django.contrib.auth import logout
6 from django.contrib.auth.models import User
7
8-from opportunities.models import SourcePackage, OpportunityList, Opportunity, Note
9-
10 def index(request):
11+ from opportunities.models import SourcePackage, OpportunityList, Opportunity, Note
12 context = {
13 'pageSection': 'home',
14 'users': User.objects.count(),
15@@ -14,6 +13,7 @@
16 'opportunitylists': OpportunityList.objects.count(),
17 'opportunities': Opportunity.objects.count(),
18 'notes': Note.objects.count(),
19+ 'features': OpportunityList.objects.filter(featured=True),
20 }
21 return render_to_response('index.html', context,
22 context_instance=RequestContext(request))
23
24=== modified file 'harvest/templates/index.html'
25--- harvest/templates/index.html 2010-08-23 16:44:10 +0000
26+++ harvest/templates/index.html 2010-08-26 16:17:43 +0000
27@@ -40,5 +40,28 @@
28 {% blocktrans count opportunitylists as counter %}1 opportunity list, {% plural %}{{ counter }} opportunity lists, {% endblocktrans %}&nbsp;
29 {% blocktrans count notes as counter %}1 note.{% plural %}{{ counter }} notes.{% endblocktrans %}
30 </div>
31+{% if features %}
32+ <div id="featured">
33+ <h2>{% trans "Featured Opportunities" %}</h2>
34+ <ul>
35+ {% for feature in features %}
36+ <li>
37+ <h3>
38+ {{ feature.name }}
39+ ({{feature.opportunity_set.all|length}} {% trans "opportunities"%})
40+ </h3>
41+ <ul>
42+ {% for opportunity in feature.opportunity_set.all|slice:":5" %}
43+ <li>
44+ <a href="{% url opportunity_edit opportunity.id %}">{{opportunity.description}}</a>
45+ ({{opportunity.sourcepackage}})
46+ </li>
47+ {% endfor %}
48+ </ul>
49+ </li>
50+ {% endfor %}
51+ </ul>
52+ </div>
53+{% endif %}
54 </div>
55 {% endblock %}

Subscribers

People subscribed via source and target branches

to all changes: