File tree 2 files changed +7
-2
lines changed 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ class ContactView(FormView):
9
9
form_class = ContactForm
10
10
success_url = "/contact"
11
11
message_as_modal = True
12
+ modal_config = {
13
+ "close_button_redirect" : "/" ,
14
+ "close_button_label" : "Return to home"
15
+ }
12
16
13
17
def form_valid (self , form ):
14
18
try :
@@ -23,4 +27,5 @@ def get_context_data(self, **kwargs):
23
27
""" Used to access message_as_modal in template as context """
24
28
context = super (ContactView , self ).get_context_data (** kwargs )
25
29
context .update ({"message_as_modal" : self .message_as_modal })
30
+ context .update ({"modal_config" : self .modal_config })
26
31
return context
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ <h5 class="modal-title black-text" id="modalLabel">Thank You.</h5>
15
15
class ="btn btn-primary "
16
16
data-bs-dismiss ="modal "
17
17
aria-label ="Close "
18
- onclick ="javascript:window.location='/ ' ">
19
- Return to home
18
+ onclick ="javascript:window.location='{{ modal_config.close_button_redirect }} ' ">
19
+ {{ modal_config.close_button_label }}
20
20
</ button >
21
21
</ div >
22
22
</ div >
You can’t perform that action at this time.
0 commit comments