Skip to content

Commit d9e675c

Browse files
committed
Bug Fixes In Tags, Events and Z Index In Dropdown
2 parents 5ae76f7 + a1b3c98 commit d9e675c

19 files changed

Lines changed: 888 additions & 470 deletions

File tree

website/events/templates/calender.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,22 @@
33
{% block title %}
44
Calender
55
{% endblock title %}
6+
{% block css %}
7+
<style>
8+
@media(max-width:1024px){
9+
#calenderDiv{
10+
width:90%;
11+
}
12+
#calender{
13+
max-width:100%;
14+
}
15+
}
16+
</style>
17+
{% endblock%}
618

719
{% block content %}
8-
<div class="ml-auto mr-auto">
9-
<iframe src="https://calendar.google.com/calendar/embed?src=recursion.nit%40gmail.com&ctz=Asia%2FKolkata" style="border: 0" width="800" height="600" frameborder="0" scrolling="no"></iframe>
20+
<div id="calenderDiv" class="ml-auto mr-auto">
21+
<iframe id="calender" src="https://calendar.google.com/calendar/embed?src=recursion.nit%40gmail.com&ctz=Asia%2FKolkata"
22+
style="border: 0;" width="800" height="600" frameborder="0" scrolling="yes"></iframe>
1023
</div>
1124
{% endblock %}

website/events/templates/create_event.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ <h1>Hello superuser:Add New Event</h1>
1818
<div >
1919

2020
<p>Enter the details below:</p><br>
21-
<form action = "{% url 'event:event_create' %}" method="POST" >
21+
<form action = "{% url 'events:event_create' %}" method="POST" >
2222
{% csrf_token %}
2323
<table>
2424
{{ form }}

website/forum/static/css/base_css.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ ul, ol {
178178
transition: .22s ease;
179179
}
180180

181-
181+
@media(max-width:450px){
182+
#logoREC{
183+
display:none;
184+
}
185+
}
182186

183187

website/forum/static/css/question_css.css

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ hr{
4646
display: inline;
4747
color:#6A73B4;
4848
padding: 3px;
49-
font-size: 70%;
49+
font-size: 79%;
5050
border-radius: 1px;
5151
}
5252
#postedOn{
@@ -81,12 +81,6 @@ hr{
8181
border-radius:25px 0 0 25px;
8282
display: inline-block;
8383
}
84-
#postQ{
85-
background-color: #247BA0;
86-
color: white;
87-
box-shadow:3px 3px grey;
88-
margin-bottom:5px;
89-
}
9084
#searchButton{
9185
height:40px;
9286
position: relative;
@@ -107,11 +101,19 @@ hr{
107101
display: block;
108102
text-align: left;
109103
}
110-
104+
#postQ{
105+
float:right;
106+
}
111107

112108
.inline{
113109
display: inline-block;
114110
}
115111
.number{
116112
font-family:'Rajdhani',sans-serif;
117113
}
114+
@media(max-width:475px){
115+
#postQ{
116+
float:left;
117+
margin:auto;
118+
}
119+
}

website/forum/templates/base.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@
5757
<body>
5858

5959

