Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new profile pages #84

Merged
merged 2 commits into from
Feb 5, 2018
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
hatsoff/settings.py
#hatsoff/db.sqlite3
week1/*2.py
week1/*.pyc
week1/migrations/*
#db.sqlite3
*.swp
Expand Down
4 changes: 3 additions & 1 deletion week1/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,10 @@ class Meta:
class PersonalInfo(forms.ModelForm):
class Meta:
model = Profile
fields = ('worksAt', 'city', 'education', 'language', 'photo')
fields = ( 'profession1', 'profession2', 'profession3', 'profession4', 'profession5', 'worksAt', 'city', 'education', 'language', 'photo', 'skill1', 'skill2', 'skill3', 'skill4', 'skill5', 'skill6', 'skill7', 'skill8', 'skill9', 'skill10')
labels = {
'profession1': _('Professions (up to 5)'),
'skill1': _('Skills (up to 10)'),
'worksAt': _('Independent/Company name'),
'city': _('City'),
'education': _('Education (School and degree)'),
Expand Down
6 changes: 3 additions & 3 deletions week1/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class User(AbstractUser):

# Create your models here.
class Profile(models.Model):
user = models.ForeignKey(User)
user = models.ForeignKey(User, unique=True)
photo = models.ImageField(upload_to=content_file_name, blank=True)
displayname = models.CharField(max_length=100, default='', blank=True)
#profession = models.CharField(max_length=200, default='', blank=False)
Expand Down Expand Up @@ -55,7 +55,7 @@ class Profile(models.Model):
cities = models.CharField(max_length=200, default='', blank=True)

class Showcase(models.Model):
user = models.ForeignKey(User)
user = models.ForeignKey(User, unique=True)
title = models.CharField(max_length=200, default='', blank=True)
number = models.IntegerField(null=True)#1 to 10
image = models.FileField(upload_to='showcaseimg/', null=True, blank=True)
Expand All @@ -80,7 +80,7 @@ class Showcase(models.Model):
tag10 = models.CharField(max_length=300, default='', blank=True)

class UpcomingWork(models.Model):
user = models.ForeignKey(User)
user = models.ForeignKey(User, unique=True)
title = models.CharField(max_length=200, default='', blank=True)
number = models.IntegerField()#1 to 10
image = models.FileField(upload_to='showcaseimg/', null=True, blank=True)
Expand Down
4 changes: 4 additions & 0 deletions week1/templates/week1/basehome.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="/css/bootstrap-theme.css"-->
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/flick/jquery-ui.css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tokenfield/0.12.0/css/tokenfield-typeahead.min.css" rel="stylesheet" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tokenfield/0.12.0/css/bootstrap-tokenfield.min.css" rel="stylesheet" type="text/css">

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js" type="text/javascript" charset="utf-8"></script>

<script src="{% static 'js/tag-it.js' %}" type="text/javascript" charset="utf-8"></script>
<script src="{% static 'js/tag-profession.js' %}" type="text/javascript" charset="utf-8"></script>
<script src="{% static 'js/tag-project.js' %}" type="text/javascript" charset="utf-8"></script>
Expand Down
37 changes: 30 additions & 7 deletions week1/templates/week1/community.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<!-- Custom fonts for this template -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">

<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/flick/jquery-ui.css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tokenfield/0.12.0/css/tokenfield-typeahead.min.css" rel="stylesheet" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tokenfield/0.12.0/css/bootstrap-tokenfield.min.css" rel="stylesheet" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.3/css/base/jquery-ui.min.css" rel="stylesheet" type="text/css">

<style id="jsbin-css">
@import url('https://fonts.googleapis.com/css?family=Noto+Sans:400,700');
body {
Expand Down Expand Up @@ -1001,8 +1006,10 @@ <h3>Community whiteboard- Connect; Collaborate; Create</h3>

<!--button onclick="return publicPost()" class="btn btn-lg btn-outline pull-right">Post</button-->

<label>Skill tag (up to 5)</label><ul id="myTags">
</ul>
<label>Skill tag (up to 5)</label>
<!-- ul id="myTags"></ul-->
<input type="text" class="form-control" id="token-skillfield" name="skilltags" />


<ul class="list-inline communityActionListBig pull-left">
<!-- li class="list-inline-item">
Expand Down Expand Up @@ -1215,22 +1222,26 @@ <h3>Contact</h3>
<i class="fa fa-chevron-up"></i>
</a>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="{% static 'js/tag-it.js' %}" type="text/javascript" charset="utf-8"></script>
<!--script src="http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js" type="text/javascript" charset="utf-8"></script-->

<!-- Bootstrap core JavaScript -->
<script src="https://code.jquery.com/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.11.1"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js"></script>
<!-- Plugin JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.min.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/typeahead.js/0.11.1/typeahead.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tokenfield/0.12.0/bootstrap-tokenfield.min.js"></script>
<!-- Contact Form JavaScript -->
<!--<script src="js/jqBootstrapValidation.js"></script><script src="js/contact_me.js"></script>-->
<!-- Custom scripts for this template -->
<!-- Socket -->
<script src="{{nodejs_url}}/socket.io/socket.io.js"></script>
<script src="https://cdn.socket.io/socket.io-1.2.0.js"></script>
<script src="{% static 'js/tag_skills.js' %}"></script>
<script type="text/javascript" src="{% static 'js/basic.js' %}"></script>
<script>
(function($) {
Expand Down Expand Up @@ -1306,7 +1317,10 @@ <h3>Contact</h3>

function publicPost(){
var skillls = [];
var lis = document.getElementById("myTags").getElementsByTagName("li");
var sk = $('#token-skillfield').val();
if (sk){
skillls = sk.split(",");
}

/* Use this again once jquery issue is fixed
for (var i = 0; i < lis.length; i++){
Expand All @@ -1331,11 +1345,18 @@ <h3>Contact</h3>
});
$('#p').val('');
$('#imageupload').val('');
}
}
$('#token-skillfield').val('');
return false;
}

function privatePost(){
var skillls = [];
var sk = $('#token-skillfield').val();
if (sk){
skillls = sk.split(",");
}
/*
var skillls = [];
var lis = document.getElementById("myTags").getElementsByTagName("li");

Expand All @@ -1345,6 +1366,7 @@ <h3>Contact</h3>
skillls.push(t.charAt(0).toUpperCase() + t.slice(1));
}
}
*/

var files = document.getElementById('imageupload').files;
var file = files[0];
Expand All @@ -1360,6 +1382,7 @@ <h3>Contact</h3>
$('#p').val('');
$('#imageupload').val('');
}
$('#token-skillfield').val('');
return false;
}

Expand Down
Loading