Statistics
| Branch: | Tag: | Revision:

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

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
{% with resource_catalog|populated_resource_catalog as resource_catalog %}
14
{% if show_form %}
15
<form action="?verify=1#top" method="post" class="withlabels quotas-form" id="group_create_form">{% csrf_token %}
16

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

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

    
173
<script>
174
        
175
</script>         
176

    
177
{% endwith %}
178
{% endblock %}