Skip to content

Commit

Permalink
added summary field to FeaturedProject model
Browse files Browse the repository at this point in the history
  • Loading branch information
jseppi committed Feb 8, 2012
1 parent 3739303 commit b8de79b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
8 changes: 5 additions & 3 deletions BridgingWaters/bwapp/fixtures/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
"model": "contenttypes.contenttype",
"fields": {
"model": "featuredproject",
"name": "featured project",
"name": "featured project",
"app_label": "bwapp"
}
},
Expand Down Expand Up @@ -1494,15 +1494,17 @@
"model": "bwapp.featuredproject",
"fields": {
"project": 1,
"created": "2011-12-01 11:37:00"
"created": "2011-12-01 11:37:00",
"summary": "This project is a great example of a featured project."
}
},
{
"pk": 2,
"model": "bwapp.featuredproject",
"fields": {
"project": 4,
"created": "2012-01-07 17:10:46"
"created": "2012-01-07 17:10:46",
"summary": "This project is ANOTHER example of a featured project."
}
}
]
7 changes: 4 additions & 3 deletions BridgingWaters/bwapp/fixtures/initial_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@
- model: bwapp.Project
pk: 1
fields:
title: 1 TEST PROJECT 1
description: This is a test project for the bw app
title: Clean Water Aqueduct
description: This is a test project for the bw app. This is a test project for the bw app. This is a test project for the bw app. This is a test project for the bw app. This is a test project for the bw app. This is a test project for the bw app. This is a test project for the bw app. This is a test project for the bw app. This is a test project for the bw app. This is a test project for the bw app. This is a test project for the bw app. This is a test project for the bw app. This is a test project for the bw app. This is a test project for the bw app. This is a test project for the bw app. This is a test project for the bw app. This is a test project for the bw app.
start_date: 2009-01-01
end_date: 2009-06-01
goal: To allow James to test the bw app
Expand All @@ -144,7 +144,7 @@
pk: 2
fields:
title: 2 TEST PROJECT 2
description: This is the second test project for the bw app
description: This is the second test project for the bw app.
start_date: 2010-02-14
end_date: 2010-06-20
goal: To allow James to test the bw app with 2 projects
Expand Down Expand Up @@ -194,6 +194,7 @@
fields:
project: 1
created: 2011-12-01 11:37:00
summary: This project is a great example of a featured project.
#----------------------------------------
# CodeRegion
- model: bwapp.CodeRegion
Expand Down
1 change: 1 addition & 0 deletions BridgingWaters/bwapp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ def __unicode__(self):
class FeaturedProject(models.Model):
project = models.ForeignKey(Project)
created = models.DateTimeField(auto_now_add=True)
summary = models.CharField(max_length=280)

def __unicode__(self):
return self.project.title
Expand Down
2 changes: 1 addition & 1 deletion BridgingWaters/bwapp/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h3>Featured Project - <a href="/bw/projects/{{feat_proj.id}}">{{feat_proj.title
<strong>Type of Project:</strong> {{feat_proj.proj_types.all|join:", "}}<br/>
<strong>Project Duration:</strong> {{feat_proj.start_date}} - {{feat_proj.end_date}}<br/>
<strong>Organizations:</strong> {{feat_proj.organizations.all|join:", "}}<br/>
<strong>Summary:</strong> {{feat_proj.description}}<br/>
<strong>Summary:</strong> Featured project summary goes here.<br/> {# TODO: Add featured project summary to database model #}
<strong>Keywords:</strong>
{% if feat_proj.keywords.all %}
{{feat_proj.keywords.all|join:", "}}
Expand Down
5 changes: 2 additions & 3 deletions BridgingWaters/bwapp/templates/project_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h2>
<strong>Project Duration:</strong> {{p.start_date}} - {{p.end_date}}<br/>
<strong>People Served by Project:</strong> {{comm_info.num_ppl_served}}<br/>

<strong>Summary:</strong>
<strong>Description:</strong>
{% if p.description|wordcount > 60 %} {# TODO: write javascript to toggle the more/less #}
<span class="trunc">{{p.description|truncatewords:50}} </span>
<span class="untrunc hide">{{p.description}} </span>
Expand Down Expand Up @@ -74,8 +74,7 @@ <h3>Location Information</h3>
<strong>Topography:</strong> {{loc.topography}}<br/>
<strong>Elevation:</strong> {{loc.elevation}}<br/>
<strong>Geographic Location:</strong> {{loc.latitude}}, {{loc.longitude}}<br/>

TODO: Map showing location of project

<div id="map" style="width: 340px; height: 200px"></div>

<script type="text/javascript">
Expand Down
1 change: 1 addition & 0 deletions BridgingWaters/bwapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def index(request):
return render(request, 'index.html', {
'latest_news_list':latest_news_list,
'feat_proj':feat_proj.project,
'summary':feat_proj.summary
})

def project_detail(request, project_id):
Expand Down
Binary file modified bw.db
Binary file not shown.

0 comments on commit b8de79b

Please sign in to comment.