Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / templates / im / projects / projectapplication_form.html @ 32a70876

History | View | Annotate | Download (6.9 kB)

1
{% extends "im/account_base.html" %}
2

    
3
{% load filters %}
4
{% load astakos_tags %}
5
{% block headjs %}
6
        {{ block.super }}         
7
        <script src="{{ IM_STATIC_URL }}js/quotas.js"></script>        
8
{% endblock %}        
9

    
10
{% block page.body %}
11
<h2>
12
    {% if update_form %}REQUEST PROJECT MODIFICATION{% else %}REQUEST PROJECT{% endif %}
13
     
14
</h2>
15

    
16
{% if not show_form %}
17
<p>These are the specifications of the Project you want to create. If you hit the "Submit" button
18
this form will be officially sent to GRNET for review. Please make sure the following reflect
19
exactly your request.</p>
20
{% endif %}
21

    
22
{% if show_form %}
23
<form action="?verify=1" method="post" class="withlabels quotas-form" id="group_create_form">{% csrf_token %}
24

    
25
    <fieldset class="with-info" id="top">
26
            <legend>
27
                    1. PROJECT DETAILS
28
                        <span class="info"> 
29
                            <em>more info</em>
30
                <span> To create a new Project, first enter the following
31
                    required fields.  The information you enter, except
32
                    <i>Comments for review</i>, will be visible to all ~okeanos
33
                    users. </span>
34
                    </span>                    
35
            </legend>
36
        {% for key, err in form.errors.items %}
37
        {% if key == "__all__" %}
38
        <div class="form-error">{{ err }}</div>
39
        {% endif %}
40
        {% endfor %}
41

    
42
        {% for field in form %}
43
        {% if  field.name in details_fields %}
44
            <div class="form-row {% if field.errors|length %}with-errors
45
        {% endif %}
46
        {% if field.is_hidden %}with-hidden{% endif %}">
47
                {{ field.errors }}
48
                 <p class="clearfix {% if field.blank %}required{% endif %}">
49
                    {{ field.label_tag }}
50
                    {{ field|safe }}
51
                    <span class="extra-img">&nbsp;</span>
52
                    {%  if field.help_text %}
53
                        <span class="info">
54
                            <em>more info</em>
55
                            <span>{{ field.help_text|safe }}</span>
56
                        </span>
57
                    {% endif %}
58
                 </p>
59
            </div>
60
        {% endif %}
61
        {% endfor %}
62
                
63
                
64
                
65
        
66
        {% for g, resources in resource_catalog %}
67
                    {% for r in resources %}
68
                {% with r.str_repr as rname %}
69
                        {% with object|resource_grants|lookup:rname as value %}
70
                            <input type="hidden" id="{{'id_'|add:rname|add:'_uplimit'}}" name="{{rname|add:'_uplimit'}}"  {% if  %}value="{{value}}"{% endif %} />
71
                {% endwith %}
72
                {% endwith %}
73
            {% endfor %}
74
        {% endfor %}
75
    </fieldset>
76
    <fieldset class="with-info">
77
            <legend>
78
                    2. MEMBERSHIP OPTIONS
79
                        <span class="info"> 
80
                            <em>more info</em>
81
                            <span> Membership options </span>
82
                    </span>                    
83
            </legend>
84
            {% for field in form %}
85
             
86
            {% if  field.name in membership_fields %}
87
                <div class="form-row {% if field.errors|length %}with-errors{% endif %}  {% if field.is_hidden %}with-hidden{% endif %}">
88
                        {{ field.errors }}
89
                             <p class="clearfix {% if field.blank %}required{% endif %}">
90
                                {{ field.label_tag }}
91
                                {{ field|safe }}
92
                                <span class="extra-img">&nbsp;</span>
93
                                {%  if field.help_text %}
94
                                        <span class="info"> 
95
                                                    <em>more info</em>
96
                                                    <span>{{ field.help_text|safe }}</span>
97
                                            </span>
98
                                {% endif %}
99
                             </p>
100
                        </div>
101
                {% endif %}
102
                {% endfor %}
103

    
104
        
105
    </fieldset>
106
    
107
    <fieldset id="icons">
108
            <legend>
109
                    3. RESOURCES
110
                    <span class="info"> 
111
                            <em>more info</em>
