Skip to content

Commit

Permalink
little changes
Browse files Browse the repository at this point in the history
  • Loading branch information
deepak-bharti-deel committed May 14, 2018
1 parent 3b6adaf commit 6dd7e31
Show file tree
Hide file tree
Showing 14 changed files with 129 additions and 89 deletions.
7 changes: 3 additions & 4 deletions hohos/authentication/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,6 @@ def online(self):
return False




def create_user_profile(sender, instance, created, **kwargs):
if created:
Profile.objects.create(user=instance)
Expand All @@ -266,8 +264,9 @@ def create_user_profile(sender, instance, created, **kwargs):
def save_user_profile(sender, instance, **kwargs):
instance.profile.save()

#post_save.connect(create_user_profile, sender=User)
#post_save.connect(save_user_profile, sender=User)

post_save.connect(create_user_profile, sender=User)
post_save.connect(save_user_profile, sender=User)



Expand Down
12 changes: 6 additions & 6 deletions hohos/authentication/templates/authentication/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,20 +176,20 @@ <h1 id="mydiv" class="logo">
{% csrf_token %}

<div class="form-group{% if form_human.username.errors %} has-error{% endif %}">
<input type="text" class="form-control greentext" id="username" name="username" placeholder="username" title="Unique username, which should not contain +,-, and white spaces" required>
<input type="text" class="form-control greentext" name="username" placeholder="username" title="Unique username, which should not contain +,-, and white spaces" required>
{% for error in form_human.username.errors %}
<label class="control-label whitetext"><span class="whitetext">{{ error }}</span></label>
{% endfor %}
</div>

<div class="form-group{% if form_human.email.errors %} has-error{% endif %}">
<input type="text" class="form-control greentext" id="email" name="email" placeholder="email" title="This is used in to send you password reset link, in case you forget your password" required="True">
<input type="text" class="form-control greentext" name="email" placeholder="email" title="This is used in to send you password reset link, in case you forget your password" required="True">
{% for error in form_human.email.errors %}
<label class="control-label whitetext"><span class="whitetext">{{ error }}</span></label>
{% endfor %}
</div>
<div class="form-group{% if form_human.password.errors %} has-error{% endif %}">
<input type="password" class="form-control greentext" id="password" name="password" placeholder="password" title="Choose a strong password" required>
<input type="password" class="form-control greentext" name="password" placeholder="password" title="Choose a strong password" required>
{% for error in form_human.password.errors %}

<label class="control-label whitetext"><span class="whitetext">{{ error }}</span></label>
Expand Down Expand Up @@ -231,7 +231,7 @@ <h2 style="color:red; font-weight:bold; border-color:white; text-shadow: 2px
{% csrf_token %}
<input type="hidden" name="is_product" value="1" >
<div class="form-group{% if form_products.username.errors %} has-error{% endif %}">
<input type="text" class="form-control redtext" id="username" name="username" placeholder="username" title="Unique username, which should not contain +,-, and white spaces" required>
<input type="text" class="form-control redtext" name="username" placeholder="username" title="Unique username, which should not contain +,-, and white spaces" required>
{% for error in form_products.username.errors %}
<label class="control-label">{{ error }}</label>
{% endfor %}
Expand All @@ -244,14 +244,14 @@ <h2 style="color:red; font-weight:bold; border-color:white; text-shadow: 2px
</div> -->

<div class="form-group{% if form_products.email.errors %} has-error{% endif %}">
<input type="text" class="form-control redtext" id="email" name="email" placeholder="email" title="This is used in to send you password reset link, in case you forget your password" required>
<input type="text" class="form-control redtext" name="email" placeholder="email" title="This is used in to send you password reset link, in case you forget your password" required>
{% for error in form_products.email.errors %}
<label class="control-label">{{ error }}</label>
{% endfor %}
</div>

<div class="form-group{% if form_products.password.errors %} has-error{% endif %}">
<input type="password" class="form-control redtext" id="password" name="password" placeholder="password" title="Choose a strong password" required>
<input type="password" class="form-control redtext" name="password" placeholder="password" title="Choose a strong password" required>
{% for error in form_products.password.errors %}
<label class="control-label">{{ error }}</label>
{% endfor %}
Expand Down
35 changes: 20 additions & 15 deletions hohos/authentication/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ def signup_human(request):
wel_post = ''
welcome1= ' You seem to love facial expressions?? You can Make it awesome!\n'\
+'Challenge your friends and imitate them. Sounds cool??\n'\
+'Welcome!\nhttp://www.hohos.in/feeds/challenge/'
+'Welcome!\nhttp://www.hohos.tech/feeds/challenge/'
welcome2= ' Get ready to speak through your awesome facial expressions...\n'\
+'http://www.hohos.in/feeds/'
+'http://www.hohos.tech/feeds/'
welcome3= ' You are awesome! \n'\
+'Imitate your friends expressions and challenge them yours.'\
+'You should try it once!\n'\
+'Its amazing!\nhttp://www.hohos.in/feeds/'
+'Its amazing!\nhttp://www.hohos.tech/feeds/'

post_no = random.randint(1,3)
if post_no==1: wel_post = welcome1
Expand Down Expand Up @@ -106,26 +106,29 @@ def signup_human(request):
to = [email]
subject = 'Welcome at hohos ' + user.username
message = 'Dear '+user.username+'!\n'\
+ 'We are happy to see you on hohos.\n' \
+ 'We are happy to see you on hohos.tech\n' \
+ 'You will have lots of amazing experience along the time. It will get better if '\
+ 'you participate in share and imitate culture at hohos.in/feeds/\n'\
+ 'you participate in share and imitate culture at hohos.tech/feeds/\n'\
+ 'Challenge your facial expressions, let your likers and other people imitate them.'\
+ 'Because its awesome to see the different versions of same thing.\n'\
+ 'This becomes rejoicing when your own friends imitate you.\n\n'\
+ 'Moreover you can become the part of OpenChat community at - hohos.in/feeds/openchat/h_h/ '\
+ 'Moreover you can become the part of OpenChat community at - hohos.tech/feeds/openchat/h_h/ '\
+ ' here You can talk to your daily use products too. Which makes things a lot easier.\n\n'\
+ 'Build you profile for better interaction.'\
+ 'First hohos.in/login and then move to hohos.in/settings/human/\n\n'\
+ 'First hohos.tech/login and then move to hohos.tech/settings/human/\n\n'\
+ 'Best wishes!\n'\
+ '-Team iA at hohos.in'
+ '-Team iA at hohos.tech'
if to:
send_mail(subject,message,from_email,to,fail_silently=False)
try:
send_mail(subject,message,from_email,to,fail_silently=False)
except:
pass

print('inside signup, authentication.views')
print('user\'s pk %d'%(user.pk))
return redirect('feeds')

else:
else:
return render(request, 'authentication/signup.html',{
'form_human': SignUpForm(),
'users_challenges' : users_challenges,
Expand Down Expand Up @@ -220,15 +223,17 @@ def signup_products(request):
+ 'people using you start sharing their feedback\n'\
+ 'This will help you become better and more efficient'\
+ 'This way both you and customers may get the best of available\n'\
+ 'Moreover you can become the part of OpenChat community at - hohos.in/feeds/openchat/h_h/ '\
+ 'Moreover you can become the part of OpenChat community at - hohos.tech/feeds/openchat/h_h/ '\
+ ' here You can talk to your daily use products too. Which makes things a lot easier.\n\n'\
+ 'Build you profile for better interaction.'\
+ 'First hohos.in/login and then move to hohos.in/settings/human/\n\n'\
+ 'First hohos.tech/login and then move to hohos.tech/settings/human/\n\n'\
+ 'Best wishes!\n'\
+ '-Team iA at hohos.in'
+ '-Team iA at hohos.tech'
if to:
send_mail(subject,message,from_email,to,fail_silently=False)

try:
send_mail(subject,message,from_email,to,fail_silently=False)
except:
pass

print('inside signup, authentication.views')
print('user\'s pk %d'%(user.pk))
Expand Down
46 changes: 22 additions & 24 deletions hohos/core/templates/core/cover.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,32 +193,30 @@ <h1 class="center">

{% block js %}

{% include 'core/cover_js.html' %}
<script type="text/javascript">

Tipped.create(".loginbtn",{position: 'right'});
Tipped.create(".Signupbtn",{position: 'left'});
Tipped.create(".resetpasswordbtn",{position: 'right'});
// Tipped.create(".hohoslogo",{position : 'top'});

// Tipped.create("#invite",{position : 'left'});
// Tipped.create("#invitebutton",{position : 'topleft'});
Tipped.create(".talkus",{position : 'right'});

Tipped.create("#username",{position : 'right'});
Tipped.create("#password",{position : 'right'});

</script>

<script type="text/javascript">
$('.welcometext').typeIt({ speed:60, breakLines:false, autoStart:false });
$('.hohoslogo').typeIt({ cursor: false});

$('.welcomeback').typeIt({
speed: 90,
autoStart: false,
loop : true,
loopDelay: 1550,
});
// Tipped.create(".loginbtn",{position: 'right'});
// Tipped.create(".Signupbtn",{position: 'left'});
// Tipped.create(".resetpasswordbtn",{position: 'right'});
// // Tipped.create(".hohoslogo",{position : 'top'});

// // Tipped.create("#invite",{position : 'left'});
// // Tipped.create("#invitebutton",{position : 'topleft'});
// Tipped.create(".talkus",{position : 'right'});

// Tipped.create("#username",{position : 'right'});
// Tipped.create("#password",{position : 'right'});

// $('.welcometext').typeIt({ speed:60, breakLines:false, autoStart:false });
// $('.hohoslogo').typeIt({ cursor: false});

// $('.welcomeback').typeIt({
// speed: 90,
// autoStart: false,
// loop : true,
// loopDelay: 1550,
// });

</script>

Expand Down
23 changes: 23 additions & 0 deletions hohos/core/templates/core/cover_js.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<script type="text/javascript">
Tipped.create(".loginbtn",{position: 'right'});
Tipped.create(".Signupbtn",{position: 'left'});
Tipped.create(".resetpasswordbtn",{position: 'right'});
// Tipped.create(".hohoslogo",{position : 'top'});

// Tipped.create("#invite",{position : 'left'});
// Tipped.create("#invitebutton",{position : 'topleft'});
Tipped.create(".talkus",{position : 'right'});

Tipped.create("#username",{position : 'right'});
Tipped.create("#password",{position : 'right'});

$('.welcometext').typeIt({ speed:60, breakLines:false, autoStart:false });
$('.hohoslogo').typeIt({ cursor: false});

$('.welcomeback').typeIt({
speed: 90,
autoStart: false,
loop : true,
loopDelay: 1550,
});
</script>
16 changes: 11 additions & 5 deletions hohos/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,20 +476,26 @@ def invite(request):
Come and show your own version of these styles and Facial Expressions.
Because its fun to see various versions of same expression from different people\n
Waiting for your amazing styles! \n
www.hohos.in'''
www.hohos.tech'''
else:
message = '''Hey there!\n
Your friend at hohos has challenged you to copy their Styles and Expressions.\n
So you are welcome at hohos.\n
Come and show your own version of various Expressions shared by other users.\n
Because its fun to see various versions of same expression from different people\n
Waiting for your amazing styles! \n
www.hohos.in''' + "\n\nYour friend "+ request.user.username + " at www.hohos.in"+request.user.username

www.hohos.tech''' + "\n\nYour friend "+ request.user.username + " at www.hohos.tech"+request.user.username

message = '<a href="www.hohos.tech">okay brow</a>'
if '@' in to_email and '.' in to_email:
from_email = django_settings.EMAIL_HOST_USER
send_mail(subject,message,from_email,
to,fail_silently=False)

# try: send_mail(subject,message,from_email,
# to,fail_silently=False)
# except: pass
# send_mail(subject,message,from_email,to,fail_silently=False,html_message=htmlmsg) #here htmlmsg is a html message which override message
send_mail(subject,message,from_email,to,fail_silently=False)

html="<i class='fa fa-check'></i>" + ' Invited ' + '<i class="fa fa-smile-o" aria-hidden="true"></i>'
return HttpResponse(html)
else:
Expand Down
28 changes: 17 additions & 11 deletions hohos/feeds/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,43 +535,49 @@ def email_on_post(request): # feeds on profiles and reponse an
to_email=to_user.email
to = [to_email]
common_message = '\n-------------------------------------------------------------------------\n'+\
'\n\nFor more you can always check your profile at - www.hohos.in'+\
'\n\nFor more you can always check your profile at - www.hohos.tech'+\
to_user.username +\
'\n\nBesides there are some new challenges and responses www.hohos.in/feeds/ which may attract you. - '\
+'\n\nAnd awesome OpenChat at www.hohos.in/feeds/openchat/h_h/'+\
'\n\nTeamiA at www.hohos.in'+\
'\n\nBesides there are some new challenges and responses www.hohos.tech/feeds/ which may attract you. - '\
+'\n\nAnd awesome OpenChat at www.hohos.tech/feeds/openchat/h_h/'+\
'\n\nTeamiA at www.hohos.tech'+\
'\n\nIn case you do not have access to your account You can always mail us at [email protected]'+\
'\n\n\n\nThis is a system generated E-mail, Login at hohos and go to Settings For managing E-mails you get from us.'
if mail_type == 'challenge_mail':
subject = user.profile.get_screen_name() + ' has challenged you ' #+ to_user.profile.get_screen_name()
message = user.profile.get_screen_name() + ' has challenged you with following caption - \n\n'\
+ post + '\nSee all challenges for you at www.hohos.in/challenges/for/' + to_user.username + common_message
+ post + '\nSee all challenges for you at www.hohos.tech/challenges/for/' + to_user.username + common_message

elif mail_type == 'response_mail':
subject = user.profile.get_screen_name() + ' has responded to your facial expressions ' #+ to_user.profile.get_screen_name()
message = user.profile.get_screen_name() + ' has imitated your style in an amazing way - \n\n'\
+ post + '\nSee the whole story at www.hohos.in/feeds/response/' + response_for_id + common_message
+ post + '\nSee the whole story at www.hohos.tech/feeds/response/' + response_for_id + common_message

if response_for_user:
from_email = django_settings.EMAIL_HOST_USER
to_email_2 = response_for_user.email #email of the originally cahllenged user
to_2 = [to_email_2]
subject_2 = user.profile.get_screen_name() + ' has responded to a challenge which was for you '
message_2 = user.profile.get_screen_name() + ' has responded to a challengewhich was originally made for you - \n\n'\
+ post + '\nSee the whole story at www.hohos.in/feeds/response/' + response_for_id + common_message
send_mail(subject_2, message_2, from_email, to_2, fail_silently=False)

+ post + '\nSee the whole story at www.hohos.tech/feeds/response/' + response_for_id + common_message
try:
send_mail(subject_2, message_2, from_email, to_2, fail_silently=False)
except:
pass

elif mail_type == 'profile_talk_mail':
subject = user.profile.get_screen_name() + ' seems to like you very much ' #+ to_user.profile.get_screen_name()
message = user.profile.get_screen_name() + ' has written this on your profile at hohos - \n\n'\
+ post + '\nSee the whole story at www.hohos.in/' + to_user.username + common_message
+ post + '\nSee the whole story at www.hohos.tech/' + to_user.username + common_message
else:
to = django_settings.EMAIL_HOST_USER
subject = 'no to_user mail found so sending back to hohosguys'
message = 'Problem sending mail'

from_email = django_settings.EMAIL_HOST_USER
send_mail(subject,message,from_email,to,fail_silently=False)
try:
send_mail(subject,message,from_email,to,fail_silently=False)
except:
pass
return HttpResponse('')
return HttpResponse('')

Expand Down
24 changes: 12 additions & 12 deletions hohos/hohos/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


ADMINS = (
('deepak','[email protected]'),
# ('deepak','[email protected]'),
)

EMAIL_USE_TLS = True
Expand Down Expand Up @@ -79,12 +79,12 @@
)


AUTHENTICATION_BACKENDS = (
# AUTHENTICATION_BACKENDS = (

'django.contrib.auth.backends.ModelBackend',
# 'social.backends.google.GoogleOAuth2',
'allauth.account.auth_backends.AuthenticationBackend',
)
# 'django.contrib.auth.backends.ModelBackend',
# # 'social.backends.google.GoogleOAuth2',
# 'allauth.account.auth_backends.AuthenticationBackend',
# )


MIDDLEWARE_CLASSES = (
Expand All @@ -100,12 +100,12 @@
# 'authentication.onlineUsers.ActiveUserMiddleware',
)

CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '139.59.87.76',
}
}
# CACHES = {
# 'default': {
# 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
# 'LOCATION': '139.59.77.182',
# }
# }


ROOT_URLCONF = 'hohos.urls'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

{% block reset_link %}

{{ protocol }}://hohos.in{% url 'password_reset_confirm' uidb64=uid token=token %}
{{ protocol }}://hohos.tech{% url 'password_reset_confirm' uidb64=uid token=token %}
{% endblock %}

{% trans "Your username, in case you forgot, is :" %} {{ user.get_username }}
Expand Down
1 change: 1 addition & 0 deletions hohos/hohos/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

urlpatterns = [
# url(r'^$',core_views.wait,name='wait'),
url(r'coolAdMiN_@3/',include(admin.site.urls)),
url(r'^googleb5ffb42fb0a2feb6.html/$', core_views.crawl, name='crawl'),
url(r'^sitemap/$', core_views.sitemap, name='sitemap'),

Expand Down
Loading

0 comments on commit 6dd7e31

Please sign in to comment.