This is an automated email from the ASF dual-hosted git repository.

solomax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openmeetings.git


The following commit(s) were added to refs/heads/master by this push:
     new ac950ca  [OPENMEETINGS-2456] opened poll results are dynamically 
updated
ac950ca is described below

commit ac950cabc414d242a07618b9fc3753053240c510
Author: Maxim Solodovnik <solomax...@gmail.com>
AuthorDate: Tue Sep 29 21:13:25 2020 +0700

    [OPENMEETINGS-2456] opened poll results are dynamically updated
---
 .../openmeetings/web/room/menu/PollsSubMenu.java   |  4 +-
 .../web/room/poll/CreatePollDialog.html            | 38 +++++++++---------
 .../web/room/poll/PollResultsDialog.html           | 42 ++++++++++----------
 .../web/room/poll/PollResultsDialog.java           | 17 +++-----
 .../openmeetings/web/room/poll/VoteDialog.html     | 46 ++++++++++++----------
 openmeetings-web/src/main/webapp/css/raw-room.css  |  3 ++
 6 files changed, 75 insertions(+), 75 deletions(-)

diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/menu/PollsSubMenu.java
 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/menu/PollsSubMenu.java
index f3b7af6..7843f55 100644
--- 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/menu/PollsSubMenu.java
+++ 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/menu/PollsSubMenu.java
@@ -139,7 +139,7 @@ public class PollsSubMenu implements Serializable {
 
                        @Override
                        public void onClick(AjaxRequestTarget target) {
-                               pollResults.updateModel(target, 
room.getClient().hasRight(Room.Right.MODERATOR));
+                               pollResults.updateModel(target, true, 
room.getClient().hasRight(Room.Right.MODERATOR));
                                pollResults.show(target);
                        }
                };
@@ -178,7 +178,7 @@ public class PollsSubMenu implements Serializable {
                        vote.show(handler);
                }
                if (pollResults.isOpened()) {
-                       pollResults.updateModel(handler, 
room.getClient().hasRight(Room.Right.MODERATOR));
+                       pollResults.updateModel(handler, false, 
room.getClient().hasRight(Room.Right.MODERATOR));
                }
        }
 
diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/poll/CreatePollDialog.html
 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/poll/CreatePollDialog.html
index b382aeb..1885736 100644
--- 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/poll/CreatePollDialog.html
+++ 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/poll/CreatePollDialog.html
@@ -22,26 +22,24 @@
 <html xmlns:wicket="http://wicket.apache.org";>
 <wicket:extend>
        <form wicket:id="form">
-               <table>
-                       <tr>
-                               <th colspan="2"><wicket:message key="19" /></th>
-                       </tr>
-                       <tr>
-                               <td><label wicket:for="name"><wicket:message 
key="1410" /></label></td>
-                               <td><input type="text" wicket:id="name" 
class="input"/></td>
-                       </tr>
-                       <tr>
-                               <td><label 
wicket:for="question"><wicket:message key="20" /></label></td>
-                               <td><textarea 
wicket:id="question"></textarea></td>
-                       </tr>
-                       <tr>
-                               <td><label wicket:for="type"><wicket:message 
key="21" /></label></td>
-                               <td><select wicket:id="type"/></td>
-                       </tr>
-                       <tr>
-                               <td colspan="2"><wicket:message key="23" /></td>
-                       </tr>
-               </table>
+               <div class="row form-group">
+                       <div class="col-11"><wicket:message key="19"/></div>
+               </div>
+               <div class="row form-group">
+                       <label wicket:for="name" class="col-4"><wicket:message 
key="1410"/></label>
+                       <input type="text" wicket:id="name" class="col-7"/>
+               </div>
+               <div class="row form-group">
+                       <label wicket:for="question" 
class="col-4"><wicket:message key="20"/></label>
+                       <textarea wicket:id="question" class="col-7"></textarea>
+               </div>
+               <div class="row form-group">
+                       <label wicket:for="type" class="col-4"><wicket:message 
key="21" /></label>
+                       <select wicket:id="type" class="custom-select col-7"/>
+               </div>
+               <div class="row">
+                       <div class="col-11"><wicket:message key="23" /></div>
+               </div>
                <div wicket:id="feedback"></div>
        </form>
 </wicket:extend>
diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/poll/PollResultsDialog.html
 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/poll/PollResultsDialog.html
index ed22811..7aef2b6 100644
--- 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/poll/PollResultsDialog.html
+++ 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/poll/PollResultsDialog.html
@@ -22,30 +22,28 @@
 <html xmlns:wicket="http://wicket.apache.org";>
 <wicket:extend>
        <form wicket:id="selForm">
-               <table class="w-100">
-                       <tr>
-                               <td><wicket:message key="1412"/></td>
-                               <td><select class="form-control" 
wicket:id="polls"></select></td>
-                       </tr>
-               </table>
+               <div class="row">
+                       <div class="col-4"><wicket:message key="1412"/></div>
+                       <select class="custom-select col-7" 
wicket:id="polls"></select>
+               </div>
        </form>
        <form wicket:id="dispForm">
-               <table class="w-100">
-                       <tr>
-                               <td colspan="2"><span 
wicket:id="name"></span>&nbsp;<wicket:message key="36"/></td>
-                       </tr>
-                       <tr>
-                               <td colspan="2"><span 
wicket:id="question"></span></td>
-                       </tr>
-                       <tr>
-                               <td><wicket:message key="39"/>&nbsp;(<span 
wicket:id="count"></span>)</td>
-                               <td><select class="form-control" 
wicket:id="chartType"></select></td>
-                       </tr>
-                       <tr>
-                               <td><wicket:message key="40"/></td>
-                               <td><div wicket:id="chart"></div></td>
-                       </tr>
-               </table>
+               <div class="row">
+                       <div class="col-11">
+                               <span 
wicket:id="name"></span>&nbsp;<wicket:message key="36"/>
+                       </div>
+               </div>
+               <div class="row">
+                       <div class="col-11"><span 
wicket:id="question"></span></div>
+               </div>
+               <div class="row">
+                       <div class="col-4"><wicket:message 
key="39"/>&nbsp;(<span wicket:id="count"></span>)</div>
+                       <select class="custom-select col-7" 
wicket:id="chartType"></select>
+               </div>
        </form>
+       <div class="row">
+               <div class="col-4"><wicket:message key="40"/></div>
+               <div class="col-7" wicket:id="chart" id="room-poll-chart"></div>
+       </div>
 </wicket:extend>
 </html>
diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/poll/PollResultsDialog.java
 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/poll/PollResultsDialog.java
index 7074c5e..c6ef92c 100644
--- 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/poll/PollResultsDialog.java
+++ 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/poll/PollResultsDialog.java
@@ -155,27 +155,22 @@ public class PollResultsDialog extends Modal<RoomPoll> {
                });
                
clone.setOutputMarkupId(true).setOutputMarkupPlaceholderTag(true);
                addButton(OmModalCloseButton.of());
+               add(chartDiv.setOutputMarkupId(true));
                super.onInitialize();
        }
 
