Skip to content

Commit

Permalink
confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklog committed May 29, 2018
1 parent c6897dc commit cbd6b5a
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/Resources/views/Package/list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% endblock %}

{% block pageActions %}
<a class="btn btn-outline-primary" href="{{ path('devliver_repo_update_all') }}"><span class="fa fa-sync fa-fw"></span> {{ 'action.update_all'|trans }}</a>
<a class="btn btn-outline-primary bs-confirmation" href="{{ path('devliver_repo_update_all') }}" data-confirmation="Do you really want to update all repositories? This can take a long time."><span class="fa fa-sync fa-fw"></span> {{ 'action.update_all'|trans }}</a>
{% endblock %}

{% block content %}
Expand Down Expand Up @@ -76,7 +76,7 @@
</td>
<td style="white-space: nowrap; width: 1px;">
<div class="btn-group">
<a href="{{ path('devliver_package_update', { package: package.id, referer: true }) }}" data-toggle="tooltip" title="{{ 'action.update'|trans }}" class="btn btn-xs btn-outline-info"><span class="fa fa-sync fa-fw"></span></a>
<a href="{{ path('devliver_package_update', { package: package.id, referer: true }) }}" title="{{ 'action.update'|trans }}" class="bs-tooltip btn btn-xs btn-outline-info"><span class="fa fa-sync fa-fw"></span></a>
</div>
</td>
</tr>
Expand Down
6 changes: 3 additions & 3 deletions src/Resources/views/Package/view.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% endblock %}

{% block pageActions %}
<a href="{{ path('devliver_package_update', { package: package.id }) }}" data-toggle="tooltip" title="{{ 'action.update'|trans }}" class="btn btn-info"><i class="fas fa-sync fa-fw"></i></a>
<a href="{{ path('devliver_package_update', { package: package.id }) }}" title="{{ 'action.update'|trans }}" class="btn btn-info bs-tooltip"><i class="fas fa-sync fa-fw"></i></a>
{% endblock %}

{% block content %}
Expand Down Expand Up @@ -118,7 +118,7 @@
{% set adapter = package_adapter(pi) %}
<li class="list-group-item py-1 px-2 clearfix">
<div class="float-left">
<a href="#" class="package-link" data-toggle="tooltip" title="{{ pi.prettyVersion }}" data-package="details_{{ (pi.prettyVersion ~ pi.sourceReference)|sha1 }}">
<a href="#" class="package-link bs-tooltip" title="{{ pi.prettyVersion }}" data-package="details_{{ (pi.prettyVersion ~ pi.sourceReference)|sha1 }}">
{{ pi.prettyVersion|truncate(40) }}

{% if adapter.alias is not null %}
Expand All @@ -128,7 +128,7 @@
</div>
<div class="float-right">
<span class="badge badge-primary badge-pill" title="Downloads">{{ version_downloads(version)|number_format }}</span>
<a href="{{ package_download_url(pi) }}" data-toggle="tooltip" title="Download"><i class="fas fa-download"></i></a>
<a href="{{ package_download_url(pi) }}" title="Download"><i class="fas fa-download bs-tooltip"></i></a>
</div>
</li>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/views/Repo/add.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% endblock %}

{% block pageActions %}
<a href="{{ path('devliver_repo_index') }}" data-toggle="tooltip" title="{{ 'action.cancel'|trans }}" class="btn btn-outline-danger"><span class="fa fa-ban fa-fw"></span> {{ 'action.cancel'|trans }}</a>
<a href="{{ path('devliver_repo_index') }}" title="{{ 'action.cancel'|trans }}" class="btn btn-outline-danger bs-tooltip"><span class="fa fa-ban fa-fw"></span> {{ 'action.cancel'|trans }}</a>
{% endblock %}

{% block content %}
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/views/Repo/edit.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
{% endblock %}

{% block pageActions %}
<a href="{{ path('devliver_repo_add') }}" data-toggle="tooltip" title="{{ 'action.add'|trans }}" class="btn btn-primary"><span class="fa fa-plus fa-fw"></span> {{ 'action.add'|trans }}</a>
<a href="{{ path('devliver_repo_add') }}" title="{{ 'action.add'|trans }}" class="btn btn-primary bs-tooltip"><span class="fa fa-plus fa-fw"></span> {{ 'action.add'|trans }}</a>
{{ parent() }}
{% endblock %}
10 changes: 5 additions & 5 deletions src/Resources/views/Repo/list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% endblock %}

