Skip to content

LUT-29659: Use RichTextContentService to enable the use of Markdown Rich Text Editor #436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@
import fr.paris.lutece.plugins.genericattributes.business.Entry;
import fr.paris.lutece.plugins.genericattributes.service.entrytype.EntryTypeServiceManager;
import fr.paris.lutece.plugins.genericattributes.service.entrytype.IEntryTypeService;
import fr.paris.lutece.portal.service.editor.RichTextContentService;
import fr.paris.lutece.portal.service.editor.RichTextParsingException;
import fr.paris.lutece.portal.service.template.AppTemplateService;
import fr.paris.lutece.portal.service.util.AppLogService;

/**
* The default display service
Expand Down Expand Up @@ -78,9 +81,17 @@ public EntryTypeDefaultDisplayService( String strEntryServiceName )
*/
private Map<String, Object> setModel( Entry entry, Map<String, Object> model )
{
model.put( FormsConstants.QUESTION_ENTRY_MARKER, entry );

return model;
try
{
entry.setComment( RichTextContentService.getContent( entry.getComment( ) ) );
model.put( FormsConstants.QUESTION_ENTRY_MARKER, entry );
return model;
}
catch (RichTextParsingException e)
{
AppLogService.error(e.getMessage(), e);
return model;
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,5 @@
</@box>
</@columns>
</@row>
<#include "/admin/util/editor/editor.html" />
<@initEditor />
<@anonymPattern />

Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,4 @@
</@box>
</@columns>
</@row>
<#include "/admin/util/editor/editor.html" />
<@initEditor />
<@anonymPattern />
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,4 @@
});
})
</script>
<#include "/admin/util/editor/editor.html" />
<@initEditor />
<@anonymPattern />
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,4 @@
</@boxBody>
</@box>
</@columns>
</@row>

<#include "/admin/util/editor/editor.html" />
<@initEditor />

</@row>
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,5 @@
</@box>
</@columns>
</@row>

<#include "/admin/util/editor/editor.html" />
<@initEditor />

<@initEditor />
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,5 @@
</@box>
</@columns>
</@row>

<#include "/admin/util/editor/editor.html" />
<@initEditor />
<@anonymPattern />
<@toDayDate />
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@
</@box>
</@columns>
</@row>
<#include "/admin/util/editor/editor.html" />
<@initEditor />
<@anonymPattern />
<script>
<#noparse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@
</@box>
</@columns>
</@row>

<#include "/admin/util/editor/editor.html" />
<@initEditor />
<@anonymPattern />
<script>
$(function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,4 @@
});
})
</script>
<#include "/admin/util/editor/editor.html" />
<@initEditor />
<@anonymPattern />
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,4 @@
</@box>
</@columns>
</@row>

<#include "/admin/util/editor/editor.html" />
<@initEditor />
<@anonymPattern />

<@anonymPattern />
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@
</@boxBody>
</@box>
</@columns>
</@row>
<#include "/admin/util/editor/editor.html" />
<@initEditor />
</@row>
<script>
document.addEventListener('DOMContentLoaded', function () {
const form = document.getElementById('form-number');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,4 @@
</@boxBody>
</@box>
</@columns>
</@row>

<#include "/admin/util/editor/editor.html" />
<@initEditor />
</@row>
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,4 @@
</@boxBody>
</@box>
</@columns>
</@row>

<#include "/admin/util/editor/editor.html" />
<@initEditor />
</@row>
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,4 @@
</@boxBody>
</@box>
</@columns>
</@row>
<#include "/admin/util/editor/editor.html" />
<@initEditor />
</@row>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />
${breadcrumb_template}
<@row>
<@columns>
Expand Down Expand Up @@ -75,5 +74,4 @@
}
});
});
</script>
<@initEditor />
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,5 @@
</@box>
</@columns>
</@row>
<#include "/admin/util/editor/editor.html" />
<@confirmField />
<@anonymPattern />
<@initEditor />

<@anonymPattern />
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,4 @@
</@columns>
</@row>

<#include "/admin/util/editor/editor.html" />
<@anonymPattern />
<@initEditor />

<@anonymPattern />
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}
Expand Down Expand Up @@ -101,5 +100,4 @@
</@columns>
</@tform>
</@row>
<@initEditor />
<@anonymPattern />
<@anonymPattern />
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}
<@row>
Expand Down Expand Up @@ -95,5 +94,4 @@
${ocr_mapping_template!}
<!-- ---------------------------------------------------------------- -->
</@row>
<@initEditor />
<@anonymPattern />
<@anonymPattern />
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,4 @@
</@box>
</@columns>
</@row>
<#include "/admin/util/editor/editor.html" />
<@anonymPattern />
<@initEditor />
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}
<@row>
Expand Down Expand Up @@ -116,5 +115,4 @@
}
});
})
</script>
<@initEditor />
</script>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}
<@row>
Expand Down Expand Up @@ -148,5 +147,4 @@
</#if>
</@box>
</@columns>
</@row>
<@initEditor />
</@row>
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}
<@row>
<@columns>
Expand Down Expand Up @@ -99,5 +97,4 @@
</@columns>
</@row>
<@anonymPattern />
<@initEditor />
<@toDayDate />
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}
<@row>
Expand Down Expand Up @@ -84,7 +83,6 @@
</@box>
</@columns>
</@row>
<@initEditor />
<@anonymPattern />
<script>
$( function(){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}
<@row>
Expand Down Expand Up @@ -78,7 +77,6 @@
</@box>
</@columns>
</@row>
<@initEditor />
<@anonymPattern />
<script>
$(function() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}
<@row>
Expand Down Expand Up @@ -128,5 +127,4 @@
}
});
})
</script>
<@initEditor />
</script>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}

Expand Down Expand Up @@ -77,7 +76,6 @@
</@box>
</@columns>
</@row>
<@initEditor />
<script type="text/javascript">
function displayHideIteration( )
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}
<@row>
Expand Down Expand Up @@ -84,5 +83,4 @@
</@box>
</@columns>
</@row>
<@initEditor />
<@anonymPattern />
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}

Expand Down Expand Up @@ -115,7 +114,6 @@
</@box>
</@columns>
</@row>
<@initEditor />
<@anonymPattern />
<script>
function setStep(c,i){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}
<@row>
Expand Down Expand Up @@ -146,5 +145,4 @@
</#if>
</@box>
</@columns>
</@row>
<@initEditor />
</@row>
Loading