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

Commit

Permalink
add opportunity id to details and main page
Browse files Browse the repository at this point in the history
  • Loading branch information
stvnrlly committed Jan 26, 2016
1 parent 6d448bd commit f8aac03
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
9 changes: 1 addition & 8 deletions forecast-admin/forecast/opportunities/templates/detail.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
{% extends "layout.html" %}
{% load static from staticfiles %}

{% block page_title %}{{ o.description }}{% endblock %}
{% block page_title %}{{ o.description }}<small> (#{{ id }})</small>{% endblock %}

{% block content %}
<table class="usa-table-borderless">
<!-- <thead>
<tr>
<th scope="col">Document Title</th>
<th scope="col">Description</th>
<th scope="col">Year</th>
</tr>
</thead> -->
<tbody>
{% for key, value in o.items %}
<tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% for o in o %}
<li class="opportunity-row" id="opportunity-row">
<div class="office">{{ o.fields.office.0 }}, {{ o.fields.office.1 }}</div>
<div class="description">{{ o.fields.description }}</div>
<div class="description">{{ o.fields.description }} (#{{ o.pk }})</div>
<div class="details">
<div class="row">
<div class="usa-width-one-half">
Expand Down
2 changes: 1 addition & 1 deletion forecast-admin/forecast/opportunities/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def details(request, id):
use_natural_foreign_keys=True,
use_natural_primary_keys=True)
opportunity = json.loads(opportunity)
return render(request, 'detail.html', {'o': opportunity[0]["fields"]})
return render(request, 'detail.html', {'o': opportunity[0]["fields"],'id': opportunity[0]["pk"]})


class OpportunityViewSet(viewsets.ReadOnlyModelViewSet):
Expand Down

0 comments on commit f8aac03

Please sign in to comment.