Skip to content

Commit

Permalink
Merge pull request #575 from plural/full-uuid-support
Browse files Browse the repository at this point in the history
Full UUID support
  • Loading branch information
plural authored Jan 26, 2022
2 parents 288ee45 + e706fe3 commit 1462c70
Show file tree
Hide file tree
Showing 30 changed files with 379 additions and 396 deletions.
2 changes: 1 addition & 1 deletion app/Resources/views/Activity/decklist_comment.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<a href="{{ path('decklist_detail', { 'decklist_id': item.comment.decklist.id, 'decklist_name': item.comment.decklist.prettyname|e('url') }) }}#comment-{{ item.comment.id }}" class="list-group-item{% if item.unchecked %} list-group-item-warning{% endif %}">
<a href="{{ path('decklist_view', { 'decklist_uuid': item.comment.decklist.uuid, 'decklist_name': item.comment.decklist.prettyname|e('url') }) }}#comment-{{ item.comment.id }}" class="list-group-item{% if item.unchecked %} list-group-item-warning{% endif %}">
<span class="glyphicon glyphicon-comment" style="margin-right:1em"></span>
{% if item.comment.author.id != app.user.id %}
<span class="username {{ item.comment.author.faction }}">{{ item.comment.author.username }}</span>
Expand Down
2 changes: 1 addition & 1 deletion app/Resources/views/Activity/decklist_publish.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<a href="{{ path('decklist_detail', { 'decklist_id': item.decklist.id, 'decklist_name': item.decklist.prettyname|e('url') }) }}" class="list-group-item{% if item.unchecked %} list-group-item-warning{% endif %}">
<a href="{{ path('decklist_view', { 'decklist_uuid': item.decklist.uuid, 'decklist_name': item.decklist.prettyname|e('url') }) }}" class="list-group-item{% if item.unchecked %} list-group-item-warning{% endif %}">
<span class="glyphicon glyphicon-list-alt" style="margin-right:1em"></span>
{% if item.decklist.user.id != app.user.id %}
<span class="username {{ item.decklist.user.faction }}">{{ item.decklist.user.username }}</span>
Expand Down
6 changes: 3 additions & 3 deletions app/Resources/views/Builder/deck.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<script src="{{ asset('/js/nrdb.smart_filter.js') }}"></script>
<script src="{{ asset('/js/nrdb.suggestions.js') }}"></script>
<script src="{{ asset('/js/nrdb.diff.js') }}"></script>
<script src="{{ asset('/js/deck.js') }}"></script>
<script src="{{ asset('/js/deck.v2.js') }}"></script>
<script type="text/javascript">
var Filters = {},
Expand All @@ -25,7 +25,7 @@ var Filters = {},
MWL_global_penalty = false,
Deck = {{ deck.slots|json_encode|raw }},
Side = {{ deck.side_name|json_encode|raw }},
Deck_id = {{ deck.id|json_encode|raw }},
Deck_uuid = {{ deck.uuid|json_encode|raw }},
History = {{ deck.history|json_encode|raw }},
Url_FactionImage = '{{ asset('/images/factions/16px/xxx.png') }}',
Url_TypeImage = '{{ asset('/images/types/xxx.png') }}',
Expand Down Expand Up @@ -243,7 +243,7 @@ var Filters = {},
{% if published_decklists|length %}
{% for decklist in published_decklists %}
<tr>
<td class="decklist-name"><a href="{{ path('decklist_detail', { 'decklist_id': decklist.id, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a></td>
<td class="decklist-name"><a href="{{ path('decklist_view', { 'decklist_uuid': decklist.uuid, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a></td>
<td class="social"><span class="glyphicon glyphicon-heart social-icon-like"></span> {{ decklist.nbvotes }}</td>
<td class="social"><span class="glyphicon glyphicon-star social-icon-favorite"></span> {{ decklist.nbfavorites }}</td>
<td class="social"><span class="glyphicon glyphicon-comment social-icon-comment"></span> {{ decklist.nbcomments }}</td>
Expand Down
16 changes: 8 additions & 8 deletions app/Resources/views/Builder/decks.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
{% block head %}
<script src="{{ asset('/js/nrdb.card_modal.js') }}"></script>
<script src="{{ asset('/js/nrdb.diff.js') }}"></script>
<script src="{{ asset('/js/publish_deck_form.js') }}"></script>
<script src="{{ asset('/js/decks.js') }}"></script>
<script src="{{ asset('/js/publish_deck_form.v2.js') }}"></script>
<script src="{{ asset('/js/decks.v2.js') }}"></script>
<script type="text/javascript">
var Identity = null,
LastClickedDeck = null,
Expand Down Expand Up @@ -103,7 +103,7 @@ var Identity = null,
<div class="col-md-12">
<div class="list-group" id="decks" data-sort-type="date_update" data-sort-order="1">
{% for deck in decks %}
<a href="#" class="list-group-item deck-list-group-item" id="deck_{{ deck.id }}" data-id="{{ deck.id }}" data-problem="{{ deck.problem }}" data-faction="{{ deck.faction_code }}">
<a href="#" class="list-group-item deck-list-group-item" id="deck_{{ deck.uuid }}" data-id="{{ deck.id }}" data-uuid="{{ deck.uuid }}" data-problem="{{ deck.problem }}" data-faction="{{ deck.faction_code }}">
<div class="deck-list-identity-image hidden-xs" title="{{ deck.identity_title }}" style="background-image:url({{ asset('/card_image/small/'~deck.identity_code~'.jpg') }})"></div>
<h4 class="decklist-name">{{ deck.name }}{% if deck.message %} <span class="glyphicon glyphicon-exclamation-sign text-danger" title="{{ deck.message }}"></span>{% endif %}</h4>
<div>
Expand Down Expand Up @@ -245,7 +245,7 @@ var Identity = null,
<div class="row">
<div class="col-md-12">
<form action="{{ path('deck_delete') }}" method="POST" enctype="application/x-www-form-urlencoded" id="delete-deck-form">
<input type="hidden" name="deck_id" id="delete-deck-id" value="">
<input type="hidden" name="deck_uuid" id="delete-deck-uuid" value="">
<p>
Are you sure that you want to delete the deck <b id="delete-deck-name"></b>?
</p>
Expand Down Expand Up @@ -274,7 +274,7 @@ var Identity = null,
<div class="row">
<div class="col-md-12">
<form action="{{ path('deck_delete_list') }}" method="POST" enctype="application/x-www-form-urlencoded" id="delete-deck-list-form">
<input type="hidden" name="ids" id="delete-deck-list-id" value="">
<input type="hidden" name="uuids" id="delete-deck-list-uuid" value="">
<p>
Are you sure that you want to delete all the decks selected?
</p>
Expand Down Expand Up @@ -412,7 +412,7 @@ var Identity = null,
<input class="form-control" type="text" name="tags" id="tag_add_tags" placeholder="a-tag another">
</div>
<div class="pull-right">
<input type="hidden" name="ids" id="tag_add_ids">
<input type="hidden" name="uuids" id="tag_add_uuids">
<button type="submit" class="btn btn-success" onclick="$('#tagAddModal').modal('hide');tag_add_process(event)">Add</button>
<button type="button" class="btn btn-default" onclick="$('#tagAddModal').modal('hide')">Cancel</button>
</div>
Expand Down Expand Up @@ -442,7 +442,7 @@ var Identity = null,
<input class="form-control" type="text" name="tags" id="tag_remove_tags" placeholder="a-tag another">
</div>
<div class="pull-right">
<input type="hidden" name="ids" id="tag_remove_ids">
<input type="hidden" name="uuids" id="tag_remove_uuids">
<button type="submit" class="btn btn-success" onclick="$('#tagRemoveModal').modal('hide');tag_remove_process(event)">Remove</button>
<button type="button" class="btn btn-default" onclick="$('#tagRemoveModal').modal('hide')">Cancel</button>
</div>
Expand Down Expand Up @@ -471,7 +471,7 @@ var Identity = null,
<label>Are you sure you want to clear all tags from the selected decks?</label>
</div>
<div class="pull-right">
<input type="hidden" name="ids" id="tag_clear_ids">
<input type="hidden" name="uuids" id="tag_clear_uuids">
<button type="submit" class="btn btn-success" onclick="$('#tagClearModal').modal('hide');tag_clear_process(event)">Yes, clear</button>
<button type="button" class="btn btn-default" onclick="$('#tagClearModal').modal('hide')">Cancel</button>
</div>
Expand Down
10 changes: 5 additions & 5 deletions app/Resources/views/Builder/deckview.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<script src="{{ asset('/js/nrdb.deck_gallery.js') }}"></script>
<script src="{{ asset('/js/nrdb.draw_simulator.js') }}"></script>
<script src="{{ asset('/js/nrdb.card_modal.js') }}"></script>
<script src="{{ asset('/js/publish_deck_form.js') }}"></script>
<script src="{{ asset('/js/deckview.js') }}"></script>
<script src="{{ asset('/js/publish_deck_form.v2.js') }}"></script>
<script src="{{ asset('/js/deckview.v2.js') }}"></script>
<script type="text/javascript">
var Identity = null,
Expand Down Expand Up @@ -170,7 +170,7 @@ var Identity = null,
{% if published_decklists|length %}
{% for decklist in published_decklists %}
<tr>
<td class="decklist-name"><a href="{{ path('decklist_detail', { 'decklist_id': decklist.id, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a></td>
<td class="decklist-name"><a href="{{ path('decklist_view', { 'decklist_uuid': decklist.uuid, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a></td>
<td class="social"><span class="glyphicon glyphicon-heart social-icon-like"></span> {{ decklist.nbvotes }}</td>
<td class="social"><span class="glyphicon glyphicon-star social-icon-favorite"></span> {{ decklist.nbfavorites }}</td>
<td class="social"><span class="glyphicon glyphicon-comment social-icon-comment"></span> {{ decklist.nbcomments }}</td>
Expand All @@ -191,7 +191,7 @@ var Identity = null,
{% if parent_decklists|length %}
{% for decklist in parent_decklists %}
<tr>
<td class="decklist-name"><a href="{{ path('decklist_detail', { 'decklist_id': decklist.id, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a></td>
<td class="decklist-name"><a href="{{ path('decklist_view', { 'decklist_uuid': decklist.uuid, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a></td>
<td class="social"><span class="glyphicon glyphicon-heart social-icon-like"></span> {{ decklist.nbvotes }}</td>
<td class="social"><span class="glyphicon glyphicon-star social-icon-favorite"></span> {{ decklist.nbfavorites }}</td>
<td class="social"><span class="glyphicon glyphicon-comment social-icon-comment"></span> {{ decklist.nbcomments }}</td>
Expand Down Expand Up @@ -272,7 +272,7 @@ var Identity = null,
<div class="row">
<div class="col-md-12">
<form action="{{ path('deck_delete') }}" method="POST" enctype="application/x-www-form-urlencoded" id="delete-deck-form">
<input type="hidden" name="deck_id" id="delete-deck-id" value="">
<input type="hidden" name="deck_uuid" id="delete-deck-uuid" value="">
<p>
Are you sure that you want to delete the deck <b id="delete-deck-name"></b>?
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</td>
<td>
<div>
<a href="{{ path('decklist_detail', { 'decklist_id': decklist.id, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a>
<a href="{{ path('decklist_view', { 'decklist_uuid': decklist.uuid, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a>
</div>
<div class="small">
<i>{{ decklist.lastpack }}</i>
Expand Down
4 changes: 2 additions & 2 deletions app/Resources/views/Decklist/decklist-row.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div style="border-top: 1px solid #ddd;margin-bottom: 10px;padding-top: 10px;">
<div class="visible-xs-block">
<a href="{{ path('decklist_detail', { 'decklist_id': decklist.id, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a>
<a href="{{ path('decklist_view', { 'decklist_uuid': decklist.uuid, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a>
</div>
<div class="media" style="margin-top:0">
<div class="media-left">
Expand All @@ -9,7 +9,7 @@
<div class="media-body">
<div class="row h4 hidden-xs">
<div class="col-sm-9">
<a href="{{ path('decklist_detail', { 'decklist_id': decklist.id, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a>
<a href="{{ path('decklist_view', { 'decklist_uuid': decklist.uuid, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a>
</div>
<div class="col-sm-3 small social">
<span class="glyphicon glyphicon-heart social-icon-like"></span> {{ decklist.nbvotes }}
Expand Down
12 changes: 6 additions & 6 deletions app/Resources/views/Decklist/decklist.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
{% block head %}
<script src="{{ asset('/js/nrdb.draw_simulator.js') }}"></script>
<script src="{{ asset('/js/nrdb.card_modal.js') }}"></script>
<script src="{{ asset('/js/publish_deck_form.js') }}"></script>
<script src="{{ asset('/js/decklist.js') }}"></script>
<script src="{{ asset('/js/publish_deck_form.v2.js') }}"></script>
<script src="{{ asset('/js/decklist.v2.js') }}"></script>
<script type="text/javascript">
var Identity = null,
Expand Down Expand Up @@ -49,7 +49,7 @@ NRDB.user.params.decklist_id = Decklist.id;
</a>
</div>
{% if duplicate %}
| <small>Duplicate of <a href="{{ path('decklist_detail', { 'decklist_id': duplicate.id, 'decklist_name': duplicate.prettyname|e('url') }) }}">{{ duplicate.name }}</a></small>
| <small>Duplicate of <a href="{{ path('decklist_view', { 'decklist_uuid': duplicate.uuid, 'decklist_name': duplicate.prettyname|e('url') }) }}">{{ duplicate.name }}</a></small>
{% endif %}
</div>
</div>
Expand Down Expand Up @@ -256,7 +256,7 @@ NRDB.user.params.decklist_id = Decklist.id;
{% if precedent_decklists|length %}
{% for decklist in precedent_decklists %}
<tr>
<td class="decklist-name"><a href="{{ path('decklist_detail', { 'decklist_id': decklist.id, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a></td>
<td class="decklist-name"><a href="{{ path('decklist_view', { 'decklist_uuid': decklist.uuid, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a></td>
<td class="social"><span class="glyphicon glyphicon-heart social-icon-like"></span> {{ decklist.nbvotes }}</td>
<td class="social"><span class="glyphicon glyphicon-star social-icon-favorite"></span> {{ decklist.nbfavorites }}</td>
<td class="social"><span class="glyphicon glyphicon-comment social-icon-comment"></span> {{ decklist.nbcomments }}</td>
Expand All @@ -277,7 +277,7 @@ NRDB.user.params.decklist_id = Decklist.id;
{% if successor_decklists|length %}
{% for decklist in successor_decklists %}
<tr>
<td class="decklist-name"><a href="{{ path('decklist_detail', { 'decklist_id': decklist.id, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a></td>
<td class="decklist-name"><a href="{{ path('decklist_view', { 'decklist_uuid': decklist.uuid, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a></td>
<td class="social"><span class="glyphicon glyphicon-heart social-icon-like"></span> {{ decklist.nbvotes }}</td>
<td class="social"><span class="glyphicon glyphicon-star social-icon-favorite"></span> {{ decklist.nbfavorites }}</td>
<td class="social"><span class="glyphicon glyphicon-comment social-icon-comment"></span> {{ decklist.nbcomments }}</td>
Expand Down Expand Up @@ -383,7 +383,7 @@ NRDB.user.params.decklist_id = Decklist.id;
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<form action="{{ path('decklist_delete', {decklist_id:decklist.id}) }}" method="POST" enctype="application/x-www-form-urlencoded" id="delete-decklistform">
<form action="{{ path('decklist_delete', {decklist_uuid:decklist.uuid}) }}" method="POST" enctype="application/x-www-form-urlencoded" id="delete-decklistform">
<input type="hidden" name="decklist_id" id="delete-decklist-id" value="{{ decklist.id }}">
<p>Are you sure you want to delete this decklist?</p>
<div class="pull-right">
Expand Down
2 changes: 1 addition & 1 deletion app/Resources/views/Default/allcomments.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<tr>
<td>
<div>{{ comment.date_creation|date('j M Y') }} on <a href="{{ path('decklist_detail', {decklist_id:comment.decklist_id,decklist_name:comment.decklist_prettyname}) }}#{{ comment.id }}">{{ comment.decklist_name }}</a>, by <a href="{{ path('user_profile_view', {user_id:comment.user_id,user_name:comment.author|e('url')}) }}" class="comment-author username">{{ comment.author }}</a>:</div>
<div>{{ comment.date_creation|date('j M Y') }} on <a href="{{ path('decklist_view', {decklist_uuid:comment.decklist_uuid,decklist_name:comment.decklist_prettyname}) }}#{{ comment.id }}">{{ comment.decklist_name }}</a>, by <a href="{{ path('user_profile_view', {user_id:comment.user_id,user_name:comment.author|e('url')}) }}" class="comment-author username">{{ comment.author }}</a>:</div>
{{ comment.text|raw }}
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion app/Resources/views/Default/decklist_of_the_week.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div id="highlight" class="decklist">

