Skip to content

Commit b86e0b8

Browse files
committed
Added pictures and rejected section to admin page
1 parent 9db327f commit b86e0b8

File tree

3 files changed

+48
-12
lines changed

3 files changed

+48
-12
lines changed

demo_project_data.csv

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ SELF_00008,community,OpenSUTD's DNA,SELF,https://github.com/OpenSUTD/community,A
1313
SELF_00009,orientation2019,Source code for SUTD Freshmen Orientation 2019 Website and Telegram Bot @ https://orientation.sutd.edu.sg,SELF,https://github.com/OpenSUTD/orientation2019,ACCEPT,chester,"orientation,student",https://orientation.sutd.edu.sg/img/frame_1.jpg
1414
SELF_00010,SAC-student-rules,A living policy document with regards to SUTD's Student Activity Centre. Contains user instructions and processes.,SELF,https://github.com/OpenSUTD/SAC-student-rules,ACCEPT,guian,policy,https://s3-ap-southeast-1.amazonaws.com/deeplearning-mat/SAC.jpg
1515
SELF_00011,deeplearning-workshop-2019,IAP Workshop: Deep Learning,SELF,https://github.com/OpenSUTD/deeplearning-workshop-2019,ACCEPT,tlkh,"workshop,machine learning,student,education",https://s3-ap-southeast-1.amazonaws.com/deeplearning-mat/DL_IAP.jpeg
16-
ACAD_00004,Random Project 3,(Pending Approval) A random project to better the world by design,ACAD,https://github.com/OpenSUTD/web-platform-prototype,PENDING,"tom,jane","51.003,random",
17-
ACAD_00006,Random Project 5,(Pending Approval) A random project to better the world by design,ACAD,https://github.com/OpenSUTD/web-platform-prototype,PENDING,"tom,jane","53.003,random",
18-
ACAD_00008,Random Project 7,(Pending Approval) A random project to better the world by design,ACAD,https://github.com/OpenSUTD/web-platform-prototype,PENDING,"tom,jane","55.003,random",
19-
ACAD_00010,Random Project 9,(Pending Approval) A random project to better the world by design,ACAD,https://github.com/OpenSUTD/web-platform-prototype,PENDING,"tom,jane","57.003,random",
16+
ACAD_00004,Random Project 3,A random project to better the world by design,ACAD,https://github.com/OpenSUTD/web-platform-prototype,PENDING,"tom,jane","51.003,random",
17+
ACAD_00006,Random Project 5,A random project to better the world by design,ACAD,https://github.com/OpenSUTD/web-platform-prototype,PENDING,"tom,jane","53.003,random",
18+
ACAD_00008,Random Project 7,A random project to better the world by design,ACAD,https://github.com/OpenSUTD/web-platform-prototype,PENDING,"tom,jane","55.003,random",
19+
ACAD_00010,Random Project 9,A random project to better the world by design,ACAD,https://github.com/OpenSUTD/web-platform-prototype,PENDING,"tom,jane","57.003,random",
2020
SELF_00012,course-notes,Unofficial student-curated course notes,SELF,https://github.com/OpenSUTD/course-notes,ACCEPT,"tlkh,yustynn","student,education",https://www.researchgate.net/profile/R_Baker7/publication/263392561/figure/fig3/AS:296561968992263@1447717292003/A-sample-Web-page-showing-how-course-notes-and-videos-are-posted-for-anyone-to-view-at.png

projects/templates/opensutd/admin_pending.html

+40-7
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ <h1>Pending Approval</h1>
1111
{% for project_item in projects_list %}
1212
<div class="col-sm-4" style="margin-top: 2rem">
1313
<div class="project-card-sm">
14-
<!-- <img src="{{ project_item.featured_image }}" class="card-img-top"> -->
14+
{% if project_item.featured_image == "" %}
15+
<img src="https://howtomechatronics.com/wp-content/uploads/2017/11/Arduino-Robot-Car-Project.jpg">
16+
{% else %}
17+
<img src="{{ project_item.featured_image }}">
18+
{% endif %}
1519
<div class="card-body">
1620
<h4 class="card-title">{{ project_item.title }}</h4>
17-
<p class="card-text">{{ project_item.caption }}</p>
21+
<p class="card-text">(Pending approval) {{ project_item.caption }}</p>
1822
<div class="row">
1923
<div class="col-sm-6" style="display: flex; justify-content: space-around">
2024
<form action='/actions/approve/{{ project_item.project_uid }}/' method='GET'>
@@ -29,27 +33,56 @@ <h4 class="card-title">{{ project_item.title }}</h4>
2933
</div>
3034
<hr>
3135
<div class="row" style="display: flex; justify-content: flex-end">
32-
<a href="{% url 'projects:project_page_bypass' project_item.project_uid %}" class="btn btn-md edit-button">
36+
<a href="{% url 'projects:project_page_bypass' project_item.project_uid %}"
37+
class="btn btn-md edit-button">
3338
View Project <i class="fa fa-angle-right" style="color:black"></i></a>
3439
</div>
3540
</div>
3641
</div>
3742
</div>
3843
{% endfor %}
3944
{% else %}
40-
4145
<div style="width: 100%">
4246
<div style="text-align:center; margin-top: 80px">
4347
<p>Yay! No more pending projects to review.</p>
4448
<br>
4549
<img src='{% static "images/yay.gif" %}' style="height: 200px">
46-
50+
4751
</div>
4852
</div>
49-
5053
{% endif %}
5154
</div>
52-
55+
<br>
56+
<hr>
57+
<br>
58+
<h2>Previously Rejected Projects</h1>
59+
<div class="row">
60+
{% if rejected_projects_list %}
61+
<!-- start iteration -->
62+
{% for project_item in rejected_projects_list %}
63+
<div class="col-sm-4" style="margin-top: 2rem">
64+
<div class="project-card-sm">
65+
{% if project_item.featured_image == "" %}
66+
<img
67+
src="https://howtomechatronics.com/wp-content/uploads/2017/11/Arduino-Robot-Car-Project.jpg">
68+
{% else %}
69+
<img src="{{ project_item.featured_image }}">
70+
{% endif %}
71+
<div class="card-body">
72+
<h4 class="card-title">{{ project_item.title }}</h4>
73+
<p class="card-text">(Rejected) {{ project_item.caption }}</p>
74+
<div class="row" style="display: flex; justify-content: space-around">
75+
<a href="{% url 'projects:project_page' project_item.project_uid %}" class="card-link">
76+
View Project <i class="fas fa-chevron-circle-right"></i></a>
77+
</div>
78+
</div>
79+
</div>
80+
</div>
81+
{% endfor %}
82+
{% else %}
83+
<p>Error! No projects are available.</p>
84+
{% endif %}
85+
</div>
5386
</div>
5487
</div>
5588
{% endblock %}

projects/views.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ def submit_new_project(request):
153153
def approval_view(request):
154154
projects_list = models.Project.objects.order_by(
155155
"-published_date").filter(status="PENDING")[:50]
156-
context = {"projects_list": projects_list}
156+
rejected_projects_list = models.Project.objects.order_by(
157+
"-published_date").filter(status="REJECT")[:50]
158+
context = {"projects_list": projects_list,
159+
"rejected_projects_list": rejected_projects_list,}
157160
return render(request, "opensutd/admin_pending.html", context)
158161

159162

0 commit comments

Comments
 (0)