Merge branch 'collection' of csgitlab.ucd.ie:19206226/q-a_platform into collection

merge-requests/3/head
bug_creator 3 years ago
commit 62168df951

@ -31,6 +31,11 @@ cache:
test: test:
stage: test stage: test
script: script:
- python -V # Print out python version for debugging
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install -r requirements.txt
- echo "TEST" - echo "TEST"
- coverage run ModelsTest.py - coverage run ModelsTest.py
- coverage report -m - coverage report -m

@ -32,6 +32,7 @@ class TestModels(unittest.TestCase):
self.assertIsNotNone(self.client) self.assertIsNotNone(self.client)
response = app.test_client().get('/', data={}) response = app.test_client().get('/', data={})
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
response = app.test_client().get('/trans', data={}) response = app.test_client().get('/trans', data={})
self.assertEqual(response.status_code, 308) self.assertEqual(response.status_code, 308)

@ -20,7 +20,7 @@ body > div {
} }
div { div {
text-align: left text-align: center
} }
a img { a img {

@ -235,11 +235,11 @@
success: function(result) { success: function(result) {
console.log('success\n'+result); console.log('success\n'+result);
if(result.like){ if(result.like){
_this.innerText=' Unfollow' _this.innerText=' Unsave'
follow_icon.setAttribute('fill','#3688FF') follow_icon.setAttribute('fill','#3688FF')
}else{ }else{
_this.innerText=' Follow' _this.innerText=' Save'
follow_icon.setAttribute('fill','#868686') follow_icon.setAttribute('fill','#868686')
} }
{#span1.setAttribute('href', '{{ url_for('.dislike', post_id=post.id) }}');#} {#span1.setAttribute('href', '{{ url_for('.dislike', post_id=post.id) }}');#}
@ -252,10 +252,11 @@
} }
}) })
}" > }" >
<svg viewBox="0 0 1024 1024" width="25" height="25"> <svg viewBox="0 0 1024 1024" width="25" height="25">
<path id="follow_icon" d="M 100 100 L 600 800 L 800 100 z" <path id="follow_icon" d="M512 822.976L828.416 1024l-83.968-378.88L1024 390.208l-368.128-32.896L512 0 368.128 357.312 0 390.208l279.552 254.912L195.584 1024z"
fill="{% if current_user.is_authenticated %} fill="
{% if not current_user.is_savinganswer(post) %} {% if current_user.is_authenticated %}
{% if not current_user.is_savinganswer(post) %}
#868686 #868686
{% else %} {% else %}
#3688FF #3688FF
@ -263,14 +264,14 @@
{% else %} {% else %}
#868686 #868686
{% endif %}"></path></svg> {% endif %}"></path></svg>
<div id="follow_answer">{% if current_user.is_authenticated %} <div id="follow_answer" align="center">{% if current_user.is_authenticated %}
{% if not current_user.is_savinganswer(post) %} {% if not current_user.is_savinganswer(post) %}
Follow Save
{% else %} {% else %}
Unfollow Unsave
{% endif %} {% endif %}
{% else %} {% else %}
Follow Save
{% endif %}</div> {% endif %}</div>
</a> </a>
<a class="liked" href="{{ url_for('.report', id=post.id,type='answer') }}"> <a class="liked" href="{{ url_for('.report', id=post.id,type='answer') }}">

@ -12,6 +12,7 @@ cookiecutter==1.7.3
coverage==6.2 coverage==6.2
dominate==2.5.1 dominate==2.5.1
Faker==4.0.3 Faker==4.0.3
flake8==4.0.1
Flask==2.0.2 Flask==2.0.2
Flask-Admin==1.5.8 Flask-Admin==1.5.8
Flask-Autodoc==0.1.2 Flask-Autodoc==0.1.2
@ -35,7 +36,10 @@ jinja2-time==0.2.0
Mako==1.1.6 Mako==1.1.6
Markdown==3.2.1 Markdown==3.2.1
MarkupSafe==2.0.1 MarkupSafe==2.0.1
mccabe==0.6.1
poyo==0.5.0 poyo==0.5.0
pycodestyle==2.8.0
pyflakes==2.4.0
python-dateutil==2.8.2 python-dateutil==2.8.2
python-dotenv==0.19.2 python-dotenv==0.19.2
python-slugify==5.0.2 python-slugify==5.0.2
@ -49,4 +53,3 @@ webencodings==0.5.1
Werkzeug==2.0.2 Werkzeug==2.0.2
WTForms==2.2 WTForms==2.2
WTForms-Appengine==0.1 WTForms-Appengine==0.1
Flask-Docs

Loading…
Cancel
Save