forked from shuup/shuup-megastore-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
87 changed files
with
6,554 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include README.rst | ||
include LICENSE | ||
|
||
recursive-include shuup_megastore_theme *.ico *.png *.jinja *.js *.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Shuup Megastore Theme | ||
===================== | ||
|
||
This is Megastore Theme for Shuup. | ||
|
||
Getting started | ||
--------------- | ||
|
||
For Bash-based shells, this should do: | ||
|
||
```bash | ||
pip install -r requirements.txt | ||
(cd shuup_megastore_theme && npm run build) | ||
cd .. | ||
python -m shuup_workbench migrate | ||
python -m shuup_workbench createsuperuser | ||
python -m shuup_workbench runserver 0.0.0.0:8000 | ||
``` | ||
|
||
For mock data, run | ||
|
||
```bash | ||
python -m shuup_workbench shuup_populate_mock | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#https://github.com/shuupio/shoop/releases/download/v3.0.0/shuup-3.0.0-py2.py3-none-any.whl | ||
#-e . | ||
#PyYAML==3.11 | ||
#beautifulsoup4==4.4.1 | ||
#https://github.com/shoopio/shoop-carousel/archive/v1.0.1.zip#egg=shuup-carousel==1.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[bdist_wheel] | ||
universal = 1 | ||
|
||
[flake8] | ||
exclude = .tox,migrations,doc/* | ||
max-line-length = 120 | ||
max-complexity = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import setuptools | ||
|
||
|
||
try: | ||
import shoop_setup_utils | ||
except ImportError: | ||
shoop_setup_utils = None | ||
|
||
|
||
if __name__ == '__main__': | ||
setuptools.setup( | ||
name="shuup_megastore_theme", | ||
version="1.0.0", | ||
description="Shuup Megastore Theme", | ||
packages=setuptools.find_packages(), | ||
include_package_data=True, | ||
entry_points={"shoop.addon": "shuup_megastore_theme=shuup_megastore_theme"}, | ||
cmdclass=(shoop_setup_utils.COMMANDS if shoop_setup_utils else {}), | ||
install_requires=[ | ||
'shoop>=3.0,<5', | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
bower_components | ||
static/shuup_megastore_theme/fonts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Licenses for Vendored Software | ||
============================== | ||
|
||
Image Lightbox, Responsive and Touch-friendly | ||
--------------------------------------------- | ||
|
||
* Copyright: Osvaldas Valutis, www.osvaldas.info | ||
* License: MIT License <https://spdx.org/licenses/MIT.html> | ||
* URL: http://osvaldas.info/image-lightbox-responsive-touch-friendly | ||
|
||
* static_src/less/vendor/imagelightbox.less | ||
* static_src/js/vendor/imagelightbox.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from django.conf import settings | ||
from django.utils.encoding import force_text | ||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
from shoop.apps import AppConfig | ||
from shoop.xtheme import Theme | ||
|
||
|
||
class ShuupMegastoreTheme(Theme): | ||
identifier = __name__ | ||
name = _("Shuup Megastore Theme") | ||
author = "Yuki Miyagi" | ||
template_dir = "shuup_megastore_theme/" | ||
|
||
def get_view(self, view_name): | ||
from . import views | ||
return getattr(views, view_name, None) | ||
|
||
def _format_cms_links(self, **query_kwargs): | ||
if "shuup.simple_cms" not in settings.INSTALLED_APPS: | ||
return | ||
from shoop.simple_cms.models import Page | ||
for page in Page.objects.visible().filter(**query_kwargs): | ||
yield {"url": "/%s" % page.url, "text": force_text(page)} | ||
|
||
def get_cms_navigation_links(self): | ||
return self._format_cms_links(visible_in_menu=True) | ||
|
||
|
||
class ShuupMegastoreThemeAppConfig(AppConfig): | ||
name = __name__ | ||
verbose_name = ShuupMegastoreTheme.name | ||
label = __name__ | ||
provides = { | ||
"xtheme": __name__ + ":ShuupMegastoreTheme", | ||
"xtheme_plugin": [ | ||
"shuup_megastore_theme.plugins:ProductHighlightPlugin", | ||
] | ||
} | ||
|
||
default_app_config = __name__ + ".ShuupMegastoreThemeAppConfig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "shuup-megastore-theme", | ||
"version": "1.0.0", | ||
"homepage": "-", | ||
"authors": [ | ||
"Yuki Miyagi <[email protected]>", | ||
"Janne Tammi <[email protected]>" | ||
], | ||
"description": "Shuup Megastore Theme", | ||
"license": "-", | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components", | ||
"test", | ||
"tests" | ||
], | ||
"dependencies": { | ||
"jquery": "~2.1.4", | ||
"owl.carousel": "~2.0.0-beta.3", | ||
"bootstrap-select": "~1.7.5", | ||
"jquery-easing": "*", | ||
"jquery-touchswipe": "~1.6.12", | ||
"bootstrap": "~3.3.5", | ||
"font-awesome": "~4.5.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
var gulp = require("gulp"); | ||
var less = require("gulp-less"); | ||
var concat = require("gulp-concat"); | ||
var uglify = require("gulp-uglify"); | ||
var plumber = require("gulp-plumber"); | ||
var minifycss = require("gulp-cssnano"); | ||
var gutil = require("gulp-util"); | ||
var PRODUCTION = gutil.env.production || process.env.NODE_ENV == "production"; | ||
|
||
gulp.task("less", function() { | ||
return gulp.src([ | ||
"bower_components/owl.carousel/dist/assets/owl.carousel.min.css", | ||
"static_src/less/style.less" | ||
]) | ||
.pipe(plumber({})) | ||
.pipe(less().on("error", function(err) { | ||
console.log(err.message); | ||
this.emit("end"); | ||
})) | ||
.pipe(concat("style.css")) | ||
.pipe((PRODUCTION ? minifycss() : gutil.noop())) | ||
.pipe(gulp.dest("static/shuup_megastore_theme/css/")); | ||
}); | ||
|
||
gulp.task("less:watch", ["less"], function() { | ||
gulp.watch(["static_src/less/**/*.less"], ["less"]); | ||
}); | ||
|
||
gulp.task("js", function() { | ||
return gulp.src([ | ||
"bower_components/jquery/dist/jquery.min.js", | ||
"bower_components/bootstrap/dist/js/bootstrap.js", | ||
"bower_components/bootstrap-select/dist/js/bootstrap-select.min.js", | ||
"bower_components/jquery-easing/jquery.easing.min.js", | ||
"bower_components/owl.carousel/dist/owl.carousel.min.js", | ||
"bower_components/jquery-touchswipe/jquery.touchSwipe.min.js", | ||
"static_src/js/vendor/image-lightbox.js", | ||
"static_src/js/custom/custom.js", | ||
"static_src/js/custom/checkout.js" | ||
]) | ||
.pipe(plumber({})) | ||
.pipe(concat("shuup_megastore_theme.js")) | ||
.pipe((PRODUCTION ? uglify() : gutil.noop())) | ||
.pipe(gulp.dest("static/shuup_megastore_theme/js/")); | ||
}); | ||
|
||
gulp.task("js:watch", ["js"], function() { | ||
gulp.watch(["static_src/js/**/*.js"], ["js"]); | ||
}); | ||
|
||
gulp.task("copy_fonts", function() { | ||
return gulp.src([ | ||
"bower_components/bootstrap/fonts/*", | ||
"bower_components/font-awesome/fonts/*" | ||
]).pipe(gulp.dest("static/shuup_megastore_theme/fonts/")); | ||
}); | ||
|
||
gulp.task("default", ["js", "less", "copy_fonts"]); | ||
|
||
gulp.task("watch", ["js:watch", "less:watch"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "shuup-megastore-theme", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "npm i && bower --config.interactive=false i && gulp" | ||
}, | ||
"author": "", | ||
"license": "Proprietary", | ||
"private": true, | ||
"dependencies": { | ||
"bower": "^1.6.5", | ||
"gulp": "^3.9.0", | ||
"gulp-autoprefixer": "^3.0.1", | ||
"gulp-concat": "^2.6.0", | ||
"gulp-cssnano": "^2.0.0", | ||
"gulp-less": "^3.0.3", | ||
"gulp-plumber": "^1.0.1", | ||
"gulp-uglify": "^1.4.0", | ||
"gulp-util": "^3.0.6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from django import forms | ||
from shoop.front.template_helpers.general import get_newest_products, get_best_selling_products, get_random_products | ||
from shoop.xtheme.plugins._base import TemplatedPlugin # TODO: FIX THIS. | ||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
|
||
class ProductHighlightPlugin(TemplatedPlugin): | ||
identifier = "shuup_megastore_theme.product_highlight" | ||
name = _("Shuup Megastore Theme Product Highlights") | ||
template_name = "shuup_megastore_theme/highlight_plugin.jinja" | ||
fields = [ | ||
("title", forms.CharField(required=False, initial="")), | ||
("type", forms.ChoiceField(choices=[ | ||
("newest", "Newest"), | ||
("best_selling", "Best Selling"), | ||
("random", "Random"), | ||
], initial="newest")), | ||
("count", forms.IntegerField(min_value=1, initial=8)) | ||
] | ||
|
||
def get_context_data(self, context): | ||
type = self.config.get("type", "newest") | ||
count = self.config.get("count", 8) | ||
if type == "newest": | ||
products = get_newest_products(context, count) | ||
elif type == "best_selling": | ||
products = get_best_selling_products(context, count) | ||
elif type == "random": | ||
products = get_random_products(context, count) | ||
else: | ||
products = [] | ||
|
||
return { | ||
"request": context["request"], | ||
"title": self.config.get("title"), | ||
"products": products | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.css | ||
*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
window.activateCheckoutAddressCopy = function(){ | ||
var shouldCopyFields = false; | ||
|
||
var toggleFieldDisability = function($field) { | ||
$field.toggleClass("disabled", shouldCopyFields); | ||
}; | ||
|
||
var toggleCopyFields = function() { | ||
shouldCopyFields = $("#same_as_billing").is(":checked"); | ||
$("#shipping :input").each(function(){ | ||
$(this).attr("readonly", shouldCopyFields); | ||
toggleFieldDisability($(this)); | ||
}); | ||
|
||
$("#id_shipping-country").attr("readonly", shouldCopyFields); | ||
|
||
$target = $("#id_shipping-country").next(".btn-group").children("button"); | ||
toggleFieldDisability($target); | ||
if(shouldCopyFields) { | ||
$("#billing :input").change(); | ||
} | ||
}; | ||
|
||
var copyFieldValue = function() { | ||
if(!shouldCopyFields) | ||
return; | ||
var targetName = $(this).attr("id").split("-")[1]; | ||
var $target = $("#id_shipping-"+targetName); | ||
$target.val($(this).val()); | ||
}; | ||
|
||
var copySelectValue = function() { | ||
$("#id_shipping-country").selectpicker("val", $(this).val()); | ||
}; | ||
|
||
$("#id_shipping-country").attr("readonly", true); | ||
toggleCopyFields(); | ||
$(document).on("input change", "#billing :input", copyFieldValue); | ||
$("#same_as_billing").on("change", toggleCopyFields); | ||
$("#id_billing-country").on("change", copySelectValue); | ||
}; |
Oops, something went wrong.