projectapplication_form.html 6.09 KB
Newer Older
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
1
2
3
{% extends "im/account_base.html" %}

{% load filters %}
Olga Brani's avatar
Olga Brani committed
4
{% load astakos_tags %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
5
6
7
8
{% block headjs %}
	{{ block.super }}	 
	<script src="{{ IM_STATIC_URL }}js/quotas.js"></script>	
{% endblock %}	
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
9

10
{% block page.body %}
11
<h2>CREATE PROJECT</h2>
Olga Brani's avatar
Olga Brani committed
12
13
 
{% with resource_catalog|populated_resource_catalog as resource_catalog %}
14
15
{% if show_form %}
<form action="?verify=1#top" method="post" class="withlabels quotas-form" id="group_create_form">{% csrf_token %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
16
17
18

    <fieldset class="with-info" id="top">
    	<legend>
19
    		1. PROJECT DETAILS
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
20
21
			<span class="info"> 
		    	<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>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
23
24
	    	</span>    		
    	</legend>
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
    	{% for field in form %}
     
    	{% if  field.name in details_fields %}
	        <div class="form-row {% if field.errors|length %}with-errors{% endif %}  {% if field.is_hidden %}with-hidden{% endif %}">
		        {{ field.errors }}
			     <p class="clearfix {% if field.blank %}required{% endif %}">
			        {{ field.label_tag }}
			        {{ field|safe }}
			        <span class="extra-img">&nbsp;</span>
			        {%  if field.help_text %}
			        	<span class="info"> 
						    <em>more info</em>
						    <span>{{ field.help_text|safe }}</span>
					    </span>
			        {% endif %}
			     </p>
			</div>
		{% endif %}
		{% endfor %}
		
		
		
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
47
48
49
50
        
        {% for g, resources in resource_catalog.get_groups_resources %}
	    	{% for rname in resources.keys %}
	    	    {% with object|resource_grants|lookup:rname as value %}
Olga Brani's avatar
Olga Brani committed
51
	    	        <input type="hidden" id="{{'id_'|add:rname|add:'_uplimit'}}" name="{{rname|add:'_uplimit'}}" autocomplete="off" {% if value %}value="{{value}}"{% endif %} />
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
52
53
54
                {% endwith %}
            {% endfor %}
        {% endfor %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
55
    </fieldset>
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
    <fieldset class="with-info">
    	<legend>
    		2. MEMBERSHIP OPTIONS
			<span class="info"> 
		    	<em>more info</em>
		    	<span> Membership options </span>
	    	</span>    		
    	</legend>
    	{% for field in form %}
    	 
    	{% if  field.name in membership_fields %}
	        <div class="form-row {% if field.errors|length %}with-errors{% endif %}  {% if field.is_hidden %}with-hidden{% endif %}">
		        {{ field.errors }}
			     <p class="clearfix {% if field.blank %}required{% endif %}">
			        {{ field.label_tag }}
			        {{ field|safe }}
			        <span class="extra-img">&nbsp;</span>
			        {%  if field.help_text %}
			        	<span class="info"> 
						    <em>more info</em>
						    <span>{{ field.help_text|safe }}</span>
					    </span>
			        {% endif %}
			     </p>
			</div>
		{% endif %}
		{% endfor %}

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

Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
173
174
175
<script>
	
</script>	 
176
177

{% endwith %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
178
{% endblock %}