Skip to content

Commit 506de4f

Browse files
fuser (fossix host user)santoshs
fuser (fossix host user)
authored andcommitted
content and archive bug resolved, changes cdns for jquery and bootstrap
Signed-off-by: fuser (fossix host user) <[email protected]>
1 parent 702a110 commit 506de4f

File tree

5 files changed

+24
-15
lines changed

5 files changed

+24
-15
lines changed

alembic.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ script_location = dbvc
1111
# the 'revision' command, regardless of autogenerate
1212
# revision_environment = false
1313

14-
sqlalchemy.url = postgresql://fossguy:DarkHat2414@localhost/fossixdb
14+
sqlalchemy.url = postgresql://fossuser:DarkHat2414@localhost/fossixdb
1515

1616

1717
# Logging configuration

fossix/config.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
class DefaultConfig(object):
44
DATABASE_CONNECT_OPTIONS = {}
55

6-
SECRET_KEY = 'SecretKeyForSessionSigning'
6+
SECRET_KEY = 'SOME_SECURE_PHRASE'
77

88
CSRF_ENABLED = True
9-
CSRF_SESSION_KEY = "somethingimpossibletoguess"
9+
CSRF_SESSION_KEY = "A_SECURE_PHRASE_TO_PROTECT_FORMS"
1010

1111
CACHE_TYPE = 'memcached'
1212
CACHE_MEMCACHED_SERVERS = ['127.0.0.1:11211']
@@ -46,7 +46,7 @@ class DebugConfig(DefaultConfig):
4646
DB_SERVER = 'localhost'
4747
DB_PORT = 5432
4848
DB_NAME = 'fossix'
49-
DB_USER = 'fossguy'
49+
DB_USER = 'user'
5050
DB_PASSWD = 'db_password'
5151

5252
SQLALCHEMY_DATABASE_URI = get_dburi('postgresql', DB_SERVER, DB_PORT,

fossix/templates/base.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ <h1> {{ pagetitle }}
6464
{% block __block_3 %}
6565
<div id="rsb" class="span5" style="margin-top:30px;">
6666
{% block rsb_content %}
67-
<div id="rsb1" class="span8">
67+
<div id="rsb1" class="span7">
6868
{% block rsb1 %}
6969
{% if recent %}
7070
<ul class="nav nav-list">

fossix/templates/master.html

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<link href="{{ config['SITE_CDN'] }}/css/bootstrap.min.css" rel="stylesheet"
5-
media="screen">
6-
<link href="{{ config['SITE_CDN'] }}/css/bootstrap-responsive.min.css" rel="stylesheet"
7-
media="screen">
4+
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
85
<link href="{{ config['SITE_CDN'] }}/css/fossix.css" rel="stylesheet"
96
media="screen">
107
<!-- <link href="{{ config['SITE_CDN'] }}/css/zocial/zocial.css" rel="stylesheet" -->
118
<!-- media="screen"> -->
12-
<script src="{{ config['SITE_CDN'] }}/js/jquery-latest.js"></script>
13-
<script src="{{ config['SITE_CDN'] }}/js/jquery-ui.min.js"></script>
14-
<script src="{{ config['SITE_CDN'] }}/js/bootstrap.min.js"></script>
9+
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
10+
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
11+
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
1512
<script src="/static/js/fossix.js"></script>
1613

1714
{% block master_head %}{% endblock %}

fossix/views/content.py

+15-3
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,11 @@ def preview(self):
137137

138138
class TagsView(FlaskView):
139139
def index(self):
140-
page = int(request.args.get('page'))
140+
page = request.args.get('page')
141+
if page is None:
142+
page = 1
143+
else:
144+
page = int(page)
141145
limit = 20
142146
start = (page - 1) * limit
143147
tags = db.session.query(Keywords).order_by(asc(Keywords.keyword)).all()
@@ -194,7 +198,11 @@ def watched(self):
194198
class ContentView(FlaskView):
195199
route_base = '/'
196200
def index(self):
197-
c = Content.get_recent(1)[0]
201+
c = Content.get_recent(1)
202+
if c is None:
203+
abort(404)
204+
205+
c = c[0]
198206
form = None
199207
if c is None:
200208
flash(u'Nothing exists :-(.')
@@ -370,7 +378,11 @@ def get(self, page):
370378
start = end - page_limit
371379

372380
c = content=db.session.query(Content).filter(
373-
Content.category=='article').all()
381+
Content.category=='article')
382+
if c.count() == 0:
383+
abort(404)
384+
385+
c = c.all()
374386
contents = c[start:end]
375387

376388
if not contents:

0 commit comments

Comments
 (0)