60-
<nav class="navbar navbar-expand-md navbar-dark bg-dark py-0" style="background-color: #f19066;">
60+
<nav class="navbar navbar-expand-md navbar-dark bg-dark py-0" style="background-color: #f19066;z-index:1;">
6161
<div class="d-flex flex-grow-1 py-0">
6262
<span class="w-100 d-lg-none d-block"><!-- hidden spacer to center brand on mobile --></span>
6363
<a class="navbar-brand" href="{% url 'home' %}">
6464
{% load staticfiles %}
65-
<img src="{% static 'image/logoInvert.png'%}" style="max-width:65px;" alt="logo">
65+
<img id="logoREC" src="{% static 'image/logoInvert.png'%}" style="max-width:65px;" alt="logo">
6666
<strong>REC</strong>ursion
6767
</a>
6868
<!-- <a class="navbar-brand-two mx-auto d-lg-none d-inline-block py-0" href="#">
@@ -90,12 +90,12 @@
9090
{% else %}
9191
<ul class="nav navbar-nav">
9292
<li class="dropdown nav-link m-2 menu-item nav-item">
93-
<a class="dropdown-toggle tab" data-toggle="dropdown" href="#" id="tabManage">Manage Account<span class="caret"></span></a>
93+
<a class="dropdown-toggle tab" data-toggle="dropdown" href="#" id="tabManage">Welcome, {{user.username}} <span class="caret"></span></a>
9494
<ul class="dropdown-menu ml-2" style="padding: 2px;color:black;">
95-
<li ><a href="{% url 'forum:list_questions' %}">Forum</a></li>
95+
<!-- <li ><a href="{% url 'forum:list_questions' %}">Forum</a></li> -->
9696
<!-- <li><a href="{% url 'user_profile:view_profile' %}">View Account</a></li> -->
97-
<!-- <li><a href="{% url 'user_profile:edit_profile' %}">Edit Account</a></li> -->
98-
<li><a href="{% url 'profile:view_profile' %}">View my activity</a></li>
97+
<li><a href="{% url 'profile:view_profile' %}">Manage Profile</a></li>
98+
<li><a href="{% url 'user_profile:edit_profile' %}">Edit Profile</a></li>
9999
<li><a href="{% url 'logout' %}">Logout</a></li>
100100
</ul>
101101
</li>
@@ -115,15 +115,15 @@
115115
linear-gradient(135deg, #2d3436 90%, #3e4446 1%),
116116
linear-gradient(45deg, #353b48 95%, rgba(0,0,255,0) 30%);">
117117
<a id="goTop">
118-
<center class="circle">
118+
<center class="circle" onclick="window.scrollTo(0,-1000000)">
119119
{% load static %}
120120
<img src="{% static 'image/rocket.png'%}" alt="go Top" onclick="window.scrollTo(0,-1000000)" style="margin-top: 2px;">
121121
</center>
122122
</a>
123123
<div class="container">
124124
<div class="row row-30">
125125
<div class="col-md-4 col-xl-5">
126-
<div class="pr-xl-4"><a class="brand" href="index.html"><img class="brand-logo-light" src="images/agency/logo-inverse-140x37.png" alt="" width="140" height="37" srcset="images/agency/logo-retina-inverse-280x74.png 2x"></a>
126+
<div class="pr-xl-4">
127127
<p>RECursion NIT Durgapur is an initiative to embolden the budding coding minds through regular Code Classes, robust coding competitions and geeky sessions.</p>
128128
<strong>Contribute to this community</strong><br>
129129
<a href="https://www.facebook.com/recursion.nit/"><i class="fab fa-facebook-f"></i></a>&nbsp;
@@ -155,7 +155,7 @@ <h3>Contacts</h3>
155155
<h3 class="ml-0">Links</h3>
156156
<ul class="nav-list ml-1">
157157
<li><a href="{% url 'forum:list_questions' %}">AskREC</a></li>
158-
<li><a href="#">Events</a></li>
158+
<li><a href="{% url 'events:calender' %}">Events</a></li>
159159
<li><a href="#">Get Started</a></li>
160160
<li><a href="#">Team</a></li>
161161
</ul>

website/forum/templates/forum/answer.html

Lines changed: 27 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,22 @@
1-
<!DOCTYPE html>
2-
<html lang="en">
3-
<head>
41

5-
<meta charset="UTF-8">
6-
<meta charset="UTF-8">
7-
<title>Update Answers</title>
8-
</head>
9-
<body>
10-
<div >
11-
{% csrf_token %}
12-
<h3>Add/Update Answer</h3>
13-
<div >
14-
15-
<p>Enter the details below:</p><br>
16-
<!-- <form method="POST">
17-
<table>
18-
19-
</table>
20-
<br>
21-
<button type="submit" class="save btn btn-primary" style="margin-left:150px;">SAVE</button>
22-
</form> -->
232
<form class='my-update-form' method="POST" data-url='{{ request.build_absolute_uri|safe }}'> {% csrf_token %}
243
<table>
25-
{{ upform }}
4+
{{upform.description}}
265
{{upform.media}}
276
<input type="hidden" name="ajax_update" value="True">
287
</table>
298
<br>
309
<button type="submit" class="save btn btn-primary" style="margin-left:150px;">UPDATE</button>
3110
</form>
3211

33-
</div>
34-
35-
</div>
36-
</body>
37-
</html>
3812

3913

4014
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
4115
<script>
4216
$(document).ready(function(){
4317
$("form.my-update-form").submit(function(task){
4418
task.preventDefault()
45-
$("#update_ans").hide()//hiding update form when new form was added
19+
4620

4721

4822
var $formData = $(this).serialize()
@@ -53,23 +27,35 @@ <h3>Add/Update Answer</h3>
5327
data:$formData ,
5428
success: function (data)
5529
{
56-
console.log("updatweeeeeeeeeee" +data)
57-
58-
Data=JSON.parse(data)
59-
Update=Data
60-
result="";
61-
result+="ANSWER =:"+Data.description+"<a href=/forum/answer/"+Data.id+">"+" Update" +"<a>"+" ANSWER is added <br/>";
62-
console.log(result);
63-
$('#ans').html(result);
64-
$("#ans").show()
65-
$("#u_ans_form"+Data.id).hide()//hiding update form when update form was clicked
66-
update_ans_res=''
67-
update_ans_res+="ANSWER =:"+ Data.description + "<a class = \"u_ans\" ans-id= \"{{ans.id}}\" href=/forum/answer/"+Data.id+">Update this Answer</a>"
68-
$(".u_ans#ans_id_"+Data.id).html( update_ans_res).show()
30+
console.log(data)
31+
$('form.my-update-form').hide()
32+
$('#div_answers').html(data)
33+
$(".u_ans").show()
6934
},
7035
error:handleFormError,
7136
})
7237
})
38+
39+
$('.u_ans').click(function(e){
40+
e.preventDefault()
41+
var id= $(this).attr('ans-id')
42+
console.log(id)
43+
$(this).toggle()//hiding update link
44+
$('#ans_body_'+id).hide()
45+
46+
$.ajax({
47+
method: "GET",
48+
url: "/forum/answer/"+id,
49+
success: function (data)
50+
{
51+
var id_name = "#u_ans_form"+id
52+
console.log(id_name)
53+
$(id_name).html(data).show()
54+
},
55+
error:handleFormError,
56+
})
57+
58+
})
7359
function handleFormError(jqXHR, textStatus, errorThrown){
7460
console.log(jqXHR)
7561
console.log(textStatus)

website/forum/templates/forum/comment.html

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,38 @@ <h3>Add/Update Comment</h3>
6060
data:$formData ,
6161
success: function (data)
6262
{
63-
console.log("updatweeeeeeeeeee" +data)
64-
Data=JSON.parse(data)
65-
Update=Data
66-
result="";
67-
result+="COMMENT =:"+Data.body+"<a href=/forum/editcomment/"+Data.id+">"+" Update" +"<a>"+" COMMENT is added <br/>";
68-
console.log(result);
69-
$('#com').html(result);
70-
$("#com").show()
71-
$("#u_com_form"+Data.id).hide()//hiding update form when update form was clicked
72-
update_com_res=''
73-
update_com_res+="COMMENTss=:"+Data.body+ "<a class = \"u_com\" com-id= \"{{comment.id}}\" href=/forum/editcomment/"+Data.id+">Update this Comment</a>"
74-
$(".u_com#com_id_"+Data.id).html( update_com_res).show()
63+
console.log(data)
64+
$('form.my-update-form').hide()
65+
$('#div_comments').html(data)
66+
$(".u_com").show()
7567
},
7668
error:handleFormError,
7769

7870
})
71+
72+
73+
//ajax call update comment
74+
$('.u_com').click(function(e){
75+
e.preventDefault()
76+
var id= $(this).attr('com-id')
77+
console.log(id)
78+
$(this).hide()//hiding update link
79+
$('#com_body_'+id).hide()
80+
81+
82+
$.ajax({
83+
method: "GET",
84+
url: "/forum/editcomment/"+id,
85+
success: function (data)
86+
{
87+
var form = "#u_com_form"+id
88+
console.log(form)
89+
$(form).html(data).show()
90+
91+
},
92+
error:handleFormError,
93+
})
94+
})
7995
})
8096
function handleFormError(jqXHR, textStatus, errorThrown){
8197
console.log(jqXHR)

0 commit comments

Comments
 (0)