Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (6.3 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>CREATE PROJECT</h2>
12

    
13
{% if show_form %}
14
<form action="?verify=1" method="post" class="withlabels quotas-form" id="group_create_form">{% csrf_token %}
15

    
16
    <fieldset class="with-info" id="top">
17
            <legend>
18
                    1. PROJECT DETAILS
19
                        <span class="info"> 
20
                            <em>more info</em>
21
                <span> To create a new Project, first enter the following
22
                    required fields.  The information you enter, except
23
                    <i>Comments for review</i>, will be visible to all ~okeanos
24
                    users. </span>
25
                    </span>                    
26
            </legend>
27
            {% for field in form %}
28
     
29
            {% if  field.name in details_fields %}
30
                <div class="form-row {% if field.errors|length %}with-errors
31
        {% endif %}
32
        {% if field.is_hidden %}with-hidden{% endif %}">
33
                        {{ field.errors }}
34
                             <p class="clearfix {% if field.blank %}required{% endif %}">
35
                                {{ field.label_tag }}
36
                                {{ field|safe }}
37
                                <span class="extra-img">&nbsp;</span>
38
                                {%  if field.help_text %}
39
                                        <span class="info"> 
40
                                                    <em>more info</em>
41
                                                    <span>{{ field.help_text|safe }}</span>
42
                                            </span>
43
                                {% endif %}
44
                             </p>
45
                        </div>
46
                {% endif %}
47
                {% endfor %}
48
                
49
                
50
                
51
        
52
        {% for g, resources in resource_catalog %}
53
                    {% for r in resources %}
54
                {% with r.str_repr as rname %}
55
                        {% with object|resource_grants|lookup:rname as value %}
56
                            <input type="hidden" id="{{'id_'|add:rname|add:'_uplimit'}}" name="{{rname|add:'_uplimit'}}"  {% if  %}value="{{value}}"{% endif %} />
57
                {% endwith %}
58
                {% endwith %}
59
            {% endfor %}
60
        {% endfor %}
61
    </fieldset>
62
    <fieldset class="with-info">
63
            <legend>
64
                    2. MEMBERSHIP OPTIONS
65
                        <span class="info"> 
66
                            <em>more info</em>
67
                            <span> Membership options </span>
68
                    </span>                    
69
            </legend>
70
            {% for field in form %}
71
             
72
            {% if  field.name in membership_fields %}
73
                <div class="form-row {% if field.errors|length %}with-errors{% endif %}  {% if field.is_hidden %}with-hidden{% endif %}">
74
                        {{ field.errors }}
75
                             <p class="clearfix {% if field.blank %}required{% endif %}">
76
                                {{ field.label_tag }}
77
                                {{ field|safe }}
78
                                <span class="extra-img">&nbsp;</span>
79
                                {%  if field.help_text %}
80
                                        <span class="info"> 
81
                                                    <em>more info</em>
82
                                                    <span>{{ field.help_text|safe }}</span>
83
                                            </span>
84
                                {% endif %}
85
                             </p>
86
                        </div>
87
                {% endif %}
88
                {% endfor %}
89

    
90
        
91
    </fieldset>
92
    
93
    <fieldset id="icons">
94
            <legend>
95
                    3. RESOURCES
96
                    <span class="info"> 
97
                            <em>more info</em>
98
                            <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>
99
                    </span>    
100
            </legend>
101
            <ul class="clearfix">
102
                {% with object|resource_groups as groups %}
103
            {% for g, group_info in resource_groups.items %}
104
                {% if g %}
105
                            <li>
106
                                <a href="#{{ g }}" id="{{'group_'|add:g}}" {% if  in  %}class="selected"{% endif %}><img src="/static/im/images/create-{{ g }}.png" alt="vm"/></a>
107
                                    <input type="hidden" name="proxy_{{ 'is_selected_'|add:g }}"  id="proxy_{{ 'id_is_selected_'|add:g }}" {% if  in  %}value="1"{% else %}value="0"{% endif %}>
108
                                    <input type="hidden" name="{{ 'is_selected_'|add:g }}"  id="{{ 'id_is_selected_'|add:g }}" {% if  in  %}value="1"{% else %}value="0"{% endif %}>
109
                        <p class="msg">{{ group_info.help_text }}</p>
110
                            </li>
111
                            {% endif %}
112
            {% endfor %}
113
            {% endwith %}
114
            </ul>
115
            
116
    </fieldset>
117
    <div class="visible">&nbsp;</div>
118
    <div class="not-visible">
119
            {% for gname, resources in resource_catalog %}
120
                 <div class="group {{'group_'|add:gname}}" id="{{ gname }}">
121
                            <a href="#icons" class="delete">X remove resource</a>        
122
                            {% for rdata in resources %}
123
                {% with rdata.str_repr as rname %}
124
                            <fieldset class="quota">
125
                                    
126
                                    <legend>
127
                                            {% if rdata.is_abbreviation %}
128
                                                    {{ rdata.verbose_name|upper }}
129
                                            {% else %}
130
                                                    {{ rdata.verbose_name|capfirst }}
131
                                            {% endif %}
132
                                            <span class="info"> 
133
                                                    <em>more info</em>
134
                                                    <span>{{ rdata.help_text }}</span>
135
                                            </span>  
136
                                    </legend>
137
                                    <div class="form-row">
138
                                            <p class="clearfix">
139
                                                    <label for="{{'id_'|add:rname|add:'_uplimit'}}_proxy" >
140
                                                                Total {% if rdata.is_abbreviation %}{{ rdata.verbose_name|upper }}{% else %}{{ rdata.verbose_name }}{% endif %}{% if not rdata.unit %}s {% endif  %}  per user
141
                                                        </label>
142
                                                    <input         type="text" 
143
                                                                               id="{{'id_'|add:rname|add:'_uplimit'}}_proxy" 
144
                                                                               name="{{rname|add:'_uplimit'}}_proxy" 
145
                                                                               placeholder="{{ rdata.placeholder}} " 
146
                                                                               {% if  == 'bytes' %} 
147
                                                                                         class="dehumanize"
148
                                                                                {% endif  %}
149
                                                                                {% if  %}
150
                                                                                        {% with |add:'_uplimit' as  %}
151
                                                                                        value = "{{ request.POST|lookup:input_value }}"
152
                                                                                        {% endwith %}
153
                                                                                {% else %}
154
                                                                                        value = "{% get_grant_value rname form %}"
155
                                                                                {% endif %}
156
                                                                               autocomplete="off"                        
157
                                                        > 
158
                                                       <span class="extra-img">&nbsp;</span>
159
                                                 <span class="info"><em>more info</em><span>{{ rdata.help_text_input_each }}</span></span>
160
                                            </p>
161
                                            <p class="error-msg">Invalid format</p>
162
                                            <p class="msg"></p>
163
                                    </div>
164
                                </fieldset>        
165
                {% endwith %}
166
                                {% endfor %}
167
                    </div>
168
                     
169
            {% endfor %}
170
    </div>
171
    
172
        <input type="hidden" name="user"  id="id_user" value="{{user.id}}">  
173
        <div class="form-row submit">
174
                   <input type="submit" value="CONTINUE" class="submit altcol" >
175
        </div>
176
</form>
177
{% else %}
178
    {% include "im/projects/projectapplication_form_summary.html" %}
179
{% endif %}
180

    
181
<script>
182
        
183
</script>         
184

    
185
{% endblock %}