Commit 2a5290786024b72ba78ea498e57bce0fb313d4e3

Authored by Alexis Koralewski
1 parent 3f6876e5
Exists in dev

Fix some issues for period & scientific program (UI changes) (to be completed)

src/core/pyros_django/scientific_program/functions.py
... ... @@ -16,17 +16,17 @@ def get_svg_timeline(previous_period,current_period,future_period):
16 16 <text x="32%" y="35%" fontsize="2em" fill="white">Private data access</text>'
17 17 svg_content+=f'<svg id="detail_previous_period"><text x="0%" y="35%" fontsize="2em" fill="black">Previous(P{current_period.id})</text>' +exploit_previous_period +"\n"+ data_access_previous_period + "</svg>"
18 18  
19   - exploit_previous_period = f'<rect id="exploit_previous_period" x="5%" y=0 width="20%" height="60%" style="fill:rgb(230, 244, 177);stroke-width:1"></rect>\
20   - <text class="date_text" x="5%" y="90%" fontsize="2em" fill="black">{current_period.start_date.strftime("%d/%m/%Y")}</text>\
21   - <text x="15%" y="35%" fontsize="2em" fill="black">Exploitation</text>'
22   - #<text x="20%" y="15%" fontsize="2em" fill="black">{current_period.end_date.strftime("%d/%m/%Y")}</text>\
23   - data_access_previous_period = f'<rect id="data_access_previous_period" x=25% y=0 width="40%" height="60%" style="fill:blue; stroke-width:1"></rect>\
24   - <text class="date_text" x="25%" y="90%" fontsize="2em" fill="black">{current_period.end_date.strftime("%d/%m/%Y")}</text>\
25   - <text class="date_text" x="60%" y="90%" fontsize="2em" fill="black">{current_period.property_of_data_end_date.strftime("%d/%m/%Y")}</text>\
26   - <text x="32%" y="35%" fontsize="2em" fill="white">Private data access</text>'
27   - svg_content+=f'<svg id="detail_previous_period"><text x="0%" y="35%" fontsize="2em" fill="black">Previous (P{current_period.id})</text>' +exploit_previous_period +"\n"+ data_access_previous_period + "</svg>"
  19 + # exploit_previous_period = f'<rect id="exploit_previous_period" x="5%" y=0 width="20%" height="60%" style="fill:rgb(230, 244, 177);stroke-width:1"></rect>\
  20 + # <text class="date_text" x="5%" y="90%" fontsize="2em" fill="black">{current_period.start_date.strftime("%d/%m/%Y")}</text>\
  21 + # <text x="15%" y="35%" fontsize="2em" fill="black">Exploitation</text>'
  22 + # #<text x="20%" y="15%" fontsize="2em" fill="black">{current_period.end_date.strftime("%d/%m/%Y")}</text>\
  23 + # data_access_previous_period = f'<rect id="data_access_previous_period" x=25% y=0 width="40%" height="60%" style="fill:blue; stroke-width:1"></rect>\
  24 + # <text class="date_text" x="25%" y="90%" fontsize="2em" fill="black">{current_period.end_date.strftime("%d/%m/%Y")}</text>\
  25 + # <text class="date_text" x="60%" y="90%" fontsize="2em" fill="black">{current_period.property_of_data_end_date.strftime("%d/%m/%Y")}</text>\
  26 + # <text x="32%" y="35%" fontsize="2em" fill="white">Private data access</text>'
  27 + # svg_content+=f'<svg id="detail_previous_period"><text x="0%" y="35%" fontsize="2em" fill="black">Previous (P{current_period.id})</text>' +exploit_previous_period +"\n"+ data_access_previous_period + "</svg>"
28 28 if current_period is not None:
29   - proposal_current_period = f'<rect id="proposal_current_period" x="5%" y=0 width="20%" height="60%" style="fill:silver;stroke-width:1"></rect>\
  29 + proposal_current_period = f'<rect id="proposal_current_period" x="10%" y=0 width="20%" height="60%" style="fill:silver;stroke-width:1"></rect>\
30 30 <text class="date_text" x="5%" y="75%" fontsize="2em" fill="black">{current_period.submission_start_date.strftime("%d/%m/%Y")}</text>\
31 31 <text x="15%" y="37%" fontsize="2em" fill="white">SP Proposal</text>'
32 32 #<text x="20%" y="45%" fontsize="2e" fill="black">{current_period.start_date.strftime("%d/%m/%Y")}</text>\
... ... @@ -41,7 +41,7 @@ def get_svg_timeline(previous_period,current_period,future_period):
41 41  
42 42 svg_content += "\n"+ f'<svg id="detail_current_period"><text x="0%" y="38%" fontsize="2em" fill="black">Current (P{current_period.id})</text>' + proposal_current_period + "\n" + exploit_current_period + "\n" + data_access_current_period + "</svg>"
43 43 if future_period is not None:
44   - proposal_future_period = f'<rect id="proposal_future_period" x="5%" y=0% width="40%" height="60%" style="fill:silver;stroke-width:1"></rect>\
  44 + proposal_future_period = f'<rect id="proposal_future_period" x="10%" y=0% width="40%" height="60%" style="fill:silver;stroke-width:1"></rect>\