{% block pageActions %}
<a class="btn btn-outline-primary" href="{{ path('devliver_repo_update_all') }}"><span class="fas fa-sync fa-fw"></span> {{ 'action.update_all'|trans }}</a>
<a class="btn btn-outline-primary bs-confirmation" href="{{ path('devliver_repo_update_all') }}" data-confirmation="Do you really want to update all repositories? This can take a long time."><span class="fas fa-sync fa-fw"></span> {{ 'action.update_all'|trans }}</a>
<a class="btn btn-primary" href="{{ path('devliver_repo_add') }}"><span class="fas fa-plus fa-fw"></span> {{ 'repository.add_repositories'|trans }}</a>
{% endblock %}

Expand All @@ -28,7 +28,7 @@
</div>
<input type="text" name="filter" value="{{ app.request.query.get('filter') }}" class="form-control" placeholder="Filter">
<div class="input-group-append">
<button class="btn btn-outline-primary" type="submit">Search</button>
<button class="btn btn-outline-primary"type="submit">Search</button>
<a href="{{ path(app.request.get('_route')) }}" class="btn btn-outline-danger">Reset</a>
</div>

Expand Down Expand Up @@ -67,9 +67,9 @@
</td>
<td style="white-space: nowrap; width: 1px;">
<div class="btn-group">
<a href="{{ path('devliver_repo_edit', { id: repo.id }) }}" data-toggle="tooltip" title="{{ 'action.edit'|trans }}" class="btn btn-xs btn-outline-primary"><span class="fa fa-edit fa-fw"></span></a>
<a href="{{ path('devliver_repo_update', { id: repo.id, referer: true }) }}" data-toggle="tooltip" title="{{ 'action.update'|trans }}" class="btn btn-xs btn-outline-info"><span class="fa fa-sync fa-fw"></span></a>
<a href="{{ path('devliver_repo_delete', { id: repo.id }) }}" data-toggle="tooltip" title="{{ 'action.remove'|trans }}" class="btn btn-xs btn-outline-danger"><span class="fa fa-trash fa-fw"></span></a>
<a href="{{ path('devliver_repo_edit', { id: repo.id }) }}" title="{{ 'action.edit'|trans }}" class="bs-tooltip btn btn-xs btn-outline-primary"><span class="fa fa-edit fa-fw"></span></a>
<a href="{{ path('devliver_repo_update', { id: repo.id, referer: true }) }}" title="{{ 'action.update'|trans }}" class="bs-tooltip btn btn-xs btn-outline-info"><span class="fa fa-sync fa-fw"></span></a>
<a href="{{ path('devliver_repo_delete', { id: repo.id }) }}" data-title="Remove?" title="{{ 'action.remove'|trans }}" class="btn btn-xs bs-confirmation bs-tooltip btn-outline-danger"><span class="fa fa-trash fa-fw"></span></a>
</div>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/views/_Partials/header.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<form class="form-inline ml-auto mr-3">
{% if latest_release.name != current_release.name and is_granted('ROLE_USER') %}
<a class="btn btn-warning" data-toggle="tooltip" title="{{ latest_release.name }}" href="https://github.com/shapecode/devliver/releases" target="_blank">
<a class="btn btn-warning bs-tooltip" title="{{ latest_release.name }}" href="https://github.com/shapecode/devliver/releases" target="_blank">
Update Available
</a>
{% endif %}
Expand Down
13 changes: 12 additions & 1 deletion src/Resources/views/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,26 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
<script src="https://use.fontawesome.com/releases/v5.0.13/js/all.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap-confirmation2/dist/bootstrap-confirmation.min.js"></script>
{% endblock %}

<script>
$(function () {
$('[data-toggle="tooltip"]').tooltip();
$('.bs-tooltip').tooltip();
$('.bs-confirmation').confirmation({
rootSelector: '.bs-confirmation',
popout: true,
singleton: true,
title: function () {
return $(this).data('confirmation');
}
});
});
{% block post_js %}{% endblock %}
</script>

{% block javascripts_post %}{% endblock %}
</body>
</html>

0 comments on commit cbd6b5a

Please sign in to comment.