From ea376fe2c995c8aac1b3253ed4745ab86dca4c76 Mon Sep 17 00:00:00 2001 From: Raghav Jajodia Date: Sat, 10 Jun 2017 19:29:32 +0530 Subject: [PATCH] The commit handles: Remove inline css Remove useless JS snippets Improve design Refactor code for better readabilty Fix indentation Add a line at the end --- website/forms.py | 8 - website/static/css/main.css | 66 ++++-- website/templates/_subscriptions.html | 91 +++++++ website/templates/about.html | 90 +------ website/templates/add_comment_to_post.html | 2 +- website/templates/base.html | 261 ++++++++++----------- website/templates/domain.html | 2 +- website/templates/edit_comment.html | 2 +- website/templates/email.html | 10 +- website/templates/hunt.html | 186 ++++++--------- website/templates/index.html | 61 ++--- website/templates/invite.html | 28 +-- website/templates/invite_friend.html | 25 +- website/templates/issue_edit.html | 64 ++--- website/templates/profile.html | 73 +++--- 15 files changed, 465 insertions(+), 504 deletions(-) create mode 100644 website/templates/_subscriptions.html diff --git a/website/forms.py b/website/forms.py index e28da1d4fc..8b1b96e808 100644 --- a/website/forms.py +++ b/website/forms.py @@ -1,16 +1,12 @@ from django import forms from .models import Issue, InviteFriend, UserProfile - class IssueEditForm(forms.ModelForm): - class Meta: model = Issue fields = ['description', 'screenshot', 'label'] - class FormInviteFriend(forms.ModelForm): - class Meta: model = InviteFriend fields = ['recipient'] @@ -18,11 +14,7 @@ class Meta: 'recipient': forms.TextInput(attrs={'class': 'form-control'}) } - class UserProfileForm(forms.ModelForm): - class Meta: model = UserProfile fields = ('user_avatar',) - - diff --git a/website/static/css/main.css b/website/static/css/main.css index 3a865a3785..392af3e2af 100644 --- a/website/static/css/main.css +++ b/website/static/css/main.css @@ -1,30 +1,68 @@ -.fa{ - color: #555; +.fa { + color: #555; } - -.round-icon{ - margin: 0 auto; +.round-icon { + margin: 0 auto; height: 50px; width: 50px; display: flex; flex-direction: column; justify-content: center; - /* border: 1px solid #000; */ background: #eee; border-radius: 50%; font-size: 30px; box-shadow: 0 1px 1px #dd4252; } - - -.no-shadow{ - box-shadow: 0 0 0 #000; +.no-shadow { + box-shadow: 0 0 0 #000; } - -.tag{ +.tag { color: #999; } - -.heading{ +.heading { font-weight: 300; } +.navbar-static-top { + margin-bottom: 0px; +} +.navbar-static-top .navbar-header { + z-index:4; +} +.navbar-static-top .navbar-brand img { + margin-left:20px; +} +.navbar-top-links img { + width: 20px; + height: 20px; +} +.navbar-static-top textarea { + resize:vertical; + height: 34px; +} +.screenshot-hash { + border: 1px solid #d43f3a; + height: 100px; +} +.navbar-static-top input[type='file'] { + opacity: 0; + width: 1px; + height:1px; +} +#login .modal-dialog { + margin-top: 200px; +} +#login .modal-body img { + padding-top: 15px; +} +#login .btn-caution { + height:86px; + width: 86px; + font-size:28px; + margin-top:3px; + margin-right:10px; + color:#dd4252; +} +#login p { + font-size: 13px; + padding-top: 20px; +} diff --git a/website/templates/_subscriptions.html b/website/templates/_subscriptions.html new file mode 100644 index 0000000000..4c63293ff9 --- /dev/null +++ b/website/templates/_subscriptions.html @@ -0,0 +1,91 @@ +{% load staticfiles %} +{% load gravatar %} +
+
+
+
+
+
+ +
+
+
Flea
+ $9 / month +
+
+
+ +
+
+
+
+
+
+
+ +
+
+
Ant
+ $99 / month +
+
+
+ +
+
+
+
+
+
+
+ +
+
+
Wasp
+ $499 / month +
+
+
+ +
+
+
+
+
+
+
+ +
+
+
Scorpion
+ $1,499 / month +
+
+
+ +
+
+
diff --git a/website/templates/about.html b/website/templates/about.html index bd5b57ab34..0e474f40fa 100644 --- a/website/templates/about.html +++ b/website/templates/about.html @@ -77,95 +77,7 @@

Subscriptions:

-
-
-
-
-
-
- -
-
-
Flea
- $9 / month -
-
-
- -
-
-
-
-
-
-
- -
-
-
Ant
- $99 / month -
-
-
- -
-
-
-
-
-
-
- -
-
-
Wasp
- $499 / month -
-
-
- -
-
-
-
-
-
-
- -
-
-
Scorpion
- $1,499 / month -
-
-
- -
-
-
+ {% include '_subscriptions.html' %}
diff --git a/website/templates/add_comment_to_post.html b/website/templates/add_comment_to_post.html index 92b50bfd02..f55284b4a3 100644 --- a/website/templates/add_comment_to_post.html +++ b/website/templates/add_comment_to_post.html @@ -8,4 +8,4 @@

New comment

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/website/templates/base.html b/website/templates/base.html index 622dc3515d..b38d540bce 100644 --- a/website/templates/base.html +++ b/website/templates/base.html @@ -42,178 +42,177 @@
-
- - +
+
+

Find Bugs, Win Points and Prizes

+
+
+
    +
  • Fix issues on websites, apps or hardware (+3 points)

  • +
  • Verify other bug reports(+2 points)

  • +
  • Invite friends (when they signup , get +1 point)

  • +
  • Find a bug on a new site or app (+4 points)

  • + +
+
+
@@ -89,7 +87,6 @@

Design

-
@@ -213,34 +210,4 @@

Latest activity

- - - {% endblock %} diff --git a/website/templates/invite.html b/website/templates/invite.html index d933e16362..13067b1488 100644 --- a/website/templates/invite.html +++ b/website/templates/invite.html @@ -1,19 +1,17 @@ {% extends "base.html" %} {% block content %} -
- {% csrf_token %} -
-
- {% if exists %} -

Click this link to open the email in your mail program. If you use Gmail, you can use this extension.

- {% endif %} - - -
+
+
+ {% if exists %} +

Click this link to open the email in your mail program. If you use Gmail, you can use this extension.

+ {% endif %} +

Invite a company and get +5 points when they join

+ + + {% csrf_token %} + -
+
- -{% endblock %} \ No newline at end of file +
+{% endblock %} diff --git a/website/templates/invite_friend.html b/website/templates/invite_friend.html index 66d5bc85d1..c4ac945f7d 100644 --- a/website/templates/invite_friend.html +++ b/website/templates/invite_friend.html @@ -1,25 +1,26 @@ {% extends "base.html" %} {% block content %} -
+ {% csrf_token %}
- {% for error in form.non_field_errors %} -
- {{ error }} + {% for error in form.non_field_errors %} +
{{ error }}
+ {% endfor %} +
+
+
+ {% if form.recipient.errors %} +
{{form.recipient.errors}}
+ {% endif %}
- {% endfor %}
-
- +
+ {{ form.recipient }} - {% for error in form.recipient.errors %} - error - {% endfor %} -
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/website/templates/issue_edit.html b/website/templates/issue_edit.html index d096d5a454..6c745c7738 100644 --- a/website/templates/issue_edit.html +++ b/website/templates/issue_edit.html @@ -8,38 +8,23 @@ {% block og_image %}{{object.screenshot.url}}{% endblock %} {% block og_description %}{{object.description}}{% endblock %} {% block description %}{{object.description}}{% endblock %} -{% block content %} -

Edit issue {{issue.pk}}

+{% block style %} +.form-group { + margin-top: 20px; +} +{% endblock %} + +{% block content %}
- +
- {{object.url}}
-
+ + Domain: + {{object.url}} +
@@ -47,37 +32,38 @@

Edit issue {{issue.pk}}

Share
- +
-
-
+ {% csrf_token %}
{% if form.description.errors %} - + {% endif %}
- - {{form.label}} + + Bug Type: {{form.label}}
- -

- {{form.screenshot}} -

+ + {% if form.screenshot.errors %} - + {% endif %}
- +
diff --git a/website/templates/profile.html b/website/templates/profile.html index e027d13001..176e2bd740 100644 --- a/website/templates/profile.html +++ b/website/templates/profile.html @@ -1,29 +1,46 @@ {% extends "base.html" %} {% load gravatar %} + +{% block style %} +.img-thumbnail { + width: 200px; + height: 200px; +} +input[type="file"] { + opacity: 0; + width: 1px; + height:1px; +} +.fa-money { + margin-right: 5px; +} +.list-group .label-default { + margin-top:3px; +} +{% endblock %} + {% block content %}

{{ user.username }}

{% if user.userprofile.avatar %} - + {% else %} - + {% endif %}
{% if request.user == user %} -
{% csrf_token %}
- +

- {% endif %}
@@ -34,7 +51,7 @@

{{ my_score|default:0 }} Points

@@ -56,29 +73,27 @@

{{ my_score|default:0 }} Points

-
-
- {{ user.username }}'s top bug findings -
-
-
- {% for website in websites %} -
- - - - - {{ website.name }} - - - {{ website.total }} Bug{{ website.total|pluralize }} - -
- {% endfor %} -
+
+
+ {{ user.username }}'s top bug findings +
+
+
+ {% for website in websites %} +
+ + + + {{ website.name }} + + {{ website.total }} Bug{{ website.total|pluralize }} + +
+ {% endfor %} +
+
-
-{% endblock %} \ No newline at end of file +{% endblock %}