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

Proposed by Daniel Holbach
Status: Merged
Merged at revision: 262
Proposed branch: lp:~dholbach/harvest/581719
Merge into: lp:harvest
Diff against target: 116 lines (+45/-4)
5 files modified
harvest/locale/harvest.pot (+18/-2)
harvest/media/css/style.css (+3/-0)
harvest/opportunities/urls.py (+7/-0)
harvest/opportunities/views.py (+15/-0)
harvest/templates/opportunities/include/opportunity.html (+2/-2)
To merge this branch: bzr merge lp:~dholbach/harvest/581719
Reviewer Review Type Date Requested Status
James Westby Approve
Review via email: mp+37597@code.launchpad.net
To post a comment you must log in.
Revision history for this message
James Westby (james-w) wrote :

Hi,

Does

   <a href="{% url opportunity_edit opportunity.id %}?next={{request.get_full_path}}" target="_blank" class="opportunity-edit-button">{% trans 'edit' %}</a>

have @login_required too?

If so then I'm fine with this change.

Thanks,

James

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

> Does
>
> <a href="{% url opportunity_edit opportunity.id
> %}?next={{request.get_full_path}}" target="_blank" class="opportunity-edit-
> button">{% trans 'edit' %}</a>
>
> have @login_required too?

Yes and the redirect-after-openid works nicely too.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'harvest/locale/harvest.pot'
2--- harvest/locale/harvest.pot 2010-09-03 13:23:33 +0000
3+++ harvest/locale/harvest.pot 2010-10-05 13:33:45 +0000
4@@ -8,7 +8,7 @@
5 msgstr ""
6 "Project-Id-Version: PACKAGE VERSION\n"
7 "Report-Msgid-Bugs-To: \n"
8-"POT-Creation-Date: 2010-09-03 07:35-0500\n"
9+"POT-Creation-Date: 2010-10-05 08:30-0500\n"
10 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13@@ -355,10 +355,26 @@
14 "\t"
15 msgstr ""
16
17-#: templates/opportunities/include/opportunity.html:7
18+#: templates/opportunities/include/opportunity.html:6
19 msgid "edit"
20 msgstr ""
21
22+#: templates/opportunities/include/opportunity.html:7
23+msgid "mark opportunity as applied"
24+msgstr ""
25+
26+#: templates/opportunities/include/opportunity.html:7
27+msgid "applied"
28+msgstr ""
29+
30+#: templates/opportunities/include/opportunity.html:8
31+msgid "mark opportunity as irrelevant"
32+msgstr ""
33+
34+#: templates/opportunities/include/opportunity.html:8
35+msgid "irrelevant"
36+msgstr ""
37+
38 #: templates/opportunities/include/opportunity_details_edit.html:45
39 msgid "Apply changes"
40 msgstr ""
41
42=== modified file 'harvest/media/css/style.css'
43--- harvest/media/css/style.css 2010-08-31 06:29:10 +0000
44+++ harvest/media/css/style.css 2010-10-05 13:33:45 +0000
45@@ -498,6 +498,9 @@
46 li.opportunity:hover > .opportunity-header > .actions {
47 opacity:1;
48 }
49+.opportunity-goaway-button {
50+ font-size:10px;
51+}
52 .opportunity-header > .opportunity-summary {
53 margin-left:10px;
54 color:rgb(180,180,180);
55
56=== modified file 'harvest/opportunities/urls.py'
57--- harvest/opportunities/urls.py 2010-08-06 20:27:49 +0000
58+++ harvest/opportunities/urls.py 2010-10-05 13:33:45 +0000
59@@ -13,6 +13,13 @@
60 'opportunities.views.opportunity_edit',
61 name='opportunity_edit'),
62
63+ url(r'^opportunity/(?P<opportunity_id>[\d]+)/applied/$',
64+ 'opportunities.views.opportunity_applied',
65+ name='opportunity_applied'),
66+
67+ url(r'^opportunity/(?P<opportunity_id>[\d]+)/irrelevant/$',
68+ 'opportunities.views.opportunity_irrelevant',
69+ name='opportunity_irrelevant'),
70
71 url(r'^xhr/results/$',
72 'opportunities.views.xhr_filter_results'),
73
74=== modified file 'harvest/opportunities/views.py'
75--- harvest/opportunities/views.py 2010-08-31 08:21:04 +0000
76+++ harvest/opportunities/views.py 2010-10-05 13:33:45 +0000
77@@ -120,6 +120,21 @@
78 }, RequestContext(request))
79
80
81+@login_required
82+def opportunity_irrelevant(request, opportunity_id):
83+ opportunity = get_object_or_404(models.Opportunity, id=opportunity_id)
84+ opportunity.reviewed = (not opportunity.reviewed)
85+ opportunity.save()
86+ models.log_action(request.user, action="marked as irrelevant", opportunity=opportunity)
87+ return filter(request)
88+
89+@login_required
90+def opportunity_applied(request, opportunity_id):
91+ opportunity = get_object_or_404(models.Opportunity, id=opportunity_id)
92+ opportunity.applied = (not opportunity.applied)
93+ opportunity.save()
94+ models.log_action(request.user, action="marked as applied", opportunity=opportunity)
95+ return filter(request)
96
97 def xhr_filter_results(request):
98 filters = HarvestFilters()
99
100=== modified file 'harvest/templates/opportunities/include/opportunity.html'
101--- harvest/templates/opportunities/include/opportunity.html 2010-09-03 09:42:21 +0000
102+++ harvest/templates/opportunities/include/opportunity.html 2010-10-05 13:33:45 +0000
103@@ -2,11 +2,11 @@
104
105 <div class="opportunity-header">
106 <a href="{{opportunity.url}}" class="opportunity-description" target="_blank">{{ opportunity.description }}</a>
107- {% if user.is_authenticated %}
108 <span class="actions">
109 <a href="{% url opportunity_edit opportunity.id %}?next={{request.get_full_path}}" target="_blank" class="opportunity-edit-button">{% trans 'edit' %}</a>
110+ (<a href="{% url opportunity_applied opportunity.id %}?next={{request.get_full_path}}" class="opportunity-goaway-button" title="{% trans 'mark opportunity as applied' %}">{% trans 'applied' %}</a>
111+ <a href="{% url opportunity_irrelevant opportunity.id %}?next={{request.get_full_path}}" class="opportunity-goaway-button" title="{% trans 'mark opportunity as irrelevant' %}">{% trans 'irrelevant' %}</a>)
112 </span>
113- {% endif %}
114 <span class="opportunity-summary">
115 {{ opportunity.summary|join:', ' }}
116 </span>

Subscribers

People subscribed via source and target branches

to all changes: