Skip to content

Commit

Permalink
TASK: Update templates for hyphenator dictionary backend
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin-K committed Aug 11, 2018
1 parent 80daded commit a1faf1f
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 67 deletions.
37 changes: 21 additions & 16 deletions Resources/Private/Templates/Dictionary/Edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,27 @@
<f:section name="Title">Edit dictionary entry "{dictionary.realWord}"</f:section>

<f:section name="Content">
<f:form action="update" object="{dictionary}" objectName="dictionary">
<ol>
<li>
<label for="locale">Locale (en_GB, de_DE, en, de, ...; "mul" for all languages)</label>
<f:form.textfield property="locale" id="locale" />
</li>
<style>
.neos form {margin-top: 10px;}
.neos form li {margin-bottom: 20px;}
.neos form li:last-child {margin-bottom: 0;}
</style>
<f:form action="update" object="{dictionary}" objectName="dictionary">
<ol>
<li>
<label for="locale">Locale (en_GB, de_DE, en, de, ...; "mul" for all languages)</label>
<f:form.textfield property="locale" id="locale" />
</li>

<li>
<label for="word">Word (divided by slashes (/) where hyphenation should take place)</label>
<f:form.textfield property="word" id="word" />
<div><small>For example: hy/phe/na/tion.</small></div>
</li>
<li>
<label for="word">Word (divided by slashes (/) where hyphenation should take place)</label>
<f:form.textfield property="word" id="word" />
<div><small>For example: hy/phe/na/tion.</small></div>
</li>

<li>
<f:form.submit value="Update" />
</li>
</ol>
</f:form>
<li>
<f:form.submit value="Update" class="neos-button" />
</li>
</ol>
</f:form>
</f:section>
52 changes: 33 additions & 19 deletions Resources/Private/Templates/Dictionary/Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,37 @@
<f:section name="Title">A list of dictionary entries</f:section>

<f:section name="Content">
<f:if condition="{dictionaries}">
<f:then>
<ul>
<f:for each="{dictionaries}" as="dictionary">
<li>
<f:link.action action="show" arguments="{dictionary: dictionary}">{dictionary.realWord}</f:link.action>
<f:link.action action="edit" arguments="{dictionary: dictionary}">Edit</f:link.action>
<f:form action="delete" arguments="{dictionary: dictionary}">
<f:form.submit value="Delete" />
</f:form>
</li>
</f:for>
</ul>
</f:then>
<f:else>
<p>No dictionary entries created yet.</p>
</f:else>
</f:if>
<p><f:link.action action="new">Create a new dictionary entry</f:link.action></p>
<f:if condition="{dictionaries}"><f:then>
<style type="text/css">
.dictionary__actions {width: 130px;}
</style>
<table class="neos-table">
<thead>
<tr>
<th>Dictionary entry (without separaion)</th>
<th>Locale</th>
<th class="dictionary__actions">Actions</th>
</tr>
</thead>
<tbody>
<f:for each="{dictionaries}" as="dictionary">
<tr>
<td><f:link.action action="show" arguments="{dictionary: dictionary}">{dictionary.realWord}</f:link.action></td>
<td>{dictionary.locale}</td>
<td>
<f:form action="edit" arguments="{dictionary: dictionary}" class="neos-inline">
<f:form.button type="submit" value="Edit"><i class="fas fa-pencil icon-pencil icon-white"></i></f:form.button>
</f:form>
<f:form action="delete" arguments="{dictionary: dictionary}" class="neos-inline">
<f:form.button type="submit" value="Delete"><i class="fas fa-trash-alt icon-trash-o icon-white"></i></f:form.button>
</f:form>
</td>
</tr>
</f:for>
</tbody>
</table>
</f:then><f:else>
<p>No dictionary entries created yet.</p>
</f:else></f:if>
<p><f:link.action action="new" class="neos-button">Create a new dictionary entry</f:link.action></p>
</f:section>
39 changes: 22 additions & 17 deletions Resources/Private/Templates/Dictionary/New.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,29 @@
<f:section name="Title">New dictionary</f:section>

<f:section name="Content">
<p>Just fill out the following form to create a new dictionary:</p>
<style>
.neos form {margin-top: 10px;}
.neos form li {margin-bottom: 20px;}
.neos form li:last-child {margin-bottom: 0;}
</style>
<p>Just fill out the following form to create a new dictionary:</p>

<f:form action="create" objectName="newDictionary">
<ol>
<li>
<label for="locale">Locale (en_GB, de_DE, en, de, ...; "mul" for all languages)</label>
<f:form.textfield property="locale" id="locale" />
</li>
<f:form action="create" objectName="newDictionary">
<ol>
<li>
<label for="locale">Locale (en_GB, de_DE, en, de, ...; "mul" for all languages)</label>
<f:form.textfield property="locale" id="locale" />
</li>

<li>
<label for="word">Word (divided by slashes (/) where hyphenation should take place)</label>
<f:form.textfield property="word" id="word" />
<div><small>For example: hy/phe/na/tion.</small></div>
</li>
<li>
<label for="word">Word (divided by slashes (/) where hyphenation should take place)</label>
<f:form.textfield property="word" id="word" />
<div><small>For example: hy/phe/na/tion.</small></div>
</li>

<li>
<f:form.submit value="Create" />
</li>
</ol>
</f:form>
<li>
<f:form.submit value="Create" class="neos-button" />
</li>
</ol>
</f:form>
</f:section>
34 changes: 19 additions & 15 deletions Resources/Private/Templates/Dictionary/Show.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,25 @@
<f:section name="Title">Show dictionary entry for "{dictionary.realWord}"</f:section>

<f:section name="Content">
<table>
<tr>
<th>Locale</th>
<td>{dictionary.locale}</td>
</tr>
<style>
.dictionary-table {margin-top: 20px; max-width: 620px !important;}
.dictionary-table td {line-height: 1.4 !important; padding: 10px 16px !important;}
</style>
<table class="neos-table dictionary-table">
<tr>
<td>Locale</td>
<td>{dictionary.locale}</td>
</tr>

<tr>
<th>Real word (without hyphenation)</th>
<td>{dictionary.realWord}</td>
</tr>
<tr>
<td>Word to replace<br>(without hyphenation)</td>
<td>{dictionary.realWord}</td>
</tr>

<tr>
<th>Word<br>(divided by slashes (/) where<br>hyphenation should take place)</th>
<td>{dictionary.word}</td>
</tr>
</table>
<f:link.action action="index">Back</f:link.action>
<tr>
<td>Hyphenated Word<br>(parts divided by /)</td>
<td>{dictionary.word}</td>
</tr>
</table>
<f:link.action action="index" class="neos-button">Back</f:link.action>
</f:section>

0 comments on commit a1faf1f

Please sign in to comment.