Skip to content

Commit

Permalink
merging #3
Browse files Browse the repository at this point in the history
  • Loading branch information
moacirmoda committed Sep 5, 2016
2 parents 369e156 + 034f63b commit a5d27c0
Show file tree
Hide file tree
Showing 199 changed files with 471 additions and 782 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ settings_local.py

*.psqlc
*.log
site/
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ RUN npm install \

USER root
EXPOSE 80 8000
ENTRYPOINT ["/app/timtec/docker/entrypoint.py"]

CMD ["supervisord", "-c", "/app/timtec/docker/supervisord.conf"]
21 changes: 18 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@ setup_js:
npm install # --loglevel silent

setup_django: clean
python manage.py syncdb --noinput
python manage.py migrate --fake --noinput
python manage.py loaddata minimal
python manage.py migrate --noinput
python manage.py loaddata initial
python manage.py compilemessages

dumpdata: clean
Expand All @@ -140,3 +139,19 @@ reset_db: clean

messages: clean
python manage.py makemessages -a -d django

doc_install:
virtualenv docs/env
make doc_update

doc_update:
docs/env/bin/pip install --upgrade pip
docs/env/bin/pip install -U -r docs/requirements.txt

doc_build:
make doc_update
docs/env/bin/mkdocs build

doc_run:
make doc_update
docs/env/bin/mkdocs serve
78 changes: 78 additions & 0 deletions README-DOCS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#PT Br

## Documentação TIM Tec

