Feature: add search route with pagination and template
This commit is contained in:
parent
29151553cc
commit
5326efcdf7
3 changed files with 372 additions and 283 deletions
|
@ -38,9 +38,9 @@
|
|||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<form action="/search" method="post" class="navbar-form navbar-left" role="search">
|
||||
<form onSubmit="location.href='/search/' + this.search.value;return false" class="navbar-form navbar-left" role="search">
|
||||
<div class="form-group">
|
||||
<input type="search" class="form-control" placeholder="Search">
|
||||
<input id="search" type="search" class="form-control" placeholder="Search">
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
|
|
53
smash/templates/search.html
Normal file
53
smash/templates/search.html
Normal file
|
@ -0,0 +1,53 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
|
||||
|
||||
{% if numpages>1 %}
|
||||
<ul class="pagination pagination-sm">
|
||||
{% for page in range(numpages) %}
|
||||
<li {% if curpage==page %} class="active" {% endif %} >
|
||||
<a {% if curpage!=page %}href="/{{page_type}}/{{search_query}}/{{page+1}}"{% endif %}>{{page+1}}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% if quotes %}
|
||||
{% for quote in quotes %}
|
||||
{% if quote.approved %}
|
||||
<div class="quote-header">
|
||||
<a class="quote-link" href="/quote/{{ quote.id }}">#{{ quote.id }}</a>
|
||||
<a class="rate-positive">+</a> ({{quote.rating}}) <a class="rate-negative">-</a>
|
||||
<div class="pull-right quote-date">{{ quote.time }}</div>
|
||||
|
||||
{% if session.authorized %}
|
||||
<form class="mod-form" action="/moderate" name="moderate" method="post">
|
||||
<input type="hidden" name="quoteid" value={{quote.id}} />
|
||||
<button type="submit" name="submit" class="btn btn-danger btn-sm btn-mod" value="Delete">Delete</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="quote">
|
||||
<p>{{ quote.content|safe }}</p>
|
||||
</div>
|
||||
|
||||
<div class="tags">
|
||||
|
||||
Tags:
|
||||
{% if quote.tags|length > 0 and quote.tags[0].name|length>0%}
|
||||
{% for tag in quote.tags %}
|
||||
<a href="/tag/{{tag.name}}" class="badge"> {{tag.name}} </a>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<strong> No tags </strong>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
598
smash/views.py
598
smash/views.py
|
@ -1,281 +1,317 @@
|
|||
import datetime
|
||||
import logging
|
||||
import psycopg2
|
||||
from flask import render_template, Markup, request, abort, session, g
|
||||
|
||||
from smash.models_sqlalchemy import *
|
||||
from smash import app, conf, db
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def timestamp():
|
||||
return datetime.datetime.now().strftime("%H:%M:%S %d/%m/%y")
|
||||
|
||||
|
||||
def message(level, msg):
|
||||
return render_template(
|
||||
"message.html",
|
||||
alertclass=level,
|
||||
message=msg,
|
||||
title="Message"
|
||||
)
|
||||
|
||||
|
||||
@app.before_request
|
||||
def before_request():
|
||||
g.appname = conf.config['APPNAME']
|
||||
g.appbrand = conf.config['APPBRAND']
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
welcome = conf.config['MOTD']
|
||||
news = ("<p><b>{}</b></p><h4>{} running on smash quote database"
|
||||
" engine launched today</h4>").format(
|
||||
datetime.datetime.now().strftime("%d/%m/%y"),
|
||||
conf.config['APPNAME']
|
||||
)
|
||||
|
||||
return render_template(
|
||||
"index.html",
|
||||
title="Quotes",
|
||||
welcometext=welcome,
|
||||
newstext=news
|
||||
)
|
||||
|
||||
|
||||
@app.route('/login', methods=['GET', 'POST'])
|
||||
def login_page():
|
||||
if request.method == 'POST':
|
||||
if request.form["secret"] == conf.config['ADMINSECRET']:
|
||||
session['authorized'] = True
|
||||
|
||||
return render_template(
|
||||
"login.html",
|
||||
)
|
||||
|
||||
|
||||
@app.route('/latest')
|
||||
def latest():
|
||||
quotes = Quote.query.filter_by(approved=True).order_by(Quote.id.desc()).all()
|
||||
allquotes = len(quotes)
|
||||
quotes = quotes[:10]
|
||||
|
||||
if len(quotes)>0:
|
||||
# Replace line breaks with html breaks and escape special characters
|
||||
for quote in quotes:
|
||||
quote.content = str(Markup.escape(quote.content)).replace('\n', '</br>')
|
||||
|
||||
return render_template(
|
||||
"latest.html",
|
||||
title="Latest",
|
||||
quotes=quotes,
|
||||
numpages=1 + allquotes//10,
|
||||
curpage=0,
|
||||
page_type="latest"
|
||||
)
|
||||
else:
|
||||
return message("alert-warning", "No quotes in the database.")
|
||||
|
||||
|
||||
@app.route('/latest/<int:page>')
|
||||
def latest_page(page):
|
||||
allquotes = len(Quote.query.filter_by(approved=True).order_by(Quote.id.desc()).all())
|
||||
quotes = Quote.query.filter_by(approved=True).order_by(Quote.id.desc()).all()[(page-1)*10:page*10]
|
||||
|
||||
for quote in quotes:
|
||||
quote.content = str(Markup.escape(quote.content)).replace('\n', '</br>')
|
||||
|
||||
return render_template(
|
||||
"latest.html",
|
||||
title="Latest - page {}".format(page),
|
||||
quotes=quotes,
|
||||
numpages=1 + allquotes//10,
|
||||
curpage=page-1,
|
||||
page_type="latest"
|
||||
)
|
||||
|
||||
@app.route('/queue')
|
||||
def queue():
|
||||
if not session.get('authorized'):
|
||||
return message("alert-danger", "You are not authorized to view this page.")
|
||||
|
||||
quotes = Quote.query.filter_by(approved=False).order_by(Quote.id).all()
|
||||
|
||||
if len(quotes)>0:
|
||||
# Replace line breaks with html breaks and escape special characters
|
||||
for quote in quotes:
|
||||
quote.content = str(Markup.escape(quote.content)).replace('\n', '</br>')
|
||||
|
||||
return render_template(
|
||||
"queue.html",
|
||||
title="Queue",
|
||||
quotes=quotes
|
||||
)
|
||||
else:
|
||||
return message("alert-warning", "No quotes in the database.")
|
||||
|
||||
|
||||
@app.route('/moderate', methods=['POST'])
|
||||
def moderate():
|
||||
if not session.get('authorized'):
|
||||
return message("alert-danger", "You are not authorized to perform this action.")
|
||||
|
||||
if request.form['submit'] == "Approve":
|
||||
quote = Quote.query.filter_by(id=request.form['quoteid']).first()
|
||||
quote.approved = True
|
||||
db.session.commit()
|
||||
|
||||
return message("alert-success", "Quote approved.")
|
||||
|
||||
elif request.form['submit'] == "Delete":
|
||||
quote = Quote.query.filter_by(id=request.form['quoteid']).first()
|
||||
db.session.delete(quote)
|
||||
db.session.commit()
|
||||
|
||||
return message("alert-success", "Quote deleted.")
|
||||
|
||||
abort(501)
|
||||
|
||||
|
||||
@app.route('/quote/<int:id>')
|
||||
def quote(id):
|
||||
quote = Quote.query.filter_by(id=id, approved=True).first()
|
||||
|
||||
if quote is None:
|
||||
return render_template(
|
||||
"message.html",
|
||||
alertclass="alert-warning",
|
||||
message="No such quote."
|
||||
)
|
||||
else:
|
||||
quote.content = str(Markup.escape(quote.content)).replace('\n', '</br>')
|
||||
return render_template(
|
||||
"latest.html",
|
||||
title="Quote #{}".format(quote.id),
|
||||
quotes=[quote,],
|
||||
numpages=1,
|
||||
curpage=0,
|
||||
page_type="quote"
|
||||
)
|
||||
|
||||
|
||||
@app.route('/tag/<tagname>')
|
||||
def tag(tagname):
|
||||
tag = Tag.query.filter_by(name=tagname).first()
|
||||
|
||||
if len(list(tag.quotes))>0:
|
||||
allquotes = len(list(tag.quotes))
|
||||
tag.quotes = tag.quotes[:10]
|
||||
|
||||
# Replace line breaks with html breaks and escape special characters
|
||||
for quote in tag.quotes:
|
||||
quote.content = str(Markup.escape(quote.content)).replace('\n', '</br>')
|
||||
|
||||
return render_template(
|
||||
"latest.html",
|
||||
title="Tag - {}".format(tagname),
|
||||
quotes=tag.quotes,
|
||||
numpages=1 + allquotes//10,
|
||||
curpage=0,
|
||||
page_type="tag/{}".format(tagname)
|
||||
)
|
||||
else:
|
||||
return message("alert-warning", "No quotes with this tag.")
|
||||
|
||||
|
||||
@app.route('/tag/<tagname>/<int:page>')
|
||||
def tag_page(tagname, page):
|
||||
tag = Tag.query.filter_by(name=tagname).first()
|
||||
|
||||
if len(list(tag.quotes))>0:
|
||||
allquotes = len(list(tag.quotes))
|
||||
tag.quotes = tag.quotes[(page-1)*10:page*10]
|
||||
|
||||
for quote in tag.quotes:
|
||||
quote.content = str(Markup.escape(quote.content)).replace('\n', '</br>')
|
||||
|
||||
return render_template(
|
||||
"latest.html",
|
||||
title="Tag - {} - page {}".format(tagname, page),
|
||||
quotes=tag.quotes,
|
||||
numpages=1 + allquotes//10,
|
||||
curpage=0,
|
||||
page_type="tag/{}".format(tagname)
|
||||
)
|
||||
|
||||
|
||||
@app.route('/tags')
|
||||
def tags():
|
||||
tags = Tag.query.order_by(Tag.name).distinct().all()
|
||||
tags = list(set([x.name for x in tags]))
|
||||
|
||||
return render_template(
|
||||
"tags.html",
|
||||
title="Tags",
|
||||
tags=tags
|
||||
)
|
||||
|
||||
|
||||
@app.route('/search', methods=['POST'])
|
||||
def search():
|
||||
if request.method == 'POST':
|
||||
return render_template(
|
||||
"message.html",
|
||||
alertclass="alert-warning",
|
||||
message="Not implemented yet. "
|
||||
)
|
||||
else:
|
||||
return 'Invalid request.'
|
||||
|
||||
|
||||
@app.route('/add', methods=['GET', 'POST'])
|
||||
def add_new():
|
||||
if request.method == 'POST':
|
||||
if request.form['submit'] == "Submit":
|
||||
quote_body = request.form["newquote"]
|
||||
quote_tags = request.form["tags"].split(',')
|
||||
|
||||
quote = Quote(quote_body, request.remote_addr, timestamp())
|
||||
quote_tags = [Tag(tag) for tag in quote_tags]
|
||||
|
||||
for tag in quote_tags:
|
||||
dbtag = Tag.query.filter_by(name=tag.name).first()
|
||||
if dbtag is not None:
|
||||
quote.tags.append(dbtag)
|
||||
else:
|
||||
quote.tags.append(tag)
|
||||
#quote.tags.extend(quote_tags)
|
||||
|
||||
db.session.add(quote)
|
||||
db.session.commit()
|
||||
|
||||
return render_template(
|
||||
"message.html",
|
||||
alertclass="alert-success",
|
||||
message="Quote added succesfully. It will need to be reviewed by the administrators before it shows up."
|
||||
)
|
||||
|
||||
elif request.form['submit'] == "Preview":
|
||||
preview = Quote(request.form['newquote'], request.remote_addr, timestamp())
|
||||
preview_tags = request.form["tags"].split(',')
|
||||
preview.approved = True
|
||||
preview.tags = [Tag(tag) for tag in preview_tags]
|
||||
|
||||
return render_template(
|
||||
"latest.html",
|
||||
title="Quote preview",
|
||||
quotes=[preview,],
|
||||
numpages=1,
|
||||
curpage=0,
|
||||
page_type="quote"
|
||||
)
|
||||
else:
|
||||
abort(501)
|
||||
|
||||
elif request.method == 'GET':
|
||||
return render_template(
|
||||
"add.html",
|
||||
title="Add new"
|
||||
)
|
||||
import datetime
|
||||
import logging
|
||||
import psycopg2
|
||||
from flask import render_template, Markup, request, abort, session, g
|
||||
|
||||
from smash.models_sqlalchemy import *
|
||||
from smash import app, conf, db
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def timestamp():
|
||||
return datetime.datetime.now().strftime("%H:%M:%S %d/%m/%y")
|
||||
|
||||
|
||||
def message(level, msg):
|
||||
return render_template(
|
||||
"message.html",
|
||||
alertclass=level,
|
||||
message=msg,
|
||||
title="Message"
|
||||
)
|
||||
|
||||
|
||||
@app.before_request
|
||||
def before_request():
|
||||
g.appname = conf.config['APPNAME']
|
||||
g.appbrand = conf.config['APPBRAND']
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
welcome = conf.config['MOTD']
|
||||
news = ("<p><b>{}</b></p><h4>{} running on smash quote database"
|
||||
" engine launched today</h4>").format(
|
||||
datetime.datetime.now().strftime("%d/%m/%y"),
|
||||
conf.config['APPNAME']
|
||||
)
|
||||
|
||||
return render_template(
|
||||
"index.html",
|
||||
title="Quotes",
|
||||
welcometext=welcome,
|
||||
newstext=news
|
||||
)
|
||||
|
||||
|
||||
@app.route('/login', methods=['GET', 'POST'])
|
||||
def login_page():
|
||||
if request.method == 'POST':
|
||||
if request.form["secret"] == conf.config['ADMINSECRET']:
|
||||
session['authorized'] = True
|
||||
|
||||
return render_template(
|
||||
"login.html",
|
||||
)
|
||||
|
||||
|
||||
@app.route('/latest')
|
||||
def latest():
|
||||
quotes = Quote.query.filter_by(approved=True).order_by(Quote.id.desc()).all()
|
||||
allquotes = len(quotes)
|
||||
quotes = quotes[:10]
|
||||
|
||||
if len(quotes)>0:
|
||||
# Replace line breaks with html breaks and escape special characters
|
||||
for quote in quotes:
|
||||
quote.content = str(Markup.escape(quote.content)).replace('\n', '</br>')
|
||||
|
||||
return render_template(
|
||||
"latest.html",
|
||||
title="Latest",
|
||||
quotes=quotes,
|
||||
numpages=1 + allquotes//10,
|
||||
curpage=0,
|
||||
page_type="latest"
|
||||
)
|
||||
else:
|
||||
return message("alert-warning", "No quotes in the database.")
|
||||
|
||||
|
||||
@app.route('/latest/<int:page>')
|
||||
def latest_page(page):
|
||||
allquotes = len(Quote.query.filter_by(approved=True).order_by(Quote.id.desc()).all())
|
||||
quotes = Quote.query.filter_by(approved=True).order_by(Quote.id.desc()).all()[(page-1)*10:page*10]
|
||||
|
||||
for quote in quotes:
|
||||
quote.content = str(Markup.escape(quote.content)).replace('\n', '</br>')
|
||||
|
||||
return render_template(
|
||||
"latest.html",
|
||||
title="Latest - page {}".format(page),
|
||||
quotes=quotes,
|
||||
numpages=1 + allquotes//10,
|
||||
curpage=page-1,
|
||||
page_type="latest"
|
||||
)
|
||||
|
||||
@app.route('/queue')
|
||||
def queue():
|
||||
if not session.get('authorized'):
|
||||
return message("alert-danger", "You are not authorized to view this page.")
|
||||
|
||||
quotes = Quote.query.filter_by(approved=False).order_by(Quote.id).all()
|
||||
|
||||
if len(quotes)>0:
|
||||
# Replace line breaks with html breaks and escape special characters
|
||||
for quote in quotes:
|
||||
quote.content = str(Markup.escape(quote.content)).replace('\n', '</br>')
|
||||
|
||||
return render_template(
|
||||
"queue.html",
|
||||
title="Queue",
|
||||
quotes=quotes
|
||||
)
|
||||
else:
|
||||
return message("alert-warning", "No quotes in the database.")
|
||||
|
||||
|
||||
@app.route('/moderate', methods=['POST'])
|
||||
def moderate():
|
||||
if not session.get('authorized'):
|
||||
return message("alert-danger", "You are not authorized to perform this action.")
|
||||
|
||||
if request.form['submit'] == "Approve":
|
||||
quote = Quote.query.filter_by(id=request.form['quoteid']).first()
|
||||
quote.approved = True
|
||||
db.session.commit()
|
||||
|
||||
return message("alert-success", "Quote approved.")
|
||||
|
||||
elif request.form['submit'] == "Delete":
|
||||
quote = Quote.query.filter_by(id=request.form['quoteid']).first()
|
||||
db.session.delete(quote)
|
||||
db.session.commit()
|
||||
|
||||
return message("alert-success", "Quote deleted.")
|
||||
|
||||
abort(501)
|
||||
|
||||
|
||||
@app.route('/quote/<int:id>')
|
||||
def quote(id):
|
||||
quote = Quote.query.filter_by(id=id, approved=True).first()
|
||||
|
||||
if quote is None:
|
||||
return render_template(
|
||||
"message.html",
|
||||
alertclass="alert-warning",
|
||||
message="No such quote."
|
||||
)
|
||||
else:
|
||||
quote.content = str(Markup.escape(quote.content)).replace('\n', '</br>')
|
||||
return render_template(
|
||||
"latest.html",
|
||||
title="Quote #{}".format(quote.id),
|
||||
quotes=[quote,],
|
||||
numpages=1,
|
||||
curpage=0,
|
||||
page_type="quote"
|
||||
)
|
||||
|
||||
|
||||
@app.route('/tag/<tagname>')
|
||||
def tag(tagname):
|
||||
tag = Tag.query.filter_by(name=tagname).first()
|
||||
|
||||
if len(list(tag.quotes))>0:
|
||||
allquotes = len(list(tag.quotes))
|
||||
tag.quotes = tag.quotes[:10]
|
||||
|
||||
# Replace line breaks with html breaks and escape special characters
|
||||
for quote in tag.quotes:
|
||||
quote.content = str(Markup.escape(quote.content)).replace('\n', '</br>')
|
||||
|
||||
return render_template(
|
||||
"latest.html",
|
||||
title="Tag - {}".format(tagname),
|
||||
quotes=tag.quotes,
|
||||
numpages=1 + allquotes//10,
|
||||
curpage=0,
|
||||
page_type="tag/{}".format(tagname)
|
||||
)
|
||||
else:
|
||||
return message("alert-warning", "No quotes with this tag.")
|
||||
|
||||
|
||||
@app.route('/tag/<tagname>/<int:page>')
|
||||
def tag_page(tagname, page):
|
||||
tag = Tag.query.filter_by(name=tagname).first()
|
||||
|
||||
if len(list(tag.quotes))>0:
|
||||
allquotes = len(list(tag.quotes))
|
||||
tag.quotes = tag.quotes[(page-1)*10:page*10]
|
||||
|
||||
for quote in tag.quotes:
|
||||
quote.content = str(Markup.escape(quote.content)).replace('\n', '</br>')
|
||||
|
||||
return render_template(
|
||||
"latest.html",
|
||||
title="Tag - {} - page {}".format(tagname, page),
|
||||
quotes=tag.quotes,
|
||||
numpages=1 + allquotes//10,
|
||||
curpage=0,
|
||||
page_type="tag/{}".format(tagname)
|
||||
)
|
||||
|
||||
|
||||
@app.route('/tags')
|
||||
def tags():
|
||||
tags = Tag.query.order_by(Tag.name).distinct().all()
|
||||
tags = list(set([x.name for x in tags]))
|
||||
|
||||
return render_template(
|
||||
"tags.html",
|
||||
title="Tags",
|
||||
tags=tags
|
||||
)
|
||||
|
||||
|
||||
@app.route('/search/<query>')
|
||||
def search(query):
|
||||
quotes = Quote.query.filter_by(approved=True).filter(Quote.content.ilike('%{}%'.format(query))).order_by(Quote.id.desc()).all()
|
||||
|
||||
allquotes = len(quotes)
|
||||
quotes = quotes[:10]
|
||||
|
||||
if len(quotes)>0:
|
||||
# Replace line breaks with html breaks and escape special characters
|
||||
for quote in quotes:
|
||||
quote.content = str(Markup.escape(quote.content)).replace('\n', '</br>')
|
||||
|
||||
return render_template(
|
||||
"search.html",
|
||||
title="Search for: {}".format(query),
|
||||
quotes=quotes,
|
||||
numpages=1 + allquotes//10,
|
||||
curpage=0,
|
||||
page_type="search",
|
||||
search_query=query
|
||||
)
|
||||
else:
|
||||
return message("alert-warning", "No quotes in the database.")
|
||||
|
||||
|
||||
@app.route('/search/<query>/<int:page>')
|
||||
def search_page(query, page):
|
||||
allquotes = len(Quote.query.filter_by(approved=True).\
|
||||
filter(Quote.content.ilike('%{}%'.format(query))).\
|
||||
order_by(Quote.id.desc()).all())
|
||||
quotes = Quote.query.filter_by(approved=True).\
|
||||
filter(Quote.content.ilike('%{}%'.format(query))).\
|
||||
order_by(Quote.id.desc()).all()[(page-1)*10:page*10]
|
||||
|
||||
for quote in quotes:
|
||||
quote.content = str(Markup.escape(quote.content)).replace('\n', '</br>')
|
||||
|
||||
return render_template(
|
||||
"search.html",
|
||||
title="Search for: {} - page {}".format(query, page),
|
||||
quotes=quotes,
|
||||
numpages=1 + allquotes//10,
|
||||
curpage=page-1,
|
||||
page_type="search",
|
||||
search_query=query
|
||||
)
|
||||
|
||||
|
||||
@app.route('/add', methods=['GET', 'POST'])
|
||||
def add_new():
|
||||
if request.method == 'POST':
|
||||
if request.form['submit'] == "Submit":
|
||||
quote_body = request.form["newquote"]
|
||||
quote_tags = request.form["tags"].split(',')
|
||||
|
||||
quote = Quote(quote_body, request.remote_addr, timestamp())
|
||||
quote_tags = [Tag(tag) for tag in quote_tags]
|
||||
|
||||
for tag in quote_tags:
|
||||
dbtag = Tag.query.filter_by(name=tag.name).first()
|
||||
if dbtag is not None:
|
||||
quote.tags.append(dbtag)
|
||||
else:
|
||||
quote.tags.append(tag)
|
||||
#quote.tags.extend(quote_tags)
|
||||
|
||||
db.session.add(quote)
|
||||
db.session.commit()
|
||||
|
||||
return render_template(
|
||||
"message.html",
|
||||
alertclass="alert-success",
|
||||
message="Quote added succesfully. It will need to be reviewed by the administrators before it shows up."
|
||||
)
|
||||
|
||||
elif request.form['submit'] == "Preview":
|
||||
preview = Quote(request.form['newquote'], request.remote_addr, timestamp())
|
||||
preview_tags = request.form["tags"].split(',')
|
||||
preview.approved = True
|
||||
preview.tags = [Tag(tag) for tag in preview_tags]
|
||||
|
||||
return render_template(
|
||||
"latest.html",
|
||||
title="Quote preview",
|
||||
quotes=[preview,],
|
||||
numpages=1,
|
||||
curpage=0,
|
||||
page_type="quote"
|
||||
)
|
||||
else:
|
||||
abort(501)
|
||||
|
||||
elif request.method == 'GET':
|
||||
return render_template(
|
||||
"add.html",
|
||||
title="Add new"
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue