Skip to content
This repository has been archived by the owner on Dec 8, 2017. It is now read-only.

Commit

Permalink
include region in opportunities
Browse files Browse the repository at this point in the history
  • Loading branch information
stvnrlly committed Aug 1, 2016
1 parent 4c11472 commit 11ab459
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
13 changes: 7 additions & 6 deletions forecast-admin/forecast/opportunities/serializers.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
from rest_framework import serializers
from .models import Opportunity, Office, OSBUAdvisor

class OfficeSerializer(serializers.ModelSerializer):
class Meta:
model = Office
fields = ('organization', 'region')


class OpportunitySerializer(serializers.ModelSerializer):
office = serializers.ReadOnlyField(source='office.organization')
# office = serializers.ReadOnlyField(source='office.organization')
office = OfficeSerializer()

class Meta:
model = Opportunity
# exclude = ('owner',)


class OfficeSerializer(serializers.ModelSerializer):
class Meta:
model = Office


class OSBUAdvisorSerializer(serializers.ModelSerializer):
class Meta:
model = OSBUAdvisor
8 changes: 6 additions & 2 deletions forecast-admin/forecast/static/assets/js/src/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ var startOpportunities = function(opportunityContainer, pageContainer) {
' <p class="office">' +
' <span>' + o.agency + '</span>';
if(o.office) {
html += ' <span class="h5">|</span>' +
' <span> ' + o.office + ' </span>';
html += ' <span class="h5">| </span>' +
' <span> ' + o.office.organization + ' </span>';
}
if(o.office.region) {
html += ' <span class="h5"> | </span>' +
' <span> ' + o.office.region + ' </span>';
}
html += ' </p>' +
' <p class="description"><a class="opportunity-top-link" href="/details/' + o.id + '">' + o.description + ' (#' + o.id + ')</a></p>' +
Expand Down

0 comments on commit 11ab459

Please sign in to comment.