Compare commits
5 Commits
59f75bb71c
...
fa35025ec1
Author | SHA1 | Date | |
---|---|---|---|
|
fa35025ec1 | ||
|
8d2bb12ad4 | ||
|
7bbb480ae2 | ||
|
f809cdcab0 | ||
|
d5342d7096 |
1
.gitignore
vendored
@ -5,6 +5,7 @@ main.css
|
||||
tmp
|
||||
log.txt
|
||||
*.rdb
|
||||
uploads
|
||||
|
||||
# Created by https://www.gitignore.io/api/linux,macos,python,windows
|
||||
|
||||
|
Before Width: | Height: | Size: 771 KiB After Width: | Height: | Size: 771 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
@ -247,7 +247,7 @@ def importRepoScreenshot(id):
|
||||
|
||||
try:
|
||||
filename = randomString(10) + ".png"
|
||||
imagePath = os.path.join(app.config["UPLOAD_FOLDER"], filename)
|
||||
imagePath = os.path.join("app/public/uploads", filename)
|
||||
print(imagePath)
|
||||
urllib.request.urlretrieve(urlmaker.getScreenshotURL(), imagePath)
|
||||
|
||||
|
@ -47,7 +47,7 @@
|
||||
<div class="pkg_meta">{{ render_submit_field(form.submit) }}</div>
|
||||
</form>
|
||||
|
||||
{% if not package.title %}
|
||||
{% if enable_wizard %}
|
||||
<script src="/static/jquery.min.js"></script>
|
||||
<script src="/static/url.min.js"></script>
|
||||
<script src="/static/polltask.js"></script>
|
||||
|
@ -47,7 +47,7 @@ def doFileUpload(file, allowedExtensions, fileTypeName):
|
||||
return None
|
||||
|
||||
filename = randomString(10) + "." + ext
|
||||
file.save(os.path.join(app.config["UPLOAD_FOLDER"], filename))
|
||||
file.save(os.path.join("app/public/uploads", filename))
|
||||
return "/uploads/" + filename
|
||||
|
||||
|
||||
|
@ -34,12 +34,11 @@ def domain(url):
|
||||
# Use nginx to serve files on production instead
|
||||
@app.route("/static/<path:path>")
|
||||
def send_static(path):
|
||||
return send_from_directory("static", path)
|
||||
return send_from_directory("public/static", path)
|
||||
|
||||
@app.route("/uploads/<path:path>")
|
||||
def send_upload(path):
|
||||
import os
|
||||
return send_from_directory(os.path.abspath(app.config["UPLOAD_FOLDER"]), path)
|
||||
return send_from_directory("public/uploads", path)
|
||||
|
||||
@app.route("/")
|
||||
@menu.register_menu(app, ".", "Home")
|
||||
|
@ -168,6 +168,11 @@ def create_edit_package_page(author=None, name=None):
|
||||
if request.method == "POST" and form.validate():
|
||||
wasNew = False
|
||||
if not package:
|
||||
package = Package.query.filter_by(name=form["name"].data, author_id=author.id).first()
|
||||
if package is not None:
|
||||
flash("Package already exists!", "error")
|
||||
return redirect(url_for("create_edit_package_page"))
|
||||
|
||||
package = Package()
|
||||
package.author = author
|
||||
wasNew = True
|
||||
@ -191,7 +196,9 @@ def create_edit_package_page(author=None, name=None):
|
||||
|
||||
return redirect(package.getDetailsURL())
|
||||
|
||||
return render_template("packages/create_edit.html", package=package, form=form, author=author)
|
||||
enableWizard = name is None and request.method != "POST"
|
||||
return render_template("packages/create_edit.html", package=package, \
|
||||
form=form, author=author, enable_wizard=enableWizard)
|
||||
|
||||
@app.route("/packages/<author>/<name>/approve/", methods=["POST"])
|
||||
@login_required
|
||||
|
@ -45,7 +45,7 @@ def _getDirPath(originalPath, create=False):
|
||||
|
||||
return path
|
||||
|
||||
def sass(app, inputDir='scss', outputPath='static', force=False, cacheDir=None):
|
||||
def sass(app, inputDir='scss', outputPath='static', force=False, cacheDir="public/static"):
|
||||
static_url_path = app.static_url_path
|
||||
inputDir = _getDirPath(inputDir)
|
||||
cacheDir = _getDirPath(cacheDir or outputPath, True)
|
||||
|
@ -13,11 +13,9 @@ GITHUB_CLIENT_SECRET = ""
|
||||
CELERY_BROKER_URL='redis://localhost:6379'
|
||||
CELERY_RESULT_BACKEND='redis://localhost:6379'
|
||||
|
||||
UPLOAD_FOLDER="tmp"
|
||||
|
||||
USER_ENABLE_REGISTER = False
|
||||
USER_ENABLE_CHANGE_USERNAME = False
|
||||
s
|
||||
|
||||
MAIL_USERNAME=""
|
||||
MAIL_PASSWORD=""
|
||||
MAIL_DEFAULT_SENDER=""
|
||||
|