<h2 class="section">Decklist of the week </h2>
<h3><a class="decklist-name" href="{{ path('decklist_detail', { 'decklist_id': decklist.id, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a></h3>
<h3><a class="decklist-name" href="{{ path('decklist_view', { 'decklist_uuid': decklist.uuid, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a></h3>

<!-- Identity and Stats -->
<div class="row">
Expand Down
6 changes: 3 additions & 3 deletions app/Resources/views/Default/publish_decklist_form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<form action="{% if decklist %}{{ path('decklist_edit', {decklist_id:decklist.id}) }}{% else %}{{ path('decklist_new') }}{% endif %}" method="POST" enctype="application/x-www-form-urlencoded" id="publish-decklist-form">
<input type="hidden" name="decklist_id" id="publish-decklist-id" value="{% if decklist %}{{ decklist.id }}{% endif %}">
<input type="hidden" name="deck_id" id="publish-deck-id">
<form action="{% if decklist %}{{ path('decklist_edit', {decklist_uuid:decklist.uuid}) }}{% else %}{{ path('decklist_new') }}{% endif %}" method="POST" enctype="application/x-www-form-urlencoded" id="publish-decklist-form">
<input type="hidden" name="decklist_uuid" id="publish-decklist-uuid" value="{% if decklist %}{{ decklist.uuid }}{% endif %}">
<input type="hidden" name="deck_uuid" id="publish-deck-uuid">
<div class="form-group">
<label for="publish-decklist-name">Name</label>
<input type="text" class="form-control decklist-name" name="name" id="publish-decklist-name" maxlength="60" placeholder="Enter a name for this decklist" value="{% if decklist %}{{ decklist.name }}{% endif %}">
Expand Down
2 changes: 1 addition & 1 deletion app/Resources/views/Default/usercomments.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<tr>
<td>
<div>{{ comment.date_creation|date('j M Y') }} on <a href="{{ path('decklist_detail', {decklist_id:comment.decklist_id,decklist_name:comment.decklist_prettyname}) }}#{{ comment.id }}">{{ comment.decklist_name }}</a>:</div>
<div>{{ comment.date_creation|date('j M Y') }} on <a href="{{ path('decklist_view', {decklist_uuid:comment.decklist_uuid,decklist_name:comment.decklist_prettyname}) }}#{{ comment.id }}">{{ comment.decklist_name }}</a>:</div>
{{ comment.text|raw }}
</td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions app/Resources/views/Diff/decklistsDiff.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<div class="row">
<div class="col-sm-4">
<h3><a href="{{ path('decklist_detail', {'decklist_id': decklist1.id,'decklist_name':decklist1.prettyname}) }}">{{ decklist1.name }}</a></h3>
<h3><a href="{{ path('decklist_view', {'decklist_uuid': decklist1.uuid,'decklist_name':decklist1.prettyname}) }}">{{ decklist1.name }}</a></h3>
{% for card in decklist1.content %}
<div>
{{ card.qty }}x
Expand All @@ -26,7 +26,7 @@
{% endfor %}
</div>
<div class="col-sm-4">
<h3><a href="{{ path('decklist_detail', {'decklist_id': decklist2.id,'decklist_name':decklist2.prettyname}) }}">{{ decklist2.name }}</a></h3>
<h3><a href="{{ path('decklist_view', {'decklist_uuid': decklist2.uuid,'decklist_name':decklist2.prettyname}) }}">{{ decklist2.name }}</a></h3>
{% for card in decklist2.content %}
<div>
{{ card.qty }}x
Expand Down
2 changes: 1 addition & 1 deletion app/Resources/views/Faction/faction.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<span class="glyphicon glyphicon-star social-icon-favorite"></span> {{ decklist.nbfavorites }}
<span class="glyphicon glyphicon-comment social-icon-comment"></span> {{ decklist.nbcomments }}
</small>
<a class="decklist-name" href="{{ path('decklist_detail', { 'decklist_id': decklist.id, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a>
<a class="decklist-name" href="{{ path('decklist_view', { 'decklist_uuid': decklist.uuid, 'decklist_name': decklist.prettyname|e('url') }) }}">{{ decklist.name }}</a>
</h4>
<h5>
<time class="pull-right" datetime="{{ decklist.dateCreation|date('c') }}">{{ decklist.dateCreation|date('j M Y') }}</time>
Expand Down
Loading

0 comments on commit 1462c70

Please sign in to comment.