Repositório do manual da aplicação [TIM Tec](https://github.com/hacklabr/timtec/). Para maiores informações, veja o portal do projeto: http://docs.timtec.com.br.

Todos os documentos aqui são gerados com [mkdocs](http://www.mkdocs.org). Esta documentação e a geração destes conteúdos está baseada em uma distribuição GNU/Linux usando gerenciador de pacotes apt.

## Como compilar a documentação?

1 - Instale o ambiente virtual python (python-virtualenv). Usarmos este ambiente para instalar o `mkdocs`. Permissões sudo ou root pode ser necessárias:

```
# apt-get update
# apt-get install python-virtualenv
```
2 - Crie e ative o ambiente virtual python

```
$ virtualenv docs-env
$ source docs-env/bin/activate
```
3 - Baixe a engine mkdocs via pip
```
$ pip install mkdocs
```

## Como usar mkdocs localmente?

1 - Depois de clonar o repositório, entre na pasta docs e rode `mkdocs serve`. Veja:

```
$ cd docs
$ mkdocs serve
```
2 - No endereço padrão localhost + porta 8000 (127.0.0.1:8000) você pode ver o site em realtime. Se você quiser processa modificaçõe, o mkdocs mostrará em tempo real.


## Gerando arquivos estáticos html/css/js

1 - Para gerar uma documentação em formato html estruturado, vamos compilar essa documentação. Dentro da pasta /docs rode o comando `mkdocs build`:

```
$ mkdocs build
```

Após esse processo será criado um novo diretório chamado `site`. Este conterá todos os arquivos da página. Dentro do diretório os arquivos estarão assim:

```
user@Server:~/zup-docs$ ls -la site/
total 80 files
drwxr-xr-x 2 user user 4096 Nov 23 15:18 api_configuration
drwxr-xr-x 2 user user 4096 Nov 23 15:18 css
drwxr-xr-x 2 user user 4096 Nov 23 15:18 fonts
drwxr-xr-x 2 user user 4096 Nov 23 15:18 images
drwxr-xr-x 2 user user 4096 Nov 23 15:18 img
drwxr-xr-x 2 user user 4096 Nov 23 15:18 implement
-rw-r--r-- 1 user user 7926 Nov 23 15:18 index.html
drwxr-xr-x 2 user user 4096 Nov 23 15:18 installation_docker
drwxr-xr-x 2 user user 4096 Nov 23 15:18 javascript
drwxr-xr-x 2 user user 4096 Nov 23 15:18 js
drwxr-xr-x 3 user user 4096 Nov 23 15:18 license
drwxr-xr-x 3 user user 4096 Nov 23 15:18 mkdocs
-rw-r--r-- 1 user user 4917 Nov 23 15:18 search.html
-rw-r--r-- 1 user user 990 Nov 23 15:18 sitemap.xml
drwxr-xr-x 2 user user 4096 Nov 23 15:18 updating_docker
drwxr-xr-x 2 user user 4096 Nov 23 15:18 web_configuration
```

Para atualizar a documentação a partir de mudanças geradas nos arquivos .md, limpe os arquivos estáticos e gere novamente a documentação.
```
$ mkdocs build --clean
$ mkdocs build
```

To more information about mkdocs, see [http://www.mkdocs.org](http://www.mkdocs.org/).


16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
## Instalação e configurações
Para acessar a documentação completa, veja a pasta [docs](docs) na raiz da aplicação.

* [INSTALAÇÃO release v3.2 ou superior](docs/source/instalacao_e_configuracao/Instalação.md)
* [ATUALIZAÇÃO a partir v3.2 ou superior](docs/source/instalacao_e_configuracao/Atualização.md)
* [ATUALIZAÇÃO a partir da versão 3.0.10 ou inferior](docs/source/instalacao_e_configuracao/Atualizando-a-partir-da-versão-3.0.10-ou-inferior.md)
* [CONFIGURAÇÕES v3.2 ou superior](docs/source/instalacao_e_configuracao/Configurações.md)
* [CONFIGURAÇÕES (Versão 3.0.10 e inferiores)](docs/source/instalacao_e_configuracao/Configurações-(Versão-3.0.10-e-inferiores).md)
* [INSTALAÇÃO release v3.2 ou superior](docs/instalacao_e_configuracao/Instalação.md)
* [ATUALIZAÇÃO a partir v3.2 ou superior](docs/instalacao_e_configuracao/Atualização.md)
* [ATUALIZAÇÃO a partir da versão 3.0.10 ou inferior](docs/instalacao_e_configuracao/Atualizando-a-partir-da-versão-3.0.10-ou-inferior.md)
* [CONFIGURAÇÕES v3.2 ou superior](docs/instalacao_e_configuracao/Configurações.md)
* [CONFIGURAÇÕES (Versão 3.0.10 e inferiores)](docs/instalacao_e_configuracao/Configurações-(Versão-3.0.10-e-inferiores).md)


## Desenvolvimento
* [Criando ambiente de dev](docs/source/instalacao_e_configuracao/%5BDev%5D-Instalação-no-Archlinux.rst)
* [Temas](docs/source/instalacao_e_configuracao/Temas.md)
* [Tutorial para criação de tema](docs/source/instalacao_e_configuracao/Tutorial-para-criação-de-tema.md)
* [Criando ambiente de dev](docs/instalacao_e_configuracao/%5BDev%5D-Instalação-no-Archlinux.rst)
* [Temas](docs/instalacao_e_configuracao/Temas.md)
* [Tutorial para criação de tema](docs/instalacao_e_configuracao/Tutorial-para-criação-de-tema.md)


## Licença - AGPLV3
Expand Down
13 changes: 13 additions & 0 deletions activities/static/templates/activity_reading.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="question textleft">
<span ng-bind-html="currentActivity.data.question"></span>
</div>
<div class="submit">
<div class="row">
<div class="col-sm-12 textright">
<button class="btn btn-success text-uppercase" ng-click="sendAnswerText()" translate>
<i class="fa fa-check-square-o"></i>
Continuar
</button>
</div>
</div>
</div>
21 changes: 12 additions & 9 deletions administration/static/js/directives/markdowneditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@
}
});

$scope.$watch($scope.active, function(value){
$scope.$watch('active', function(value){
var modal_element = angular.element('#modal-markdown-editor-' + $scope.id);
if (value)
if (value){
original = angular.copy($scope.content);
modal_element.modal('show');
}
else
modal_element.modal('hide');
});
Expand Down Expand Up @@ -125,13 +127,14 @@
});
scope.title = attr.title;

scope.$watch('active', function(value){
var modal_element = angular.element('#modal-markdown-editor-' + scope.id);
if (value)
modal_element.modal('show');
else
modal_element.modal('hide');
});
// scope.$watch('active', function(value){
// var modal_element = angular.element('#modal-markdown-editor-' + scope.id);
// if (value)
// modal_element.modal('show');
// }
// else
// modal_element.modal('hide');
// });
}

