diff options
-rw-r--r-- | plugins/SitesManager/templates/SitesManager.js | 10 | ||||
-rw-r--r-- | plugins/SitesManager/templates/SitesManager.tpl | 8 |
2 files changed, 13 insertions, 5 deletions
diff --git a/plugins/SitesManager/templates/SitesManager.js b/plugins/SitesManager/templates/SitesManager.js index 7dcf84d252..f6d47ea625 100644 --- a/plugins/SitesManager/templates/SitesManager.js +++ b/plugins/SitesManager/templates/SitesManager.js @@ -132,25 +132,27 @@ function SitesManager ( _timezones, _currencies, _defaultTimezone, _defaultCurre this.init = function () { $('.addRowSite').click( function() { piwikHelper.hideAjaxError(); - $(this).toggle(); + $('.addRowSite').toggle(); var numberOfRows = $('table#editSites')[0].rows.length; var newRowId = 'row' + numberOfRows; - + var submitButtonHtml = '<input type="submit" class="addsite submit" value="' + _pk_translate('General_Save_js') +'" />'; $(' <tr id="'+newRowId+'">\ <td> </td>\ - <td><input id="name" value="Name" size="15" /></td>\ + <td><input id="name" value="Name" size="15" /><br/><br/><br/>'+submitButtonHtml+'</td>\ <td><textarea cols="25" rows="3" id="urls">http://siteUrl.com/\nhttp://siteUrl2.com/</textarea><br />'+aliasUrlsHelp+'</td>\ <td><textarea cols="20" rows="4" id="excludedIps"></textarea><br />'+excludedIpHelp+'</td>\ <td><textarea cols="20" rows="4" id="excludedQueryParameters"></textarea><br />'+excludedQueryParametersHelp+'</td>\ <td>'+getTimezoneSelector(defaultTimezone)+'<br />' + timezoneHelp + '</td>\ <td>'+getCurrencySelector(defaultCurrency)+'<br />' + currencyHelp + '</td>\ - <td><input type="submit" class="addsite submit" value="' + _pk_translate('General_Save_js') +'" /></td>\ + <td>'+submitButtonHtml+'</td>\ <td><span class="cancel link_but">'+sprintf(_pk_translate('General_OrCancel_js'),"","")+'</span></td>\ </tr>') .appendTo('#editSites') ; + piwikHelper.lazyScrollTo('#'+newRowId); + $('.addsite').click( function(){ $.ajax( getAddSiteAJAX($('tr#'+newRowId)) ); }); diff --git a/plugins/SitesManager/templates/SitesManager.tpl b/plugins/SitesManager/templates/SitesManager.tpl index 311f93b649..30fa417889 100644 --- a/plugins/SitesManager/templates/SitesManager.tpl +++ b/plugins/SitesManager/templates/SitesManager.tpl @@ -87,11 +87,17 @@ vertical-align:middle; {ajaxErrorDiv} {ajaxLoadingDiv} +{capture assign=createNewWebsite} + <div class="addRowSite"><img src='plugins/UsersManager/images/add.png' alt="" /> {'SitesManager_AddSite'|translate}</div> +{/capture} {if $adminSites|@count == 0} {'SitesManager_NoWebsites'|translate} {else} <div class="entityContainer"> + {if $isSuperUser} + {$createNewWebsite} + {/if} <table class="entityTable dataTable" id="editSites"> <thead> <tr> @@ -125,7 +131,7 @@ vertical-align:middle; </tbody> </table> {if $isSuperUser} - <div class="addRowSite"><img src='plugins/UsersManager/images/add.png' alt="" /> {'SitesManager_AddSite'|translate}</div> + {$createNewWebsite} {/if} </div> {/if} |