Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions fossee_manim/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@
("released", "Released")
)

video_status=(
("approved","video approval"),
("pending","video pending")
)

def has_profile(user):
""" check if user has profile """
Expand Down Expand Up @@ -173,12 +177,14 @@ class Animation(models.Model):
related_name="%(app_label)s_%(class)s_related")
outline = models.TextField()
status = models.CharField(max_length=255, choices=status)
video_upload_status = models.CharField(max_length=255,null=True,choices=video_status)
category = models.ForeignKey(Category, on_delete=models.CASCADE)
subcategory = models.CharField(max_length=255, blank=True)
created = models.DateTimeField(default=timezone.now)
tags = TaggableManager()
history = HistoricalRecords()


def __str__(self):
return u"{0} | {1}".format(self.title, self.status)

Expand Down
14 changes: 2 additions & 12 deletions fossee_manim/templates/fossee_manim/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,13 @@
<button class="btn btn-link perma_link" type="button"><a href="{% url 'library' %}" style="color:#222222">Library</a></button>
</div>
</div>

<link rel="stylesheet" type="text/css" href="https://fossee.in/data/banner/css/nice-bar.css" />
<script type="text/javascript" src="https://fossee.in/data/banner/js/nice-bar.js"></script>
<div style= "margin:30px;">
<center>
<a href="https://scipy.in/2019" target="_blank"> <img class="img-responsive" src="https://static.fossee.in/scipy2019/email-templates/SciPyIndia2019.gif"></a>
</center>
</div>
{% endblock %}

{% block content %}
<br><br>
<h1>Base Template Content. Please override me</h1>
</div>
{% endblock %}


<!-- </main> -->

{% block footer %}
Expand Down Expand Up @@ -162,8 +152,8 @@ <h1>Base Template Content. Please override me</h1>
{% endblock footer %}

<!-- START Bootstrap-Alert -->
<div class="alert text-center cookiealert" role="alert" style="background: #dddddd; color: black;">
The website is currently undergoing some developmental changes. If you encounter any glitches, write to us at animations@fossee.in ; we value your feedback and suggestions !
<div class="alert text-center cookiealert" role="alert" style="background: #d1ff3c; color: black;">
The website is currently undergoing some developmental changes. If you encounter any glitches, write to us at animations@fossee.in ; we value your feedback and suggestions !
<button type="button" class="close" data-dismiss="alert" aria-label="Close" >
<span aria-hidden="true">&times;</span>
</button>
Expand Down
6 changes: 6 additions & 0 deletions fossee_manim/templates/fossee_manim/edit_proposal.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
<br>

{% if proposal_form.instance.status == 'changes' and request.user.profile.position == 'contributor' %}

{% if proposal_form.instance.video_upload_status == 'approved' %}
<form method="POST" action="{% url 'upload_animation' proposal_form.instance.id %}" enctype="multipart/form-data">
{% csrf_token %}
<label class="btn btn-info">
Expand All @@ -43,6 +45,7 @@
{{ msg }}
</label>
</form>
{% endif %}
{% elif proposal_form.instance.status == 'pending' and request.user.profile.position == 'contributor' %}
<h3>Awaiting Reviewer's Moderation </h3>
<h6>Further details regarding the second stage of Proposal will be shared with you over the email shortly</h6>
Expand All @@ -62,6 +65,9 @@ <h6>Further details regarding the second stage of Proposal will be shared with y
<button class="btn btn-success pull-left" type="submit" name="release" value="1">Approve</button>
<button class="btn btn-danger pull-left" type="submit" name="rejected" value="2" style="margin-left: 1%">Reject</button>
<button class="btn btn-info pull-left" type="submit" name="proposal_form" value="3" style="margin-left: 1%" >Send Proposal 2 Form</button>
<button class="btn btn-info pull-left" type="submit" name="approve_video" value="4" style="margin-left: 1%" >Submit video</button>


</div>
</div>
</form>
Expand Down
14 changes: 11 additions & 3 deletions fossee_manim/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ def send_proposal(request):
form_data = form.save(commit=False)
form_data.contributor = user
form_data.status = "pending"
form_data.video_upload_status = "pending"
form.save()
else:
return render(request, 'fossee_manim/send_proposal.html',
Expand All @@ -301,6 +302,7 @@ def send_proposal(request):

@login_required
def proposal_status(request):
val = 1;
user = request.user
if is_email_checked(user) and user.is_authenticated():
profile = Profile.objects.get(user_id=user)
Expand Down Expand Up @@ -334,14 +336,17 @@ def proposal_status(request):
@login_required
def edit_proposal(request, proposal_id=None):
user = request.user
print(proposal_id)
if is_email_checked(user) and user.is_authenticated():
comment_form = CommentForm()
proposal = Animation.objects.get(id=proposal_id)
proposal_form = AnimationProposal(instance=proposal)
upload_form = UploadAnimationForm()
categories = Category.objects.all()
video = AnimationStats.objects.filter(animation=proposal_id)

if len(video)>0:
print("hai")
msg = ('Previously a video was uploaded for '+ video[0].animation.title)
else:
msg = ('No video uploaded')
Expand All @@ -356,12 +361,15 @@ def edit_proposal(request, proposal_id=None):
status1 = request.POST.get('release')
status2 = request.POST.get('rejected')
status3 = request.POST.get('proposal_form')

if status1 or status2 or status3 is not None:
status4=request.POST.get('approve_video')
if status1 or status2 or status3 or status4 is not None:
if status1:
proposal.status = 'released'
send_email(request, call_on='released',
contributor=proposal.contributor)
elif status4:
proposal.video_upload_status='approved'
proposal.status='changes'
elif status3:
send_email(request, call_on='proposal_form',
contributor=proposal.contributor)
Expand All @@ -382,7 +390,7 @@ def edit_proposal(request, proposal_id=None):
form_data.animation = proposal
form_data.animation_status = proposal.status
if user.profile.position == 'reviewer':
proposal.status = 'changes'
# proposal.status = 'changes'
proposal.save()
send_email(request, call_on='changes',
contributor=proposal.contributor,
Expand Down