function getConfigFunction(templateUrl) {
Expand Down
3 changes: 2 additions & 1 deletion administration/static/js/edit-lesson/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
{'name': 'trueorfalse', 'label': 'Verdadeiro ou falso'},
{'name': 'relationship', 'label': 'Relacionar sentenças'},
{'name': 'html5', 'label': 'HTML5'},
{'name': 'markdown', 'label': 'Texto simples'}
{'name': 'markdown', 'label': 'Texto simples'},
{'name': 'reading', 'label': 'Atividade de leitura'}
];

/* Methods */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="question textleft">
<modalmarkdowneditor title="reading" content="currentActivity.data.question">
</modalmarkdowneditor>
</div>
2 changes: 1 addition & 1 deletion administration/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
url(r'^home/$', lr(AdminView.as_view(template_name="home.html")), name="administration.home"),

# list all courses
url(r'^$', lr(RedirectView.as_view(url="courses/"))),
url(r'^$', lr(RedirectView.as_view(url="courses/", permanent=False))),
url(r'^courses/$', AdminView.as_view(template_name="courses.html"), name='administration.courses'),

# users
Expand Down
7 changes: 7 additions & 0 deletions core/static/js/lesson/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@
ga('send', 'event', 'activity', 'submit');
};

$scope.sendAnswerText = function() {
var progress;
progress = Progress.complete($scope.currentUnit.id);
$scope.currentUnit.progress = progress;
$scope.nextUnit();
};

$scope.nextStep = function(skipComment) {
var progress;
if($scope.section === 'video') {
Expand Down
1 change: 1 addition & 0 deletions core/static/templates/lesson_activity.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% load timtec_markdown %}
<div class="col-lg-8 col-md-10 col-sm-10">
<div class="course-activity">
<ng:include src="activity_template"></ng:include>
Expand Down
6 changes: 4 additions & 2 deletions core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,7 @@ def render_to_response(self, context, **response_kwargs):

driver.service.process.send_signal(SIGTERM)
driver.quit()

Image.open(png_path).convert("RGB").save(pdf_path, format='PDF')
Image.open(png_path).convert("RGB").save(pdf_path, format='PDF', quality=100, dpi=(300, 300))

response = HttpResponse(content_type='application/pdf')
response['Content-Disposition'] = 'attachment; filename=%s' % pdf_filename
Expand Down Expand Up @@ -407,6 +406,9 @@ def get_queryset(self):


class EmitReceiptView(RedirectView):

permanent = False

def get_redirect_url(self, *args, **kwargs):
course_id = kwargs.get('course_id')
if course_id:
Expand Down
Binary file removed courses_export/arquiteturadainformacao.tar.gz
Binary file not shown.
Binary file removed courses_export/backend.tar.gz
Binary file not shown.
Binary file removed courses_export/desenhodejogos.tar.gz
Binary file not shown.
Binary file removed courses_export/dev-jogos.tar.gz
Binary file not shown.
Binary file removed courses_export/edicaoetratamento.tar.gz
Binary file not shown.
Binary file removed courses_export/html5.tar.gz
Binary file not shown.
Binary file removed courses_export/introbd.tar.gz
Binary file not shown.
Binary file removed courses_export/introducao-a-criacao-de-sites.tar.gz
Binary file not shown.
Binary file removed courses_export/introphp.tar.gz
Binary file not shown.
Binary file not shown.
Binary file removed courses_export/logicadeprogramacao.tar.gz
Binary file not shown.
Binary file removed courses_export/producaodetextos.tar.gz
Binary file not shown.
Binary file removed courses_export/programacaojava.tar.gz
Binary file not shown.
Binary file removed courses_export/publicacaodigital.tar.gz
Binary file not shown.
15 changes: 0 additions & 15 deletions courses_export/readme.md

This file was deleted.

Binary file removed courses_export/timfazciencia.tar.gz
Binary file not shown.
Binary file removed courses_export/videos-educacionais-para-web.tar.gz
Binary file not shown.
80 changes: 0 additions & 80 deletions docker/entrypoint.py

This file was deleted.

File renamed without changes.
Loading

0 comments on commit a5d27c0

Please # to comment.