File: row.html

package info (click to toggle)
python-ase 3.26.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,484 kB
  • sloc: python: 148,112; xml: 2,728; makefile: 110; javascript: 47
file content (138 lines) | stat: -rw-r--r-- 3,493 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
{% extends 'ase/db/templates/layout.html' %}

{% macro atoms() %}
<div id="appdiv"></div>
<div class="row align-items-center">
  <div class="col-6">
    <a class="btn btn-primary btn-sm" href="/gui/{{ row.id }}">Open ASE's GUI</a>
  </div>
  <div class="col-3 px-1">
    <div class="btn-group pull-right">
      <button type="button" class="btn btn-primary dropdown-toggle btn-sm"
              data-bs-toggle="dropdown">
        Unit cell <span class="caret"></span>
      </button>
      <ul class="dropdown-menu">
        <li><a onclick="repeatCell(1, 1, 1);">1x1x1</a></li>
        <li><a onclick="repeatCell({{ n1 }}, {{ n2 }}, {{ n3 }});">
            {{ n1 }}x{{ n2 }}x{{ n3 }}</a></li>
      </ul>
    </div>
  </div>
  <div class="col-3">
    <div class="btn-group pull-right">
      <button type="button" class="btn btn-primary dropdown-toggle btn-sm"
              data-bs-toggle="dropdown">
        Download <span class="caret"></span>
      </button>
      <ul class="dropdown-menu">
        <li><a href="/atoms/{{ project.name }}/{{ row.id }}/xyz">xyz</a></li>
        <li><a href="/atoms/{{ project.name }}/{{ row.id }}/json">json</a></li>
      </ul>
    </div>
  </div>
</div>
{% endmacro %}

{% macro cell() %}
<table class="table table-striped">
  <thead>
    <tr>
      <th>Axis</th>
      <th>x</th>
      <th>y</th>
      <th>z</th>
      <th>Periodic</th>
    </tr>
  </thead>
  <tbody>
  {% for axis in dct.cell %}
    <tr>
      <td>{{ loop.index }}</td>
      {% for a in axis %} <td>{{ a }}</td>{% endfor %}
      <td>{{ row.pbc[loop.index0] }}</td>
    </tr>
  {% endfor %}
  </tbody>
</table>
<table class="table table-striped">
  <tbody>
    <tr>
      <td>Lengths:</td>
      {% for L in dct.lengths %}<td>{{ L }}</td>{% endfor %}
    </tr>
    <tr>
      <td>Angles:</td>
      {% for a in dct.angles %}<td>{{ a }}</td>{% endfor %}
    </tr>
  </tbody>
</table>
{% endmacro %}


{% block title %}
Summary
{% endblock %}

{% set n1, n2, n3 = dct.size %}

{% block head %}
<script src="{{ url_for('static', filename='jsmol/JSmol.min.js') }}"></script>

<script>
jmol_isReady = function(applet)
{
    Jmol._getElement(applet, "appletdiv").style.border="1px solid lightgray";
    Jmol.script(jmolApplet0, "set displaycellparameters false;")
    Jmol.script(jmolApplet0,
    "load /atoms/{{ project.name }}/{{ row.id }}/cif { {{ n1 }} {{ n2 }} {{ n3 }} };");
    }
</script>

<script src="{{ url_for('static', filename='row.js') }}"></script>
{% endblock %}

{% block navbar %}
<li>
  <a href="/{{ project.name }}/">Back to search page</a>
</li>
{% endblock %}

{% block content %}

<div class="container-fluid">
  <h1>{{ dct.formula|safe }}</h1>

  <h4 class="card-title">Structure</h4>
  <div class="card">
    <div class="col-md-6 p-2">
      {{ atoms() }}
      <div class="col">{{ cell() }}</div>
    </div> <!--END col-md-6-->
  </div> <!--END CARD-->

  <div class="col-9">
    <h4 class="card-title mt-2">Keys and values</h4>
    <div class="card">
      <table class="table table-striped">
        <thead>
          <tr>
            <th>Key</th>
            <th>Description</th>
            <th>Value</th>
          </tr>
        </thead>
        <tbody>
        {% for key, desc, val in dct.table %}
          <tr>
            <td> {{ key }} </td>
            <td> {{ desc }} </td>
            <td> {{ val|safe }} </td>
          </tr>
        {% endfor %}
        </tbody>
      </table>
    </div> <!--END Col-9-->
  </div>
</div>
{% endblock content %}