112
                            <span>Here you add resources to your Project. Each resource you specify here, will be granted to *EACH* user of this Project. So the total resources will be: &lt;Total number of members&gt; * &lt;amount_of_resource&gt; for each resource. </span>
113
                    </span>    
114
            </legend>
115
            <ul class="clearfix">
116
                {% with object|resource_groups as groups %}
117
            {% for g, group_info in resource_groups.items %}
118
                {% if g %}
119
                            <li>
120
                                <a href="#{{ g }}" id="{{'group_'|add:g}}" {% if  in  %}class="selected"{% endif %}><img src="/static/im/images/create-{{ g }}.png" alt="vm"/></a>
121
                                    <input type="hidden" name="proxy_{{ 'is_selected_'|add:g }}"  id="proxy_{{ 'id_is_selected_'|add:g }}" {% if  in  %}value="1"{% else %}value="0"{% endif %}>
122
                                    <input type="hidden" name="{{ 'is_selected_'|add:g }}"  id="{{ 'id_is_selected_'|add:g }}" {% if  in  %}value="1"{% else %}value="0"{% endif %}>
123
                        <p class="msg">{{ group_info.help_text }}</p>
124
                            </li>
125
                            {% endif %}
126
            {% endfor %}
127
            {% endwith %}
128
            </ul>
129
            
130
    </fieldset>
131
    <div class="visible">&nbsp;</div>
132
    <div class="not-visible">
133
            {% for gname, resources in resource_catalog %}
134
                 <div class="group {{'group_'|add:gname}}" id="{{ gname }}">
135
                            <a href="#icons" class="delete">X remove resource</a>        
136
                            {% for rdata in resources %}
137
                {% with rdata.str_repr as rname %}
138
                            <fieldset class="quota">
139
                                    
140
                                    <legend>
141
                                            {% if rdata.is_abbreviation %}
142
                                                    {{ rdata.verbose_name|upper }}
143
                                            {% else %}
144
                                                    {{ rdata.verbose_name|capfirst }}
145
                                            {% endif %}
146
                                            <span class="info"> 
147
                                                    <em>more info</em>
148
                                                    <span>{{ rdata.help_text }}</span>
149
                                            </span>  
150
                                    </legend>
151
                                    <div class="form-row">
152
                                            <p class="clearfix">
153
                                                    <label for="{{'id_'|add:rname|add:'_uplimit'}}_proxy" >
154
                                Total {{rdata.pluralized_display_name}} per user
155
                                                        </label>
156
                                                    <input         type="text" 
157
                                                                               id="{{'id_'|add:rname|add:'_uplimit'}}_proxy" 
158
                                                                               name="{{rname|add:'_uplimit'}}_proxy" 
159
                                                                               placeholder="{{ rdata.placeholder}} " 
160
                                                                               {% if  == 'bytes' %} 
161
                                                                                         class="dehumanize"
162
                                                                                {% endif  %}
163
                                                                                {% if  %}
164
                                                                                        {% with |add:'_uplimit' as  %}
165
                                                                                        value = "{{ request.POST|lookup:input_value }}"
166
                                                                                        {% endwith %}
167
                                                                                {% else %}
168
                                                                                        value = "{% get_grant_value rname form %}"
169
                                                                                {% endif %}
170
                                                                               autocomplete="off"                        
171
                                                        > 
172
                                                       <span class="extra-img">&nbsp;</span>
173
                                                 <span class="info"><em>more info</em><span>{{ rdata.help_text_input_each }}</span></span>
174
                                            </p>
175
                                            <p class="error-msg">Invalid format</p>
176
                                            <p class="msg"></p>
177
                                    </div>
178
                                </fieldset>        
179
                {% endwith %}
180
                                {% endfor %}
181
                    </div>
182
                     
183
            {% endfor %}
184
    </div>
185
    
186
        <input type="hidden" name="user"  id="id_user" value="{{user.id}}">  
187
        <div class="form-row submit">
188
                   <input type="submit" value="CONTINUE" class="submit altcol" >
189
        </div>
190
</form>
191
{% else %}
192
    {% include "im/projects/projectapplication_form_summary.html" %}
193
{% endif %}
194

    
195
<script>
196
        
197
</script>         
198

    
199
{% endblock %}