added faqs, fixed bp bugs
This commit is contained in:
parent
71f98a53fc
commit
d8484ac2f4
|
@ -25,3 +25,4 @@ admin.site.register(BestPracticeLink)
|
|||
admin.site.register(Guideline)
|
||||
admin.site.register(Glossary)
|
||||
admin.site.register(BestPracticeDownload)
|
||||
admin.site.register(BestPracticeFAQ)
|
||||
|
|
|
@ -96,6 +96,12 @@ class BestPracticeStory(models.Model):
|
|||
'image': self.image.url if self.image.name != '' else ''
|
||||
}
|
||||
|
||||
class BestPracticeFAQ(models.Model):
|
||||
question = models.TextField()
|
||||
answer = models.TextField()
|
||||
|
||||
def __unicode__(self):
|
||||
return self.question
|
||||
|
||||
class BestPracticeCategory(models.Model):
|
||||
name = models.CharField(max_length=256)
|
||||
|
|
|
@ -9,10 +9,13 @@ def link_bps(value):
|
|||
matches = re.findall(r, value)
|
||||
for match in matches:
|
||||
id = int(match.replace("BP:", "").strip())
|
||||
try:
|
||||
bp = BestPractice.objects.get(pk=id)
|
||||
title = bp.title
|
||||
html = "<a class='bpRelated' href='/itf/bestpractices/stories#%d' title='View related Best Practice story'>%s</a>" % (id, title,)
|
||||
value = value.replace(match, html, 1)
|
||||
except:
|
||||
value = value.replace(match, '', 1)
|
||||
return value
|
||||
|
||||
register.filter("link_bps", link_bps)
|
||||
|
|
|
@ -50,6 +50,7 @@ h3 {
|
|||
font-weight: normal !important;
|
||||
font-style: italic;
|
||||
margin-left: 12px;
|
||||
text-decoration: underline !important;
|
||||
}
|
||||
|
||||
.bpRelated:hover {
|
||||
|
|
|
@ -71,6 +71,8 @@ $(document).ready(function() {
|
|||
<li><a href="/itf/bestpractices/stories">Stories</a></li>
|
||||
<li><a href="/itf/bestpractices/guidelines">Guidelines</a></li>
|
||||
<li><a href="/itf/bestpractices/glossary">Glossary</a></li>
|
||||
<li><a href="/itf/bestpractices/faq">FAQ</a></li>
|
||||
<li><a href="/itf/bestpractices/download">Download</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
<li><a href="/itf/bestpractices/stories">Stories</a></li>
|
||||
<li><a href="/itf/bestpractices/guidelines">Guidelines</a></li>
|
||||
<li class="bpCurrentTab">Glossary</li>
|
||||
<li><a href="/itf/bestpractices/faq">FAQ</a></li>
|
||||
<li><a href="/itf/bestpractices/download">Download</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
<li><a href="/itf/bestpractices/stories">Stories</a></li>
|
||||
<li class="bpCurrentTab">Guidelines</li>
|
||||
<li><a href="/itf/bestpractices/glossary">Glossary</a></li>
|
||||
<li><a href="/itf/bestpractices/faq">FAQ</a></li>
|
||||
<li><a href="/itf/bestpractices/download">Download</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
<li class="bpCurrentTab">Stories</li>
|
||||
<li><a href="/itf/bestpractices/guidelines">Guidelines</a></li>
|
||||
<li><a href="/itf/bestpractices/glossary">Glossary</a></li>
|
||||
<li><a href="/itf/bestpractices/faq">FAQ</a></li>
|
||||
<li><a href="/itf/bestpractices/download">Download</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user