Commit 115abdda authored by JC Brand's avatar JC Brand

muc-views: pass all model attributes to template

Makes it possible to show a validation message in a downstream
application.
parent dffe3d1a
...@@ -1474,12 +1474,12 @@ converse.plugins.add('converse-muc-views', { ...@@ -1474,12 +1474,12 @@ converse.plugins.add('converse-muc-views', {
__('Choose a nickname to enter') : __('Choose a nickname to enter') :
__('Please choose your nickname'); __('Please choose your nickname');
const html = tpl_chatroom_nickname_form({ const html = tpl_chatroom_nickname_form(Object.assign({
heading, heading,
'label_nickname': __('Nickname'), 'label_nickname': __('Nickname'),
'label_join': __('Enter groupchat'), 'label_join': __('Enter groupchat'),
'nickname': this.model.get('nickname') }, this.model.toJSON()));
});
if (_converse.muc_show_logs_before_join) { if (_converse.muc_show_logs_before_join) {
const container = this.el.querySelector('.muc-bottom-panel'); const container = this.el.querySelector('.muc-bottom-panel');
container.innerHTML = html; container.innerHTML = html;
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<form class="converse-form chatroom-form converse-centered-form"> <form class="converse-form chatroom-form converse-centered-form">
<fieldset class="form-group"> <fieldset class="form-group">
<label>{{{o.heading}}}</label> <label>{{{o.heading}}}</label>
<p class="validation-message">{{{o.validation_message}}}</p>
<input type="text" required="required" name="nick" value="{{{o.nickname}}}" <input type="text" required="required" name="nick" value="{{{o.nickname}}}"
class="form-control {{o.error_class}}" placeholder="{{{o.label_nickname}}}"/> class="form-control {{o.error_class}}" placeholder="{{{o.label_nickname}}}"/>
</fieldset> </fieldset>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment