Skip to content

Commit

Permalink
Merge pull request #77 from SlateFoundation/develop
Browse files Browse the repository at this point in the history
Release: slate v2.1.13
  • Loading branch information
themightychris authored Oct 13, 2016
2 parents 6e746d0 + 2506b79 commit ab0bac8
Show file tree
Hide file tree
Showing 4 changed files with 390 additions and 2 deletions.
97 changes: 97 additions & 0 deletions html-templates/progress/section-interim-reports/reports.email.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{$from = $.User->EmailRecipient}

{capture assign=subject}{strip}

{if count($students) > 1}
Interim reports for {count($students)} students
{else}
Interim report for {$students[0]->FullName}
{/if}

{if count($terms) == 1}
, {$terms[0]->Title}
{/if}

{/strip}{/capture}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{$subject|escape}</title>

<style type="text/css">
.interim a:visited { color: #a35500 !important; }
.interim a:hover { color: #6a3700 !important; }
.interim a:active { color: #6a3700 !important; }
</style>
</head>
<body style="color: #333; font-family: Georgia, serif; font-size: 16px; line-height: 1.3;">

<h2>{$subject|escape}</h2>

{foreach item=Interim from=$data}
<div style="margin: 1em 0; background-color: #ecf5f9; border: 1px solid #789dab; padding: 1em; border-radius: .25em;">
{$Section = $Interim->Section}
{$Instructor = $Section->Instructors.0}

<h3 style="margin: 0 0 1em; color: #004b66;">{$Section->Title}</h3>

{if count($students) > 1}
<div style="margin: 1em 0;">
<span style="color: #5e6366; font-size: smaller; font-style: italic;">Student</span>
<br />
<span style="display: block; margin-left: 1.5em;">
<strong>{$Interim->Student->FullName|escape}</strong>
</span>
</div>
{/if}

{if count($terms) > 1}
<div style="margin: 1em 0;">
<span style="color: #5e6366; font-size: smaller; font-style: italic;">Term</span>
<br />
<span style="display: block; margin-left: 1.5em;">
<strong>{$Interim->Term->Title|escape}</strong>
</span>
</div>
{/if}

<div style="margin: 1em 0;">
<span style="color: #5e6366; font-size: smaller; font-style: italic;">Teacher{tif count($Section->Teachers) != 1 ? s}</span>
<br />
<span style="display: block; margin-left: 1.5em;">
{foreach item=Teacher from=$Section->Teachers implode='<br />'}
<strong>{$Teacher->FullName|escape}</strong>
&lt;<a href="mailto:{$Teacher->Email|escape}?subject=Re:%20{$subject|escape:url}" style="color: #a35500;">{$Teacher->Email|escape}</a>&gt;
{/foreach}
</span>
</div>

{if $Interim->Grade}
<div style="margin: 1em 0;">
<span style="color: #5e6366; font-size: smaller; font-style: italic;">Current Grade</span>
<br />
<span style="display: block; margin-left: 1.5em;">
<strong>{$Interim->Grade}</strong>
</span>
</div>
{/if}

{if $Interim->Notes}
<span style="color: #5e6366; font-size: smaller; font-style: italic;">Notes</span>
<br />
<div style="display: block; margin: 0 1.5em;">
{if $Interim->NotesFormat == 'html'}
{$Interim->Notes}
{elseif $Interim->NotesFormat == 'markdown'}
{$Interim->Notes|escape|markdown}
{else}
{$Interim->Notes|escape}
{/if}
</div>
{/if}
</div>
{/foreach}
</body>
</html>
4 changes: 2 additions & 2 deletions php-classes/Slate/People/Student.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ class Student extends User
,'linkClass' => GuardianRelationship::class
,'linkLocal' => 'PersonID'
,'linkForeign' => 'RelatedPersonID'
,'conditions' => ['Link.Class = "Guardian"']
,'conditions' => ['Link.Class = "Emergence\\\\People\\\\GuardianRelationship"']
]
,'GuardianRelationships' => [
'type' => 'one-many'
,'class' => GuardianRelationship::class
,'foreign' => 'PersonID'
,'conditions' => ['Class' => 'Guardian']
,'conditions' => ['Class' => GuardianRelationship::class]
]
];

Expand Down
5 changes: 5 additions & 0 deletions php-classes/Slate/Progress/SectionInterimReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ class SectionInterimReport extends AbstractSectionTermReport
'Notes' => [
'type' => 'clob',
'default' => null
],
'NotesFormat' => [
'type' => 'enum',
'values' => ['markdown', 'html'],
'default' => 'markdown'
]
];

Expand Down
Loading

0 comments on commit ab0bac8

Please sign in to comment.