Skip to content

Commit

Permalink
FINAL DONE
Browse files Browse the repository at this point in the history
  • Loading branch information
SabikAbtahee committed May 30, 2018
1 parent 7f76ee0 commit 6ece76f
Show file tree
Hide file tree
Showing 18 changed files with 133 additions and 19 deletions.
Binary file modified Communication/__pycache__/views.cpython-36.pyc
Binary file not shown.
32 changes: 23 additions & 9 deletions Communication/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,29 @@ def getNotifications(self,request):
return JsonResponse(data, safe = False)

def notifiedAllAssignedDevelopers(self, project, sender, fileNumbers, isMaster, type):
AssignDev = Database.models.AssignDeveloper.objects.filter(project=project)
tempUser = Database.models.User.objects.get(username = sender)
for assignDev in AssignDev:
if(assignDev.assignDeveloper.username!=tempUser.username):
self.addToNotificationTable(sender, assignDev.assignDeveloper, project.projectName, type, fileNumbers, "", isMaster)
print("called for loop")
if(isMaster==False):
self.addToNotificationTable(sender, project.user, project.projectName, type, fileNumbers,"", isMaster)
print("called ifelse")
if(type=="comment"):
AssignDev = Database.models.AssignDeveloper.objects.filter(project=project)
tempUser = Database.models.User.objects.get(username=sender)
for assignDev in AssignDev:
if (assignDev.assignDeveloper.username != tempUser.username):
self.addToNotificationTable(sender, assignDev.assignDeveloper, project.projectName, type,
fileNumbers, str(fileNumbers), isMaster)
print("called for loop")
print(str(fileNumbers))
if (isMaster == False):
self.addToNotificationTable(sender, project.user, project.projectName, type, fileNumbers, str(fileNumbers), isMaster)
print("called ifelse")
else:
AssignDev = Database.models.AssignDeveloper.objects.filter(project=project)
tempUser = Database.models.User.objects.get(username=sender)
for assignDev in AssignDev:
if (assignDev.assignDeveloper.username != tempUser.username):
self.addToNotificationTable(sender, assignDev.assignDeveloper, project.projectName, type,
fileNumbers, "", isMaster)
print("called for loop")
if (isMaster == False):
self.addToNotificationTable(sender, project.user, project.projectName, type, fileNumbers, "", isMaster)
print("called ifelse")



Expand Down
Binary file modified ProfileManagement/__pycache__/views.cpython-36.pyc
Binary file not shown.
10 changes: 8 additions & 2 deletions ProfileManagement/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
from django.contrib.auth import authenticate
from django.contrib import messages
# Create your views here.
import Database
import Database,Authentication
from django.contrib.auth.models import User
from django.http import JsonResponse
from django.contrib.auth.forms import PasswordChangeForm
from django.contrib.auth import update_session_auth_hash
from django.http import HttpResponse

from django.contrib.auth import logout

class ProfileManagement(object):
def userIsAuthenticated(self, user):
Expand Down Expand Up @@ -38,7 +38,13 @@ def profileView(self, request):
form = PasswordChangeForm(data=request.POST, user=request.user)
if form.is_valid():
user = form.save()

user.is_active = False
response = logout(request)

return render(response, 'Authentication/signOut.html')


if (len(request.FILES) != 0):
pic = request.FILES['pictureUpload']
# print(pic)
Expand Down
Binary file modified Project/__pycache__/views.cpython-36.pyc
Binary file not shown.
3 changes: 2 additions & 1 deletion Project/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,8 @@ def commentOnFile(self,request,projectname,id):
description = request.POST.get('COMMENT-DESCRIPTION')
comment=Database.models.Comment(file=file,commentDescription=description,commentTime=datetime.now(),commentator=user.username)
comment.save()
Communication().notifiedAllAssignedDevelopers(project, user.username, fileNumbers=0, isMaster=True,
print(file.fileName)
Communication().notifiedAllAssignedDevelopers(project, user.username, file.id, isMaster=True,
type="comment")

return redirect('/projectmanagement/' + project.projectName + '/'+id+'/')
Expand Down
Binary file modified Search/__pycache__/views.cpython-36.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion Search/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,6 @@ def commentOnFile(self,request,username,projectname,id):
comment = Database.models.Comment(file=file, commentDescription=description, commentTime=datetime.now(),
commentator=user.username)
comment.save()
Communication().notifiedAllAssignedDevelopers(project, user.username, fileNumbers=0, isMaster=False,
Communication().notifiedAllAssignedDevelopers(project, user.username, file.id, isMaster=False,
type="comment")
return redirect('/search/' + userProject.username+'/'+project.projectName + '/' + id + '/')
27 changes: 27 additions & 0 deletions media/chin/Hello1hello1/263A_beautiful_matrix.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include<bits/stdc++.h>
using namespace std;
void file(){
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
}
void run(){
int a[5][5],x,y,ans;
for(int i=0;i<5;i++){
for(int j=0;j<5;j++){
cin >>a[i][j];
if(a[i][j]==1){
x=i;
y=j;
}
}
}
ans = abs(2-x) + abs(2-y);
cout << ans <<"\n";
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
file();
run();
return 0;
}
36 changes: 36 additions & 0 deletions media/chin/Hello1hello1/458_-_The_Decoder.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

//test


#include<bits/stdc++.h>
using namespace std;
void file(){
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
}
void run(){

string ss,ans="";
int length;

while(getline(cin,ss)){
ans="";
length = ss.length();
//cout << length;
for(int i=0;i<length;i++){
ans+=ss[i]-7;
//printf("%c",ss[i]-7);
}
cout <<ans<< "\n";
}
// HELLOW WORLD
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
file();
run();
return 0;
}
// Hellow again

31 changes: 31 additions & 0 deletions media/chin/Hello1hello1/494_-_Kindergarten_Counting_Game.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include<bits/stdc++.h>
using namespace std;
void file(){
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
}
void run(){
string s;
int ans=0,len;
bool flag=false;
while(getline(cin,s)){
ans=1;
len=s.length();
for(int i=0;i<len;i++){
if(s[i]==32 && flag==true){
ans++;
}
}
cout << ans <<"\n";

}

}
//HELLOW
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
file();
run();
return 0;
}
Binary file added media/chin/Hello1hello1/download.zip
Binary file not shown.
Binary file added media/chin/Screenshot_14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/chin/Screenshot_24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/chin/dbms_practice.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion templates/ProfileManagement/profileView.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<br>
<br>
<label class="btn btn-primary btn-lg btn-file" style="font-size: 15px;font-family: 'Verdana'; border-radius: 10px;margin-right: 10px;">
Browse <input type="file" name="pictureUpload" style="display: none; font-size: 20px" value="{{userInformation.profilePicture.url}}">
Browse <input type="file" name="pictureUpload" style="display: none; font-size: 20px" value="{{userInformation.profilePicture.url}}" accept="image/*">
</label>


Expand Down
2 changes: 1 addition & 1 deletion templates/Project/projectDetails.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h6>Project Tags: {{ project.skilltag }}</h6>
</form>
{%endif%}

<p>Assigned Developrs: {{ assignDevelopers|length }}</p>
<p>Assigned Developers: {{ assignDevelopers|length }}</p>
{%if isAssigned%}
<p>You assigned here</p>
{%endif%}
Expand Down
7 changes: 3 additions & 4 deletions templates/registration/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ <h1>Sign In</h1>
<p>Your account is not activated. Please enter your email address to activate your account and press
<strong>Activate Your Account</strong> button.</p>
<input type="email" placeholder="Email" id="activateEmail" name="email_or_username" autocomplete="off"/>
<p id="actEmailerr">#</p>
<p id="actEmailerr"></p>
<button type = "submit" id="activateBtn"> Activate Your Account</button>
<hr>
</form>
Expand Down Expand Up @@ -202,9 +202,8 @@ <h1>Sign In</h1>
dataType: 'json',

success: function (data) {
console.log(data.isExist);
console.log(data.active);
alert(data.active);


if (data.isExist===false) {

document.getElementById('actEmailerr').innerHTML = "Sorry no email exists";
Expand Down

0 comments on commit 6ece76f

Please sign in to comment.