RenderControl() public method

Outputs server control content to a provided T:System.Web.UI.HtmlTextWriter object and stores tracing information about the control if tracing is enabled.
public RenderControl ( System.Web.UI.HtmlTextWriter writer ) : void
writer System.Web.UI.HtmlTextWriter The object that receives the control content.
return void
Esempio n. 1
0
        /// <summary>
        /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client.
        /// </summary>
        /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            if (!Expanded)
            {
                foreach (WorkflowActionTypeEditor workflowActionTypeEditor in this.Controls.OfType <WorkflowActionTypeEditor>())
                {
                    if (workflowActionTypeEditor.Expanded)
                    {
                        Expanded = true;
                        break;
                    }
                }
            }

            string inactiveCss = _cbActivityTypeIsActive.Checked ? string.Empty : " workflow-activity-inactive";
            string activatedWithWorkflowCss = _cbActivityTypeIsActivatedWithWorkflow.Checked ? " activated-with-workflow" : string.Empty;

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-widget workflow-activity" + inactiveCss + activatedWithWorkflowCss);

            writer.AddAttribute("data-key", _hfActivityTypeGuid.Value);
            writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ID + "_section");
            writer.RenderBeginTag("section");

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-heading clearfix clickable");
            writer.RenderBeginTag("header");

            // Hidden Field to track expansion
            _hfExpanded.RenderControl(writer);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-toggle pull-left");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute("class", "panel-title");
            writer.RenderBeginTag(HtmlTextWriterTag.H3);
            _lblActivityTypeName.Text = _tbActivityTypeName.Text;
            _lblActivityTypeName.RenderControl(writer);

            // H3 tag
            writer.RenderEndTag();
            _lblActivityTypeDescription.Text = _tbActivityTypeDescription.Text;
            _lblActivityTypeDescription.RenderControl(writer);

            // Name/Description div
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            if (_sbSecurity.EntityId != 0)
            {
                writer.WriteLine(string.Format("<span class=\"label label-default\">Id: {0}</span>", _sbSecurity.EntityId));
            }
            writer.WriteLine("<a class='btn btn-xs btn-link workflow-activity-reorder'><i class='fa fa-bars'></i></a>");
            writer.WriteLine(string.Format("<a class='btn btn-xs btn-link'><i class='workflow-activity-state fa {0}'></i></a>",
                                           Expanded ? "fa fa-chevron-up" : "fa fa-chevron-down"));

            if (IsDeleteEnabled)
            {
                _lbDeleteActivityType.Visible = true;
                _lbDeleteActivityType.RenderControl(writer);
            }
            else
            {
                _lbDeleteActivityType.Visible = false;
            }

            // Add/ChevronUpDown/Delete div
            writer.RenderEndTag();

            _lblInactive.Style[HtmlTextWriterStyle.Display] = _cbActivityTypeIsActive.Checked ? "none" : string.Empty;
            _lblInactive.RenderControl(writer);

            // header div
            writer.RenderEndTag();

            if (!Expanded)
            {
                // hide details if the activity and actions are valid
                writer.AddStyleAttribute("display", "none");
            }
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // activity edit fields
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _tbActivityTypeName.ValidationGroup = ValidationGroup;
            _tbActivityTypeName.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-2");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _cbActivityTypeIsActive.ValidationGroup = ValidationGroup;
            _cbActivityTypeIsActive.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-4");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            if (_sbSecurity.EntityId > 0)
            {
                _sbSecurity.Title = _tbActivityTypeName.Text;
                _sbSecurity.RenderControl(writer);
            }

            _cbActivityTypeIsActivatedWithWorkflow.ValidationGroup = ValidationGroup;
            _cbActivityTypeIsActivatedWithWorkflow.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            _tbActivityTypeDescription.ValidationGroup = ValidationGroup;
            _tbActivityTypeDescription.RenderControl(writer);

            _pwAttributes.RenderControl(writer);

            // actions
            writer.RenderBeginTag("fieldset");

            writer.RenderBeginTag("legend");
            writer.WriteLine("Actions");
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right");
            writer.RenderBeginTag(HtmlTextWriterTag.Span);
            _lbAddActionType.RenderControl(writer);
            writer.RenderEndTag();
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "workflow-action-list");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            foreach (WorkflowActionTypeEditor workflowActionTypeEditor in this.Controls.OfType <WorkflowActionTypeEditor>())
            {
                workflowActionTypeEditor.ValidationGroup = ValidationGroup;
                workflowActionTypeEditor.RenderControl(writer);
            }

            // workflow-action-list div
            writer.RenderEndTag();

            // actions fieldset
            writer.RenderEndTag();

            // widget-content div
            writer.RenderEndTag();

            // section tag
            writer.RenderEndTag();
        }
Esempio n. 2
0
        /// <summary>
        /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            if (CSSClass != string.Empty)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "note " + CSSClass);
            }
            else
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "note");
            }

            if (this.NoteId.HasValue)
            {
                writer.AddAttribute("rel", this.NoteId.Value.ToStringSafe());
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // Edit Mode HTML...
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-noteentry");
            if (NoteId.HasValue || !AddAlwaysVisible)
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none");
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            if (DisplayType == NoteDisplayType.Full && UsePersonIcon)
            {
                writer.Write(Person.GetPhotoImageTag(CreatedByPhotoId, CreatedByGender, 50, 50));
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "noteentry-control");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _ddlNoteType.RenderControl(writer);
            _tbNote.RenderControl(writer);
            writer.RenderEndTag();

            // The optional create date text box, but only for new notes...
            if (ShowCreateDateInput && !NoteId.HasValue)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "createDate clearfix");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _dtCreateDate.RenderControl(writer);
                writer.RenderEndTag();  // createDate div
            }

            if (DisplayType == NoteDisplayType.Full)
            {
                // Options
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "settings clearfix");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "options pull-left");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                if (ShowAlertCheckBox)
                {
                    _cbAlert.RenderControl(writer);
                }

                if (ShowPrivateCheckBox)
                {
                    _cbPrivate.RenderControl(writer);
                }

                writer.RenderEndTag();

                if (ShowSecurityButton && this.NoteId.HasValue)
                {
                    _sbSecurity.EntityId = this.NoteId.Value;
                    _sbSecurity.Title    = this.Label;
                    _sbSecurity.RenderControl(writer);
                }

                writer.RenderEndTag();  // settings div
            }

            writer.RenderEndTag();  // panel body

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-footer");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            _lbSaveNote.Text = "Save " + Label;
            _lbSaveNote.RenderControl(writer);

            if (NoteId.HasValue || !AddAlwaysVisible)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "edit-note-cancel btn btn-link btn-xs");
                writer.RenderBeginTag(HtmlTextWriterTag.A);
                writer.Write("Cancel");
                writer.RenderEndTag();
            }

            writer.RenderEndTag();  // panel-footer div

            writer.RenderEndTag();  // note-entry div

            if (NoteId.HasValue)
            {
                // View Mode HTML...
                writer.AddAttribute(HtmlTextWriterAttribute.Class, ArticleClass);
                writer.RenderBeginTag("article");

                if (DisplayType == NoteDisplayType.Full)
                {
                    if (UsePersonIcon)
                    {
                        writer.Write(Person.GetPhotoImageTag(CreatedByPhotoId, CreatedByGender, 50, 50));
                    }
                    else
                    {
                        writer.AddAttribute(HtmlTextWriterAttribute.Class, IconClass);
                        writer.RenderBeginTag(HtmlTextWriterTag.I);
                        writer.RenderEndTag();
                    }
                }

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "details");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                if (DisplayType == NoteDisplayType.Full)
                {
                    // Heading
                    writer.RenderBeginTag(HtmlTextWriterTag.H5);
                    string heading = Caption;
                    if (string.IsNullOrWhiteSpace(Caption))
                    {
                        heading = CreatedByName;
                    }
                    writer.Write(heading.EncodeHtml());
                    if (CreatedDateTime.HasValue)
                    {
                        writer.Write(" ");
                        writer.AddAttribute("class", "date");
                        writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.Write(CreatedDateTime.Value.ToRelativeDateString(6));
                        writer.RenderEndTag();
                    }
                    writer.RenderEndTag();

                    writer.Write(Text.EncodeHtml().ConvertCrLfToHtmlBr());
                }
                else
                {
                    writer.Write(Text.EncodeHtml().ConvertCrLfToHtmlBr());
                    writer.Write(" - ");
                    if (!string.IsNullOrWhiteSpace(CreatedByName))
                    {
                        writer.AddAttribute("class", "note-author");
                        writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.Write(CreatedByName);
                        writer.RenderEndTag();
                        writer.Write(" ");
                    }
                    if (CreatedDateTime.HasValue)
                    {
                        writer.AddAttribute("class", "note-created");
                        writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.Write(CreatedDateTime.Value.ToRelativeDateString(6));
                        writer.RenderEndTag();
                    }
                }

                writer.RenderEndTag();  // Details Div

                if (CanEdit)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "actions rollover-item");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);

                    _lbDeleteNote.RenderControl(writer);

                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "edit-note");
                    writer.AddAttribute(HtmlTextWriterAttribute.Href, "#");
                    writer.RenderBeginTag(HtmlTextWriterTag.A);
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "fa fa-pencil");
                    writer.RenderBeginTag(HtmlTextWriterTag.I);
                    writer.RenderEndTag();
                    writer.RenderEndTag();  // A

                    writer.RenderEndTag();  // actions
                }

                writer.RenderEndTag();  // article
            }

            writer.RenderEndTag();
        }
Esempio n. 3
0
        /// <summary>
        /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            if (CSSClass != string.Empty)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "note " + CSSClass);
            }
            else
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "note");
            }

            if (this.NoteId.HasValue)
            {
                writer.AddAttribute("rel", this.NoteId.Value.ToStringSafe());
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // Edit Mode HTML...
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-noteentry");
            if (NoteId.HasValue || !AddAlwaysVisible)
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none");
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            if (DisplayType == NoteDisplayType.Full && UsePersonIcon)
            {
                writer.Write(Person.GetPersonPhotoImageTag(CreatedByPersonId, CreatedByPhotoId, null, CreatedByGender, null, 50, 50));
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "noteentry-control");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _ddlNoteType.RenderControl(writer);
            _tbNote.RenderControl(writer);
            writer.RenderEndTag();

            // The optional create date text box, but only for new notes...
            if (ShowCreateDateInput && !NoteId.HasValue)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "createDate clearfix");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _dtCreateDate.RenderControl(writer);
                writer.RenderEndTag();  // createDate div
            }

            if (DisplayType == NoteDisplayType.Full)
            {
                // Options
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "settings clearfix");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "options pull-left");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                if (ShowAlertCheckBox)
                {
                    _cbAlert.RenderControl(writer);
                }

                if (ShowPrivateCheckBox)
                {
                    _cbPrivate.RenderControl(writer);
                }

                writer.RenderEndTag();

                if (ShowSecurityButton && this.NoteId.HasValue)
                {
                    _sbSecurity.EntityId = this.NoteId.Value;
                    _sbSecurity.Title    = this.Label;
                    _sbSecurity.RenderControl(writer);
                }

                writer.RenderEndTag();  // settings div
            }

            writer.RenderEndTag();  // panel body

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-footer");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            _lbSaveNote.Text = "Save " + Label;
            _lbSaveNote.RenderControl(writer);

            if (NoteId.HasValue || !AddAlwaysVisible)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "edit-note-cancel btn btn-link btn-xs");
                writer.RenderBeginTag(HtmlTextWriterTag.A);
                writer.Write("Cancel");
                writer.RenderEndTag();
            }

            writer.RenderEndTag();  // panel-footer div

            writer.RenderEndTag();  // note-entry div

            if (NoteId.HasValue)
            {
                // View Mode HTML...
                writer.AddAttribute(HtmlTextWriterAttribute.Class, ArticleClass);
                writer.RenderBeginTag("article");

                if (DisplayType == NoteDisplayType.Full)
                {
                    if (UsePersonIcon)
                    {
                        writer.Write(Person.GetPersonPhotoImageTag(CreatedByPersonId, CreatedByPhotoId, CreatedByAge, CreatedByGender, null, 50, 50));
                    }
                    else
                    {
                        writer.AddAttribute(HtmlTextWriterAttribute.Class, IconClass);
                        writer.RenderBeginTag(HtmlTextWriterTag.I);
                        writer.RenderEndTag();
                    }
                }

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "details");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                // first, encode the text to ensure html tags get encoded
                string renderedText = Text.EncodeHtml();

                // convert any http, etc text into clickable links (do this before applying Markdown)
                renderedText = renderedText.Linkify();

                // convert any markdown into HTML, and convert into crlf into <br />
                renderedText = renderedText.ConvertMarkdownToHtml(true);

                if (DisplayType == NoteDisplayType.Full)
                {
                    // Heading
                    writer.RenderBeginTag(HtmlTextWriterTag.H5);

                    if (DisplayNoteTypeHeading & this.NoteTypeId.HasValue)
                    {
                        var noteType = NoteTypeCache.Get(this.NoteTypeId.Value);
                        if (noteType != null)
                        {
                            writer.RenderBeginTag(HtmlTextWriterTag.Strong);
                            writer.Write(noteType.Name + " &nbsp; ");
                            writer.RenderEndTag();
                        }
                    }

                    string heading = Caption;
                    if (string.IsNullOrWhiteSpace(Caption))
                    {
                        heading = CreatedByName;
                    }
                    writer.Write(heading.EncodeHtml());
                    if (CreatedDateTime.HasValue)
                    {
                        writer.Write(" ");
                        writer.AddAttribute("class", "date");
                        writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.Write(CreatedDateTime.Value.ToRelativeDateString(6));
                        writer.RenderEndTag();
                    }
                    writer.RenderEndTag();

                    writer.Write(renderedText);
                }
                else
                {
                    writer.Write(renderedText);
                    writer.Write(" - ");
                    if (!string.IsNullOrWhiteSpace(CreatedByName))
                    {
                        writer.AddAttribute("class", "note-author");
                        writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.Write(CreatedByName);
                        writer.RenderEndTag();
                        writer.Write(" ");
                    }
                    if (CreatedDateTime.HasValue)
                    {
                        writer.AddAttribute("class", "note-created");
                        writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.Write(CreatedDateTime.Value.ToRelativeDateString(6));
                        writer.RenderEndTag();
                    }
                }

                writer.RenderEndTag();  // Details Div

                if (CanEdit)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "actions rollover-item");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);

                    _lbDeleteNote.RenderControl(writer);

                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "edit-note");
                    writer.AddAttribute(HtmlTextWriterAttribute.Href, "#");
                    writer.RenderBeginTag(HtmlTextWriterTag.A);
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "fa fa-pencil");
                    writer.RenderBeginTag(HtmlTextWriterTag.I);
                    writer.RenderEndTag();
                    writer.RenderEndTag();  // A

                    writer.RenderEndTag();  // actions
                }

                writer.RenderEndTag();  // article
            }

            writer.RenderEndTag();
        }
