Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lkt-201836900127_add buttons to jump back to the ancestor category #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions .idea/OAPS-TreeLib-master.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/dataSources.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions service.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,15 @@ def get_subject(subjectID):
).all()
for x in a:
hot_article.append(x)
<<<<<<< HEAD

return render_template('subject.html', url=url, subject_id=subject.id, articles=articles, hot_article=hot_article, Tool=Tool)

=======
if not subject.pid == "None" :
return render_template('subject.html', url=url, subject_id=subject.id,lasturl="http://127.0.0.1:5000/subject/"+str(subject.pid) ,articles=articles, hot_article=hot_article, Tool=Tool)
else :return render_template('subject.html', url=url, subject_id=subject.id,lasturl="http://127.0.0.1:5000/" ,articles=articles, hot_article=hot_article, Tool=Tool)
>>>>>>> 4c444f8 (第一次提交)
# ============================================================================================
# before request
# ============================================================================================
Expand Down Expand Up @@ -397,8 +403,11 @@ def find_subjects(subject, count):
# ================================================================================
@app.route('/edit_subcategory', methods=['GET', 'POST'])
def add_sub_category():
<<<<<<< HEAD
if not session.get('logged_in'):
return render_template('login.html')
=======
>>>>>>> 4c444f8 (第一次提交)
if request.method == 'POST':
subject_id = request.form['subject_id']
subject_name = request.form['subject_name']
Expand Down
6 changes: 6 additions & 0 deletions templates/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,15 @@ <h2 class="card-title">{{ article.title }}</h2><!--title-->
</div>
</div><br>

<<<<<<< HEAD
{% if comments %}
<div class="alert alert-primary">
Number of comments :{{ comments|length }}
</div>


=======
>>>>>>> 4c444f8 (第一次提交)
{% for comment in comments[::-1] %}
<div class="card">
<div class="card-body">
Expand All @@ -152,7 +155,10 @@ <h2 class="card-title">{{ article.title }}</h2><!--title-->
</div>
</div>
{% endfor %}
<<<<<<< HEAD
{% endif %}
=======
>>>>>>> 4c444f8 (第一次提交)


{% endblock %}
10 changes: 10 additions & 0 deletions templates/subject.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,23 @@
<br><div class="card">
<div class="card-body">
<p class="card-text">You are in {{ url }}</p>
<<<<<<< HEAD
<form name="myform" method="get" onsubmit="return verify();">
<input type="text" name="subject_id" style="display: none" value={{ subject_id }}><br>
<button type="submit" class="btn btn-primary" onclick="postArticle()">post article</button>
{% if session.get('logged_in') %}
<button type="submit" class="btn btn-primary" onclick="createSubject()">add subcategory</button>
<input type="checkbox" name="add_father" value="father" /> add main subject
{% endif %}
=======
<a href="{{lasturl}}">返回上一级</a>
<form name="myform" method="get" onsubmit="return verify();">
<input type="text" name="subject_id" style="display: none" value={{ subject_id }}>
<input type="email" name="email" id="email" placeholder="Enter Email to post or create" required="required"/><br><br>
<button type="submit" class="btn btn-primary" onclick="postArticle()">post article</button>
<button type="submit" class="btn btn-primary" onclick="createSubject()">add subcategory</button>
<input type="checkbox" name="add_father" value="father" /> add main subject
>>>>>>> 4c444f8 (第一次提交)
</form>
</div>
</div><br>
Expand Down