|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- {% extends 'base.html' %}
-
- {% block content %}
-
- <div class="row">
- <div class="col">
- <h1 class="text-center">{% block title %} {{ resource['name'] }} {% endblock %}</h1>
- </div>
- </div>
- {% if current_user.is_authenticated %}
- {% if resource['type'] == 'tool' %}
- <div class="row text-center py-3">
- <a href="{{ url_for('tool.edit_tool', tool_id=resource['id']) }}">
- <span class="badge bg-dark">Edit</span>
- </a>
- </div>
- {% elif resource['type'] == 'practice' %}
- <div class="row text-center py-3">
- <a href="{{ url_for('practice.edit_practice', practice_id=resource['id']) }}">
- <span class="badge bg-dark">Edit</span>
- </a>
- </div>
- {% elif resource['type'] == 'book' %}
- <div class="row text-center py-3">
- <a href="{{ url_for('book.edit_book', book_id=resource['id']) }}">
- <span class="badge bg-dark">Edit</span>
- </a>
- </div>
- {% endif %}
- {% endif %}
- <div class="row">
- <div class="col">
- <table class="table table-hover">
- <tbody>
- <tr>
- <th>
- Created:
- </th>
- <td>
- {{ resource['created'].strftime("%Y-%m-%d %H:%M") }} UTC
- </td>
- </tr>
- {% if resource['description'] %}
- <tr>
- <th>
- Description:
- </th>
- <td>
- {{ resource['description'] }}
- </td>
- </tr>
- {% endif %}
- <!-- fields for tools -->
- {% if resource['developer'] %}
- <tr>
- <th>
- Developer
- </th>
- <td>
- {% if resource['developerUrl'] %}
- <a href="{{ resource['developerUrl'] }}">{{ resource['developer'] }}</a>
- {% else %}
- {{ resource['developer'] }}
- {% endif %}
- </td>
- </tr>
- {% endif %}
- {% if resource['license'] %}
- <tr>
- <th>
- Software license:
- </th>
- <td>
- {{ resource['license'] }}
- </td>
- </tr>
- {% endif %}
- {% if resource['scriptingLanguage'] %}
- <tr>
- <th>
- Software language(s):
- </th>
- <td>
- {{ resource['scriptingLanguage'] }}
- </td>
- </tr>
- {% endif %}
- {% if resource['projectUrl'] %}
- <tr>
- <th>
- Project page:
- </th>
- <td>
- <a href="{{ resource['projectUrl'] }}">{{ resource['projectUrl'] }}</a>
- </td>
- </tr>
- {% endif %}
- {% if resource['repositoryUrl'] %}
- <tr>
- <th>
- Code repository:
- </th>
- <td>
- <a href="{{ resource['repositoryUrl'] }}">{{ resource['repositoryUrl'] }}</a>
- </td>
- </tr>
- {% endif %}
- {% if resource['expertiseToUse'] %}
- <tr>
- <th>
- Expertise required to use:
- </th>
- <td>
- {{ resource['expertiseToUse'] }}
- </td>
- </tr>
- {% endif %}
- {% if resource['expertiseToHost'] %}
- <tr>
- <th>
- Expertise required to self-host:
- </th>
- <td>
- {{ resource['expertiseToHost'] }}
- </td>
- </tr>
- {% endif %}
- {% if resource['dependencies'] %}
- <tr>
- <th>
- Technical dependencies:
- </th>
- <td>
- {{ resource['dependencies'] }}
- </td>
- </tr>
- {% endif %}
- {% if resource['ingestFormats'] %}
- <tr>
- <th>
- Import / ingest formats:
- </th>
- <td>
- {{ resource['ingestFormats'] }}
- </td>
- </tr>
- {% endif %}
- {% if resource['outputFormats'] %}
- <tr>
- <th>
- Output formats:
- </th>
- <td>
- {{ resource['outputFormats'] }}
- </td>
- </tr>
- {% endif %}
- {% if resource['status'] %}
- <tr>
- <th>
- Platform status:
- </th>
- <td>
- {{ resource['status'] }}
- </td>
- </tr>
- {% endif %}
- <!-- fields for practices -->
- {% if resource['experimental'] %}
- <tr>
- <th>
- How is this / Can this be an experimental practice?
- </th>
- <td>
- {{ resource['experimental'] }}
- </td>
- </tr>
- {% endif %}
- {% if resource['lessonsLearned'] %}
- <tr>
- <th>
- How has it been applied experimentally (lessons learned for authors and publishers)?
- </th>
- <td>
- <p style="white-space: pre-line">{{ resource['lessonsLearned'] }}</p>
- </td>
- </tr>
- {% endif %}
- {% if resource['references'] %}
- <tr>
- <th>
- References:
- </th>
- <td>
- <p style="white-space: pre-line">{{ resource['references'] }}</p>
- </td>
- </tr>
- {% endif %}
- </tbody>
- </table>
- </div>
- </div>
- {% if relationships %}
- <div class="row">
- <div class="col">
- <h2 class="text-center">Linked resources:</h2>
- </div>
- </div>
- <div class="row">
- {% for relationship in relationships %}
- <div class="col-md-4 col-sm-6 py-3">
- {% if relationship['type'] == 'tool' %}
- <div class="card text-dark bg-tool mb-3">
- <div class="card-body">
- <a href="{{ url_for('tool.show_tool', tool_id=relationship['id']) }}">
- <h3 class="card-title text-center text-dark">{{ relationship['name'] }}</h3>
- </a>
- <p class="card-text">
- {{ relationship['description']|truncate(100) }}
- </p>
- </div>
- </div>
- {% elif relationship['type'] == 'practice' %}
- <div class="card text-dark bg-practice mb-3">
- <div class="card-body">
- <a href="{{ url_for('practice.show_practice', practice_id=relationship['id']) }}">
- <h3 class="card-title text-center text-dark">{{ relationship['name'] }}</h3>
- </a>
- <p class="card-text">
- {{ relationship['description']|truncate(100) }}
- </p>
- </div>
- </div>
- {% elif relationship['type'] == 'book' %}
- <div class="card text-dark bg-book mb-3">
- <div class="card-body">
- <a href="{{ url_for('book.show_book', book_id=relationship['id']) }}">
- <h3 class="card-title text-center text-dark">{{ relationship['name'] }}</h3>
- </a>
- <p class="card-text">
- {{ relationship['description']|truncate(100) }}
- </p>
- </div>
- </div>
- {% endif %}
- </div>
- {% endfor %}
- </div>
- {% endif %}
- {% endblock %}
|