Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (7 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 {{ BRANDING_COMPANY_NAME }} 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 {{ BRANDING_SERVICE_NAME }}
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 }}" 
121
                    id="{{'group_'|add:g}}" 
122
                    {% if  in  %}class="selected"{% endif %}>
123
                    <img src="{{ IM_STATIC_URL }}images/create-{{ g }}.png" alt="vm"/></a>
124
                <input type="hidden" name="proxy_{{ 'is_selected_'|add:g }}" 
125
                id="proxy_{{ 'id_is_selected_'|add:g }}" {% if  in  %}value="1"{% else %}value="0"{% endif %}>
126
                                    <input type="hidden" name="{{ 'is_selected_'|add:g }}"  id="{{ 'id_is_selected_'|add:g }}" {% if  in  %}value="1"{% else %}value="0"{% endif %}>
127
                        <p class="msg">{{ group_info.help_text }}</p>
128
                            </li>
129
                            {% endif %}
130
            {% endfor %}
131
            {% endwith %}
132
            </ul>
133
            
134
    </fieldset>
135
    <div class="visible">&nbsp;</div>
136
    <div class="not-visible">
137
            {% for gname, resources in resource_catalog %}
138
                 <div class="group {{'group_'|add:gname}}" id="{{ gname }}">
139
                <a href="#icons" class="delete">X remove resource</a>        
140
                            {% for rdata in resources %}
141
                {% with rdata.str_repr as rname %}
142
                            <fieldset class="quota">
143
                                    
144
                                    <legend>
145
                                            {% if rdata.is_abbreviation %}
146
                                                    {{ rdata.verbose_name|upper }}
147
                                            {% else %}
148
                                                    {{ rdata.verbose_name|capfirst }}
149
                                            {% endif %}
150
                                            <span class="info"> 
151
                                                    <em>more info</em>
152
                                                    <span>{{ rdata.help_text }}</span>
153
                                            </span>  
154
                                    </legend>
155
                                    <div class="form-row">
156
                                            <p class="clearfix">
157
                                                    <label for="{{'id_'|add:rname|add:'_uplimit'}}_proxy" >
158
                                Total {{rdata.pluralized_display_name}} per user
159
                                                        </label>
160
                                                    <input         type="text" 
161
                                                                               id="{{'id_'|add:rname|add:'_uplimit'}}_proxy" 
162
                                                                               name="{{rname|add:'_uplimit'}}_proxy" 
163
                                                                               placeholder="{{ rdata.placeholder}} " 
164
                                                                               {% if  == 'bytes' %} 
165
                                                                                         class="dehumanize"
166
                                                                                {% endif  %}
167
                                                                                {% if  %}
168
                                                                                        {% with |add:'_uplimit' as  %}
169
                                                                                        value = "{{ request.POST|lookup:input_value }}"
170
                                                                                        {% endwith %}
171
                                                                                {% else %}
172
                                                                                        value = "{% get_grant_value rname form %}"
173
                                                                                {% endif %}
174
                                        autocomplete="off"> 
175
                                                       <span class="extra-img">&nbsp;</span>
176
                                                 <span class="info"><em>more info</em><span>{{ rdata.help_text_input_each }}</span></span>
177
                                            </p>
178
                                            <p class="error-msg">Invalid format</p>
179
                                            <p class="msg"></p>
180
                                    </div>
181
                                </fieldset>        
182
                {% endwith %}
183
                                {% endfor %}
184
                    </div>
185
                     
186
            {% endfor %}
187
    </div>
188
    
189
        <input type="hidden" name="user"  id="id_user" value="{{user.id}}">  
190
        <div class="form-row submit">
191
                   <input type="submit" value="CONTINUE" class="submit altcol" >
192
        </div>
193
</form>
194
{% else %}
195
    {% include "im/projects/projectapplication_form_summary.html" %}
196
{% endif %}
197

    
198
<script>
199
        
200
</script>         
201

    
202
{% endblock %}