Example #1
0
        public string CoachNotesHtml(HtmlConNoteControl htmlConNoteCtrl,
                                     StoryStageLogic theStoryStage, TeamMemberData LoggedOnMember, bool bViewHidden)
        {
            string strHtml = null;

            strHtml += GetHeaderRow(CstrZerothLineName, 0, FirstVerse.IsVisible,
                                    FirstVerse.CoachNotes, LoggedOnMember);

            strHtml += FirstVerse.CoachNotes.Html(htmlConNoteCtrl, theStoryStage,
                                                  LoggedOnMember, bViewHidden, FirstVerse.IsVisible, 0);

            for (int i = 1; i <= Count; i++)
            {
                VerseData aVerseData = this[i - 1];
                if (aVerseData.IsVisible || bViewHidden)
                {
                    strHtml += GetHeaderRow("Ln: " + i, i, aVerseData.IsVisible,
                                            aVerseData.CoachNotes, LoggedOnMember);

                    strHtml += aVerseData.CoachNotes.Html(htmlConNoteCtrl, theStoryStage,
                                                          LoggedOnMember, bViewHidden, aVerseData.IsVisible, i);
                }
            }

            return(String.Format(Properties.Resources.HTML_Table, strHtml));
        }
        public string Html(HtmlConNoteControl htmlConNoteCtrl,
                           StoryStageLogic theStoryStage, TeamMemberData LoggedOnMember,
                           bool bViewHidden, bool bVerseVisible, int nVerseIndex)
        {
            string strHtml = null;

            for (int i = 0; i < Count; i++)
            {
                ConsultNoteDataConverter aCNDC = this[i];
                if (aCNDC.Visible || bViewHidden)
                {
                    strHtml += aCNDC.Html(htmlConNoteCtrl, theStoryStage, LoggedOnMember, nVerseIndex, i);
                }
            }

            // color changes if hidden
            string strColor;

            if (bVerseVisible)
            {
                strColor = "#FFFFFF";
            }
            else
            {
                strColor = "#F0E68C";
            }

            return(String.Format(Properties.Resources.HTML_TableRowColor, strColor,
                                 String.Format(Properties.Resources.HTML_TableCellWithSpan, 2,
                                               String.Format(Properties.Resources.HTML_TableNoBorder, strHtml))));
        }
