My week 5 main task is to create edit and preview templates for email and comment. Previously, comment and email templates were stored as HTML attachments, but there was no way in the UI for users to edit the html , or to preview the result template after the backend turned the edited html into a pdf.
My approach was to add two reusable dialogs in the Settings page: EditDialog and PreviewDialog, and wire them to their respective buttons on the Settings page, the Edit button and the Preview button.
EditDialog is a general HTML template editor. When it opens, it loads the attachment (comment.htm or email.htm), converts the blob to text, and shows it in a multiline field and user can edit the html content in the field. After editing, the HTML is saved back into CouchDB.
PreviewDialog is the preview for that edited template. It does not render the raw HTML in the page. Instead It fetches the matching PDF (comment.pdf or email.pdf) and displays it in an <iframe>.
After implementing the edit and preview templates, administrators can change the content directly on the website’s Settings page in second, instead of manually modifying a file and uploading a new version to the database.
Next Week’s Plan
For next week, I plan to investigate the root cause of the login page bug and fix it. This bug shows a blank page when a user first enters the website, instead of navigating to the login page.
0 Comments