torchbox/verdant-rca — pull request #10 by spapas (2014-03-24 10:39:30+00:00)
Title: Add common RelatedLinksFields allowing empty text

This adds a RelatedLinkItemFields Abstract class defining common fields for Relate Links. These common RelatedLink fields existed in the following:

SchoolPageRelatedLink, ProgrammePageRelatedLink, EventIndexRelatedLink,
ReviewPageRelatedLink, StandardPageRelatedLink, StandardIndexRelatedLink,
HomePageRelatedLink, JobsIndexRelatedLink, AlumniIndexRelatedLink,
ResearchInnovationPageRelatedLink, GalleryPageRelatedLink

so all were refactored to inherit from RelatedLinkItemFields.

One thing here is that the link field in the previous was optional - I left it also optional in the base class but can somebody explain why it had to be optional ? I think that it should've been required.

The link_text field in RelatedLinkItemFields is optional. To get the title for the link the get_link_text property has to be used. This will check to see if the link_text field has a value - if not then the title of the
related page will be used.

The sidebar_link.html template has been modified to use the get_link_text.