Intern:Editorial/Forms

Common Elements
The forms for editing entities share some common elements:


 * Colored border: Each entity has its color, inspired by the colors used in 4D.
 * Heading: In the top of the colored border, there is an Entity Tag (displays the ID). Drag it to an input field to create a reference. Next, the common name (title, label, name, ...) and the type of the entity is displayed.
 * Footer: At the bottom, there are a number of buttons. "Submit" saves changes to the database. "Delete" removes the entity from the database (before deleting, the editorial checks if the entity is referenced by another entity. "Revert" undoes the changes done to the entity.
 * Usages: At the end (bottom or right) of each entity form, the usages section can be extended. It displays all other entities that reference the current one. (This list is checked automatically before deleting an entity. Referenced entities must not be removed.)

Input Fields
Some of the input fields are a bit unusual:


 * Multiline text fields: fields for longer titles, comments, or the abstract text display multiple lines of text. They extend vertically to show all entered text, up to a limit where scrolling becomes necessary to view all text.
 * Character count: at the right, some fields show the maximum number of characters, and the current number of characters allowed to enter in a field.
 * Clear entry: to clear the data of a field, use the "x" at the right of the field when hovering over it. This works for date/time fields, entity reference fields, options fields.
 * Single entity reference fields: these fields take a single reference to an entity (e.g. "Institution" field in "Staffs"). There is a little caret on the right of the field, so it can be distinguished from other fields. Start typing to search for existing entities (displayed in a popup below). If a second entity is entered, it replaces the first one. At the bottom of the autocomplete popup, there is a "New" button to create a new entity of the given type and link it automatically. You can also drag'n'drop a compatible entity tag from the same or a different view.
 * Multi entity reference fields: same as the above, but takes multiple entity tags (e.g. "Keywords" field in "Dataset"). Currently, there is no visual difference to single reference fields. You can add as many entity tags as you like. It is not (yet) possible to change the order of entries.
 * Mini tables: for some complex relations, mini-tables are available (e.g. "Authors" in "Dataset"). The bottom line here is to search for an entity by autocomplete and add it to the table. You can also drop entity tags into the table. Change sort order with the little arrows on the left. Remove an entry from the list with the trashcan on the right.

Revert Changes
While you are working on a form, your changes are recorded. You can easily review your changes, revert them individually or all together.


 * When editing a field, the color of the field's label changes from grey to teal to indicate that there is an edit.
 * Click a teal label to view the previous-data-popup.
 * Click the back-arrow in the previous-data-popup to revert your changes of the corresponding field.
 * Click the "Revert" button on the footer of a form to revert all your edits.
 * If a form is submitted, all edits are persisted and all labels become grey again.