Commit c08bb3d8 authored by Francesca Sargent 's avatar Francesca Sargent
Browse files

Up to date, ready for server

parent 755db690
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -460,4 +460,3 @@ def moderate_disable(id):
db.session.add(comment)
return redirect(url_for('.moderate',
page=request.args.get('page', 1, type=int)))
No preview for this file type
{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% import "_macros.html" as macros %}
{% block title %}Open Sauces - Recipe{% endblock %}
{% block cuisine %}
{% include '_cuisines.html' %}
<h4 id="comments">Comments</h4>
{% if current_user.can(Permission.COMMENT) %}
<div class="comment-form">
{{ wtf.quick_form(form) }}
</div>
{% endif %}
{% include '_comments.html' %}
{% if pagination %}
<div class="pagination">
{{ macros.pagination_widget(pagination, '.recipe', fragment='#comments', id=recipes[0].id) }}
</div>
{% endif %}
{% endblock %}
No preview for this file type
......@@ -126,3 +126,12 @@ div.navbar-header > a.navbar-brand,
ul.nav.navbar-nav a {
color: #fff;
}
.methodtags {
display: inline-block;
padding: 5px;
background: #9b59b6;
color: #fff;
margin: 5px;
font-size: 1.2em;
}
......@@ -9,19 +9,23 @@
</a>
<div class="recipe-date">{{ moment(cuisine.timestamp).fromNow() }}</div>
<div class="recipe-body">
{% if cuisine.methods %}
<strong>Associated Methods: </strong> {% for method in cuisine.methods %} <span class="badge">{{ method.name }} </span> {% endfor %} <br/>
{% endif %}
{% if cuisine.body_html %}
{{ cuisine.body_html | safe }}
{% else %}
{{ cuisine.description }}
{% endif %}
</div>
<div class="recipe-footer">
{% if current_user == cuisine.author %}
<a href="{{ url_for('.edit', id=cuisine.id) }}">
<a href="{{ url_for('.editcuisine', id=cuisine.id) }}">
<span class="label label-primary">Edit</span>
</a>
{% elif current_user.is_administrator() %}
<a href="{{ url_for('.edit', id=cuisine.id) }}">
<a href="{{ url_for('.editcuisine', id=cuisine.id) }}">
<span class="label label-danger">Edit [Admin]</span>
</a>
{% endif %}
......
......@@ -8,6 +8,9 @@
</a>
<div class="recipe-date">{{ moment(method.timestamp).fromNow() }}</div>
<div class="recipe-body">
{% if method.cuisines %}
<strong>Associated Cuisines: </strong> {% for cuisine in method.cuisines %} <span class="badge">{{ cuisine.name }}</span> {% endfor %} <br/>
{% endif %}
{% if method.method_text %}
{{ method.method_text | safe }}
{% else %}
......@@ -16,11 +19,11 @@
</div>
<div class="recipe-footer">
{% if current_user == method.author %}
<a href="{{ url_for('.edit', id=method.id) }}">
<a href="{{ url_for('.editmethod', id=method.id) }}">
<span class="label label-primary">Edit</span>
</a>
{% elif current_user.is_administrator() %}
<a href="{{ url_for('.edit', id=method.id) }}">
<a href="{{ url_for('.editmethod', id=method.id) }}">
<span class="label label-danger">Edit [Admin]</span>
</a>
{% endif %}
......
......@@ -24,11 +24,11 @@
<div class="recipe-footer">
{% if current_user == recipe.author %}
<a href="{{ url_for('.edit', id=recipe.id) }}">
<a href="{{ url_for('.editrecipe', id=recipe.id) }}">
<span class="label label-primary">Edit</span>
</a>
{% elif current_user.is_administrator() %}
<a href="{{ url_for('.edit', id=recipe.id) }}">
<a href="{{ url_for('.editrecipe', id=recipe.id) }}">
<span class="label label-danger">Edit [Admin]</span>
</a>
{% endif %}
......
{% extends "bootstrap/base.html" %}
<script type="text/javascript" src="{{ url_for('static', filename='jquery.autocomplete.js') }}"></script>
{% block title %}Open Sauces{% endblock %}
{% block head %}
......@@ -93,7 +94,50 @@
{% block scripts %}
{{ super() }}
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<script>
$.ajax({
type: 'GET',
url: '{{ url_for(".autocompletecuisine") }}',
data: $(this).serialize(),
success:function(data){
console.log(data.json_list)
$('#cuisines').autocomplete({
source: data.json_list,
minLength: 2
});
var cuisines = data.json_list
$.each(cuisines, function(key, val) {
$('#cuisines').after('<div class="methodtags">'+val +'</div>');
});
},
error: function (request, status, error) {
alert(request.responseText);
}
});
$.ajax({
type: 'GET',
url: '{{ url_for(".autocompletemethod") }}',
data: $(this).serialize(),
success:function(data){
console.log(data.json_list)
$('#methods').autocomplete({
source: data.json_list,
minLength: 2
});
var methods = data.json_list
$.each(methods, function(key, val) {
$('#methods').after('<div class="methodtags">'+val +'</div>');
});
},
error: function (request, status, error) {
alert(request.responseText);
}
});
</script>
{{ moment.include_moment() }}
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
{% endblock %}
{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% import "_macros.html" as macros %}
{% block title %}Open Sauces - Recipe{% endblock %}
{% block cuisine %}
{% include '_cuisines.html' %}
<h4 id="comments">Comments</h4>
{% if current_user.can(Permission.COMMENT) %}
<div class="comment-form">
{{ wtf.quick_form(form) }}
</div>
{% endif %}
{% include '_comments.html' %}
{% if pagination %}
<div class="pagination">
{{ macros.pagination_widget(pagination, '.recipe', fragment='#comments', id=recipes[0].id) }}
</div>
{% endif %}
{% endblock %}
{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% block title %}Open Sauces - Edit Recipe{% endblock %}
{% block title %}Open Sauces - Edit{% endblock %}
{% block page_content %}
<div class="page-header">
<h1>Edit Recipe</h1>
<h1>Edit</h1>
</div>
<div>
{{ wtf.quick_form(form) }}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment