Skip to content

Commit 6244868

Browse files
author
alanowen
committed
fix bugs
1 parent 948564d commit 6244868

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+18747
-2
lines changed

app/api/image.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
from . import api
66

77

8+
redis = redis.Redis(host='host', port=6379)
9+
10+
811
@api.route('/image', methods=['POST'])
912
def upload_image():
1013
pass

app/main/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def new_post():
9898
@main.route('/post/edit/<int:id>', methods=['GET', 'POST'])
9999
@login_required
100100
def edit_post(id):
101-
post = Post.filter.query.get_or_404(id)
101+
post = Post.query.get_or_404(id)
102102
form = PostEditForm()
103103

104104
if form.validate_on_submit():

app/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from werkzeug.security import generate_password_hash, check_password_hash
77
from flask_login import UserMixin, AnonymousUserMixin
88

9+
from app import utils
910
from . import db, login_manager
1011

1112
post_tags = db.Table('post_tags', db.Model.metadata,
@@ -101,7 +102,9 @@ def on_body_change(target, value, oldvalue, initiator):
101102
# # markdown(value, extensions=['fenced_code', 'codehilite'], output_format='html5'),
102103
# markdown(value, extras=['fenced-code-blocks']),
103104
# tags=allowed_tags, strip=True))
104-
target.body_html = markdown(value, extras=['fenced-code-blocks', 'nl2br', 'tables'])
105+
106+
target.body_html = utils.convert_to_html(value)
107+
#target.body_html = markdown(value, extras=['fenced-code-blocks', 'nl2br', 'tables'])
105108

106109

107110
class AnonymousUser(AnonymousUserMixin):
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
Contributing to bootstrap-fileinput
2+
===================================
3+
Looking to contribute something to bootstrap-fileinput? **Here's how you can help.**
4+
5+
Please take a moment to review this document in order to make the contribution
6+
process easy and effective for everyone involved.
7+
8+
Following these guidelines helps to communicate that you respect the time of
9+
the developers managing and developing this open source project. In return,
10+
they should reciprocate that respect in addressing your issue or assessing
11+
patches and features.
12+
13+
Using the issue tracker
14+
-----------------------
15+
When [reporting bugs][reporting-bugs] or
16+
[requesting features][requesting-features], the
17+
[issue tracker on GitHub][issue-tracker] is the recommended channel to use.
18+
19+
The issue tracker **is not** a place for support requests. Refer the
20+
[plugin documentation](http://plugins.krajee.com/file-input),
21+
[plugin demos](http://plugins.krajee.com/file-input/demo), and / or refer to the
22+
[webtips Q & A forum](http://webtips.krajee.com/questions) which are the better places to get help.
23+
24+
Reporting bugs with bootstrap-fileinput
25+
---------------------------------------
26+
We really appreciate clear bug reports that _consistently_ show an issue
27+
_within bootstrap-fileinput_.
28+
29+
The ideal bug report follows these guidelines:
30+
31+
1. **Use the [GitHub issue search][issue-search]** &mdash; Check if the issue
32+
has already been reported.
33+
2. **Check if the issue has been fixed** &mdash; Try to reproduce the problem
34+
using the code in the `master` branch.
35+
3. **Isolate the problem** &mdash; Try to create an
36+
[isolated js fiddle][isolated-case] that consistently reproduces the problem.
37+
38+
Please try to be as detailed as possible in your bug report, especially if an
39+
isolated test case cannot be made. Some useful questions to include the answer
40+
to are:
41+
42+
- What steps can be used to reproduce the issue?
43+
- What is the bug and what is the expected outcome?
44+
- What browser(s) and Operating System have you tested with?
45+
- Does the bug happen consistently across all tested browsers?
46+
- What version of jQuery are you using? And what version of bootstrap-fileinput?
47+
- Are you using bootstrap-fileinput with other plugins?
48+
49+
All of these questions will help others fix and identify any potential bugs.
50+
51+
Requesting features in bootstrap-fileinput
52+
------------------------------------------
53+
Before starting work on a major feature for bootstrap-fileinput, **read the
54+
[documentation](http://plugins.krajee.com/file-input) first** or you may risk spending a considerable amount of
55+
time on something which the project developers are not interested in bringing into the project.
56+
57+
### Submitting a pull request
58+
59+
We use GitHub's pull request system for submitting patches. Here are some
60+
guidelines to follow when creating the pull request for your fix.
61+
62+
1. Make sure to create a ticket for your pull request. This will serve as the
63+
bug ticket, and any discussion about the bug will take place there. Your pull
64+
request will be focused on the specific changes that fix the bug.
65+
2. Make sure to reference the ticket you are fixing within your pull request.
66+
This will allow us to close off the ticket once we merge the pull request, or
67+
follow up on the ticket if there are any related blocking issues.
68+
3. Explain why the specific change was made. Not everyone who is reviewing your
69+
pull request will be familiar with the problem it is fixing.
70+
4. Run your tests first. If your tests aren't passing, the pull request won't
71+
be able to be merged. If you're breaking existing tests, make sure that you
72+
aren't causing any breaking changes.
73+
5. Only include source changes. While it's not required, only including changes
74+
from the `src` directory will prevent merge conflicts from occuring. Making
75+
this happen can be as a simple as not committing changes from the `dist`
76+
directory.
77+
78+
By following these steps, you will make it easier for your pull request to be
79+
reviewed and eventually merged.
80+
81+
Triaging issues and pull requests
82+
---------------------------------
83+
Anyone can help the project maintainers triage issues and review pull requests.
84+
85+
### Handling new issues
86+
87+
bootstrap-fileinput regularly receives new issues which need to be tested and organized.
88+
89+
When a new issue that comes in that is similar to another existing issue, it
90+
should be checked to make sure it is not a duplicate. Duplicates issues should
91+
be marked by replying to the issue with "Duplicate of #[issue number]" where
92+
`[issue number]` is the url or issue number for the existing issue. This will
93+
allow the project maintainers to quickly close off additional issues and keep
94+
the discussion focused within a single issue.
95+
96+
If you can test issues that are reported to bootstrap-fileinput that contain test cases and
97+
confirm under what conditions bugs happen, that will allow others to identify
98+
what causes a bug quicker.
99+
100+
### Reviewing pull requests
101+
102+
It is very common for pull requests to be opened for issues that contain a clear
103+
solution to the problem. These pull requests should be rigorously reviewed by
104+
the community before being accepted. If you are not sure about a piece of
105+
submitted code, or know of a better way to do something, do not hesitate to make
106+
a comment on the pull request.
107+
108+
### Reviving old tickets
109+
110+
If you come across tickets which have not been updated for a while, you are
111+
encouraged to revive them. While this can be as simple as saying `:+1:`, it is
112+
best if you can include more information on the issue. Common bugs and feature
113+
requests are more likely to be fixed, whether it is by the community or the
114+
developers, so keeping tickets up to date is encouraged.
115+
116+
Licensing
117+
---------
118+
119+
It should also be made clear that **all code contributed to bootstrap-fileinput** must be
120+
licensable under the [BSD-3 license][licensing]. Code that cannot be released
121+
under this license **cannot be accepted** into the project.
122+
123+
[isolated-case]: https://jsfiddle.net/
124+
[issue-search]: https://github.com/kartik-v/bootstrap-fileinput/search?q=&type=Issues
125+
[issue-tracker]: https://github.com/kartik-v/bootstrap-fileinput/issues
126+
[licensing]: https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
127+
[reporting-bugs]: #reporting-bugs-with-bootstrap-fileinput
128+
[requesting-features]: #requesting-features-in-bootstrap-fileinput
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## Prerequisites
2+
3+
- [ ] I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
4+
- [ ] The issue still exists against the latest `master` branch of bootstrap-fileinput.
5+
- [ ] This is not an usage question. I confirm having read the plugin [documentation](http://plugins.krajee.com/file-input) and [demos](http://plugins.krajee.com/file-input/demo).
6+
- [ ] This is not a general programming / coding question. (Those should be directed to the [webtips Q & A forum](http://webtips.krajee.com/questions)).
7+
- [ ] I have attempted to find the simplest possible steps to reproduce the issue.
8+
- [ ] I have included a failing test as a pull request (Optional).
9+
10+
## Steps to reproduce the issue
11+
12+
1.
13+
2.
14+
3.
15+
16+
## Expected behavior and actual behavior
17+
18+
When I follow those steps, I see...
19+
20+
I was expecting...
21+
22+
## Environment
23+
24+
Browsers
25+
26+
- [ ] Google Chrome
27+
- [ ] Mozilla Firefox
28+
- [ ] Internet Explorer
29+
- [ ] Safari
30+
31+
Operating System
32+
33+
- [ ] Windows
34+
- [ ] Mac OS X
35+
- [ ] Linux
36+
- [ ] Mobile
37+
38+
Libraries
39+
40+
- jQuery version:
41+
- bootstrap-fileinput version:
42+
43+
## Isolating the problem
44+
45+
- [ ] This bug happens [on the plugin demos page](http://plugins.krajee.com/file-input/demo)
46+
- [ ] The bug happens consistently across all tested browsers
47+
- [ ] This bug happens when using bootstrap-fileinput without other plugins
48+
- [ ] I can reproduce this bug in [a jsbin](https://jsbin.com/)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Scope
2+
This pull request includes a
3+
4+
- [ ] Bug fix
5+
- [ ] New feature
6+
- [ ] Translation
7+
8+
## Changes
9+
The following changes were made
10+
11+
-
12+
-
13+
-
14+
15+
## Related Issues
16+
If this is related to an existing ticket, include a link to it as well.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
nuget/content/
2+
nuget/bootstrap-fileinput.*.nupkg
3+
.DS_Store
4+
.idea

0 commit comments

Comments
 (0)