Example #3
0
        public string CoachNotesHtml(HtmlConNoteControl htmlConNoteCtrl,
                                     StoryStageLogic theStoryStage, ProjectSettings projSettings,
                                     TeamMemberData LoggedOnMember,
                                     bool bViewHidden)
        {
            string strHtml = Verses.CoachNotesHtml(htmlConNoteCtrl, theStoryStage,
                                                   LoggedOnMember, bViewHidden);

            return(String.Format(Properties.Resources.HTML_Header,
                                 StylePrefix(projSettings),
                                 Properties.Resources.HTML_DOM_Prefix,
                                 strHtml));
        }
        public string Html(HtmlConNoteControl htmlConNoteCtrl,
                           StoryStageLogic theStoryStage,
                           TeamMemberData LoggedOnMember,
                           int nVerseIndex, int nConversationIndex)
        {
            System.Diagnostics.Debug.Assert(Count > 0);
            if (Count == 0)
            {
                return(null);
            }

            // r1: "Round: n"; "button"
            // r2-n: "Label:"; "value in textbox"
            string strRow = String.Format(Properties.Resources.HTML_TableCellWithSpanAndWidth, 100, 2,
                                          String.Format("{0}{1}", CstrRoundLabel, RoundNum));

            // only the initiator of a conversation gets the buttons to delete, hide or
            //  end conversation.
            CommInstance aCInitiator = this[0];

            if (CanDoConversationButtons(LoggedOnMember.MemberType, aCInitiator.Initiator))
            {
                strRow += String.Format(Properties.Resources.HTML_TableCell,
                                        String.Format(Properties.Resources.HTML_Button,
                                                      ButtonId(nVerseIndex, nConversationIndex, CnBtnIndexDelete),
                                                      "return window.external.OnClickDelete(this.id);",
                                                      "Delete"));

                strRow += String.Format(Properties.Resources.HTML_TableCell,
                                        String.Format(Properties.Resources.HTML_Button,
                                                      ButtonId(nVerseIndex, nConversationIndex, CnBtnIndexHide),
                                                      "return window.external.OnClickHide(this.id);",
                                                      (Visible) ? CstrButtonLabelHide : CstrButtonLabelUnhide));

                strRow += String.Format(Properties.Resources.HTML_TableCell,
                                        String.Format(Properties.Resources.HTML_Button,
                                                      ButtonId(nVerseIndex, nConversationIndex,
                                                               CnBtnIndexEndConversation),
                                                      "return window.external.OnClickEndConversation(this.id);",
                                                      (IsFinished)
                                                                                                                  ? CstrButtonLabelConversationReopen
                                                                                                                  : CstrButtonLabelConversationEnd));
            }

            string strHtml = String.Format(Properties.Resources.HTML_TableRowId,
                                           ButtonRowId(nVerseIndex, nConversationIndex),
                                           strRow);

            string strHtmlTable = null;

            for (int i = 0; i < Count; i++)
            {
                CommInstance aCI = this[i];

                strRow = null;
                Color clrRow;
                if (IsFromMentor(aCI))
                {
                    strRow += String.Format(Properties.Resources.HTML_TableCell,
                                            MentorLabel);
                    clrRow = CommentColor;
                }
                else
                {
                    strRow += String.Format(Properties.Resources.HTML_TableCell,
                                            MenteeLabel);
                    clrRow = ResponseColor;
                }

                string strColor = VerseData.HtmlColor(clrRow);

                // only the last one is editable and then only if the right person is
                //  logged in
                string strHtmlElementId;
                if (IsEditable(theStoryStage, i, LoggedOnMember, aCI))
                {
                    strHtmlElementId = TextareaId(nVerseIndex, nConversationIndex);
                    strRow          += String.Format(Properties.Resources.HTML_TableCellForTextArea, "#FF0000",
                                                     String.Format(Properties.Resources.HTML_TextareaWithRefDrop,
                                                                   strHtmlElementId,
                                                                   StoryData.CstrLangInternationalBtStyleClassName,
                                                                   aCI));

                    strHtmlTable += String.Format(Properties.Resources.HTML_TableRowIdColor,
                                                  TextareaRowId(nVerseIndex, nConversationIndex),
                                                  strColor,
                                                  strRow);
                }
                else
                {
                    strHtmlElementId = TextParagraphId(nVerseIndex, nConversationIndex, i);
                    string strHyperlinkedText = aCI.ToString().Replace("\r\n", "<br />");                       // regexParagraph.Replace(aCI.ToString(), ParagraphFound);
                    strHyperlinkedText = regexBibRef.Replace(strHyperlinkedText, BibleReferenceFound);
                    strHyperlinkedText = regexLineRef.Replace(strHyperlinkedText, LineReferenceFound);
                    strHyperlinkedText = regexItalics.Replace(strHyperlinkedText, EmphasizedTextFound);
                    strHyperlinkedText = regexHttpRef.Replace(strHyperlinkedText, HttpReferenceFound);

                    strRow += String.Format(Properties.Resources.HTML_TableCellWidth, 100,
                                            String.Format(Properties.Resources.HTML_ParagraphText,
                                                          strHtmlElementId,
                                                          StoryData.CstrLangInternationalBtStyleClassName,
                                                          strHyperlinkedText));

                    strHtmlTable += String.Format(Properties.Resources.HTML_TableRowIdColor,
                                                  TextareaReadonlyRowId(nVerseIndex, nConversationIndex, i),
                                                  strColor,
                                                  strRow);
                }

                // keep track of the element id so we can use it during 'Search/Replace' operations
                aCI.HtmlElementId   = strHtmlElementId;
                aCI.HtmlConNoteCtrl = htmlConNoteCtrl;
            }

            string strEmbeddedTable = String.Format(Properties.Resources.HTML_Table,
                                                    strHtmlTable);

            strHtml += String.Format(Properties.Resources.HTML_TableRowIdColor,
                                     ConversationTableRowId(nVerseIndex, nConversationIndex),
                                     "#CCFFAA",
                                     String.Format(Properties.Resources.HTML_TableCellWithSpan, 5,
                                                   strEmbeddedTable));

            return(strHtml);
        }