Skip to content
Snippets Groups Projects
Commit e892e13a authored by Jeff Sturek's avatar Jeff Sturek
Browse files

Merge branch 'add-option' into 'master'

Add two line recognized student org option

See merge request !21
parents a8d6bd05 b68e4020
Branches
Tags
1 merge request!21Add two line recognized student org option
Pipeline #46607 passed
public/images/org_recognized_student_2-1_example.png

139 KiB

public/images/org_recognized_student_2-1_vert_example.png

65.2 KiB

public/images/org_recognized_student_example.png

109 KiB | W: | H:

public/images/org_recognized_student_example.png

116 KiB | W: | H:

public/images/org_recognized_student_example.png
public/images/org_recognized_student_example.png
public/images/org_recognized_student_example.png
public/images/org_recognized_student_example.png
  • 2-up
  • Swipe
  • Onion skin
public/images/org_recognized_student_vert_example.png

52.6 KiB | W: | H:

public/images/org_recognized_student_vert_example.png

55.9 KiB | W: | H:

public/images/org_recognized_student_vert_example.png
public/images/org_recognized_student_vert_example.png
public/images/org_recognized_student_vert_example.png
public/images/org_recognized_student_vert_example.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -114,6 +114,10 @@ class LockupsController extends Controller { ...@@ -114,6 +114,10 @@ class LockupsController extends Controller {
$valid = $valid && self::checkTextFieldLength($post_params, 'subject', 40); $valid = $valid && self::checkTextFieldLength($post_params, 'subject', 40);
$valid = $valid && self::checkTextFieldLength($post_params, 'subject_second_line', 40); $valid = $valid && self::checkTextFieldLength($post_params, 'subject_second_line', 40);
break; break;
case 'org_recognized_student_2_1':
$valid = $valid && self::checkTextFieldLength($post_params, 'organization', 31);
$valid = $valid && self::checkTextFieldLength($post_params, 'organization_second_line', 31);
break;
case 'acronym': case 'acronym':
$valid = $valid && self::checkTextFieldLength($post_params, 'acronym', 10); $valid = $valid && self::checkTextFieldLength($post_params, 'acronym', 10);
break; break;
...@@ -297,6 +301,10 @@ class LockupsController extends Controller { ...@@ -297,6 +301,10 @@ class LockupsController extends Controller {
$valid = $valid && self::checkTextFieldLength($post_params, 'subject', 40); $valid = $valid && self::checkTextFieldLength($post_params, 'subject', 40);
$valid = $valid && self::checkTextFieldLength($post_params, 'subject_second_line', 40); $valid = $valid && self::checkTextFieldLength($post_params, 'subject_second_line', 40);
break; break;
case 'org_recognized_student_2_1':
$valid = $valid && self::checkTextFieldLength($post_params, 'organization', 31);
$valid = $valid && self::checkTextFieldLength($post_params, 'organization_second_line', 31);
break;
case 'acronym': case 'acronym':
$valid = $valid && self::checkTextFieldLength($post_params, 'acronym', 10); $valid = $valid && self::checkTextFieldLength($post_params, 'acronym', 10);
break; break;
......
...@@ -48,6 +48,8 @@ class SvgGenerator { ...@@ -48,6 +48,8 @@ class SvgGenerator {
const CENTER_DIVIDER = "M51,0 L51,39 Z"; const CENTER_DIVIDER = "M51,0 L51,39 Z";
const RECOGNIZED_STUDENT_ORGANIZATION = 'Recognized Student Organization';
public static $lockup_templates_directory = __DIR__ . '/LockupTemplates'; public static $lockup_templates_directory = __DIR__ . '/LockupTemplates';
public static function createPreviewLockup($template, $lockup, $orient = 'horiz') { public static function createPreviewLockup($template, $lockup, $orient = 'horiz') {
...@@ -219,8 +221,8 @@ class SvgGenerator { ...@@ -219,8 +221,8 @@ class SvgGenerator {
$svg->setLetterSpacing(0); $svg->setLetterSpacing(0);
$svg->setFontSize(8.125); $svg->setFontSize(8.125);
$svg->setFontColor($secondary_text_color); $svg->setFontColor($secondary_text_color);
$svg->addText('Recognized Student Organization', 44, 26); $svg->addText(self::RECOGNIZED_STUDENT_ORGANIZATION, 44, 26);
$secondary_text_width = $svg->textDimensions('Recognized Student Organization')[0]; $secondary_text_width = $svg->textDimensions(self::RECOGNIZED_STUDENT_ORGANIZATION)[0];
$svg->addAttribute('viewBox', "0 0 " . (max($main_text_width, $secondary_text_width) + 44) . " 38"); $svg->addAttribute('viewBox', "0 0 " . (max($main_text_width, $secondary_text_width) + 44) . " 38");
$svg_file->height = 38; $svg_file->height = 38;
...@@ -311,6 +313,32 @@ class SvgGenerator { ...@@ -311,6 +313,32 @@ class SvgGenerator {
$svg->addAttribute('width', max($main_text_width, $secondary_text_width, $third_width, $fourth_width) + 44); $svg->addAttribute('width', max($main_text_width, $secondary_text_width, $third_width, $fourth_width) + 44);
} }
break; break;
case 'org_recognized_student_2_1':
$svg->setFontSVG(self::TUNGSTEN);
$svg->setLetterSpacing(0.05);
$svg->setFontSize(12);
$svg->setFontColor($main_text_color);
$svg->addText($lockup->org_name, 44, -5.8);
$main_text_width = $svg->textDimensions($lockup->org_name)[0];
$svg->addText($lockup->org_second_line, 44, 5.2);
$third_width = $svg->textDimensions($lockup->org_second_line)[0];
$svg->setFontSVG(self::MERCURY);
$svg->setLetterSpacing(0);
$svg->setFontSize(8.125);
$svg->setFontColor($secondary_text_color);
$svg->addText(self::RECOGNIZED_STUDENT_ORGANIZATION, 44, 26);
$secondary_text_width = $svg->textDimensions(self::RECOGNIZED_STUDENT_ORGANIZATION)[0];
$svg->addAttribute('viewBox', "0 0 " . (max($main_text_width, $secondary_text_width, $third_width) + 44) . " 38");
$svg_file->height = 38;
$svg_file->width = max($main_text_width, $secondary_text_width, $third_width) + 44;
if (!$preview) {
$svg->addAttribute('height', 38);
$svg->addAttribute('width', max($main_text_width, $secondary_text_width, $third_width) + 44);
}
break;
case 'acronym': case 'acronym':
$svg->setFontSVG(self::TUNGSTEN); $svg->setFontSVG(self::TUNGSTEN);
$svg->setLetterSpacing(0.05); $svg->setLetterSpacing(0.05);
...@@ -451,8 +479,8 @@ class SvgGenerator { ...@@ -451,8 +479,8 @@ class SvgGenerator {
$svg->setLetterSpacing(0); $svg->setLetterSpacing(0);
$svg->setFontSize(8.125); $svg->setFontSize(8.125);
$svg->setFontColor($secondary_text_color); $svg->setFontColor($secondary_text_color);
$text_width = $svg->textDimensions('Recognized Student Organization')[0]; $text_width = $svg->textDimensions(self::RECOGNIZED_STUDENT_ORGANIZATION)[0];
$svg->addText('Recognized Student Organization', 100 - ($text_width / 2), 55); $svg->addText(self::RECOGNIZED_STUDENT_ORGANIZATION, 100 - ($text_width / 2), 55);
break; break;
case 'org_subject_1_2': case 'org_subject_1_2':
$svg->setFontSVG(self::TUNGSTEN); $svg->setFontSVG(self::TUNGSTEN);
...@@ -511,6 +539,24 @@ class SvgGenerator { ...@@ -511,6 +539,24 @@ class SvgGenerator {
$text_width = $svg->textDimensions($lockup->subject_second_line)[0]; $text_width = $svg->textDimensions($lockup->subject_second_line)[0];
$svg->addText($lockup->subject_second_line, 100 - ($text_width / 2), 70); $svg->addText($lockup->subject_second_line, 100 - ($text_width / 2), 70);
break; break;
case 'org_recognized_student_2_1':
$svg->setFontSVG(self::TUNGSTEN);
$svg->setLetterSpacing(0.05);
$svg->setFontSize(12);
$svg->setFontColor($main_text_color);
$text_width = $svg->textDimensions($lockup->org_name)[0];
$svg->addText($lockup->org_name, 100 - ($text_width / 2), 37);
$text_width = $svg->textDimensions($lockup->org_second_line)[0];
$svg->addText($lockup->org_second_line, 100 - ($text_width / 2), 48);
$svg->setFontSVG(self::MERCURY);
$svg->setLetterSpacing(0);
$svg->setFontSize(8.125);
$svg->setFontColor($secondary_text_color);
$text_width = $svg->textDimensions(self::RECOGNIZED_STUDENT_ORGANIZATION)[0];
$svg->addText(self::RECOGNIZED_STUDENT_ORGANIZATION, 100 - ($text_width / 2), 66);
break;
case 'acronym': case 'acronym':
$svg->setFontSVG(self::TUNGSTEN); $svg->setFontSVG(self::TUNGSTEN);
$svg->setLetterSpacing(0.05); $svg->setLetterSpacing(0.05);
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<img class="vert" style="display: none;" src="<?php echo $context->baseURL; ?>images/org_recognized_student_vert_example.png" role="presentation"> <img class="vert" style="display: none;" src="<?php echo $context->baseURL; ?>images/org_recognized_student_vert_example.png" role="presentation">
</label><br> </label><br>
<label for="type-org-recognized-student"> <label for="type-org-recognized-student">
Recognized Student Organization lockup: primary and secondary hierarchy for your recognized student organization name in a single line design. Recognized Student Organization lockup: primary hierarchy for your recognized student organization name in a single line design.
</label> </label>
</div> </div>
<div> <div>
...@@ -99,6 +99,17 @@ ...@@ -99,6 +99,17 @@
<br><em>*Additional line should be used when ID is too long to fit on one line.</em> <br><em>*Additional line should be used when ID is too long to fit on one line.</em>
</label> </label>
</div> </div>
<div>
<label>
<input type="radio" name="type" value="org_recognized_student_2_1" id="type-org-recognized-student-2-1" <?php if ($context->lockup->style == 'org_recognized_student_2_1') echo 'checked="checked"'; ?>>
<img class="horiz height-38" src="<?php echo $context->baseURL; ?>images/org_recognized_student_2-1_example.png" role="presentation">
<img class="vert" style="display: none;" src="<?php echo $context->baseURL; ?>images/org_recognized_student_2-1_vert_example.png" role="presentation">
</label><br>
<label for="type-org-recognized-student-2-1">
Recognized Student Organization lockup: primary hierarchy for your recognized student organization name in a two line design.
<br><em>*Additional line should be used when ID is too long to fit on one line.</em>
</label>
</div>
<div> <div>
<label> <label>
<input type="radio" name="type" value="acronym" id="type-acronym" <?php if ($context->lockup->style == 'acronym') echo 'checked="checked"'; ?>> <input type="radio" name="type" value="acronym" id="type-acronym" <?php if ($context->lockup->style == 'acronym') echo 'checked="checked"'; ?>>
...@@ -202,7 +213,7 @@ ...@@ -202,7 +213,7 @@
31 characters max 31 characters max
</div> </div>
</div> </div>
<input class="dcf-input-text" type="text" name="organization_second_line" maxlength="31" id="organization-second-line"> <input class="dcf-input-text" type="text" name="organization_second_line" maxlength="31" id="organization-second-line" value="<?php echo $context->lockup->organization_second_line; ?>">
</div> </div>
<div id="subject-field" style="display: none;"> <div id="subject-field" style="display: none;">
<label for="subject">Subject</label> <label for="subject">Subject</label>
...@@ -414,6 +425,15 @@ require(['jquery'], function ($) { ...@@ -414,6 +425,15 @@ require(['jquery'], function ($) {
$('#acronym-second-line-field').hide(); $('#acronym-second-line-field').hide();
$('#acronym-subject-field').hide(); $('#acronym-subject-field').hide();
$('#extension-county-field').hide(); $('#extension-county-field').hide();
} else if ($('#type-org-recognized-student-2-1').is(':checked')) {
$('#organization-field').show();
$('#organization-second-line-field').show();
$('#subject-field').hide();
$('#subject-second-line-field').hide();
$('#acronym-field').hide();
$('#acronym-second-line-field').hide();
$('#acronym-subject-field').hide();
$('#extension-county-field').hide();
} else if ($('#type-acronym').is(':checked')) { } else if ($('#type-acronym').is(':checked')) {
$('#organization-field').hide(); $('#organization-field').hide();
$('#organization-second-line-field').hide(); $('#organization-second-line-field').hide();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment