Added room_owner and welcome message thingy(server-side)

Took 24 minutes
This commit is contained in:
Tobias Hopp 2020-10-04 17:45:24 +02:00
parent f48ed79fd9
commit 78f386d563
4 changed files with 32 additions and 11 deletions

17
.idea/workspace.xml generated
View File

@ -21,6 +21,7 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="fc13552d-b118-4828-b78f-fc8714e0cfdc" name="Default Changelist" comment="Final COMMIT!!!"> <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$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/controller/FaqController.class.inc.php" beforeDir="false" afterPath="$PROJECT_DIR$/controller/FaqController.class.inc.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/templates/faq.tmpl.html" beforeDir="false" afterPath="$PROJECT_DIR$/templates/faq.tmpl.html" afterDir="false" /> <change beforePath="$PROJECT_DIR$/templates/faq.tmpl.html" beforeDir="false" afterPath="$PROJECT_DIR$/templates/faq.tmpl.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/vendor/js/faq.js" beforeDir="false" afterPath="$PROJECT_DIR$/vendor/js/faq.js" afterDir="false" /> <change beforePath="$PROJECT_DIR$/vendor/js/faq.js" beforeDir="false" afterPath="$PROJECT_DIR$/vendor/js/faq.js" afterDir="false" />
</list> </list>
@ -33,7 +34,7 @@
<execution /> <execution />
</component> </component>
<component name="DarkyenusTimeTracker"> <component name="DarkyenusTimeTracker">
<option name="totalTimeSeconds" value="78719" /> <option name="totalTimeSeconds" value="80313" />
<option name="gitIntegration" value="true" /> <option name="gitIntegration" value="true" />
<option name="naggedAbout" value="1" /> <option name="naggedAbout" value="1" />
</component> </component>
@ -79,7 +80,7 @@
<updated>1601618466935</updated> <updated>1601618466935</updated>
<workItem from="1601618467981" duration="36776000" /> <workItem from="1601618467981" duration="36776000" />
<workItem from="1601809534320" duration="1558000" /> <workItem from="1601809534320" duration="1558000" />
<workItem from="1601811106543" duration="5297000" /> <workItem from="1601811106543" duration="7559000" />
</task> </task>
<task id="LOCAL-00001" summary="Initial commit"> <task id="LOCAL-00001" summary="Initial commit">
<created>1601618764031</created> <created>1601618764031</created>
@ -193,7 +194,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1601818395954</updated> <updated>1601818395954</updated>
</task> </task>
<option name="localTasksCounter" value="17" /> <task id="LOCAL-00017" summary="Added room_owner and welcome message thingy(client-side)">
<created>1601824311591</created>
<option name="number" value="00017" />
<option name="presentableId" value="LOCAL-00017" />
<option name="project" value="LOCAL" />
<updated>1601824311591</updated>
</task>
<option name="localTasksCounter" value="18" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@ -226,7 +234,8 @@
<MESSAGE value="Done issue #5 and #3" /> <MESSAGE value="Done issue #5 and #3" />
<MESSAGE value="Fix issue #2" /> <MESSAGE value="Fix issue #2" />
<MESSAGE value="Fix issue #4" /> <MESSAGE value="Fix issue #4" />
<option name="LAST_COMMIT_MESSAGE" value="Fix issue #4" /> <MESSAGE value="Added room_owner and welcome message thingy(client-side)" />
<option name="LAST_COMMIT_MESSAGE" value="Added room_owner and welcome message thingy(client-side)" />
</component> </component>
<component name="WindowStateProjectService"> <component name="WindowStateProjectService">
<state x="728" y="326" width="800" height="683" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1601632929047"> <state x="728" y="326" width="800" height="683" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1601632929047">

View File

@ -115,5 +115,20 @@ class FaqController extends DefaultController
return $view->getResponse(); return $view->getResponse();
} }
public function getWelcomeInfoAction()
{
$view = new Apitemplate();
$FAQModel = new FaqModel();
$room = $FAQModel->getRoom();
$room_owner = $FAQModel->checkUserIsRoomOwner( $room );
$sid = session_id();
$view->setResponse( array( 'is_owner' => $room_owner, 'sid' => $sid ) );
$view->setSuccess( true );
return $view->getResponse();
}
} }

View File

@ -127,14 +127,11 @@
</div> </div>
</div> </div>
<div class="modal fade" id="welcomeModal" tabindex="-1" role="dialog" aria-labelledby="welcomeModalLabel" aria-hidden="true"> <div class="modal fade" id="welcomeModal" tabindex="-1" role="dialog" data-backdrop="static" data-focus="true" data-keyboard="true" aria-labelledby="welcomeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document"> <div class="modal-dialog modal-lg" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="welcomeModalLabel">Welcome - Readme first</h5> <h5 class="modal-title" id="welcomeModalLabel">Welcome - ReadMe first</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<span>In the following page you can ask unlimited questions.<br>Your question should be contain 10 up to 500 characters.<br>The owner of this room then can answer your question.</span> <span>In the following page you can ask unlimited questions.<br>Your question should be contain 10 up to 500 characters.<br>The owner of this room then can answer your question.</span>
@ -149,7 +146,7 @@
</div> </div>
<div class="modal fade" id="errorModal" tabindex="-1" role="dialog" aria-labelledby="errorModalLabel" aria-hidden="true"> <div class="modal fade" id="errorModal" tabindex="-1" role="dialog" aria-labelledby="errorModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document"> <div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title text-danger" id="errorModalLabel">Error</h5> <h5 class="modal-title text-danger" id="errorModalLabel">Error</h5>

2
vendor/js/faq.js vendored
View File

@ -284,4 +284,4 @@ function welcomeMessage()
setInterval( function() { getQuestions(); }, 1500 ); setInterval( function() { getQuestions(); }, 1500 );
welcomeMessage(); setTimeout( function() { welcomeMessage(); getQuestions(); }, 500 );