Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tests, fix for vote, send email, profuction settings

  • Loading branch information...
commit d7a595f94c7e8d9837f6fc4e0f7241da7ca9bb32 1 parent ec96005
@d1ffuz0r authored
View
2  .gitignore
@@ -1,3 +1,3 @@
*.pyc
lulz.db
-public/media/backgrounds/*.*
+public/media/backgrounds/*
View
10 lulz/views.py
@@ -2,6 +2,7 @@
from decorators import render_json, render_to
from lulz.forms import AddJob, AddComment, SearchForm
from models import Job, Comments, Category, Likes
+from django.core.mail import send_mail
escape = lambda string: string.replace("&", "&").\
@@ -44,12 +45,9 @@ def fetch(request):
result["jobs"].append({"id": job.id,
"name": job.name,
"desc": escape(job.desc),
- "tags": job.tags,
"likes": job.likes,
- "link": job.link,
"date": job.date.__str__(),
- "comments": job.jobcomm.count(),
- "category": job.category.id})
+ "comments": job.jobcomm.count()})
result["success"] = True
return result
@@ -62,6 +60,10 @@ def addvacancy(request):
form = AddJob(request.POST)
if form.is_valid():
form.save()
+ send_mail("Added new cavancy: %s" % form.cleaned_data["name"],
+ "Added new vacancy: %s" % form.cleaned_data["name"],
+ "report@joblulz.tk",
+ ["d1fffuz0r@gmail.com"])
return {"success": True}
else:
return result
View
14 public/static/css/style.css
@@ -55,10 +55,10 @@ img {
padding: 5px;
}
img.float-right {
- margin: 5px 0px 10px 10px;
+ margin: 5px 0 10px 10px;
}
img.float-left {
- margin: 5px 10px 10px 0px;
+ margin: 5px 10px 10px 0;
}
code {
@@ -69,7 +69,7 @@ code {
overflow: auto;
font: 500 1em/1.5em 'Lucida Console', 'courier new', monospace ;
/* white-space: pre; */
- background: url(post.jpg);
+ background: url(/static/images/post.jpg);
border: 1px solid #E0DBC9;
}
acronym {
@@ -114,7 +114,7 @@ td {
border-bottom: 1px solid #DFDFDF;
}
td.first,th.first {
- border-left: 0px;
+ border-left: 0;
}
tr.row-a {
background: #F8F8F8;
@@ -480,7 +480,7 @@ input.button {
left: 30%;
position: fixed;
z-index: 100;
- box-shadow: #8C9F0D 0px 0px 15px;
+ box-shadow: #8C9F0D 0 0 15px;
}
#full .post-footer{
height: 16px;
@@ -491,9 +491,11 @@ input.button {
.popup .likes{
float: right;
}
+.popup .counter{
+ color: #000000;
+}
.popup .like{
cursor: pointer;
-
}
.popup .like:hover{
color: red;
View
6 public/static/js/lol.js
@@ -84,7 +84,7 @@ $(document).ready(function()
JOB += '<a href="#full" class="readmore" id="' + job.id + '">Полностью</a> | ';
JOB += 'Комментарии (' + job.comments + ') | ';
JOB += '<span class="date">' + d.getDate() + ':' + (m+1) + ':' + d.getFullYear() + '</span> | ';
- JOB += '<span class="date">' + job.likes + '</span>';
+ JOB += '<span class="date">Рейтинг: ' + job.likes + '</span>';
JOB += '</p>';
JOB += '</div>';
@@ -104,7 +104,7 @@ $(document).ready(function()
// show create vacancy form
$("#add").click(function()
{
- $(".add").show();
+ $(".add, .add form").show();
});
$(".close").click(function()
@@ -197,7 +197,7 @@ $(document).ready(function()
COMM = '<h1>Нет комментариев</h1>';
}
- $(".bg").css('background', 'url(/media/' + v.cat_image + ')');
+ $(".bg").css('background', 'url(/site_media/' + v.cat_image + ')');
$("#full, .bg").show();
$("#full .desc").html(DESC);
View
1  public/templates/jobs.html
@@ -4,6 +4,7 @@
<meta charset="utf-8">
{% csrf_token %}
<link rel="stylesheet" href="{{ STATIC_URL }}css/style.css" type="text/css" />
+ <link rel="shortcut icon" href="{{ STATIC_URL }}images/favicon.ico" />
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.form.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.validate.min.js"></script>
View
13 settings.py
@@ -20,6 +20,17 @@
}
}
+#Email
+"""
+EMAIL_HOST = "smtp.alwaysdata.com"
+EMAIL_HOST_USER = "report@joblulz.tk"
+EMAIL_HOST_PASSWORD = "qseofx2"
+DEFAULT_FROM_EMAIL = "Job reporter"
+EMAIL_PORT = "25"
+"""
+EMAIL_HOST = "localhost"
+DEFAULT_FROM_EMAIL = "report@joblulz.tk"
+EMAIL_PORT = "1025"
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
@@ -45,7 +56,7 @@
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
-MEDIA_ROOT = 'D:/projects/joblulz/src/public/media/'
+MEDIA_ROOT = 'D:/projects/joblulz/src/public/site_media/'
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
View
2  urls.py
@@ -14,7 +14,7 @@
url(r'^ajax/full/$', full),
url(r'^ajax/fetch/$', fetch),
url(r'^ajax/like/$', like),
- url(r"^media/(?P<path>.*)$",
+ url(r"^site_media/(?P<path>.*)$",
"django.views.static.serve",
{"document_root": settings.MEDIA_ROOT}),
url(r"^static/(?P<path>.*)$",
Please sign in to comment.
Something went wrong with that request. Please try again.