diff options
Diffstat (limited to 'plugins/Goals/templates/_addEditGoal.twig')
-rw-r--r-- | plugins/Goals/templates/_addEditGoal.twig | 69 |
1 files changed, 18 insertions, 51 deletions
diff --git a/plugins/Goals/templates/_addEditGoal.twig b/plugins/Goals/templates/_addEditGoal.twig index 79a9491afc..16be9c2424 100644 --- a/plugins/Goals/templates/_addEditGoal.twig +++ b/plugins/Goals/templates/_addEditGoal.twig @@ -1,67 +1,34 @@ {% import 'ajaxMacros.twig' as ajax %} {{ ajax.errorDiv() }} -{{ ajax.loadingDiv('goalAjaxLoading') }} -<div class="entityContainer"> - {% if onlyShowAddNewGoal is not defined %} - {% include "@Goals/_listGoalEdit.twig" %} - {% endif %} +<script type="text/javascript"> {% if userCanEditGoals %} - {% include "@Goals/_formAddGoal.twig" %} {% if onlyShowAddNewGoal is not defined %} - <div class='entityCancel' style='display:none;'> - {{ 'General_OrCancel'|translate("<a class='entityCancelLink'>","</a>")|raw }} - </div> - + piwik.goals = {{ goalsJSON|raw }}; {% endif %} + {% else %} + piwik.goals = {{ goalsJSON|raw }}; {% endif %} - <a id='bottom'></a> -</div> -<script type="text/javascript"> - var mappingMatchTypeName = { - "url": "{{ 'Goals_URL'|translate }}", - "title": "{{ 'Goals_PageTitle'|translate }}", - "file": "{{ 'Goals_Filename'|translate }}", - "external_website": "{{ 'Goals_ExternalWebsiteUrl'|translate }}", - "event": "{{ 'Events_Event'|translate }}" - }; - var mappingMatchTypeExamples = { - "url": "{{ 'General_ForExampleShort'|translate }} {{ 'Goals_Contains'|translate("'checkout/confirmation'") }} \ - <br />{{ 'General_ForExampleShort'|translate }} {{ 'Goals_IsExactly'|translate("'http://example.com/thank-you.html'") }} \ - <br />{{ 'General_ForExampleShort'|translate }} {{ 'Goals_MatchesExpression'|translate("'(.*)\\\/demo\\\/(.*)'") }}", - "title": "{{ 'General_ForExampleShort'|translate }} {{ 'Goals_Contains'|translate("'Order confirmation'") }}", - "file": "{{ 'General_ForExampleShort'|translate }} {{ 'Goals_Contains'|translate("'files/brochure.pdf'") }} \ - <br />{{ 'General_ForExampleShort'|translate }} {{ 'Goals_IsExactly'|translate("'http://example.com/files/brochure.pdf'") }} \ - <br />{{ 'General_ForExampleShort'|translate }} {{ 'Goals_MatchesExpression'|translate("'(.*)\\\.zip'") }}", - "external_website": "{{ 'General_ForExampleShort'|translate }} {{ 'Goals_Contains'|translate("'amazon.com'") }} \ - <br />{{ 'General_ForExampleShort'|translate }} {{ 'Goals_IsExactly'|translate("'http://mypartner.com/landing.html'") }} \ - <br />{{ 'General_ForExampleShort'|translate }} {{ 'Goals_MatchesExpression'|translate("'http://www.amazon.com\\\/(.*)\\\/yourAffiliateId'") }}", - "event": "{{ 'General_ForExampleShort'|translate }} {{ 'Goals_Contains'|translate("'video'") }} \ - <br />{{ 'General_ForExampleShort'|translate }} {{ 'Goals_IsExactly'|translate("'click'") }} \ - <br />{{ 'General_ForExampleShort'|translate }} {{ 'Goals_MatchesExpression'|translate("'(.*)_banner'") }}" - }; - $(document).ready(function () { - {% if userCanEditGoals %} - bindGoalForm(); +</script> +<div piwik-manage-goals + {% if userCanEditGoals %} {% if onlyShowAddNewGoal is not defined %} - piwik.goals = {{ goalsJSON|raw }}; - bindListGoalEdit(); - {% if idGoal %} - editGoal({{ idGoal|e('js') }}); - {% else %} - showEditGoals(); + show-goal="{{ idGoal|e('js') }}" {% endif %} {% else %} - initAndShowAddGoalForm(); + show-add-goal="true" {% endif %} - {% else %} - piwik.goals = {{ goalsJSON|raw }}; - showEditGoals(); - {% endif %} - }); + {% endif %}> -</script> + {% if onlyShowAddNewGoal is not defined %} + {% include "@Goals/_listGoalEdit.twig" %} + {% endif %} + {% if userCanEditGoals %} + {% include "@Goals/_formAddGoal.twig" %} + {% endif %} + <a id='bottom'></a> +</div> |