Done issue #5 and #3

Took 9 minutes
This commit is contained in:
Tobias Hopp 2020-10-04 13:24:24 +02:00
parent f3cc31e9b6
commit ab03d3a263
2 changed files with 29 additions and 9 deletions

23
.idea/workspace.xml generated
View File

@ -21,8 +21,7 @@
<component name="ChangeListManager">
<list default="true" id="fc13552d-b118-4828-b78f-fc8714e0cfdc" name="Default Changelist" comment="Final COMMIT!!!">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config.inc.php" beforeDir="false" afterPath="$PROJECT_DIR$/config.inc.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/model/FaqModel.class.inc.php" beforeDir="false" afterPath="$PROJECT_DIR$/model/FaqModel.class.inc.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/vendor/js/faq.js" beforeDir="false" afterPath="$PROJECT_DIR$/vendor/js/faq.js" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -33,7 +32,7 @@
<execution />
</component>
<component name="DarkyenusTimeTracker">
<option name="totalTimeSeconds" value="73466" />
<option name="totalTimeSeconds" value="73933" />
<option name="gitIntegration" value="true" />
<option name="naggedAbout" value="1" />
</component>
@ -78,7 +77,7 @@
<option name="presentableId" value="Default" />
<updated>1601618466935</updated>
<workItem from="1601618467981" duration="36776000" />
<workItem from="1601809534320" duration="505000" />
<workItem from="1601809534320" duration="1018000" />
</task>
<task id="LOCAL-00001" summary="Initial commit">
<created>1601618764031</created>
@ -164,7 +163,14 @@
<option name="project" value="LOCAL" />
<updated>1601751093352</updated>
</task>
<option name="localTasksCounter" value="13" />
<task id="LOCAL-00013" summary="Fix issue #1">
<created>1601810048772</created>
<option name="number" value="00013" />
<option name="presentableId" value="LOCAL-00013" />
<option name="project" value="LOCAL" />
<updated>1601810048772</updated>
</task>
<option name="localTasksCounter" value="14" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@ -193,7 +199,8 @@
<MESSAGE value="Should be the final commit" />
<MESSAGE value="&#10;Updating database-conf" />
<MESSAGE value="Final COMMIT!!!" />
<option name="LAST_COMMIT_MESSAGE" value="Final COMMIT!!!" />
<MESSAGE value="Fix issue #1" />
<option name="LAST_COMMIT_MESSAGE" value="Fix issue #1" />
</component>
<component name="WindowStateProjectService">
<state x="728" y="326" width="800" height="683" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1601632929047">
@ -232,10 +239,10 @@
<screen x="0" y="34" width="1920" height="1046" />
</state>
<state x="441" y="192" width="1037" height="736" key="SettingsEditor/0.34.1920.1046@0.34.1920.1046" timestamp="1601632853044" />
<state x="555" y="292" width="800" height="535" key="Vcs.Push.Dialog.v2" timestamp="1601751094619">
<state x="555" y="292" width="800" height="535" key="Vcs.Push.Dialog.v2" timestamp="1601810051854">
<screen x="0" y="34" width="1920" height="1046" />
</state>
<state x="555" y="292" width="800" height="535" key="Vcs.Push.Dialog.v2/0.34.1920.1046@0.34.1920.1046" timestamp="1601751094619" />
<state x="555" y="292" width="800" height="535" key="Vcs.Push.Dialog.v2/0.34.1920.1046@0.34.1920.1046" timestamp="1601810051854" />
<state x="809" y="122" width="639" height="876" key="com.intellij.database.view.ui.AbstractDbRefactoringDialog" timestamp="1601632983240">
<screen x="0" y="34" width="1920" height="1046" />
</state>

15
vendor/js/faq.js vendored
View File

@ -100,9 +100,18 @@ function openReadMoreModal( id )
readMoreModalTitle.html( 'Question from: Anonymous' );
request( 'getQuestion', {"question_id":id}, function( result )
{
let _answer = '';
if( result.data.answer === null || result.data.answer.length < 5 )
{
_answer = 'So far there is no answer to this question.';
}
else
{
_answer = result.data.answer;
}
readMoreModalTitle.html( 'Question from: ' + result.data.created_by );
readMoreModalText.html( '<strong>Question</strong><br>' + result.data.question +
'<hr><strong>Answer</strong><br>' + result.data.answer
'<hr><strong>Answer</strong><br>' + _answer
);
}, function() {
readMoreModalText.html( 'An error occurred, please try again later!' );
@ -120,6 +129,10 @@ function openAnswerModal( id )
request( 'getQuestion', {"question_id":id}, function( result )
{
readMoreModalTitle.html( 'Answer ' + result.data.created_by + " question" );
if( result.data.answer !== null && result.data.answer.length > 5 )
{
answerText.val( result.data.answer );
}
answer_id = result.data.id;
}, function() {
answerErrorMsg.html( 'An error occurred, please try again!' );