Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
f8279790
Commit
f8279790
authored
Sep 18, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
converse-register: render the buttons as part of the template
instead of manually
parent
33cc7282
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
19 deletions
+15
-19
src/converse-register.js
src/converse-register.js
+8
-19
src/templates/registration_form.html
src/templates/registration_form.html
+7
-0
No files found.
src/converse-register.js
View file @
f8279790
...
...
@@ -500,34 +500,23 @@
'
__
'
:
_converse
.
__
,
'
domain
'
:
this
.
domain
,
'
title
'
:
this
.
title
,
'
instructions
'
:
this
.
instructions
'
instructions
'
:
this
.
instructions
,
'
registration_domain
'
:
_converse
.
registration_domain
});
const
buttons
=
form
.
querySelector
(
'
fieldset.buttons
'
);
if
(
this
.
form_type
===
'
xform
'
)
{
_
.
each
(
stanza
.
querySelectorAll
(
'
field
'
),
(
field
)
=>
{
form
.
insertAdjacentHTML
(
'
before
end
'
,
buttons
.
insertAdjacentHTML
(
'
before
begin
'
,
utils
.
xForm2webForm
(
field
,
stanza
,
this
.
domain
)
);
});
}
else
{
this
.
renderLegacyRegistrationForm
(
form
);
}
if
(
this
.
fields
)
{
form
.
insertAdjacentHTML
(
'
beforeend
'
,
`<input type="submit" class="pure-button button-primary" value="
${
__
(
'
Register
'
)}
"/>`
);
if
(
!
_converse
.
registration_domain
)
{
form
.
insertAdjacentHTML
(
'
beforeend
'
,
`<input type="button" class="pure-button button-cancel" value="
${
__
(
'
Choose a different provider
'
)}
"/>`
);
}
}
else
{
form
.
insertAdjacentHTML
(
'
beforeend
'
,
`<input type="button" class="pure-button button-cancel" value="
${
__
(
'
Return
'
)}
"/>`
);
if
(
!
this
.
fields
)
{
form
.
querySelector
(
'
.button-primary
'
).
classList
.
add
(
'
hidden
'
);
}
this
.
model
.
set
(
'
registration_form_rendered
'
,
true
);
this
.
showRegistrationForm
();
...
...
src/templates/registration_form.html
View file @
f8279790
...
...
@@ -2,3 +2,10 @@
<p
class=
"title"
>
{{{title}}}
</p>
<p
class=
"instructions"
>
{{{instructions}}}
</p>
<div
class=
"form-errors hidden"
></div>
<fieldset
class=
"buttons"
>
<input
type=
"submit"
class=
"pure-button button-primary"
value=
"{{{__('Register')}}}"
/>
{[ if (!registration_domain) { ]}
<input
type=
"button"
class=
"pure-button button-cancel"
value=
"{{{__('Choose a different provider')}}}"
/>
{[ } ]}
</fieldset>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment