diff options
author | prashantsinalkar | 2020-03-05 19:28:24 +0530 |
---|---|---|
committer | prashantsinalkar | 2020-03-06 11:48:26 +0530 |
commit | fde8470c5e47434df8c854bd3135763062fada12 (patch) | |
tree | c859006456fe98e2259424c5a3826e54c17e1cbf /arduino_blog | |
parent | a87bea9854a2ab1248abac74c4b2f04f819297ee (diff) | |
download | arduino_projects_website-fde8470c5e47434df8c854bd3135763062fada12.tar.gz arduino_projects_website-fde8470c5e47434df8c854bd3135763062fada12.tar.bz2 arduino_projects_website-fde8470c5e47434df8c854bd3135763062fada12.zip |
fixed file structure and added forgot passowrd link
Diffstat (limited to 'arduino_blog')
16 files changed, 801 insertions, 26 deletions
diff --git a/arduino_blog/static/admin/templates/clearable_file_input.html b/arduino_blog/static/admin/templates/clearable_file_input.html new file mode 100644 index 0000000..4002c00 --- /dev/null +++ b/arduino_blog/static/admin/templates/clearable_file_input.html @@ -0,0 +1,13 @@ +{% if widget.is_initial %} + <br> + <p class="file-upload">{{ widget.initial_text }}: <a href="{{ widget.value.url }}">{{ widget.value }}</a> + {% if not widget.required %} + <span class="clearable-file-input"> + <input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}"> + <label for="{{ widget.checkbox_id }}"><strong>{{ widget.clear_checkbox_label }}</strong></label></span> + {% endif %} + <br> +{% endif %} + +<input type="{{ widget.type }}" name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}> +{% if widget.is_initial %}</p>{% endif %}
\ No newline at end of file diff --git a/arduino_blog/static/admin/templates/forgot-password.html b/arduino_blog/static/admin/templates/forgot-password.html new file mode 100644 index 0000000..24eb95c --- /dev/null +++ b/arduino_blog/static/admin/templates/forgot-password.html @@ -0,0 +1,54 @@ +{% extends "website/templates/base.html" %} +{% load widget_tweaks %} +{% block content %} +{% load static %} + +<link rel="stylesheet" href="{% static 'website/css/login.css' %}"> +<br><br><br> +<div class="row"> +<div class="form"> +<div class="headerlogin"><h2>Forgot Password</h2></div> +<div class="login"> + + </br> + {% if invalid_email %} + <center> + <div class="alert alert-danger"> + <a class="close" data-dismiss="alert" href="#">×</a> + <b>Invalid Email address</b> + </div> + </center> + <div class="clearfix"></div> + {% endif %} + + <form method="POST"> {% csrf_token %} + {{ form.as_p }} + {% with WIDGET_ERROR_CLASS='field_error' %} + <p>Enter the Email address you used while registration.</p> + <p >We will send you the updated login details on your Email address.</p> + <form action="" method=POST enctype="multipart/form-data"> + {% csrf_token %} + <p><input class="pwd-recovery-email" type=text id="email" name="email" style="width:80%" placeholder="Your Email"></p> + <p><input class="btn btn-primary btn-sm" type=submit value="Reset Password"></p> + </form> + {% endwith %} + + </form> +</br> + + + </div> + </br> + <div class="sign"> +<div class="need">Already Registered? </div> +<div> <a href="/accounts/login/" class="btn btn-sm btn-success">Login </a></div> +</div> + +</div> + +</div> <!-- /.row --> +{% endblock %} + +{% block javascript %} + $(".alert").alert(); +{% endblock %}
\ No newline at end of file diff --git a/arduino_blog/static/admin/templates/message.html b/arduino_blog/static/admin/templates/message.html new file mode 100644 index 0000000..6493cbe --- /dev/null +++ b/arduino_blog/static/admin/templates/message.html @@ -0,0 +1,17 @@ +{% extends 'website/templates/base.html' %} +{% load widget_tweaks %} +{% load static %} +{% block title %}Successful{% endblock %} +{% block cssblock %} + <link rel="stylesheet" href="{% static 'website/css/login.css' %}" type="text/css" media="screen" charset="utf-8" /> +{% endblock %} +{% block search %} +{% endblock %} +{% block content %} +<br/><br/> +<h4>Thank you for registering.<br/> +Your account activation link has been sent to the email id provided.</h4> + +{% endblock %} + + diff --git a/arduino_blog/static/admin/templates/profile.html b/arduino_blog/static/admin/templates/profile.html new file mode 100644 index 0000000..6a96243 --- /dev/null +++ b/arduino_blog/static/admin/templates/profile.html @@ -0,0 +1,91 @@ +{% extends 'website/templates/base.html' %} +{% load widget_tweaks %} +{% load static %} + +{% block title %}User Profile{% endblock %} +{% block cssblock %}<link rel="stylesheet" href="{% static 'website/css/chosen.min.css' %}" type="text/css" media="screen" charset="utf-8" />{% endblock %} +{% block heading %} + <i class="fa fa-list-ul"></i> User Profile +{% endblock %} + +{% block content %} + + <div class="row well "> + <div class="col-sm-8"> + <form class="form-signin form-horizontal" role="form" id="login_form" method="post" enctype="multipart/form-data">{% csrf_token %} + <div class="form-group"> + <label class="col-sm-3 control-label" for="id_first_name">First Name<span style="color:red">*</span></label> + <div class="col-sm-9"> + {% render_field form.first_name class+="form-control first_name" tabindex="1" data-placeholder="Choose first_name" %} + {{ form.first_name.errors }} + <!-- <small>Please enter your first name.</small> --> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label" for="id_last_name">Last Name<span style="color:red">*</span></label> + <div class="col-sm-9"> + {% render_field form.last_name class+="form-control last_name" tabindex="1" data-placeholder="Choose last_name" %} + {{ form.last_name.errors }} + <!-- <small>Please enter your last name.</small> --> + </div> + </div> + + + <!-- + <div class="form-group"> + <label class="col-sm-3 control-label" for="id_location">Location</label> + <div class="col-sm-9"> + {% render_field form.location class+="form-control location" tabindex="1" data-placeholder="Enter location" %} + {{ form.location.errors }} + </div> + </div> + + <div class="form-group"> + <label class="col-sm-3 control-label" for="id_street">Street</label> + <div class="col-sm-9"> + {% render_field form.street class+="form-control street" tabindex="1" data-placeholder="Choose street" %} + {{ form.street.errors }} + </div> + </div> + --> + <div class="form-group"> + <label class="col-sm-3 control-label" for= "id_street">Address</label> + <div class="col-sm-9"> + {% render_field form.address class+="form-control street" tabindex="1" data-placeholder="Enter street" %} + {{ form.address.errors }} + <!-- <small>Please enter your valid address.</small> --> + </div> + </div> + + + <div class="form-group"> + <label class="col-sm-3 control-label" for="id_phone">Phone</label> + <div class="col-sm-9"> + {% render_field form.phone class+="form-control phone" tabindex="1" data-placeholder="Choose phone" %} + {{ form.phone.errors }} + <!-- <small>Please enter your valid phone number.</small> --> + </div> + </div> + <!-- {# <div class="form-group"> #} + {# <label class="col-sm-3 control-label" for="id_phone">Picture</label> #} + {# <div class="col-sm-9"> #} + {# {% render_field form.picture class+="form-control picture" tabindex="1" %} #} + {# {{ form.picture.errors }} #} + {# </div> #} + {# </div> #} --> + <div class="form-group"> + <div class="col-sm-offset-3 col-sm-9"> + <input class="btn btn-primary" type="submit" value="Submit" /> + </div> + </div> + </form> + </div> + </div> + + <br> + <small><span style="color:red">* </span><strong>Field required</strong></small> + <small></p><span style="color:red">* </span><strong>Fields required to access basic features of forum</strong></small> + +{% endblock %} + + diff --git a/arduino_blog/static/admin/templates/registration/password_change_done.html b/arduino_blog/static/admin/templates/registration/password_change_done.html new file mode 100644 index 0000000..36ce7b4 --- /dev/null +++ b/arduino_blog/static/admin/templates/registration/password_change_done.html @@ -0,0 +1,19 @@ +{% extends "base.html" %} +<!DOCTYPE html> +{% block title %} Password change successful {% endblock %} +{% block pagetitle %} Password reset done{% endblock %} +{% block formtitle %} Open Source Hardware Project {% endblock %} +{% block content %} +{% load static %} + +<section class="jumbotron text-center"> + <div class="container"> + <div class="row"> + <div class="col-sm"> + <p>Your password has been changed successfully. </p> + <p><a class= "btn btn-success" href='/'>Go to home page.</a></p> + </div> + </div> + </div> +</section> +{% endblock %}
\ No newline at end of file diff --git a/arduino_blog/static/admin/templates/registration/password_change_form.html b/arduino_blog/static/admin/templates/registration/password_change_form.html new file mode 100644 index 0000000..21f33e8 --- /dev/null +++ b/arduino_blog/static/admin/templates/registration/password_change_form.html @@ -0,0 +1,18 @@ +{% extends MODERATOR_ACTIVATED|yesno:'website/templates/moderator/base.html,website/templates/base.html' %} +<!DOCTYPE html> +{% block title %} Change Password {% endblock %} + +{% block pagetitle %} FOSSEE Forums {% endblock %} + +{% block content %} +<form action="" method="post" > + {% csrf_token %} + <center> + <table class=span1> + {{ form }} + </table> + </center> + <center><button class="btn" type="submit">Change Password</button> + <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/accounts/");'>Cancel</button></center> +</form> +{% endblock content %} diff --git a/arduino_blog/static/admin/templates/registration/password_reset_complete.html b/arduino_blog/static/admin/templates/registration/password_reset_complete.html new file mode 100644 index 0000000..0d8e410 --- /dev/null +++ b/arduino_blog/static/admin/templates/registration/password_reset_complete.html @@ -0,0 +1,19 @@ +{% extends "base.html" %} +{% block title %} Password reset complete {% endblock %} +{% block pagetitle %} Password reset {% endblock %} +{% block formtitle %} Open Source Hardware Project {% endblock %} +{% block content %} +{% load static %} + +<section class="jumbotron text-center"> + <div class="container"> + <div class="row"> + <div class="col-sm"> + <p>Your password has been reset. </p> + <p><a class= "btn btn-success" href="{{ login_url }}">Log in</a></p> + </div> + </div> + </div> +</section> + +{% endblock %} diff --git a/arduino_blog/static/admin/templates/registration/password_reset_confirm.html b/arduino_blog/static/admin/templates/registration/password_reset_confirm.html new file mode 100644 index 0000000..4787a8b --- /dev/null +++ b/arduino_blog/static/admin/templates/registration/password_reset_confirm.html @@ -0,0 +1,64 @@ +{% extends "base.html" %} +{% block title %}Reset Password{% endblock %} +{% block pagetitle %} Password reset {% endblock %} +{% block formtitle %} Open Source Hardware Project {% endblock %} +{% block content %} +{% load static %} +<section class="jumbotron text-center"> + <div class="container"> + <div class="row vertical-center-row"> + <div class="col-sm"> + <div><h3>Password Reset</h3></div> + <center> + {% if validlink %} + <p>Please enter your new password twice. + So we can verify you typed it in correctly.</p> + <form action="" method="post"> + <div style="display:none"> + <input type="hidden" value="{{ csrf_token }}" name="csrfmiddlewaretoken"> + </div> + <table> + <tr> + <td>{{ form.new_password1.errors }} + <label for="id_new_password1" >New password:</label></td> + <td>{{ form.new_password1 }}</td> + </tr> + <tr> + <td>{{ form.new_password2.errors }} + <label for="id_new_password2" >Confirm password:</label></td> + <td>{{ form.new_password2 }}</td> + </tr> + <tr> + <td></td> + <td><button class= "btn btn-success" type="submit" onclick="return checkform(this);">Submit</button> + </tr> + </table> + </form> + {% else %} + <h1>Password reset unsuccessful</h1> + <p>The password reset link was invalid, <br /> + possibly because it has already been used. <br /> + Please request a new password reset.</p> + {% endif %} + </center> + </div> +</section> + +<script> +function checkform(form) { + // alert("in"); + var pwd1 = document.getElementById("id_new_password1"); + // alert(pwd1.value); + var pwd2 = document.getElementById("id_new_password2"); + //return false; + if(pwd1.value.length && pwd2.value.length < 8) { + alert("Error: Password must contain at least eight characters!"); + pwd1.focus(); + pwd1.value = ""; + pwd2.value = ""; + return false; + } +} + +</script> +{% endblock %} diff --git a/arduino_blog/static/admin/templates/registration/password_reset_done.html b/arduino_blog/static/admin/templates/registration/password_reset_done.html new file mode 100644 index 0000000..acc337e --- /dev/null +++ b/arduino_blog/static/admin/templates/registration/password_reset_done.html @@ -0,0 +1,20 @@ + +{% extends "base.html" %} +{% block title %} Password reset successful {% endblock %} +{% block pagetitle %} Open Source Hardware Project {% endblock %} +{% block formtitle %} Email will be send to the registered email address {% endblock %} +{% block content %} +{% load static %} +<section class="jumbotron text-center"> + <div class="container"> + <div class="row"> + <div class="col-sm"> + <div class="headerlogin"><h3> Password reset </h3></div> + <div class="login"> + If an account exists with this email, you would receive the password reset instructions shortly. Please check your spam folder too. + </div> + </div> + </div> + </div> +</section> +{% endblock %} diff --git a/arduino_blog/static/admin/templates/registration/password_reset_form.html b/arduino_blog/static/admin/templates/registration/password_reset_form.html new file mode 100644 index 0000000..c852809 --- /dev/null +++ b/arduino_blog/static/admin/templates/registration/password_reset_form.html @@ -0,0 +1,30 @@ + +{% extends "base.html" %} +{% block title %} Forgot Password {% endblock %} +{% block pagetitle %} Open Source Hardware Project {% endblock %} +{% block formtitle %} Email will be send to the registered email address {% endblock %} +{% block content %} +{% load static %} +<section class="jumbotron text-center"> + <div class="container"> + <div class="row"> + <div class="col-sm"> + <div class="headerlogin"><h3> Recovery Email </h3></div> + <div class="login"> + <br> + Kindly Enter Your Email ID used for Registration. The password Reset link will be mailed to the same. + <br><br> + <form action="" method="post"> + {% csrf_token %} + {{ form.email.errors }} + <p><label for="id_email">E-mail address:</label> {{ form.email }} <input class="btn btn-success" type="submit" value="Reset password" /></p> + <!-- <button class="btn btn-sm btn-primary" type="submit">Request</button> + <a class="btn btn-sm " href="{{URL_ROOT}}/accounts/login/">Cancel</a> --> + </form> + <br> + </div> + </div> + </div> + </div> +</section> +{% endblock content %} diff --git a/arduino_blog/static/admin/templates/update-password.html b/arduino_blog/static/admin/templates/update-password.html new file mode 100644 index 0000000..33eb1d6 --- /dev/null +++ b/arduino_blog/static/admin/templates/update-password.html @@ -0,0 +1,41 @@ +{% extends "website/templates/base.html" %} +{% load widget_tweaks %} +{% block content %} +{% load static %} + +<link rel="stylesheet" href="{% static 'website/css/login.css' %}"> +<br><br><br> +<div class="row"> +<div class="form"> +<div class="headerlogin"><h2>Update Password</h2></div> +<div class="login"> + {% if no_match %} + <center> + <div class="alert" style="width:400px;height:50px;"> + <a class="close" data-dismiss="alert" href="#">×</a> + <p>Password & Confirm Password did not match</p> + </div> + </center> + <div class="clearfix"></div> + {% endif %} + <form method="POST"> {% csrf_token %} + + {% with WIDGET_ERROR_CLASS='field_error' %} + <p>Enter the Email address you used while registration.</p> + <p >We will send you the updated login details on your Email address.</p> + <p><input class="pwd-recovery-email" type=password id="new_password" name="new_password" placeholder="New Password"> + <p><input class="pwd-recovery-email" type=password id="confirm_new_password" name="confirm_new_password" placeholder="Confirm New Password"> + <p><input class="btn btn-primary btn-sm" type=submit value="Update Password"> + {% endwith %} + + </form> + </br> + </div> + <div class="sign"> +<div class="need">Already Registered? </div> +<div> <a href="/accounts/login/" class="btn btn-sm btn-success">Login </a></div> +</div> + </div> +</div> +{% endblock %} + diff --git a/arduino_blog/static/admin/templates/user-login.html b/arduino_blog/static/admin/templates/user-login.html new file mode 100644 index 0000000..d0717c0 --- /dev/null +++ b/arduino_blog/static/admin/templates/user-login.html @@ -0,0 +1,74 @@ +{% extends "website/templates/base.html" %} +{% load widget_tweaks %} +{% block content %} +{% load static %} + +<link rel="stylesheet" href="{% static 'website/css/login.css' %}"> +<br><br><br> +<div class="row"> +<div class="form"> +<div class="headerlogin"><h2>Sign In</h2></div> +<div class="login"> + {% if password_reset %} + <center> + <div class="alert alert-danger"> + <a class="close" data-dismiss="alert" href="#">×</a> + <p>Kindly log in to Ask Question</p> + </div> + </center> + <div class="clearfix"></div> + {% endif %} + <!-- {% if password_updated %} + <center> + <div class="alert alert-danger"> + <a class="close" data-dismiss="alert" href="#">×</a> + <p>Password has been updated successfully !</p> + </div> + </center> + <div class="clearfix"></div> + {% endif %} --> + </br> + <form action="{% url 'user_login' %}" method="POST"> {% csrf_token %} + {% if form.errors %} + <div class="alert alert-danger"> + <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> + <b>Invalid username or password</b> + </div> + {% endif %} + {% with WIDGET_ERROR_CLASS='field_error' %} + <div class="input-group"> + <span class="input-group-addon"><i class="fa fa-user fa-fw"></i></span> + {% render_field form.username class+="form-control" placeholder="Username" %} + </div> + </br> + <div class="input-group"> + <span class="input-group-addon"><i class="fa fa-lock fa-fw"></i></span> + {% render_field form.password class+="form-control" placeholder="Password" %} + </div> + </br> + {% if next %} + <input type="hidden" name="next" value="{{ next }}"> + {% endif %} + <input class="btn btn-sm btn-primary" type="submit" value="Login"> + <span class="ch"><a href="/forgotpassword/">Forgot Password?</a></span> + {% endwith %} + </form> + + + <h4>Rules and Regulations</h4> + <ol> + <li>This forum is a place to discuss questions and doubts related to the FOSSEE FOSS.</li> + <li>This is not a place for self promotion.</li> + <li>Any violation of the above may lead to the permanent account deletion.</li> + <li>As this is a public forum, please refrain from sharing details such as email ids, phone numbers, address, etc. on the FORUM.</li> + </ol> + + </div><br/> +<div class="sign"> +<div class="need">Need new account ?</div> +<div> <a class="btn btn-sm btn-success" href="/accounts/register/" >Register</a></div> +</div> +</div> + +</div> <!-- /.row --> +{% endblock %} diff --git a/arduino_blog/static/admin/templates/user-register.html b/arduino_blog/static/admin/templates/user-register.html new file mode 100644 index 0000000..cfa38d9 --- /dev/null +++ b/arduino_blog/static/admin/templates/user-register.html @@ -0,0 +1,108 @@ +{% extends 'website/templates/base.html' %} +{% load widget_tweaks %} +{% load static %} +{% block title %}Register{% endblock %} +{% block cssblock %} + <link rel="stylesheet" href="{% static 'website/css/login.css' %}" type="text/css" media="screen" charset="utf-8" /> +{% endblock %} +{% block search %} +{% endblock %} +{% block content %} + +<div class="form" style="margin: 50px auto 0px;"> +<div class="headerlogin"><h2>Register</h2></div> +<div class="login"> + <br> + <p> The activation link of the account will be sent to the Email id provided.</p> + <br> + <form id="logForm" method="post" class="form-horizontal">{% csrf_token %} + <div class="form-group"> + <div class="col-xs-12"> + <div class="input-group"> + <span class="input-group-addon"><i class="fa fa-user fa-fw"></i></span> + {% render_field form.username class+="form-control username" tabindex="1" placeholder="Desired Username" %} + </div> + {{ form.username.errors }} + </div> + </div> + <div class="form-group"> + <div class="col-xs-12"> + <div class="input-group"> + <span class="input-group-addon"><i class="fa fa-envelope fa-fw"></i></span> + {% render_field form.email class+="form-control email" tabindex="1" placeholder="Your Email" %} + </div> + {{ form.email.errors }} + </div> + </div> + <div class="form-group"> + <div class="col-xs-12"> + <div class="input-group"> + <span class="input-group-addon"><i class="fa fa-lock fa-fw"></i></span> + {% render_field form.password class+="form-control password" tabindex="1" placeholder="Enter password" %} + </div> + {{ form.password.errors }} + </div> + </div> + <div class="form-group"> + <div class="col-xs-12"> + <div class="input-group"> + <span class="input-group-addon"><i class="fa fa-lock fa-fw"></i></span> + {% render_field form.password_confirm class+="form-control password_confirm" tabindex="1" placeholder="Retype Password" %} + </div> + {{ form.password_confirm.errors }} + </div> + </div> + <div class="form-group"> + <div class="col-xs-12"> + <div class="input-group captcha-group"> + <script src='https://www.google.com/recaptcha/api.js'></script> + <div class="g-recaptcha" data-sitekey="{{ SITE_KEY }}" data-callback="enableBtn"></div> + </div> + </div> + </div> + + <script> + function enableBtn(){ + document.getElementById("regstr").disabled = false; + } + </script> + <div class="col-sm-5 submitWrap"> + <button type="submit" class="btn btn-primary btn-sm " id="regstr" disabled>Register</button> + </div> + + + </div> + </br> </br> </br> + <div class="sign"> +<div class="need">Already Registered? </div> +<div> <a href="/accounts/login/" class="btn btn-sm btn-success">Login </a></div> +</div> + + </form> + </div> + </div> + </div> +{% endblock %} +{% block uncompressjsblock %} + <script> + $(function() { + // Add refresh button after field (this can be done in the template as well) + + // Click-handler for the refresh-link + $('.captcha-refresh').click(function(){ + var $form = $(this).parents('form'); + var url = location.protocol + "//" + window.location.hostname + ":"+ location.port + "/captcha/refresh/"; + + // Make the AJAX-call + $.getJSON(url, {}, function(json) { + $form.find('input[name="captcha_0"]').val(json.key); + $form.find('img.captcha').attr('src', json.image_url); + }); + + return false; + }); + }); + </script> +{% endblock %} + + diff --git a/arduino_blog/static/admin/templates/view-profile.html b/arduino_blog/static/admin/templates/view-profile.html new file mode 100644 index 0000000..3416928 --- /dev/null +++ b/arduino_blog/static/admin/templates/view-profile.html @@ -0,0 +1,210 @@ +{% extends MODERATOR_ACTIVATED|yesno:'website/templates/moderator/base.html,website/templates/base.html' %} +{% load widget_tweaks %} +{% load static %} +{% load count_tags %} + +{% block title %}User Profile{% endblock %} + +{% block cssblock %} +{% endblock %} + +{% block heading %} + <i class="fa fa-list-ul"></i> User Profile +{% endblock %} + +{% block content %} + +<br><br> +<div> + <h3>{{profile.user.username}}'s Dashboard</h3> +</div> +<br><br> + +<div class="col-lg-12 "> + + <ul class="nav nav-tabs"> + <li class="active"><a data-toggle="tab" href="#profile"> <span ><i class="fa fa-user"></i></span> + Profile</a></li> + <li><a data-toggle="tab" href="#questions"><span ><i class="fa fa-question-circle"></i></span> + Questions</a></li> + <li><a data-toggle="tab"href="#answers"><span ><i class="fa fa-check-circle"></i></span> + Answers</a></li> + + {% if show %} + <li><a data-toggle="tab" href="#profile_edit"><span ><i class="fa fa-user"></i></span> + Edit Profile</a></li> + {% endif %} + </ul> + + <div class="tab-content"> + + <div id="profile" class="tab-pane fade in active"> + <p> + <div class="row well view-profile" style="margin-top: 20px;"> + <div class="col-sm-12"> + <div class="col-sm-12"> + + <form class="form-signin form-horizontal control-label " role="form" id="login_form" method="post" enctype="multipart/form-data">{% csrf_token %} + {{ form.errors }} + + <div class="form-group"> + <label class="col-sm-3" for="id_first_name">User Name</label> + <div class="col-sm-8 "> + {% if profile.user.username %}{{ profile.user.username }}{% else %}-{% endif %} + </div> + </div> + + <div class="form-group"> + <label class="col-sm-3 " for="id_last_name">First Name</label> + <div class="col-sm-8 "> + {% if profile.user.first_name %}{{ profile.user.first_name }}{% else %}-{% endif %} + </div> + </div> + + <div class="form-group"> + <label class="col-sm-3 " for="id_last_name">Last Name</label> + <div class="col-sm-8 "> + {% if profile.user.last_name %}{{ profile.user.last_name }}{% else %}-{% endif %} + </div> + </div> + + {% if show %} + <div class="form-group"> + <label class="col-sm-3 " for= "id_street">Address</label> + <div class="col-sm-8 "> + {% if profile.address %}{{ profile.address }}{% else %}-{% endif %} + </div> + </div> + {% endif %} + + {% if show %} + <div class="form-group"> + <label class="col-sm-3 " for="id_phone">Email</label> + <div class="col-sm-8 "> + {% if profile.user.email %}{{ profile.user.email }}{% else %}-{% endif %} + </div> + </div> + {% endif %} + + {% if show %} + <div class="form-group"> + <label class="col-sm-3 " for="id_phone">Phone</label> + <div class="col-sm-8 "> + {% if profile.phone %}{{ profile.phone }}{% else %}-{% endif %} + </div> + </div> + {% endif%} + + <div class="form-group"> + <label class="col-sm-3 " for="id_phone">Profile Created</label> + <div class="col-sm-8 "> + {{ profile.created }} + </div> + </div> + </form> + </div> + </div> + </div> + </p> + </div> + + <div id="profile_edit" class="tab-pane fade "> + + <div class="row well view-profile" style="margin-top: 20px;"> + <div class="col-sm-12"> + <div class="col-sm-12"> + + {% if show %} + <form class="form-signin form-horizontal" action="/accounts/profile/" method="post" enctype="multipart/form-data">{% csrf_token %} + + <div class="form-group"> + <label class="col-sm-3 control-label" for="id_first_name">First Name<span style="color:red">*</span></label> + <div class="col-sm-5"> + {% render_field form.first_name class+="form-control first_name" tabindex="1" data-placeholder="Choose first_name" %} + {{ form.first_name.errors }} + </div> + </div> + + <div class="form-group"> + <label class="col-sm-3 control-label" for="id_last_name">Last Name<span style="color:red">*</span></label> + <div class="col-sm-5"> + {% render_field form.last_name class+="form-control last_name" tabindex="1" data-placeholder="Choose last_name" %} + {{ form.last_name.errors }} + </div> + </div> + + <div class="form-group"> + <label class="col-sm-3 control-label" for= "id_street">Address</label> + <div class="col-sm-5"> + {% render_field form.address class+="form-control street" tabindex="1" data-placeholder="Enter address" %} + {{ form.address.errors }} + </div> + </div> + + <div class="form-group"> + <label class="col-sm-3 control-label" for="id_phone">Phone</label> + <div class="col-sm-5"> + {% render_field form.phone class+="form-control phone" tabindex="1" data-placeholder="Choose phone" %} + {{ form.phone.errors }} + </div> + </div> + + <input class="btn btn-primary" type="submit" value="Submit" /> + </form> + + <small><span style="color:red">* </span><strong>Field required</strong></small> + <small></p><span style="color:red">* </span><strong>Fields required to access basic features of forum</strong></small> + {% endif %} + + </div> + </div> + </div> + </div> + + <div id="questions" class="tab-pane fade"> + + <p> + <div class="row well view-profile" style="margin-top: 20px;"> + + {% for question in questions %} + <div class="my-question"> + <span class="title"><a href="{% url 'website:get_question' question.id %}"> + {{ question.title }}</a> + </span> + <br /> + <span class="date"> + <small>Asked on:{{ question.date_created }}</small> + </span> + </div> + {% endfor %} + + </div> + </p> + </div> + + <div id="answers" class="tab-pane fade"> + + <p> + <div class="row well view-profile" style="margin-top: 20px;"> + + {% for answer in answers%} + <div class="my-answer"> + <span class="body"> + <a href="{% url 'website:get_question' answer.question.id %}">{{ answer.question.title }}</a> + </span> + <br><br> + <span class="date"> + <small>Replied on:{{ answer.date_created }} + </small> + </span> + </div> + {% endfor %} + + </div> + </p> + + </div> + </div> +</div> + +{% endblock %}
\ No newline at end of file diff --git a/arduino_blog/templates/login.html b/arduino_blog/templates/login.html index 052fd99..f9709ab 100644 --- a/arduino_blog/templates/login.html +++ b/arduino_blog/templates/login.html @@ -3,18 +3,18 @@ {% load widget_tweaks %} {% load static %} {% block content %} - <section id="cfp" class="section cfp"> - <div class="container"> + <section id="cfp" class="section cfp jumbotron d-flex justify-content-between"> + <div class="container fluid"> <p> <center> - {% if user and not user.is_anonymous %} - <h2>Submit Proposal </h2> - {% else %} - <h2>Login</h2> - {% endif %} + {% if user and not user.is_anonymous %} + <h3>Submit Proposal </h3> + {% else %} + <h3>Login</h3> + {% endif %} </center> </p> - {% if registration_complete %} + {% if registration_complete %} <center> <p>Thank You for your registration. You can now log in by clicking <a href="{% url 'arduino_blog:user_login' %}">here!</a> @@ -22,23 +22,20 @@ <br/> <br/> </center> - {% endif %} - <form action="" method="POST"> - {% csrf_token %} - {{ form.as_p }} - <button class="btn btn-success" name ="login" type="submit">Login</button> - <br/> - <br/> - <a style="padding-right : 20px;" href="{% url 'arduino_blog:user_register' %}" class="btn btn btn-primary">Create an Account - </a> - <!-- <br><br> - <a href="/2019/forgotpassword/" class="btn btn-primary">Forgot Password?</a> --> - </form> - </p> - <br> - </div> - - </section> + {% endif %} + <div class="row" ><div class="col-sm d-flex justify-content-center"> + <form class="bg-info p-4" action="" method="POST"> + {% csrf_token %} + {{ form.as_table }} + <p></p> + <button class="btn btn-success" name ="login" type="submit">Login</button> + <a style="padding-right : 20px;" href="{% url 'arduino_blog:user_register' %}" class="btn btn btn-primary">Create an Account + </a> + <br> + <p><a class="btn btn btn-warning" href="/accounts/forgotpassword/">Forgot Password?</a></p> + </form></div></div> + </div> + </section> {% endblock %} diff --git a/arduino_blog/templates/user-register.html b/arduino_blog/templates/user-register.html index a5282d6..2b2fde6 100644 --- a/arduino_blog/templates/user-register.html +++ b/arduino_blog/templates/user-register.html @@ -5,7 +5,7 @@ {% block content %} <section id="register" class="section register"> - <div class="container"> + <div class="container fluid"> <center> <h2>Sign Up</h2> </center> |