denny/ShinyCMS

View on GitHub
root/admin/forums/edit_section.tt

Summary

Maintainability
Test Coverage
[%- IF section.id;
        meta.title = 'Edit Section';
    ELSE;
        meta.title = 'Add Section';
    END;
-%]

[%- IF section.id %]
<form id="edit_section" action="[% c.uri_for( '/admin/forums/section', section.id, 'save' ) %]" method="post">
[%- ELSE %]
<form id="add_section" action="[% c.uri_for( '/admin/forums/section/add-do' ) %]" method="post">
[%- END %]
    <p>
        <label for="name">Section name</label>
        <br><input type="text" class="textshort" id="name" name="name" value="[% section.name | html %]">
    </p>
    <p>
        <label for="name">URL name</label>
        <br><input type="text" class="textshort" id="url_name" name="url_name" value="[% section.url_name | html %]">
    </p>
    <p>
        <label for="display_order">Display order</label>
        <br><input class="textshort" type="text" id="display_order" name="display_order" value="[% section.display_order | html %]">
    </p>
    <p>
        <label for="name">Description</label>
        <br><textarea cols="60" rows="4" id="description" name="description">[% section.description | html %]</textarea>
    </p>
    <p>
        [%- IF section.id %]
        <input name="submit" type="submit" value="Update">
        <input name="delete" type="submit" value="Delete" onclick="javascript:return confirm('Are you sure you want to delete this section?')">
        [%- ELSE %]
        <input name="submit" type="submit" value="Create">
        [%- END %]
    </p>
</form>