12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- {% extends "base.html" %}
- {% load static %}
- {% block head_extra %}
- <script>
- $(document).ready(function() {
- // Initialize the tooltip.
- $('#copy-button').tooltip();
- // When the copy button is clicked, select the value of the text box, attempt
- // to execute the copy command, and trigger event to update tooltip message
- // to indicate whether the text was successfully copied.
- $('#copy-button').bind('click', function() {
- var input = document.querySelector('#copy-input');
- input.setSelectionRange(0, input.value.length + 1);
- try {
- var success = document.execCommand('copy');
- if (success) {
- $('#copy-button').trigger('copied', ['Copied!']);
- } else {
- $('#copy-button').trigger('copied', ['Copy with Ctrl-c']);
- }
- } catch (err) {
- $('#copy-button').trigger('copied', ['Copy with Ctrl-c']);
- }
- });
- // Handler for updating the tooltip message.
- $('#copy-button').bind('copied', function(event, message) {
- $(this).attr('title', message)
- .tooltip('fixTitle')
- .tooltip('show')
- .attr('title', "Copy to Clipboard")
- .tooltip('fixTitle');
- });
- });
- </script>
- {% endblock %}
- {% block title %}{{object.name}}{% endblock %}
- {% block content %}
- <a href="{% url "games:game_list" %}">Back to list</a>
- <p><img src="{{object.screenshot.url}}" /></p>
- <dl>
- <dt>Released
- <dd>{{object.release_date|date:"Y/m/d"}}</dd>
- <dt>Players</dt>
- <dd>{{object.players}}</dd>
- <dt>Game System</dt>
- <dd>
- <a href="{{game.game_system.get_absolute_url}}">
- <span class="system-badge badge badge-success {{game.game_system.retropie_slug}}">{{game.game_system.name|upper}}</span>
- </a>
- </dd>
- <dt>Genre</dt>
- <dd>{% for genre in object.genre.all %}{{genre}}{% if not forloop.last %}, {% endif %}{% endfor %}</dd>
- <dt>Region</dt>
- <dd>{{object.region}}</dd>
- <dt>Publisher/Developer</dt>
- <dd><a href="{{object.publisher.get_absolute_url}}">{{object.publisher}}</a>/<a href="{{object.developer.get_absolute_url}}">{{object.developer}}</a></dd>
- <dt>Rating</dt>
- <dd>{{game.rating_by_100}}</dd>
- </dl>
- {% if object.webretro_url %}
- <p><a href="{{game.webretro_url}}" class="btn btn-primary" targe="_blank">Play</a></p>
- {% elif object.retroarch_cmd %}
- <p>
- <form>
- <div class="input-group">
- <input type="text" class="form-control"
- value="{{object.retroarch_cmd}}" placeholder="" id="copy-input">
- <span class="input-group-btn">
- <button class="btn btn-default" type="button" id="copy-button"
- data-toggle="tooltip" data-placement="button"
- title="Copy to Clipboard">
- Copy
- </button>
- </span>
- </div>
- </form>
- </p>
- {% endif %}
- <p>{{object.description}}</p>
- {% endblock %}
|