Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unstable #44

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
d665b9f
Preparando las cosas para dar soporte a python3.4.
tutuca May 18, 2014
46a26c5
Cleaning up old migrations
tutuca May 18, 2014
4da121c
Soporte inicial para python3.
tutuca May 20, 2014
8652453
Fixed pagination and login remaining issues.
tutuca May 20, 2014
b1434e9
Deprecated django-tagging in favor of taggit. Lost the tagcloud.
tutuca May 20, 2014
132c2e5
Added ltmo project as application, this solves the static files issue…
tutuca May 20, 2014
ea31a04
Little style changes
tutuca Jun 3, 2014
11d193a
Fixed iteration over manager due to upgrade to django-taggit
tutuca Jun 15, 2014
dd83f94
Minor style updates
tutuca Jun 15, 2014
f1f125d
Tag style
tutuca Jul 20, 2014
40ecbdc
Renombro la carpeta templates, afuera del proyecto django.
tutuca May 15, 2015
891532c
Definición de app para leaks
tutuca May 15, 2015
09b39d1
Pongo la app de banners acá porque estoy podrido de mantener dos proy…
tutuca May 15, 2015
99b9804
Ahora armo el frontend con grunt
tutuca May 22, 2015
3dedf9f
Bower+grunt workflow
tutuca May 22, 2015
3db42cf
quito jquery y jquery-ui ya que los bajo con bower
tutuca Jun 7, 2015
c469f7b
Agrego jquery-ui a bower.json
tutuca Jun 7, 2015
b6dfd56
Mayormente cambios de jshint.
tutuca Jun 7, 2015
a9aba82
Agrego migración inicial para banners, que de alguna manera me daba e…
tutuca Jun 8, 2015
ceef87e
Cargo los archivos generados por Grunt. Modificaciones mínimas a Grun…
tutuca Jun 8, 2015
a5639af
Deprecado openid en favor de oauth2
tutuca Jun 8, 2015
d321081
renamed.
tutuca Jun 28, 2015
2391e1b
Integro Django Rest Framework. Fix for #11
tutuca Jun 29, 2015
c483316
version bump
tutuca Jun 29, 2015
7136a76
Agrego un archivo de requisitos de desarrollo
tutuca Jun 29, 2015
19c5dc7
Actualizo las instrucciones de instalación.
tutuca Jun 29, 2015
c41908b
arreglo para travis, medio choto...
tutuca Jul 3, 2015
213fd45
Merge branch '45-travis' into unstable
tutuca Jul 3, 2015
bd47f04
Actualizo las migraciones para que anden con 1.8
tutuca Jul 4, 2015
46cf05d
Renombro la carpeta templates, afuera del proyecto django.
tutuca May 15, 2015
bdf8925
Updated gitignore
tutuca May 15, 2015
f02a3eb
Preparando las cosas para dar soporte a python3.4.
tutuca May 18, 2014
7f10b66
Renombro la carpeta templates, afuera del proyecto django.
tutuca May 15, 2015
ffa8e0f
Updated gitignore
tutuca May 15, 2015
4c5a130
Ahora armo el frontend con grunt
tutuca May 22, 2015
35ed953
Actualicé el .gitignore para ignorar los archivos estáticos, después …
tutuca May 22, 2015
44fe0b8
Bower+grunt workflow
tutuca May 22, 2015
ccf7996
Integro un toolchain basado en webpack y babel.
tutuca Jul 3, 2015
31fe62d
Delego los archivos estáticos a webpack
tutuca Jul 4, 2015
75f25bd
algunas cosas agregadas al package.json
tutuca Jul 4, 2015
ee2b691
aplicación básica
tutuca Jul 4, 2015
2d2cb7e
Nuevo y renovado toolchain, sólo andan los javascript porque voy a em…
tutuca Jul 12, 2015
79ea382
Merge branch '43-toolchain' into unstable
tutuca Jul 12, 2015
63aed77
Configuración de tests y django 1.9
tutuca Mar 16, 2016
4d95522
Achatadas las migraciones
tutuca Mar 16, 2016
fe515e5
Corrijo ruta de css
tutuca Mar 16, 2016
2d7be1b
elimino bower, ya no lo uso mas
tutuca Mar 16, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ etc/*
apps/*
cloth/lib/*
static/

static/admin/*
static/css/*
static/js/*
static/media/
node_modules/

dump/

ltmo/media
6 changes: 6 additions & 0 deletions .idea/jsLibraryMappings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 71 additions & 0 deletions .idea/jsLinters/jshint.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/js.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 95 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
options: {
includePaths: [
'./node_modules/bootstrap-sass/assets/stylesheets',
'./node_modules/font-awesome/scss/'
]
},
dist: {
options: {
outputStyle: 'compressed'
},
files: {
'./static/css/style.css': './cloth/scss/style.scss'
}
}
},
copy: {
main: {
files: [
{
flatten:true,
cwd: './node_modules/font-awesome/fonts/',
src: ['*.*'],
dest: './static/fonts/',
expand: true
},
{
flatten:true,
cwd: './cloth/img/',
src: ['*.png', '*.jpg', '*.gif'],
dest: './static/img/',
expand: true
},
]
}
},
webpack: {
main: {
entry: {
main: "./cloth/main.js",
},
output: {
path: "./static/js",
publicPath: "/static/js",
filename: "main.js",

},
module: {
loaders: [
{ test: /\.jsx?$/, exclude: /node_modules/, loader: "babel" }
]
},
},
},
watch: {
scss: {
files: [
//watched files
'./cloth/*.scss',
],
tasks: ['sass'],
},
js : {
files: [
'./cloth/**/*.jsx',
'./cloth/**/*.js',
'./cloth/*.js',
],
tasks: ['copy:main', 'webpack:main'],
},
config: {
files: [
'Gruntfile.js',
'bower.json',
'package.json'
],
tasks: ['copy', 'sass', 'webpack'],
}
}
});
// Plugin loading
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-webpack');
grunt.loadNpmTasks('grunt-sass');

// Task definition
grunt.registerTask('build', ['copy', 'sass', 'webpack']);
grunt.registerTask('default', ['build', 'watch']);

};
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include requirements.txt
recursive-include ltmo/static/ *
recursive-include ltmo/templates/ *
exclude ltmo/local_settings.py
Expand Down
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
¿Qué es lo que observa?
=============

Este repositorio contiene tanto el código del sitio.

Asumimos una máquina en algún linux corriendo alguna versión reciente de python.
Debería andar en cualquier lado que python sea instalable.

El sitio está hecho en [django](http://djangoproject.com) y tiene muy pocas dependencias, la mejor manera de tener una instancia corriendo es:

### para desarrollo:

$ virtualenv ltmo
$ source ltmo/bin/activate
(ltmo)$ cd /path/to/clone
(ltmo)$ pip install -r requirements.txt
(ltmo)$ python setup.py develop
(ltmo)$ ltmo migrate
(ltmo)$ ltmo runserver

Una instancia queda corriendo en http://localhost:8000.

### frontend

Usamos un toolchain que consta de [npm](http://npm.io), [grunt](http://grunt.io), [bower](http://bower.io). Se instala más o menos así:

$ cd /path/to/clone
$ npm install # descarga dependencias de desarrollo.
$ bower install # descarga bibliotecas para el cliente.
$ grunt # observa cambios en una serie de archivos y ejecuta acciones.

Esto resulta en una carpeta `static` en la raíz de tu copia local.

### para producción:

$ pip install ltmo # sudo si es necesario.

Vea [[notas de instalación|Deployment]] para saber como instalarlo en un servidor en particular.



## ¿Y qué pasa con el resto?

Todo lo que envíes con spill se manda a ltmo.com.ar ahí vamos a ir agregando cosas a medida que tengamos más tiempo para perder aceite.

No sabemos muy bien de que se trata todo esto pero somos lo que hacemos


[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/tutuca/ltmo/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
33 changes: 0 additions & 33 deletions README.mkd

This file was deleted.

1 change: 1 addition & 0 deletions banners/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default_app_config = 'banners.apps.BannersAppConfig'
5 changes: 5 additions & 0 deletions banners/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.contrib import admin
from . import models
# Add your admin site registrations here, eg.
# from banners.models import Author
admin.site.register(models.Banner)
6 changes: 6 additions & 0 deletions banners/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class BannersAppConfig(AppConfig):
name = 'banners'
verbose_name = 'Banner'
39 changes: 39 additions & 0 deletions banners/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
import taggit.managers


class Migration(migrations.Migration):

dependencies = [
('taggit', '0002_auto_20141128_0837'),
]

operations = [
migrations.CreateModel(
name='Banner',
fields=[
('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')),
('code', models.TextField(blank=True, null=True, max_length=1024)),
('clicks', models.PositiveIntegerField(blank=True, default=0)),
('views', models.PositiveIntegerField(blank=True, default=0)),
],
),
migrations.CreateModel(
name='TemplateBanner',
fields=[
('banner_ptr', models.OneToOneField(parent_link=True, to='banners.Banner', auto_created=True, serialize=False, primary_key=True)),
('image', models.ImageField(upload_to='banners', null=True)),
('url', models.URLField(blank=True)),
('template', models.CharField(default='banner.html', max_length=70)),
],
bases=('banners.banner',),
),
migrations.AddField(
model_name='banner',
name='slot',
field=taggit.managers.TaggableManager(verbose_name='Tags', to='taggit.Tag', through='taggit.TaggedItem', help_text='A comma-separated list of tags.'),
),
]
File renamed without changes.
39 changes: 39 additions & 0 deletions banners/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-

from django.db import models
from taggit.managers import TaggableManager
from django.template.loader import render_to_string
from django.template.defaultfilters import slugify
from django.template import Context, Template


class Banner(models.Model):
code = models.TextField(max_length=1024, blank=True, null=True)
slot = TaggableManager()
clicks = models.PositiveIntegerField(default=0, blank=True)
views = models.PositiveIntegerField(default=0, blank=True)

def __unicode__(self):
return "Banner #%s on %s" % (self.pk, self.slot)

def render_code(self):
template = Template(self.code)
return template.render(Context({'object': self, }))


class TemplateBanner(Banner):
image = models.ImageField(upload_to='banners', null=True)
url = models.URLField(blank=True)
template = models.CharField(max_length=70, default='banner.html')

def __unicode__(self):
return "%s" % (slugify(self.pk, self.slot),)

def show_in_list(self):
self.views += 1
return render_to_string(
self.template,
{
'object': self,
}
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions ltmo/templates/slot.html → banners/templates/slot.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{% for banner in banners %}
{{banner.code|safe}}
{{banner.code|safe}}
{% endfor %}

File renamed without changes.
Loading