This file contains hidden or 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
class TokenViewSet(viewsets.GenericViewSet): | |
def retrieve(self, request, pk=None): | |
if request.user.is_authenticated(): | |
token, created = Token.objects.get_or_create(user=request.user) | |
return Response({ 'token': token.key }) | |
else: | |
return Response({ | |
'status': 'Access Denied!', | |
'message': 'This account is not active!' |
This file contains hidden or 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
class MapFilterForm(forms.Form): | |
form = None | |
created__gte = forms.DateField(required=False) | |
created__lte = forms.DateField(required=False) | |
device = forms.ModelChoiceField(queryset=DeviceTeam.objects.all(), | |
required=False) | |
device__in = forms.ModelMultipleChoiceField(queryset=Device.objects.all(), | |
required=False) | |
def __init__(self, form=form, data=None, files=None, auto_id='id_%s', prefix=None, |
This file contains hidden or 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
from django.core import serializers | |
from django.shortcuts import get_object_or_404 | |
from django.views.generic import ListView | |
from form.models import Form | |
from ..forms import MapFilterForm | |
from ..models import Harvest | |
class FormMap(ListView): |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- Mobile support --> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- Twitter Bootstrap --> | |
<!-- DatePicker --> | |
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> |
This file contains hidden or 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
var tmp = []; | |
harvests.filter(function(harvest) { | |
var question; | |
// use Array.prototype.filter | |
question = questions.filter(function (question) { | |
// supondo harvest.question ==> id da questao | |
// do contrario use harvest.question.id | |
return harvest.question == question.id; |
This file contains hidden or 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
.gridStyle { | |
border: 1px solid rgb(212,212,212); | |
width: 400px; | |
height: 300px; | |
} |
This file contains hidden or 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
Array.prototype.forEach(document.querySelectorAll('[bind]'), function (bindable) { | |
this.value = application[this.attribues.get('bind')]; | |
bindable.addEventListener('keyup', (function (event) { | |
application[this.attribues.get('bind')] = this.value; | |
}).bind(bindable)); | |
}); |
This file contains hidden or 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
angular.module('myApp') | |
.factory('Harvest', [ | |
'$resource', | |
function ($resource) { | |
return $resource('/viewver/api/harvest_viewver/?id', {'id': '@id'}, { | |
create: { method: 'POST' } | |
update: { method: 'PUT' } | |
}); | |
} | |
]); |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- http://jsfiddle.net/p7snevh1/81/ by myself --> | |
<style> | |
html, body { height: 100%; } | |
#list { height: 100%; } | |
#list>.item { | |
height: 18px; padding: 2px 0; border-bottom: solid 1px gray; overflow: hidden; | |
} |
This file contains hidden or 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
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
nggettext_compile: { | |
all: { | |
options: { | |
format: "json" | |
}, | |
files: [ |
OlderNewer