Statistics
| Branch: | Tag: | Revision:

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

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

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

    
178
<script>
179
        
180
</script>         
181

    
182
{% endblock %}