Questtype ?Textinput?: add support for field sizes (Issue #252) and general improvements
This commit is contained in:
commit
8d903135a5
3476 changed files with 599099 additions and 0 deletions
210
www/analytics/plugins/UsersManager/templates/index.twig
Normal file
210
www/analytics/plugins/UsersManager/templates/index.twig
Normal file
|
|
@ -0,0 +1,210 @@
|
|||
{% extends 'admin.twig' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h2 piwik-enriched-headline
|
||||
help-url="http://piwik.org/docs/manage-users/">{{ 'UsersManager_ManageAccess'|translate }}</h2>
|
||||
<div id="sites" class="usersManager">
|
||||
<section class="sites_selector_container">
|
||||
<p>{{ 'UsersManager_MainDescription'|translate }}</p>
|
||||
|
||||
<div class="sites_selector_title">{{ 'SitesManager_Sites'|translate }}:</div>
|
||||
|
||||
{% set applyAllSitesText %}
|
||||
<strong>{{ 'UsersManager_ApplyToAllWebsites'|translate }}</strong>
|
||||
{% endset %}
|
||||
|
||||
<div piwik-siteselector
|
||||
class="sites_autocomplete"
|
||||
siteid="{{ idSiteSelected }}"
|
||||
sitename="{{ defaultReportSiteName }}"
|
||||
all-sites-text="{{ applyAllSitesText|raw }}"
|
||||
all-sites-location="top"
|
||||
id="usersManagerSiteSelect"
|
||||
switch-site-on-select="false"></div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
{% import 'ajaxMacros.twig' as ajax %}
|
||||
{{ ajax.errorDiv }}
|
||||
{{ ajax.loadingDiv }}
|
||||
|
||||
<div class="entityContainer" style="width:600px;">
|
||||
{% if anonymousHasViewAccess %}
|
||||
<div style="display:inline-block;margin-top:10px;" id="usersManagerAnonymousUserHasViewAccess">
|
||||
{{ ['UsersManager_AnonymousUserHasViewAccess'|translate("'anonymous'","'view'"), 'UsersManager_AnonymousUserHasViewAccess2'|translate]|join(' ')|notification({'placeAt': '#usersManagerAnonymousUserHasViewAccess', 'noclear': true}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<table class="entityTable dataTable" id="access" style="display:inline-table;width:500px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='first'>{{ 'UsersManager_User'|translate }}</th>
|
||||
<th>{{ 'UsersManager_Alias'|translate }}</th>
|
||||
<th>{{ 'UsersManager_PrivNone'|translate }}</th>
|
||||
<th>{{ 'UsersManager_PrivView'|translate }}</th>
|
||||
<th>{{ 'UsersManager_PrivAdmin'|translate }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% set accesValid %}<img src='plugins/UsersManager/images/ok.png' class='accessGranted' />{% endset %}
|
||||
{% set accesInvalid %}<img src='plugins/UsersManager/images/no-access.png' class='updateAccess' />{% endset %}
|
||||
{% set superUserAccess %}<span title="{{ 'UsersManager_ExceptionSuperUserAccess'|translate }}">N/A</span>{% endset %}
|
||||
{% for login,access in usersAccessByWebsite %}
|
||||
<tr>
|
||||
<td id='login'>{{ login }}</td>
|
||||
<td>{{ usersAliasByLogin[login]|raw }}</td>
|
||||
<td id='noaccess'>
|
||||
{% if login in superUserLogins %}
|
||||
{{ superUserAccess }}
|
||||
{% elseif access=='noaccess' and idSiteSelected != 'all' %}
|
||||
{{ accesValid }}
|
||||
{% else %}
|
||||
{{ accesInvalid }}
|
||||
{% endif %} </td>
|
||||
<td id='view'>
|
||||
{% if login in superUserLogins %}
|
||||
{{ superUserAccess }}
|
||||
{% elseif access == 'view' and idSiteSelected != 'all' %}
|
||||
{{ accesValid }}
|
||||
{% else %}
|
||||
{{ accesInvalid }}
|
||||
{% endif %} </td>
|
||||
<td id='admin'>
|
||||
{% if login in superUserLogins %}
|
||||
{{ superUserAccess }}
|
||||
{% elseif login == 'anonymous' %}
|
||||
N/A
|
||||
{% else %}
|
||||
{% if access == 'admin' and idSiteSelected != 'all' %}{{ accesValid }}{% else %}{{ accesInvalid }}{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="accessUpdated" style="vertical-align:top;"></div>
|
||||
</div>
|
||||
|
||||
<div class="ui-confirm" id="confirm">
|
||||
<h2>{{ 'UsersManager_ChangeAllConfirm'|translate("<span id='login'></span>")|raw }}</h2>
|
||||
<input role="yes" type="button" value="{{ 'General_Yes'|translate }}"/>
|
||||
<input role="no" type="button" value="{{ 'General_No'|translate }}"/>
|
||||
</div>
|
||||
|
||||
{% if userIsSuperUser %}
|
||||
<div class="ui-confirm" id="confirmUserRemove">
|
||||
<h2></h2>
|
||||
<input role="yes" type="button" value="{{ 'General_Yes'|translate }}"/>
|
||||
<input role="no" type="button" value="{{ 'General_No'|translate }}"/>
|
||||
</div>
|
||||
<div class="ui-confirm" id="confirmPasswordChange">
|
||||
<h2>{{ 'UsersManager_ChangePasswordConfirm'|translate }}</h2>
|
||||
<input role="yes" type="button" value="{{ 'General_Yes'|translate }}"/>
|
||||
<input role="no" type="button" value="{{ 'General_No'|translate }}"/>
|
||||
</div>
|
||||
<br/>
|
||||
<h2>{{ 'UsersManager_UsersManagement'|translate }}</h2>
|
||||
<p>{{ 'UsersManager_UsersManagementMainDescription'|translate }}
|
||||
{{ 'UsersManager_ThereAreCurrentlyNRegisteredUsers'|translate("<b>"~usersCount~"</b>")|raw }}</p>
|
||||
{% import 'ajaxMacros.twig' as ajax %}
|
||||
{{ ajax.errorDiv('ajaxErrorUsersManagement') }}
|
||||
{{ ajax.loadingDiv('ajaxLoadingUsersManagement') }}
|
||||
<div class="entityContainer" style="margin-bottom:50px;">
|
||||
<table class="entityTable dataTable" id="users">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'General_Username'|translate }}</th>
|
||||
<th>{{ 'General_Password'|translate }}</th>
|
||||
<th>{{ 'UsersManager_Email'|translate }}</th>
|
||||
<th>{{ 'UsersManager_Alias'|translate }}</th>
|
||||
<th>token_auth</th>
|
||||
{% if showLastSeen is defined and showLastSeen %}
|
||||
<th>{{ 'UsersManager_LastSeen'|translate }}</th>
|
||||
{% endif %}
|
||||
<th>{{ 'General_Edit'|translate }}</th>
|
||||
<th>{{ 'General_Delete'|translate }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for i,user in users %}
|
||||
{% if user.login != 'anonymous' %}
|
||||
<tr class="editable" id="row{{ i }}">
|
||||
<td id="userLogin" class="editable">{{ user.login }}</td>
|
||||
<td id="password" class="editable">-</td>
|
||||
<td id="email" class="editable">{{ user.email }}</td>
|
||||
<td id="alias" class="editable">{{ user.alias|raw }}</td>
|
||||
<td id="token_auth">{{ user.token_auth }}</td>
|
||||
{% if user.last_seen is defined %}
|
||||
<td id="last_seen">{% if user.last_seen is empty %}-{% else %}{{ 'General_TimeAgo'|translate(user.last_seen)|raw }}{% endif %}</td>
|
||||
{% endif %}
|
||||
<td>
|
||||
<span class="edituser link_but" id="row{{ i }}">
|
||||
<img title="{{ 'General_Edit'|translate }}" src='plugins/Zeitgeist/images/ico_edit.png'/>
|
||||
<span>{{ 'General_Edit'|translate }}</span>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="deleteuser link_but" id="row{{ i }}">
|
||||
<img title="{{ 'General_Delete'|translate }}" src='plugins/Zeitgeist/images/ico_delete.png'/>
|
||||
<span>{{ 'General_Delete'|translate }}</span>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="addrow"><img src='plugins/UsersManager/images/add.png'/> {{ 'UsersManager_AddUser'|translate }}</div>
|
||||
</div>
|
||||
|
||||
<h2 id="super_user_access">{{ 'UsersManager_SuperUserAccessManagement'|translate }}</h2>
|
||||
<p>{{ 'UsersManager_SuperUserAccessManagementMainDescription'|translate }} <br/>
|
||||
{{ 'UsersManager_SuperUserAccessManagementGrantMore'|translate }}</p>
|
||||
|
||||
{{ ajax.errorDiv('ajaxErrorSuperUsersManagement') }}
|
||||
{{ ajax.loadingDiv('ajaxLoadingSuperUsersManagement') }}
|
||||
|
||||
<table class="entityTable dataTable" id="superUserAccess" style="display:inline-table;width:400px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='first'>{{ 'UsersManager_User'|translate }}</th>
|
||||
<th>{{ 'UsersManager_Alias'|translate }}</th>
|
||||
<th>{{ 'Installation_SuperUser'|translate }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% if users|length > 1 %}
|
||||
{% for login,alias in usersAliasByLogin if login != 'anonymous' %}
|
||||
<tr>
|
||||
<td id='login'>{{ login }}</td>
|
||||
<td>{{ alias|raw }}</td>
|
||||
<td id='superuser' data-login="{{ login|e('html_attr') }}">
|
||||
<img src='plugins/UsersManager/images/ok.png' class='accessGranted' data-hasaccess="1" {% if not (login in superUserLogins) %}style="display:none"{% endif %} />
|
||||
<img src='plugins/UsersManager/images/no-access.png' class='updateAccess' data-hasaccess="0" {% if login in superUserLogins %}style="display:none"{% endif %} />
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
{{ 'UsersManager_NoUsersExist'|translate }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div id="superUserAccessUpdated" style="vertical-align:top;"></div>
|
||||
|
||||
<div class="ui-confirm" id="superUserAccessConfirm">
|
||||
<h2> </h2>
|
||||
<input role="yes" type="button" value="{{ 'General_Yes'|translate }}"/>
|
||||
<input role="no" type="button" value="{{ 'General_No'|translate }}"/>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
181
www/analytics/plugins/UsersManager/templates/userSettings.twig
Normal file
181
www/analytics/plugins/UsersManager/templates/userSettings.twig
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
{% extends 'admin.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<h2 piwik-enriched-headline>{{ 'UsersManager_MenuUserSettings'|translate }}</h2>
|
||||
|
||||
<br/>
|
||||
<div class="ui-confirm" id="confirmPasswordChange">
|
||||
<h2>{{ 'UsersManager_ChangePasswordConfirm'|translate }}</h2>
|
||||
<input role="yes" type="button" value="{{ 'General_Yes'|translate }}"/>
|
||||
<input role="no" type="button" value="{{ 'General_No'|translate }}"/>
|
||||
</div>
|
||||
|
||||
<table id='userSettingsTable' class="adminTable">
|
||||
<tr>
|
||||
<td><label for="username">{{ 'General_Username'|translate }} </label></td>
|
||||
<td>
|
||||
<input size="25" value="{{ userLogin }}" id="username" disabled="disabled"/>
|
||||
<span class='form-description'>{{ 'UsersManager_YourUsernameCannotBeChanged'|translate }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label for="alias">{{ 'UsersManager_Alias'|translate }} </label></td>
|
||||
<td><input size="25" value="{{ userAlias }}" id="alias" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="email">{{ 'UsersManager_Email'|translate }} </label></td>
|
||||
<td><input size="25" value="{{ userEmail }}" id="email"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div style="margin-top: 5px;margin-bottom: 10px;">{{ 'General_Language'|translate }}</div></td>
|
||||
<td>
|
||||
<fieldset style="margin-top: 5px;margin-bottom: 10px;">
|
||||
<select name="language" id="language" onchange="if (this.value=='') window.open('?module=Proxy&action=redirect&url=http://piwik.org/translations/');">
|
||||
<option title="" value="">{{ 'LanguagesManager_AboutPiwikTranslations'|translate }}</option>
|
||||
{% for language in languages %}
|
||||
<option value="{{ language.code }}" {% if language.code == currentLanguageCode %}selected="selected"{% endif %}
|
||||
title="{{ language.name }} ({{ language.english_name }})">{{ language.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<br />
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ 'UsersManager_ReportToLoadByDefault'|translate }}</td>
|
||||
<td>
|
||||
<fieldset>
|
||||
<input id="defaultReportRadioAll" type="radio" value="MultiSites"
|
||||
name="defaultReport"{% if defaultReport=='MultiSites' %} checked="checked"{% endif %} />
|
||||
<label for="defaultReportRadioAll">{{ 'General_AllWebsitesDashboard'|translate }}</label><br/>
|
||||
<input id="defaultReportSpecific" type="radio" value="1"
|
||||
name="defaultReport"{% if defaultReport != 'MultiSites' %} checked="checked"{% endif %} />
|
||||
<label for="defaultReportSpecific" style="padding-right:12px;">{{ 'General_DashboardForASpecificWebsite'|translate }}</label>
|
||||
{% if defaultReport=='MultiSites' %}
|
||||
{% set defaultReportIdSite=1 %}
|
||||
{% else %}
|
||||
{% set defaultReportIdSite=defaultReport %}
|
||||
{% endif %}
|
||||
|
||||
<div piwik-siteselector
|
||||
class="sites_autocomplete"
|
||||
siteid="{{ defaultReportIdSite }}"
|
||||
sitename="{{ defaultReportSiteName }}"
|
||||
switch-site-on-select="false"
|
||||
show-all-sites-item="false"
|
||||
showselectedsite="true"
|
||||
id="defaultReportSiteSelector"></div>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ 'UsersManager_ReportDateToLoadByDefault'|translate }}</td>
|
||||
<td>
|
||||
<fieldset>
|
||||
{% for value,description in availableDefaultDates %}
|
||||
<input id="defaultDate-{{ loop.index }}" type="radio"{% if defaultDate==value %} checked="checked"{% endif %} value="{{ value }}" name="defaultDate"/>
|
||||
<label for="defaultDate-{{ loop.index }}">{{ description }}</label>
|
||||
<br/>
|
||||
{% endfor %}
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{% if isValidHost is defined and isValidHost %}
|
||||
<tr>
|
||||
<td><label for="email">{{ 'General_ChangePassword'|translate }} </label></td>
|
||||
<td><input size="25" value="" autocomplete="off" id="password" type="password"/>
|
||||
<span class='form-description'>{{ 'UsersManager_IfYouWouldLikeToChangeThePasswordTypeANewOne'|translate }}</span>
|
||||
<br/><br/><input size="25" value="" autocomplete="off" id="passwordBis" type="password"/>
|
||||
<span class='form-description'> {{ 'UsersManager_TypeYourPasswordAgain'|translate }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
{% if isValidHost is not defined or not isValidHost %}
|
||||
<div id="injectedHostCannotChangePwd">
|
||||
{% set injectedHostCannotChangePwd %}
|
||||
{{ 'UsersManager_InjectedHostCannotChangePwd'|translate(invalidHost) }}
|
||||
{% if not isSuperUser %}{{ 'UsersManager_EmailYourAdministrator'|translate(invalidHostMailLinkStart,'</a>')|raw }}{% endif %}
|
||||
{% endset %}
|
||||
{{ injectedHostCannotChangePwd|notification({'raw': true, 'context': 'error', 'placeat': '#injectedHostCannotChangePwd', 'noclear': true}) }}
|
||||
</div>
|
||||
<br/>
|
||||
{% endif %}
|
||||
|
||||
{% import 'ajaxMacros.twig' as ajax %}
|
||||
{{ ajax.errorDiv('ajaxErrorUserSettings') }}
|
||||
{{ ajax.loadingDiv('ajaxLoadingUserSettings') }}
|
||||
<input type="submit" value="{{ 'General_Save'|translate }}" id="userSettingsSubmit" class="submit"/>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<h2 id="excludeCookie">{{ 'UsersManager_ExcludeVisitsViaCookie'|translate }}</h2>
|
||||
<p>
|
||||
{% if ignoreCookieSet %}
|
||||
{{ 'UsersManager_YourVisitsAreIgnoredOnDomain'|translate("<strong>", piwikHost, "</strong>")|raw }}
|
||||
{% else %}
|
||||
{{ 'UsersManager_YourVisitsAreNotIgnored'|translate("<strong>","</strong>")|raw }}
|
||||
{% endif %}
|
||||
</p>
|
||||
<span style="margin-left:20px;">
|
||||
<a href='{{ linkTo({'token_auth':token_auth, 'action':'setIgnoreCookie'}) }}#excludeCookie'>› {% if ignoreCookieSet %}{{ 'UsersManager_ClickHereToDeleteTheCookie'|translate }}
|
||||
{% else %}{{'UsersManager_ClickHereToSetTheCookieOnDomain'|translate(piwikHost) }}{% endif %}
|
||||
<br/>
|
||||
</a></span>
|
||||
|
||||
<br/><br/>
|
||||
{% if isSuperUser %}
|
||||
<h2>{{ 'UsersManager_MenuAnonymousUserSettings'|translate }}</h2>
|
||||
{% if anonymousSites|length == 0 %}
|
||||
<h3 class='form-description'><strong>{{ 'UsersManager_NoteNoAnonymousUserAccessSettingsWontBeUsed2'|translate }}</strong></h3>
|
||||
<br/>
|
||||
{% else %}
|
||||
<br/>
|
||||
{{ ajax.errorDiv('ajaxErrorAnonymousUserSettings') }}
|
||||
{{ ajax.loadingDiv('ajaxLoadingAnonymousUserSettings') }}
|
||||
<table id='anonymousUserSettingsTable' class="adminTable" style='width:850px;'>
|
||||
<tr>
|
||||
<td style="width:400px;">{{ 'UsersManager_WhenUsersAreNotLoggedInAndVisitPiwikTheyShouldAccess'|translate }}</td>
|
||||
<td>
|
||||
<fieldset>
|
||||
<input id="anonymousDefaultReport-login" type="radio" value="Login"
|
||||
name="anonymousDefaultReport"{% if anonymousDefaultReport==loginModule %} checked="checked"{% endif %} />
|
||||
<label for="anonymousDefaultReport-login">{{ 'UsersManager_TheLoginScreen'|translate }}</label><br/>
|
||||
<input id="anonymousDefaultReport-multisites" {% if anonymousSites is empty %}disabled="disabled" {% endif %}type="radio" value="MultiSites"
|
||||
name="anonymousDefaultReport"{% if anonymousDefaultReport=='MultiSites' %} checked="checked"{% endif %} />
|
||||
<label for="anonymousDefaultReport-multisites">{{ 'General_AllWebsitesDashboard'|translate }}</label><br/>
|
||||
|
||||
<input id="anonymousDefaultReport-specific" {% if anonymousSites is empty %}disabled="disabled" {% endif %}type="radio" value="1"
|
||||
name="anonymousDefaultReport"{% if anonymousDefaultReport>0 %} checked="checked"{% endif %} />
|
||||
<label for="anonymousDefaultReport-specific">{{ 'General_DashboardForASpecificWebsite'|translate }}</label>
|
||||
{% if anonymousSites is not empty %}
|
||||
<select id="anonymousDefaultReportWebsite">
|
||||
{% for info in anonymousSites %}
|
||||
<option value="{{ info.idsite }}" {% if anonymousDefaultReport==info.idsite %} selected="selected"{% endif %}>{{ info.name|raw }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% endif %}
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ 'UsersManager_ForAnonymousUsersReportDateToLoadByDefault'|translate }}</td>
|
||||
<td>
|
||||
<fieldset>
|
||||
{% for value,description in availableDefaultDates %}
|
||||
<input id="anonymousDefaultDate-{{ loop.index }}" type="radio" {% if anonymousDefaultDate==value %}checked="checked" {% endif %}value="{{ value }}"
|
||||
name="anonymousDefaultDate"/>
|
||||
<label for="anonymousDefaultDate-{{ loop.index }}">{{ description }}</label>
|
||||
<br/>
|
||||
{% endfor %}
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<input type="submit" value="{{ 'General_Save'|translate }}" id="anonymousUserSettingsSubmit" class="submit"/>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue