cmip6_file.html 6.63 KB
Newer Older
1
{% extends "landingpage/cmip6_headerfooter.html" %}
2

3
{% block content %}
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
    <!--
    The context object needs the following objects:

    Simple values:

    * filename
    * handle [*]
    * filesize
    * checksum
    * checksum_method
    * any_parent_replaced (Boolean): To indicate if we have to insert the note about replaced datasets
    
    Complex objects:

    * urls_original: List of dicts. Every dict needs:
        * host [*]
        * url [*]
    * urls_replicas: List of dicts. Every dict needs:
        * host [*]
        * url [*]
    * list_of_aggregation_handles: List of strings (handles).
        These handles can be retrieved from the file handle record, but it is very little information.
        The user needs to click on them to know what they are, if they are up-to-date, etc.
        Alternative: list_of_aggregation_records
    * list_of_aggregation_records: List of dicts.
        This contains more info, which is extracted from the records of the aggregation handles, so more
        calls to retrieve handle records are needed. Maybe one day this could be done on user's request only.
        Every dict needs:
        * level (e.g. "dataset") [*]
34
35
        * version
        * title [*] (can be drs-name, can be file name... depends on the level)
36
37
38
39
40
41
42
43
        * handle [*]
        * replaced (True or False) [*]

    [*] I do not check the existence of these, so if they don't exist, the page may break.
        
    -->


44
        <div class="section">
45
46
47
48
49
            {% if filename %}
                <h1><em>{{filename}}</em> (file)</h1>
            {% else %}
                <h1>File <em>(filename unknown)</em></h1>
            {% endif %}
50
51
        </div>

52
53


54
55
56
        <div class="section">
            <h2>General information</h2>
            <table>
57
            {% if filename %}
58
                <tr>
59
                    <td class="leftcol">File name</td>
60
                    <td>{{filename}}</td>
61
62
63
                </tr>
            {% endif %}
            <tr>
64
                <td class="leftcol">Persistent identifier</td>
65
66
                <td><a href="http://hdl.handle.net/{{handle}}">hdl:{{handle}}</a></td>
            </tr>
67
            {% if filesize %}
68
                <tr>
69
                    <td class="leftcol">File size</td>
70
                    <td>{{filesize}}</td>
71
72
73
74
                </tr>
            {% endif %}
            {% if checksum and not checksum_method%}
                <tr>
75
                    <td class="leftcol">Checksum</td>
76
77
78
79
80
                    <td>{{checksum}}</td>
                </tr>
            {% else %}
            {% if checksum and checksum_method %}
                <tr>
81
                    <td class="leftcol">Checksum ({{checksum_method}})</td>
82
83
84
85
86
87
                    <td>{{checksum}}</td>
                </tr>
            {% endif %}{% endif %}
            </table>
        </div>

88

89
90
91
92
93
94
95
        <div class="section">
            <h2>Data access</h2>

            {% if urls_original or urls_replica %}
                <table>
                {% if urls_original %}
                {% for entry in urls_original %}
96
                    <tr>   
97
                        <td class="leftcol">Hosted by {{entry.host}}:</td>
98
99
100
101
102
103
                        <td><a href="{{entry.url}}">{{entry.url}}</a></td>
                    </tr>
                {% endfor %}
                {% endif %}
                {% if urls_replicas %}
                {% for entry in urls_replicas %}
104
                    <tr> 
105
                        <td class="leftcol">Mirrored at {{entry.host}}:</td>
106
107
108
109
110
111
112
113
114
115
116
117
                        <td><a href="{{entry.url}}">{{entry.url}}</a> (Replica)</td>
                    </tr>
                {% endfor %}
                {% endif %}
                </table>
            {% endif %}
        </div>


        <div class="section">
            <h2>The file is part of the following aggregation(s)</em></h2>

118
            {% if list_of_aggregation_records %}
119
                <table>
120
                {% for item in list_of_aggregation_records %}
121
                    <tr>
122
                        <td class="leftcol">{{item.level}}</td>
123
                        <td>
124
125
126
127
                            {{ item.title }}
                            {% if item.version %}
                                (version {{ item.version }})
                            {% endif %}
128
                            <br/><a href="http://hdl.handle.net/{{ item.handle }}/">hdl:{{ item.handle }}</a>
129
130
                            {% if item.replaced %}
                                <!--/td><td class="replaced"><span class="attention">Attention, this {{item.level}} was replaced by a newer version!*</span-->
131
                                <br/><br/><span class="note"><img height="20px" src="/static/warning_cmip6_green_transparent.png"><strong>&nbsp;This {{item.level}} was replaced by a newer version.</strong> If a dataset containing this file was replaced by a newer version, it is possible that there was an issue with this file, but not necessarily. It is also possible that the dataset was replaced due to problems in other files or due to lacking files. Please refer to the dataset's errata description to get more information. You can find information on the errata on the dataset's landing page or at the ESGF Errata Service.</span>                          
132
                            {% endif %}
133
134
135
                        </td>
                    </tr>
                {% endfor %}
136
                <!--
137
138
                {% if any_parent_replaced %}
                    <tr class="note">
139
140
                        <td colspan="3"><span class="note">
                            <img height="14px" src="/static/warning_cmip6_green_transparent.png"><strong>&nbsp;This dataset was replaced by a newer version.</strong> If a dataset containing this file was replaced by a newer version, it is possible that there was an issue with this file, but not necessarily. It is also possible that the dataset was replaced due to problems in other files or due to lacking files. Please refer to the dataset's errata description to get more information. You can find information on the errata on the dataset's landing page or at the ESGF Errata Service.</span>
141
142
143
                        </td>
                    </tr>
                {% endif %}
144
                -->
145
146
                </table>

147
            {% else %}{% if list_of_aggregation_handles %}
148
                <table>
149
                {% for handle in list_of_aggregation_handles %}
150
151
152
153
154
155
156
157
                    <tr><td><a href="http://hdl.handle.net/{{ handle }}/">{{ handle }}</a></td></tr>
                {% endfor %}
                </table>
            {% else %}
                <p>No information on which aggregations this handle belongs to.</p>
            {% endif %}{% endif %}
        </div>

158
{% endblock %}