Esempio n. 4
0
        /// <summary>
        /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "note-editor");
            writer.AddAttribute("rel", this.NoteId.ToStringSafe());
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // Edit Mode HTML...
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-noteentry");
            writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            _tbNote.RenderControl(writer);

            // Options
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "settings clearfix");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "options pull-left");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            if (ShowAlertCheckBox)
            {
                _cbAlert.RenderControl(writer);
            }

            if (ShowPrivateCheckBox)
            {
                _cbPrivate.RenderControl(writer);
            }

            writer.RenderEndTag();

            if (ShowSecurityButton)
            {
                _sbSecurity.EntityId = this.NoteId;
                _sbSecurity.Title    = this.Label;
                _sbSecurity.RenderControl(writer);
            }

            writer.RenderEndTag();  // settings div
            writer.RenderEndTag();  // panel body

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-footer");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _lbSaveNote.RenderControl(writer);
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "edit-note-cancel btn btn-xs");
            writer.RenderBeginTag(HtmlTextWriterTag.A);
            writer.Write("Cancel");
            writer.RenderEndTag();
            writer.RenderEndTag();

            writer.RenderEndTag();  // note-entry div

            // View Mode HTML...
            writer.AddAttribute(HtmlTextWriterAttribute.Class, ArticleClass);
            writer.RenderBeginTag("article");

            writer.AddAttribute(HtmlTextWriterAttribute.Class, IconClass);
            writer.RenderBeginTag(HtmlTextWriterTag.I);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "details");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // Heading
            writer.RenderBeginTag(HtmlTextWriterTag.H5);
            writer.Write(Caption.EncodeHtmlThenConvertCrLfToHtmlBr());
            if (CreatedDateTime.HasValue)
            {
                writer.Write(" ");
                writer.AddAttribute("class", "date");
                writer.RenderBeginTag(HtmlTextWriterTag.Span);
                writer.Write(CreatedDateTime.Value.ToRelativeDateString(6));
                writer.RenderEndTag();
            }
            writer.RenderEndTag();

            writer.Write(Text.EncodeHtmlThenConvertCrLfToHtmlBr());

            writer.RenderEndTag();  // Details Div

            if (CanEdit)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "actions rollover-item");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                _lbDeleteNote.RenderControl(writer);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "edit-note");
                writer.AddAttribute(HtmlTextWriterAttribute.Href, "#");
                writer.RenderBeginTag(HtmlTextWriterTag.A);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "fa fa-pencil");
                writer.RenderBeginTag(HtmlTextWriterTag.I);
                writer.RenderEndTag();
                writer.RenderEndTag();  // A


                writer.RenderEndTag();  // actions
            }

            writer.RenderEndTag();  // article

            writer.RenderEndTag();
        }