diff options
Diffstat (limited to 'plugins/Goals/templates/_formAddGoal.twig')
-rw-r--r-- | plugins/Goals/templates/_formAddGoal.twig | 248 |
1 files changed, 143 insertions, 105 deletions
diff --git a/plugins/Goals/templates/_formAddGoal.twig b/plugins/Goals/templates/_formAddGoal.twig index d8cdaf2ba4..2a3f43bbfe 100644 --- a/plugins/Goals/templates/_formAddGoal.twig +++ b/plugins/Goals/templates/_formAddGoal.twig @@ -1,109 +1,147 @@ -<div class='entityAddContainer' style="display:none;"> - <form> - <table class="dataTable entityTable"> - <thead> - <tr class="first"> - <th colspan="2">{{ 'Goals_AddNewGoal'|translate }}</th> - <tr> - </thead> - <tbody> - <tr> - <td class="first">{{ 'Goals_GoalName'|translate }} </td> - <td><input type="text" name="name" value="" size="28" id="goal_name" class="inp"/></td> - </tr> - <tr> - <td style='width:260px;' class="first">{{ 'Goals_GoalIsTriggered'|translate }}</td> - <td> - <select name="trigger_type" class="inp"> - <option value="visitors">{{ 'Goals_WhenVisitors'|translate }}</option> - <option value="manually">{{ 'Goals_Manually'|translate }}</option> - </select> - - <p id="match_attribute_section2"> - <input type="radio" id="match_attribute_url" value="url" name="match_attribute"/> - <label for="match_attribute_url">{{ 'Goals_VisitUrl'|translate }}</label> - <br/> - <input type="radio" id="match_attribute_title" value="title" name="match_attribute"/> - <label for="match_attribute_title">{{ 'Goals_VisitPageTitle'|translate }}</label> - <br/> - <input type="radio" id="match_attribute_event" value="event" name="match_attribute"/> - <label for="match_attribute_event">{{ 'Goals_SendEvent'|translate }}</label> - <br/> - <input type="radio" id="match_attribute_file" value="file" name="match_attribute"/> - <label for="match_attribute_file">{{ 'Goals_Download'|translate }}</label> - <br/> - <input type="radio" id="match_attribute_external_website" value="external_website" name="match_attribute"/> - <label for="match_attribute_external_website">{{ 'Goals_ClickOutlink'|translate }}</label> - </p> - </td> - </tr> - </tbody> - <tbody id="match_attribute_section"> - <tr> - <td class="first">{{ 'Goals_WhereThe'|translate }} <span class="whereUrl" id="match_attribute_name"></span><select name="event_type" class="whereEvent inp"> - <option value="event_category">{{ 'Events_EventCategory'|translate }}</option> - <option value="event_action">{{ 'Events_EventAction'|translate }}</option> - <option value="event_name">{{ 'Events_EventName'|translate }}</option> - </select></td> - <td> - <select name="pattern_type" class="inp"> - <option value="contains">{{ 'Goals_Contains'|translate("") }}</option> - <option value="exact">{{ 'Goals_IsExactly'|translate("") }}</option> - <option value="regex">{{ 'Goals_MatchesExpression'|translate("") }}</option> - </select> - - {{ 'Goals_Pattern'|translate }} - - <input type="text" name="pattern" value="" size="16" class="inp"/> - <br/> - - <div id="examples_pattern" class="entityInlineHelp"></div> - <br/> - <span style="float:right;"> - {{ 'Goals_Optional'|translate }} <input type="checkbox" id="case_sensitive"/> - <label for="case_sensitive">{{ 'Goals_CaseSensitive'|translate }}</label> - </span> - </td> - </tr> - </tbody> - <tbody id="manual_trigger_section" style="display:none;"> - <tr> - <td colspan="2" class="first"> +<div piwik-content-block + content-title="{{ 'Goals_AddNewGoal'|translate|e('html_attr') }}" + class="addEditGoal" + ng-show="manageGoals.showEditGoal"> + + {% if addNewGoalIntro is defined and addNewGoalIntro %} + {{ addNewGoalIntro|raw }} + {% endif %} + + <div piwik-form> + <div piwik-field uicontrol="text" name="goal_name" + ng-model="manageGoals.goal.name" + title="{{ 'Goals_GoalName'|translate|e('html_attr') }}"> + </div> + + <div class="row goalIsTriggeredWhen"> + <div class="col s12"> + <h3>{{ 'Goals_GoalIsTriggered'|translate|e('html_attr') }}</h3> + </div> + </div> + + <div class="row"> + <div class="col s12 m6 goalTriggerType"> + <div piwik-field uicontrol="select" name="trigger_type" + ng-model="manageGoals.goal.triggerType" + ng-change="manageGoals.changedTriggerType()" + full-width="true" + options="{{ goalTriggerTypeOptions|json_encode }}"> + </div> + </div> + <div class="col s12 m6"> + <div piwik-alert="info" ng-show="manageGoals.goal.triggerType == 'manually'"> {{ 'Goals_WhereVisitedPageManuallyCallsJavascriptTrackerLearnMore'|translate("<a target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/docs/javascript-tracking/%23toc-manually-trigger-a-conversion-for-a-goal'>","</a>")|raw }} - </td> - </tr> - </tbody> - <tbody> - <tr> - <td class="first"> {{ 'Goals_AllowMultipleConversionsPerVisit'|translate }} </td> - <td> - <input type="radio" id="allow_multiple_0" value="0" name="allow_multiple"/> - <label for="allow_multiple_0">{{ 'Goals_DefaultGoalConvertedOncePerVisit'|translate }}</label> - - <div class="entityInlineHelp"> - {{ 'Goals_HelpOneConversionPerVisit'|translate }} - </div> - <br/> - - <input type="radio" id="allow_multiple_1" value="1" name="allow_multiple"/> - <label for="allow_multiple_1">{{ 'Goals_AllowGoalConvertedMoreThanOncePerVisit'|translate }}</label> - <br/><br/> - </tr> - <tr> - </tbody> - <tbody> - <tr> - <td class="first">{{ 'Goals_Optional'|translate }} {{ 'Goals_DefaultRevenue'|translate }}</td> - <td>{{ ' <input type="text" name="revenue" size="2" value="0" class="inp" /> '|money(idSite)|raw }} - <div class="entityInlineHelp"> {{ 'Goals_DefaultRevenueHelp'|translate }} </div> - </td> - </tr> - <tr> - </tbody> - </table> - <input type="hidden" name="methodGoalAPI" value=""/> + </div> + + <div piwik-field uicontrol="radio" name="match_attribute" + ng-show="manageGoals.goal.triggerType != 'manually'" + full-width="true" + ng-model="manageGoals.goal.matchAttribute" + options="{{ goalMatchAttributeOptions|json_encode }}"> + </div> + </div> + </div> + + <div class="row whereTheMatchAttrbiute" ng-show="manageGoals.goal.triggerType != 'manually'"> + <h3 class="col s12">{{ 'Goals_WhereThe'|translate|e('html_attr') }} + <span ng-show="manageGoals.goal.matchAttribute == 'url'"> + {{ 'Goals_URL'|translate }} + </span> + <span ng-show="manageGoals.goal.matchAttribute == 'title'"> + {{ 'Goals_PageTitle'|translate }} + </span> + <span ng-show="manageGoals.goal.matchAttribute == 'file'"> + {{ 'Goals_Filename'|translate }} + </span> + <span ng-show="manageGoals.goal.matchAttribute == 'external_website'"> + {{ 'Goals_ExternalWebsiteUrl'|translate }} + </span> + </h3> + </div> + + <div class="row" ng-show="manageGoals.goal.triggerType != 'manually'"> + <div class="col s12 m6 l4" + ng-show="manageGoals.goal.matchAttribute == 'event'"> + <div piwik-field uicontrol="select" name="event_type" + ng-model="manageGoals.goal.eventType" + full-width="true" + options="{{ eventTypeOptions|json_encode }}"> + </div> + </div> + + <div class="col s12 m6 l4"> + <div piwik-field uicontrol="select" name="pattern_type" + ng-model="manageGoals.goal.patternType" + full-width="true" + options="{{ patternTypeOptions|json_encode }}"> + </div> + </div> + + <div class="col s12 m6 l4"> + <div piwik-field uicontrol="text" name="pattern" + ng-model="manageGoals.goal.pattern" + title="{{ 'Goals_Pattern'|translate|e('html_attr') }}" + full-width="true"> + </div> + </div> + + <div id="examples_pattern" class="col s12" piwik-alert="info"> + <span ng-show="manageGoals.goal.matchAttribute == '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\\\/(.*)'") }} + </span> + <span ng-show="manageGoals.goal.matchAttribute == 'title'"> + {{ 'General_ForExampleShort'|translate }} {{ 'Goals_Contains'|translate("'Order confirmation'") }} + </span> + <span ng-show="manageGoals.goal.matchAttribute == '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'") }} + </span> + <span ng-show="manageGoals.goal.matchAttribute == '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'") }} + </span> + <span ng-show="manageGoals.goal.matchAttribute == 'event'"> + {{ 'General_ForExampleShort'|translate }} {{ 'Goals_Contains'|translate("'video'") }} + <br />{{ 'General_ForExampleShort'|translate }} {{ 'Goals_IsExactly'|translate("'click'") }} + <br />{{ 'General_ForExampleShort'|translate }} {{ 'Goals_MatchesExpression'|translate("'(.*)_banner'") }}" + </span> + </div> + </div> + + <div piwik-field uicontrol="checkbox" name="case_sensitive" + ng-model="manageGoals.goal.caseSensitive" + ng-show="manageGoals.goal.triggerType != 'manually'" + title="{{ 'Goals_CaseSensitive'|translate|e('html_attr') }} {{ 'Goals_Optional'|translate|e('html_attr') }}"> + </div> + + <div piwik-field uicontrol="radio" name="allow_multiple" + ng-model="manageGoals.goal.allowMultiple" + options="{{ allowMultipleOptions|json_encode }}" + introduction="{{ 'Goals_AllowMultipleConversionsPerVisit'|translate|e('html_attr') }}" + inline-help="{{ 'Goals_HelpOneConversionPerVisit'|translate|e('html_attr') }}"> + </div> + + <div piwik-field uicontrol="text" name="revenue" + ng-model="manageGoals.goal.revenue" + introduction="{{ 'Goals_DefaultRevenue'|translate }} {{ 'Goals_Optional'|translate }}" + inline-help="{{ 'Goals_DefaultRevenueHelp'|translate|e('html_attr') }}"> + </div> + <input type="hidden" name="goalIdUpdate" value=""/> - <input type="submit" value="" name="submit" id="goal_submit" class="submit"/> - </form> + <div piwik-save-button + saving="manageGoals.isLoading" + onconfirm="manageGoals.save()" + ng-value="manageGoals.goal.submitText"></div> + + {% if onlyShowAddNewGoal is not defined %} + <div class='entityCancel' ng-show="manageGoals.showEditGoal" ng-click="manageGoals.showListOfReports()"> + {{ 'General_OrCancel'|translate("<a class='entityCancelLink'>","</a>")|raw }} + </div> + {% endif %} + </div> </div> |