This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
/
contact_admin_modal.xhtml
74 lines (64 loc) · 2.7 KB
/
contact_admin_modal.xhtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<div xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:s="http://jboss.org/schema/seam/taglib"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j"
class="modal" id="contactAdminDialog" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<script>
$(document).ready(function() {
jQuery('#' + jqSelector('#{rich:clientId('contact-admin-subject')}')).
val('#{msgs['jsf.message.admin.inquiry.subject']}');
});
function cancelContactAdmin() {
jQuery('#' + jqSelector('#{rich:clientId('contact-admin-message')}')).val('');
jQuery(getContactAdminForm()).find('#send-button').removeClass('is-active');
return false;
}
function getContactAdminForm() {
return jQuery('#' + jqSelector('#{rich:clientId('contactAdminForm')}'));
}
</script>
<div class="modal__dialog l--constrain-medium">
<header class="modal__header">
<h2 class="modal__title">
#{msgs['jsf.message.admin.inquiry.title']}
</h2>
<button type="button"
class="modal__close button--link"
data-dismiss="modal" onclick="cancelContactAdmin();return false;">
<i class="i i--huge i--cancel"></i>
</button>
</header>
<h:form id="contactAdminForm" styleClass="l--push-bottom-0">
<h:inputHidden id="contact-admin-subject" value="#{contactAdminAction.subject}"/>
<div class="modal__content l--pad-all-1">
<s:decorate id="messageField" template="../field.xhtml">
<h:inputTextarea id="contact-admin-message" value="#{contactAdminAction.htmlMessage}"
required="true">
<a4j:ajax event="blur" render="messageField" execute="@this"/>
</h:inputTextarea>
</s:decorate>
</div>
<a4j:jsFunction name="sendContactAdminEmail" action="#{contactAdminAction.send}"
execute="@form"
oncomplete="jQuery(getContactAdminForm()).find('#cancel-button').click()"/>
<footer class="modal__footer l--pad-h-1 l--pad-v-half bg--highest">
<div class="g--tight">
<div class="g__item w--2-3"/>
<div class="g__item w--1-3 txt--align-right">
<button id="cancel-button" onclick="cancelContactAdmin();return false;"
class="cancel button--link l--push-right-half"
data-dismiss="modal">
#{msgs['jsf.Cancel']}
</button>
<button id="send-button" class="button loader button--primary"
onclick="sendContactAdminEmail()">
<span class="loader__label">#{msgs['jsf.email.Send']}</span>
</button>
</div>
</div>
</footer>
</h:form>
</div>
</div>