Commit b0ca0333b2c1112e0a8b5c4c0fad5584c46ae532
1 parent
051565a3
Exists in
master
and in
11 other branches
adding success proposal creation
Showing
2 changed files
with
20 additions
and
1 deletions
Show diff stats
index.html
... | ... | @@ -80,7 +80,7 @@ |
80 | 80 | <div class='subtitle'>Qual a sua sugestão para melhorar este programa?</div> |
81 | 81 | <div class='info'>Ela se tornará pública em até 24 horas após o envio e poderá ser apoiada por outros participantes.</div> |
82 | 82 | <div class='send-proposal-button'><a href='#'>Envie Sua Proposta</a></div> |
83 | - <form class='make-proposal-form' id='make-proposal-form-{{id}}'> | |
83 | + <form class='make-proposal-form hide' id='make-proposal-form-{{id}}'> | |
84 | 84 | <div class="name"> |
85 | 85 | <div><label>Título</label></div> |
86 | 86 | <input id="article_name" name="article[name]" type="text" placeholder="Título"> |
... | ... | @@ -93,6 +93,10 @@ |
93 | 93 | <input id='content_type' name='content_type' value='ProposalsDiscussionPlugin::Proposal' type='hidden'> |
94 | 94 | <input type='submit' id='make-proposal-button' class='make-proposal-button' name='make-proposal-button' value='Enviar'> |
95 | 95 | </form> |
96 | + <div class='success-proposal-sent hide'> | |
97 | + <p>Sua proposta foi encaminhada com sucesso!</p> | |
98 | + <a href='#'>Encaminhar Nova Proposta</a> | |
99 | + </div> | |
96 | 100 | </div> |
97 | 101 | </div> |
98 | 102 | <div class='support-proposal-container'> | ... | ... |
js/main.js
... | ... | @@ -82,6 +82,18 @@ $.getJSON(noosferoAPI) |
82 | 82 | } |
83 | 83 | event.preventDefault(); |
84 | 84 | }); |
85 | + $( '.send-proposal-button a' ).click(function(event){ | |
86 | + //Display Topics or Discussion by category | |
87 | + $('.make-proposal-form').show(); | |
88 | + $('.send-proposal-button').hide(); | |
89 | + event.preventDefault(); | |
90 | + }); | |
91 | + $( '.success-proposal-sent a' ).click(function(event){ | |
92 | + //Display Topics or Discussion by category | |
93 | + $('.make-proposal-form').show(); | |
94 | + $('.success-proposal-sent').hide(); | |
95 | + event.preventDefault(); | |
96 | + }); | |
85 | 97 | |
86 | 98 | $('.make-proposal-form').submit(function (e) { |
87 | 99 | e.preventDefault(); |
... | ... | @@ -92,6 +104,9 @@ $.getJSON(noosferoAPI) |
92 | 104 | data: $('#'+this.id).serialize() |
93 | 105 | }) |
94 | 106 | .done(function( data ) { |
107 | + this.reset(); | |
108 | + $('.make-proposal-form').hide(); | |
109 | + $('.success-proposal-sent').show(); | |
95 | 110 | }) |
96 | 111 | .fail(function( jqxhr, textStatus, error ) { |
97 | 112 | var err = textStatus + ", " + error; | ... | ... |