From 54b7c70adce3370876a88457a7b0983a5df0cd42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Garrido=20Labrador?= Date: Fri, 21 Sep 2018 13:18:46 +0200 Subject: [PATCH] Migrating to Silex --- Source/assets/html/about.twig | 2 +- Source/assets/html/add.twig | 4 +- Source/assets/html/base.twig | 22 +- Source/assets/html/baseOld.twig | 56 ++ Source/assets/html/code.twig | 12 +- Source/assets/html/codebox.twig | 4 +- Source/assets/html/doc.twig | 6 +- Source/assets/html/firstCodes.twig | 2 +- Source/assets/html/firstpage.twig | 6 +- Source/assets/html/loginregister.twig | 3 +- Source/assets/html/nav.twig | 6 +- Source/composer.json | 5 +- Source/composer.lock | 711 +++++++++++++++- Source/config/packages/dev/routing.yaml | 3 + Source/config/packages/routing.yaml | 3 + Source/config/packages/test/routing.yaml | 3 + Source/config/routes.yaml | 3 + Source/index.php | 10 +- Source/src/Config.php | 2 +- Source/src/DB.php | 9 +- Source/src/app.php | 415 ++-------- Source/src/appOld.php | 382 +++++++++ Source/src/dbToTable.php | 6 +- Source/src/functions.php | 2 +- Source/src/users.php | 10 + composer.json | 8 + composer.lock | 990 +++++++++++++++++++++++ 27 files changed, 2295 insertions(+), 390 deletions(-) create mode 100644 Source/assets/html/baseOld.twig create mode 100644 Source/config/packages/dev/routing.yaml create mode 100644 Source/config/packages/routing.yaml create mode 100644 Source/config/packages/test/routing.yaml create mode 100644 Source/config/routes.yaml create mode 100644 Source/src/appOld.php create mode 100644 composer.json create mode 100644 composer.lock diff --git a/Source/assets/html/about.twig b/Source/assets/html/about.twig index 1ddc237..616849d 100644 --- a/Source/assets/html/about.twig +++ b/Source/assets/html/about.twig @@ -1,4 +1,4 @@ -{% extends "base.twig" %} +{% extends app.fronthtml~"/base.twig" %} {% block content %}
diff --git a/Source/assets/html/add.twig b/Source/assets/html/add.twig index 072d911..e15b55e 100644 --- a/Source/assets/html/add.twig +++ b/Source/assets/html/add.twig @@ -52,9 +52,7 @@
- +
diff --git a/Source/assets/html/base.twig b/Source/assets/html/base.twig index 4b9da97..cc46707 100644 --- a/Source/assets/html/base.twig +++ b/Source/assets/html/base.twig @@ -2,35 +2,35 @@ {{ page.title }} - + - - + + + {##} {% block css %}{% endblock %} - - - + + + - + -{% include 'nav.twig' %} -{% include 'header.twig' %} +{% include app.fronthtml~'/nav.twig' %} +{% include app.fronthtml~'/header.twig' %} {% block content %}{% endblock %} -{% include "footer.twig" %} +{% include app.fronthtml~"/footer.twig" %} {% block js %} {% endblock %} - + + + + + + +{% include 'nav.twig' %} +{% include 'header.twig' %} + +{% block content %}{% endblock %} + +{% include "footer.twig" %} + +{% block js %} + +{% endblock %} + + + + + diff --git a/Source/assets/html/code.twig b/Source/assets/html/code.twig index 0b3a49f..dea9019 100644 --- a/Source/assets/html/code.twig +++ b/Source/assets/html/code.twig @@ -1,9 +1,9 @@ -{% extends "base.twig" %} +{% extends app.fronthtml~"/base.twig" %} {% block content %}
- {% include "codebox.twig" %} + {% include app.fronthtml~"/codebox.twig" %}
@@ -81,6 +81,14 @@ {% endfor %}
+
+ + +
+
+ + +
diff --git a/Source/assets/html/codebox.twig b/Source/assets/html/codebox.twig index b6efe7f..e630569 100644 --- a/Source/assets/html/codebox.twig +++ b/Source/assets/html/codebox.twig @@ -1,14 +1,14 @@ - {% if code.extlib is not null %} + {% if code.extlib is defined %}
- {{ code.name }} + {{ code.name }}
Author: {{ code.nick }} Version: {{ code.version }} Lang: {{ code.lLang }}
External library: {{ code.extlib }} diff --git a/Source/assets/html/doc.twig b/Source/assets/html/doc.twig index 0b7ef73..d40a223 100644 --- a/Source/assets/html/doc.twig +++ b/Source/assets/html/doc.twig @@ -1,4 +1,4 @@ -{% extends "base.twig" %} +{% extends app.fronthtml~"/base.twig" %} {% block content %}

Documentation

@@ -9,9 +9,9 @@

How can I submit my own solution?

  1. First, you need to sign up in CodeShare (link), and then go to submit page to start.

    - submit
  2. + submit
  3. Write the solution's name and description. Notice that in this input boxes you shouldn't type any reference of language they can be uploaded in multiple languages in the future, and there are a box for language.

    -
  4. +
  5. Now select language to help other users to find it easily.

  6. If your solution use a external library you can add its name and its version in their own input boxes.

  7. After that, introduce the Input and Output examples with the following criteria:

  8. diff --git a/Source/assets/html/firstCodes.twig b/Source/assets/html/firstCodes.twig index c9a3138..759ba73 100644 --- a/Source/assets/html/firstCodes.twig +++ b/Source/assets/html/firstCodes.twig @@ -7,7 +7,7 @@ {% endif %}
    - {% include "codebox.twig" %} + {% include app.fronthtml~"/codebox.twig" %}
    {% endfor %} diff --git a/Source/assets/html/firstpage.twig b/Source/assets/html/firstpage.twig index d919ce7..b236bdd 100644 --- a/Source/assets/html/firstpage.twig +++ b/Source/assets/html/firstpage.twig @@ -1,8 +1,8 @@ -{% extends "base.twig" %} +{% extends app.fronthtml~"/base.twig" %} {% block content %}
    Last codes
    -{% include "filter.twig" %} +{% include app.fronthtml~"/filter.twig" %}
    - {% include "firstCodes.twig" %} + {% include app.fronthtml~"/firstCodes.twig" %}
    {% endblock %} \ No newline at end of file diff --git a/Source/assets/html/loginregister.twig b/Source/assets/html/loginregister.twig index 5f10607..fa9bf0f 100644 --- a/Source/assets/html/loginregister.twig +++ b/Source/assets/html/loginregister.twig @@ -32,7 +32,8 @@
- +
diff --git a/Source/assets/html/nav.twig b/Source/assets/html/nav.twig index e23a328..5cbef69 100644 --- a/Source/assets/html/nav.twig +++ b/Source/assets/html/nav.twig @@ -11,16 +11,16 @@