45 45 <text class="date_text" x="5%" y="75%" fontsize="2em" fill="black">{future_period.submission_start_date.strftime("%d/%m/%Y")}</text>\
46 46 <text x="32%" y="37%" fontsize="2em" fill="white">SP Proposal</text>'
47 47  
... ... @@ -63,7 +63,7 @@ def get_global_svg_timeline(previous_period,current_period,future_period):
63 63 svg_future_period = ""
64 64  
65 65 if previous_period is not None:
66   - previous_period_svg = f'<rect class="previous_period" x="5%" y=0% width="20%" height="20%" style="fill:rgb(230, 244, 177);stroke-width:1"></rect>\
  66 + previous_period_svg = f'<rect class="previous_period" x="10%" y=0% width="20%" height="20%" style="fill:rgb(230, 244, 177);stroke-width:1"></rect>\
67 67 <rect class="previous_period" x="25%" y=0 width="40%" height="20%" style="fill:blue; stroke-width:1"></rect>\
68 68 <text x="12%" y="12%" fontsize="2em" fill="black">Exploitation</text>'
69 69 #<text class="date_text" x="5%" y="15%" fontsize="2em" fill="black">{previous_period.start_date.strftime("%d/%m/%Y")}</text>\
... ... @@ -72,7 +72,7 @@ def get_global_svg_timeline(previous_period,current_period,future_period):
72 72  
73 73 if current_period is not None:
74 74 current_period_svg = f'<rect class="current_period" x="25%" y=30% width="20%" height="20%" style="fill:rgb(230, 244, 177);stroke-width:1"></rect>\
75   - <rect class="current_period" x="5%" y=30% width="20%" height="20%" style="fill:silver;stroke-width:1"></rect>\
  75 + <rect class="current_period" x="10%" y=30% width="20%" height="20%" style="fill:silver;stroke-width:1"></rect>\
76 76 <rect class="current_period" x=45% y=30% width="20%" height="20%" style="fill:rgb(192,192,220);stroke-width:1"></rect>\
77 77 <text x="32%" y="42%" fontsize="2em" fill="red">Exploitation</text>'
78 78 #<text class="date_text" x="25%" y="45%" fontsize="2em" fill="black">{current_period.start_date.strftime("%d/%m/%Y")}</text>\
... ... @@ -90,7 +90,7 @@ def get_global_svg_timeline(previous_period,current_period,future_period):
90 90 return svg_content
91 91  
92 92 def get_proposal_svg_timeline(period,period_name):
93   - proposal_svg = f'<svg id="proposal_detail" width="80vw" height="10vh"> <rect x="5%" y=40% width="19.9%" height="40%" style="fill:silver;stroke-width:1"></rect>\
  93 + proposal_svg = f'<svg id="proposal_detail" width="80vw" height="10vh"> <rect x="10%" y=40% width="19.9%" height="40%" style="fill:silver;stroke-width:1"></rect>\
94 94 <text class="date_text" x="5%" y="100%" fontsize="2em" fill="black">{period.submission_start_date.strftime("%d/%m/%Y")}</text>\
95 95 <text x="12%" y="65%" fontsize="2em" fill="black">Proposal submission</text>'
96 96  
... ...
src/core/pyros_django/scientific_program/templates/scientific_program/create_period.html
... ... @@ -97,12 +97,14 @@
97 97 </tr>
98 98 </thead>
99 99 <tbody>
100   - <tr>
101   -
102   - <td><a href="{% url 'detail_period' active_period.id %}">{{ active_period.id}}</a> (current period)</td>
103   - <td>{{ active_period.start_date }}</td>
104   - <td>{{ active_period.end_date }}</td>
105   - </tr>
  100 + {% if active_period %}
  101 + <tr>
  102 +
  103 + <td><a href="{% url 'detail_period' active_period.id %}">{{ active_period.id}}</a> (current period)</td>
  104 + <td>{{ active_period.start_date }}</td>
  105 + <td>{{ active_period.end_date }}</td>
  106 + </tr>
  107 + {% endif %}
106 108 {% for period in past_periods %}
107 109 <tr>
108 110  
... ...