Skip to content

Commit

Permalink
Merge pull request #9 from creative-commoners/pulls/1.0/up-to-date-or…
Browse files Browse the repository at this point in the history
…-prune

FIX Update i18n plurals, block type, add title to template and clearfix underneath form
  • Loading branch information
NightJar committed Oct 25, 2017
2 parents 5a8cc3c + 44c7c27 commit 81a72cf
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 15 deletions.
Empty file added lang/_manifest_exclude
Empty file.
8 changes: 8 additions & 0 deletions lang/en.yml
@@ -0,0 +1,8 @@
en:
DNADesign\ElementalUserForms\Model\ElementForm:
BlockType: Form
PLURALNAME: forms
PLURALS:
one: 'A form'
other: '{count} forms'
SINGULARNAME: form
23 changes: 9 additions & 14 deletions src/Model/ElementForm.php
Expand Up @@ -12,26 +12,16 @@ class ElementForm extends BaseElement
{
use UserForm;

/**
* @var string
*/
private static $table_name = 'ElementForm';

/**
* @var string
*/
private static $title = 'Form';

/**
* @var string
*/
private static $icon = 'dnadesign/silverstripe-elemental-userforms:images/form.svg';

/**
* @var string
*/
private static $controller_class = ElementFormController::class;

private static $singular_name = 'form';

private static $plural_name = 'forms';

/**
* @return UserForm
*/
Expand Down Expand Up @@ -70,4 +60,9 @@ public function Link($action = null)

return parent::Link($action);
}

public function getType()
{
return _t(__CLASS__ . '.BlockType', 'Form');
}
}
7 changes: 6 additions & 1 deletion templates/DNADesign/ElementalUserForms/Model/ElementForm.ss
@@ -1,3 +1,8 @@
<div class="formelement__form">
<div class="form-element__form $ExtraClass">
<% if $Title && $ShowTitle %>
<h2 class="form-element__title">$Title</h2>
<% end_if %>

$ElementForm
</div>
<div style="clear: both"></div>

0 comments on commit 81a72cf

Please sign in to comment.