~mvngu/igraph/doc

« back to all changes in this revision

Viewing changes to nexus/cgi-bin/templates/dataset.html

  • Committer: Gabor Csardi
  • Date: 2012-02-21 04:05:12 UTC
  • mfrom: (2640.1.1 0.6-main)
  • Revision ID: csardi.gabor@gmail.com-20120221040512-n2orudv0a2cdw3g1
Merged Nexus branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
$def with (ds, tags, meta, formats, papers, networks=[])
 
2
 
 
3
<div class="title"><h2>$ds.name [$ds.sid]
 
4
$if check_admin(redirect=False):
 
5
    <span class="edit">
 
6
      <a href="$:getbase()/web/edit/$ds.id">[edit]</a>
 
7
      <a href="$:getbase()/web/check/$ds.id">[check]</a>
 
8
      <a href="$:getbase()/web/delete/$ds.id">[delete]</a>
 
9
      <a href="$:getbase()/web/recreate/$ds.id">[recreate]</a>
 
10
    </span>
 
11
</h2></div>
 
12
 
 
13
<div class="dataset">
 
14
<p class="datasettags2">
 
15
  $if ds.nnets > 1:
 
16
    $ds.nnets networks,
 
17
  $if ds.minv==ds.maxv:
 
18
    $ds.minv
 
19
  $else:
 
20
    $ds.minv-$ds.maxv
 
21
  vertices, 
 
22
  $if ds.mine==ds.maxe:
 
23
    $ds.mine
 
24
  $else:
 
25
    $ds.mine-$ds.maxe 
 
26
  edges.
 
27
  Tags:
 
28
  $:", ".join(link_to_tag(getbase(), tag) for tag in tags)
 
29
<p class="datasetdate2">$ds.date</p>
 
30
 
 
31
<p>$ds.shortdescription</p>
 
32
 
 
33
<h3>Download</h3>
 
34
<ul class="download">
 
35
$for k,f in dataformats.items():
 
36
  <li>
 
37
  <span style="width:35px;float:left;">
 
38
    $if k in formats.keys():
 
39
      <a href="$:getbase()/api/dataset?id=${ds.id}&format=$k">
 
40
      <img src="$:getbase()/static/images/formats/${k}.png" 
 
41
           style="display:block;height:20px;margin-left:auto;margin-right:auto;" 
 
42
           alt="" title="Download in $k format" /></a>
 
43
  </span>
 
44
  $if k in formats.keys():
 
45
    <a href="$:getbase()/api/dataset?id=${ds.id}&format=$k">${k} format</a> 
 
46
    ($pretty_size(formats[k].size)) &ndash; $formats[k].shortdesc,
 
47
    <a href="$:getbase()/api/format?dataformat=$k&format=html">more...</a>
 
48
  </li>
 
49
  
 
50
</ul>
 
51
 
 
52
<h3>Description</h3>
 
53
<div class="datasetdescription">
 
54
$:markdown(ds.description)
 
55
</div>
 
56
 
 
57
$if ds.nnets > 1 and len(networks) > 1:
 
58
  <h3>Networks</h3>
 
59
  <dl class="networks">
 
60
  $for net in networks:
 
61
    <dt>($net.id) '$net.sid'</dt>
 
62
    <dd>$net.vertices vertices, $net.edges edges. $net.description</dd>
 
63
    
 
64
 
 
65
$if len(meta) > 0:
 
66
  <h3>Metadata</h3>
 
67
  <dl class="metadata">
 
68
  $for m in meta:
 
69
    <dt>$m.type.capitalize() attribute '$m.name'</dt>
 
70
    <dd>
 
71
      $if m.network=='NULL' and len(networks) > 1:
 
72
        (all)
 
73
      $elif len(networks) > 1:
 
74
        ($m.network)
 
75
      $m.description
 
76
    </dd>
 
77
  </dl>
 
78
 
 
79
$if len(papers) > 0:
 
80
  <h3>Publication(s)</h3>
 
81
  $for p in papers:
 
82
    <p>$p.citation</p>
 
83
 
 
84
<h3>Source</h3>
 
85
<p>$:makelinks(ds.source)</p>
 
86
 
 
87
<h3>Licence</h3>
 
88
<p><a href="$ds.licence_url">$ds.licence_name</a></p>
 
89
 
 
90
</div>