-       public void updateModel(IPartialPageRequestHandler target, boolean 
moderator) {
+       public void updateModel(IPartialPageRequestHandler target, boolean 
onOpen, boolean moderator) {
                selForm.updateModel(target);
                this.moderator = moderator;
                RoomPoll p = selForm.select.getModelObject();
-               dispForm.updateModel(p, false, target);
-               StringBuilder builder = new StringBuilder();
-               
builder.append("$('#").append(PollResultsDialog.this.getMarkupId()).append("').on('dialogopen',
 function( event, ui ) {");
-               builder.append(getScript(barChart(p), true));
-               builder.append("});");
-
-               target.appendJavaScript(builder.toString());
+               dispForm.updateModel(p, !onOpen, target);
        }
 
        private StringBuilder getScript(Chart<?> chart, boolean onShow) {
                StringBuilder sb = new StringBuilder()
                                
.append("$('#").append(chartDiv.getMarkupId()).append("').html(''); ");
                if (onShow) {
-                       
sb.append("$('#").append(getMarkupId()).append("').on('shown.bs.modal', 
function (e) {\n");
+                       
sb.append("$('#").append(getMarkupId()).append("').off().on('shown.bs.modal', 
function (e) {\n");
                }
                
sb.append("$.jqplot('").append(chartDiv.getMarkupId()).append("', ")
                                .append(chart.getChartData().toJsonString())
@@ -219,7 +214,7 @@ public class PollResultsDialog extends Modal<RoomPoll> {
        public Modal<RoomPoll> show(IPartialPageRequestHandler handler) {
                opened = true;
                super.show(handler);
-               dispForm.redraw(handler, true);
+               
handler.appendJavaScript(getScript(barChart(selForm.select.getModelObject()), 
true));
                return this;
        }
 
@@ -290,6 +285,7 @@ public class PollResultsDialog extends Modal<RoomPoll> {
 
                PollSelectForm(String id) {
                        super(id);
+                       setOutputMarkupId(true);
                }
 
                @Override
@@ -349,7 +345,6 @@ public class PollResultsDialog extends Modal<RoomPoll> {
 
                @Override
                protected void onInitialize() {
-                       add(chartDiv.setOutputMarkupId(true));
                        chartSimple = getString("1414");
                        chartPie = getString("1415");
                        add(name, question, count);
diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/poll/VoteDialog.html
 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/poll/VoteDialog.html
index 5c294b1..11d2463 100644
--- 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/poll/VoteDialog.html
+++ 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/poll/VoteDialog.html
@@ -22,28 +22,34 @@
 <html xmlns:wicket="http://wicket.apache.org";>
 <wicket:extend>
        <form wicket:id="form">
-               <table>
-                       <tr>
-                               <td colspan="2"><span 
wicket:id="user"></span>&nbsp;<wicket:message key="36" /></td>
-                       </tr>
-                       <tr>
-                               <td colspan="2"><span 
wicket:id="roomPoll.question"></span></td>
-                       </tr>
-                       <tr>
-                               <td><wicket:message key="33" /></td>
-                               <td>
-                                       <div wicket:id="typeBool">
-                                               <div wicket:id="answer">
-                                                       <input type="radio" 
wicket:id="true"/><label wicket:for="true"><wicket:message key="34" 
/></label><br/>
-                                                       <input type="radio" 
wicket:id="false"/><label wicket:for="false"><wicket:message key="35" /></label>
+               <div class="row form-group">
+                       <div class="col-11">
+                               <span 
wicket:id="user"></span>&nbsp;<wicket:message key="36"/>
+                       </div>
+               </div>
+               <div class="row form-group">
+                       <div class="col-11"><span 
wicket:id="roomPoll.question"></span></div>
+               </div>
+               <div class="row">
+                       <div class="col-4"><wicket:message key="33" /></div>
+                       <div class="col-7">
+                               <div wicket:id="typeBool">
+                                       <div wicket:id="answer">
+                                               <div class="custom-control 
custom-radio">
+                                                       <input type="radio" 
wicket:id="true" class="custom-control-input"/>
+                                                       <label 
wicket:for="true" class="custom-control-label"><wicket:message key="34" 
/></label>
+                                               </div>
+                                               <div class="custom-control 
custom-radio">
+                                                       <input type="radio" 
wicket:id="false" class="custom-control-input"/>
+                                                       <label 
wicket:for="false" class="custom-control-label"><wicket:message key="35" 
/></label>
                                                </div>
                                        </div>
-                                       <div wicket:id="typeInt">
-                                               <select 
wicket:id="pointList"></select>
-                                       </div>
-                               </td>
-                       </tr>
-               </table>
+                               </div>
+                               <div wicket:id="typeInt">
+                                       <select class="custom-select" 
wicket:id="pointList"></select>
+                               </div>
+                       </div>
+               </div>
                <div wicket:id="feedback"></div>
        </form>
 </wicket:extend>
diff --git a/openmeetings-web/src/main/webapp/css/raw-room.css 
b/openmeetings-web/src/main/webapp/css/raw-room.css
index 24fd529..2204572 100644
--- a/openmeetings-web/src/main/webapp/css/raw-room.css
+++ b/openmeetings-web/src/main/webapp/css/raw-room.css
@@ -663,6 +663,9 @@ html[dir="rtl"] .room-block .sb-wb .sidebar {
 .main.room.INTERVIEW .wb-block .wb-area .rec-btn 
.ui-button-icon.ui-icon.record {
        border-radius: 15px;
 }
+#room-poll-chart {
+       height: 300px;
+}
 #quick-vote {
        position: absolute;
        right: 40px;

Reply via email to