mirror of
https://gitlab.com/CodeSolutionsProject/CodeShare.git
synced 2026-03-03 00:56:41 +01:00
Initial commit
This commit is contained in:
18
Source/assets/html/TOS.twig
Normal file
18
Source/assets/html/TOS.twig
Normal file
@@ -0,0 +1,18 @@
|
||||
{% extends "base.twig" %}
|
||||
{% block content %}
|
||||
<div class="container justified" style="font-size: 12pt">
|
||||
<h4 style="text-align: center">Terms of service</h4>
|
||||
<h4 class="docheader top10">Definitions</h4>
|
||||
<ul><li><p>Solution: Any code snippet and its enclosed information</p></li></ul>
|
||||
<h4 class="docheader top10">Privacy</h4>
|
||||
<p>All personal data bring to JKA Network in registration form are save under Spanish's law of data protection (LO 15/1999).
|
||||
You can claim your right through JKA Network email <a href="mailto:contacto@jkanetwork.com">contacto@jkanetwork.com</a> </p>
|
||||
<h4 class="docheader top10">About content upload to CodeShare</h4>
|
||||
<p>All content which the user upload to CodeShare except his email, password or comments are ceded with their all rights to JKA Network and immediately JKA Network will prescind from with their rights on these putting them under the public domain<br>
|
||||
Only JKA Network can remove comment or solutions hosted in CodeShare</p>
|
||||
<h4 class="docheader top10">About user's account</h4>
|
||||
<p>The registered user in all moment can close their account but all data hosted in CodeShare will remain hosted.
|
||||
<br>JKA Network is reserved the right to ban the access to account of any user who engage <a href="index.php?page=doc#vandalism">vandalism</a></p>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
17
Source/assets/html/about.twig
Normal file
17
Source/assets/html/about.twig
Normal file
@@ -0,0 +1,17 @@
|
||||
{% extends "base.twig" %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row" style="text-align: center">
|
||||
<h4>About CodeShare</h4>
|
||||
<div class="col-lg-12">
|
||||
<h5>Developers</h5>
|
||||
<p>Developed by JKA Network's Team</p>
|
||||
<h5>Open source licenses</h5>
|
||||
<p><a href="http://getbootstrap.com/"><strong>Bootstrap 3</strong> by Twitter - Licensed under MIT</a></p>
|
||||
<p><a href="https://bootswatch.com/"><strong>Paper theme to Boostrap 3</strong> by Bootswatch - Licensed under MIT</a></p>
|
||||
<p><a href="https://jquery.com/"><strong>jQuery 3.2.1</strong> by jQuery - Licensed under custom license</a></p>
|
||||
<p><a href="https://highlightjs.org/"><strong>Highlight.js</strong> by Ivan Sagalev Licensed under BSD</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
76
Source/assets/html/add.twig
Normal file
76
Source/assets/html/add.twig
Normal file
@@ -0,0 +1,76 @@
|
||||
{% extends "base.twig" %}
|
||||
{% block content %}
|
||||
<form class="form-horizontal" method="post">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-12" for="name">Solution's name:</label>
|
||||
<div class="col-sm-12">
|
||||
<input type="text" class="form-control" required="required" name="name" placeholder="Enter solution's name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-12" for="description">Description</label>
|
||||
<div class="col-sm-12">
|
||||
<input type="text" class="form-control" required="required" name="description" placeholder="Add a description">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-12" for="lang">Language:</label>
|
||||
<div class="col-sm-12">
|
||||
<select id="lang" name="lang" required="required" class="form-control">
|
||||
<option value=""></option>
|
||||
{% for key,value in supported %}
|
||||
<option value="{{ key }}">{{ value }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-6" for="lang">Name of external library, if needed:</label>
|
||||
<label class="control-label col-sm-6" for="lang">It needs a specific version of this library?:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="extlib" placeholder="Name of library"/>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="extlibver" placeholder="Version used, only if needed"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-6" for="input">Input example:</label>
|
||||
<label class="control-label col-sm-6" for="output">Output example:</label>
|
||||
<div class="col-sm-6">
|
||||
<textarea class="form-control" required="required" name="input" placeholder="Input example" rows="4"></textarea>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<textarea class="form-control" required="required" name="output" placeholder="Output example" rows="4"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-12" for="code">Code:</label>
|
||||
<div class="col-sm-12">
|
||||
<textarea class="form-control" required="required" name="code" placeholder="Paste here your code" rows="15"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12 col-sm-12">
|
||||
<button type="submit" class="btn btn-success btn-block">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
{% block css %}
|
||||
<style>
|
||||
.control-label {
|
||||
text-align: left !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
textarea {
|
||||
line-height: 20px;
|
||||
font-family: monospace;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
33
Source/assets/html/base.twig
Normal file
33
Source/assets/html/base.twig
Normal file
@@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{{ page.title }}</title>
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="{{ path.css }}/bootstrap-paper.css"/>
|
||||
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
|
||||
<link type="text/css" rel="stylesheet" href="{{ path.css }}/main.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="{{ path.css }}/codeStyles/vs.css"/>
|
||||
{#<link rel="shortcut icon" href="{{ path.img }}favicon.ico" type="image/x-icon"/>#}
|
||||
{% block css %}{% endblock %}
|
||||
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="description" content="{{ page.description }}"/>
|
||||
<script src="{{ path.js }}/highlight.pack.js"></script>
|
||||
<script src="{{ path.js }}/functions.js"></script>
|
||||
<script src="{{ path.js }}/jquery-3.2.1.min.js"></script>
|
||||
<script src="{{ path.js }}/bootstrap.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
{% include 'nav.twig' %}
|
||||
{% include 'header.twig' %}
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
{% include "footer.twig" %}
|
||||
|
||||
{% block js %}
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
</body>
|
||||
222
Source/assets/html/code.twig
Normal file
222
Source/assets/html/code.twig
Normal file
@@ -0,0 +1,222 @@
|
||||
{% extends "base.twig" %}
|
||||
{% block content %}
|
||||
<div id="ajaxPut">
|
||||
<div class="codebox">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
{% include "codebox.twig" %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
|
||||
<h3>Input example</h3>
|
||||
<pre class="IOExample">{{ code.input }}</pre>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
|
||||
<h3>Output example</h3>
|
||||
<pre class="IOExample">{{ code.output }}</pre>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3"></div>
|
||||
{% if user.nick is defined and user.IDU == code.idu %}
|
||||
<button class="btn btn-primary btn-lg col-md-6" style="margin: 10px 0;" data-toggle="modal" data-target="#modify">Edit</button>
|
||||
{% endif %}
|
||||
<div class="col-md-3"></div>
|
||||
</div>
|
||||
{% if user.ROLE == 3 %}
|
||||
<a href="?page=del&id={{ code.idc }}&lang={{ code.lang }}&version={{ code.version }}" class="btn btn-danger">Delete source</a>
|
||||
{% endif %}
|
||||
{% if page.otherV %}
|
||||
<div style='text-align: center; font-size: 22px; '><a href='?page=code&id={{ code.idc }}&lang={{ code.lang }}'>View version's history</a></div>
|
||||
{% endif %}
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="text-align:center;"><h3>Other implementations</h3>
|
||||
</div>
|
||||
{% if page.otherI %}
|
||||
{% for i in otherImplementation %}
|
||||
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12" style='text-align: center;'>
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
<a href="?page=code&id={{ code.idc }}&lang={{ i.lang }}&version={{ i.version }}">Link</a>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Lang: </strong>{{ i.lLang }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<pre><code class='{{ i.lang }}'>{{ i.code }}</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if user.nick is defined %}
|
||||
<div class="col-lg-4 col-md-4 col-sm-12 col-s-12" style="text-align: center;">
|
||||
<button type="button" class="btn btn-default btn-lg btn-block btn-primary" data-toggle="modal"
|
||||
data-target="#otherImplementation" style="margin: 35% 0;">Add other implementation
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if user.nick is defined %}
|
||||
<div id="otherImplementation" class="modal fade" role="dialog" aria-labelledby="otherImplementation"
|
||||
aria-hidden="true">
|
||||
<div class="vertical-alignment-helper">
|
||||
<div class="modal-dialog vertical-align-center">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5>Contribute with other implementation</h5>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form method="post">
|
||||
<div class="col_full">
|
||||
<label for="lang">Language:</label>
|
||||
<select id="lang" name="lang" required="required" class="form-control">
|
||||
<option value=""></option>
|
||||
{% for key,value in supported %}
|
||||
{% if key not in page.existedLangs %}
|
||||
<option value="{{ key }}"> {{ value }} </option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col_full">
|
||||
<label for="code">Code:</label>
|
||||
<textarea style="width: 100%" rows="{{ code.rows }}" required="required" name="code" id="code"></textarea>
|
||||
</div>
|
||||
<div class="col_full">
|
||||
<button class="btn btn-default btn-lg btn-block btn-success" type="submit">Submit
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if user.nick is defined and user.IDU == code.idu%}
|
||||
<div id="modify" class="modal fade" role="dialog" aria-labelledby="modify"
|
||||
aria-hidden="true">
|
||||
<div class="vertical-alignment-helper">
|
||||
<div class="modal-dialog vertical-align-center">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5>Modify your share</h5>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form method="post">
|
||||
{% if page.original == user.IDU %}
|
||||
<div class="col_full">
|
||||
<label for="name">Name:</label>
|
||||
<input type="text" name="name" value="{{ code.name }}" id="name" required="required">
|
||||
</div>
|
||||
<div class="col_full">
|
||||
<label for="description">Description:</label>
|
||||
<input type="text" name="description" value="{{ code.description }}" id="description" required="required">
|
||||
</div>
|
||||
<div class="col_full">
|
||||
<label for="input">Input:</label>
|
||||
<textarea style="width: 100%" required="required" id="input" name="input">{{ code.input }}</textarea>
|
||||
</div>
|
||||
<div class="col_full">
|
||||
<label for="output">Output:</label>
|
||||
<textarea style="width: 100%" required="required" id="output" name="output">{{ code.output }}</textarea>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="col_full" id="lib">
|
||||
<label for="extlib">External Library</label>
|
||||
<input type="text" name="extlib" id="extlib" {% if code.extlib is not null %}value="{{ code.extlib }}"{% endif %} placeholder="Name of library">
|
||||
</div>
|
||||
<div class="col_full" id="libVer">
|
||||
<label for="extlibver">Library version</label>
|
||||
<input type="text" name="extlibver" id="extlibver" {% if code.extlib is not null %}value="{{ code.extlibver }}" required="required"{% endif %} placeholder="Library version">
|
||||
</div>
|
||||
<div class="col_full">
|
||||
<label for="code">Code:</label>
|
||||
<textarea style="width: 100%" rows="{{ code.rows }}" required="required" name="code" id="code">{{ code.code }}</textarea>
|
||||
</div>
|
||||
<div class="col_full">
|
||||
<button class="btn btn-default btn-lg btn-block btn-success" type="submit">Submit
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<script>
|
||||
function verRequired() {
|
||||
extlibver=document.getElementById("extlibver");
|
||||
if(extlib.value=="")
|
||||
extlibver.removeAttribute("required");
|
||||
else
|
||||
extlibver.setAttribute("required","required");
|
||||
}
|
||||
var extlib = document.getElementById("extlib");
|
||||
extlib.onkeyup=verRequired;
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
<style>
|
||||
textarea {
|
||||
line-height: 20px;
|
||||
font-family: monospace;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
label{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.col_full {
|
||||
clear: both;
|
||||
float: none;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.vertical-alignment-helper {
|
||||
display: table;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
pointer-events: none;
|
||||
|
||||
}
|
||||
|
||||
.vertical-align-center {
|
||||
/* To center vertically */
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
/* Bootstrap sets the size of the modal in the modal-dialog class, we need to inherit it */
|
||||
width: inherit;
|
||||
height: inherit;
|
||||
/* To center horizontally */
|
||||
margin: 0 auto;
|
||||
pointer-events: all;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
35
Source/assets/html/codebox.twig
Normal file
35
Source/assets/html/codebox.twig
Normal file
@@ -0,0 +1,35 @@
|
||||
<table style="width: 100%; text-align:center">
|
||||
<tr>
|
||||
<th>
|
||||
<a href="?page=code&id={{ code.idc }}&lang={{ code.lang }}&version={{ code.version }}">{{ code.name }}</a>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Author:</strong> {{ code.nick }} <strong> Version: </strong>{{ code.version }} <strong>
|
||||
Lang: </strong>{{ code.lLang }}</td>
|
||||
</tr>
|
||||
{% if code.extlib is not null %}
|
||||
<tr>
|
||||
<td>
|
||||
<strong>External library:</strong> {{ code.extlib }}
|
||||
{% if code.extlibver is not null %}
|
||||
<strong> Version used: </strong>{{ code.extlibver }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<th colspan="6">Description</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">{{ code.description }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="6">Code</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<pre><code class='{{ code.lang }} codeto'>{{ code.code }}</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
45
Source/assets/html/doc.twig
Normal file
45
Source/assets/html/doc.twig
Normal file
@@ -0,0 +1,45 @@
|
||||
{% extends "base.twig" %}
|
||||
{% block content %}
|
||||
<div class="container justified" style="font-size: 12pt;">
|
||||
<h4 style="text-align: center">Documentation</h4>
|
||||
<h4 class="docheader top10" id="what">What is CodeShare?</h4>
|
||||
<p><strong>CodeShare</strong> is a platform where everybody can share implementations of common problems of computer programming. Developed by <strong>JKA Network</strong>, a Spanish's association that promotes the free culture.</p>
|
||||
<h4 class="docheader top10" id="who">Who can use CodeShare?</h4>
|
||||
<p><strong>Everybody can copy and distribute any code posted in this platform</strong>, and sign up and share their own solutions or post new implementations of solutions already hosted. As a warning, if someone engage vandalism (see <a href="#vandalism">vandalism in CodeShare</a>) they will be banned from publishing or editing any code, and in serious cases, ban their account permanentely. However, they will not be restricted form services of unregistered users.</p>
|
||||
<h4 class="docheader top10" id="how">How can I submit my own solution?</h4>
|
||||
<ol>
|
||||
<li><p>First, you need to <strong>sign up</strong> in CodeShare <a href="?page=register">(link)</a>, and then go to <a href="?page=add">submit page</a> to start.</p>
|
||||
<img src="{{ path.img }}/doc/submit.png" alt="submit"/></li>
|
||||
<li><p>Write the <strong>solution's name and description.</strong> 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.</p>
|
||||
<img src="{{ path.img }}/doc/name_des.png"/></li>
|
||||
<li><p>Now select <strong>language</strong> to help other users to find it easily.</p></li>
|
||||
<li><p>If your solution use a <strong>external library</strong> you can add its name and its version in their own input boxes.</p></li>
|
||||
<li><p>After that, introduce the <strong>Input</strong> and <strong>Output</strong> examples with the following criteria:</p></li>
|
||||
<ul>
|
||||
<li>If you have a method with parameters and a returned value like
|
||||
<pre><code class="python codeto">def sum(varA,varB):
|
||||
return varA+varB</code></pre>
|
||||
<strong><strong>Input</strong></strong> might be: "1 2" and <strong><strong>Output</strong></strong>: "3"</li>
|
||||
<li>Else if you have a global variable or constant is preferable that you specify the name.
|
||||
<pre><code class="java codeto">public static double circleArea(double radius){
|
||||
return radius*radius*PI;
|
||||
}</code></pre><strong>Input</strong> have to be: "radius: 4.0, PI: 3.1416"</li>
|
||||
<li>Else if the method modify an object (and not return anything) you might to <strong>input</strong> the different states, for example in sort algorithm it would be like this<br>
|
||||
<strong>Input</strong>: "(5 4 8 3 1 4 7 2 3)", <strong>Output</strong>: "(1 2 3 3 4 4 5 7 8)"</li>
|
||||
<li>Else if the <strong>input</strong> is by a <strong>peripheral</strong> use the same notation that 2nd case</li>
|
||||
<li>Else if the <strong>output</strong> is in a <strong>peripheral</strong> use the next notation<br><strong>Output</strong>: "<peripheral>: what the periphery will do"</li>
|
||||
<li>Else <strong>input</strong> or <strong>output</strong> are void type "None, void or null" in <strong>input</strong> or <strong>output</strong> boxes</li>
|
||||
</ul>
|
||||
<li><p>Now paste your <strong>code</strong></p></li>
|
||||
<li><p>Finally push the submit button and automatically you will be redirect to your new code page.</p></li>
|
||||
</ol>
|
||||
<h4 class="docheader top10" id="vandalism">What behaviors are considered vandalism in CodeShare?</h4>
|
||||
<ul>
|
||||
<li>Create other implementation wrongly intentionally, and/or to make hurt.</li>
|
||||
<li>Submit a useless solution (For ex: "How to sum two variables").</li>
|
||||
<li>Include personal or other people data in solution's name, description, input, output or in comments.</li>
|
||||
<li>Make spam.</li>
|
||||
<li>Replace the identity of another.</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
||||
7
Source/assets/html/error.twig
Normal file
7
Source/assets/html/error.twig
Normal file
@@ -0,0 +1,7 @@
|
||||
{% extends "base.twig" %}
|
||||
{% block content %}
|
||||
<div class='center'>
|
||||
<h1>{{ error.number }} - {{ error.text }}
|
||||
</h1>
|
||||
</div>;
|
||||
{% endblock %}
|
||||
16
Source/assets/html/filter.twig
Normal file
16
Source/assets/html/filter.twig
Normal file
@@ -0,0 +1,16 @@
|
||||
<div style="text-align: center; margin-top:10px; "><button class="btn btn-default" onclick="mostrar('filterBlock')">Filters</button></div>
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" id="filterBlock" style="display: none;">
|
||||
|
||||
{% for key,value in page.supported %}
|
||||
<div class='codeFilterCheckBox'><input type='checkbox' class='codeFilterCheckBoxInput' checked='true' value='{{ key }}' onclick="getAjax()"> {{ value }}</div>
|
||||
{% endfor %}
|
||||
<div class='codeFilterCheckBox'><button type='button' class='codeFilterCheckBoxInput btn btn-default btn-sm' onclick="unselectAll()">Unselect all</button></div>
|
||||
|
||||
<div class="container"></div>
|
||||
<div class="row">
|
||||
<div class="codeFilterSearch col-md-11">
|
||||
<input type="text" class="codeFilterSearchInput" id="search" name="search" placeholder="Code's name or description" onkeyup="getAjax()">
|
||||
</div>
|
||||
{#<div class="codeFilterButton col-md-4"><button class="btn btn-default" onclick="getAjax()">Filter</button></div>#}
|
||||
</div>
|
||||
</div>
|
||||
15
Source/assets/html/firstCodes.twig
Normal file
15
Source/assets/html/firstCodes.twig
Normal file
@@ -0,0 +1,15 @@
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
{% for code in page.last %}
|
||||
{% if loop.index0 is divisible by(2) %}
|
||||
</div>
|
||||
<div class="row">
|
||||
{% endif %}
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
|
||||
<div class="codebox">
|
||||
{% include "codebox.twig" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
8
Source/assets/html/firstpage.twig
Normal file
8
Source/assets/html/firstpage.twig
Normal file
@@ -0,0 +1,8 @@
|
||||
{% extends "base.twig" %}
|
||||
{% block content %}
|
||||
<h5 style="text-align:center">Last codes</h5>
|
||||
{% include "filter.twig" %}
|
||||
<div id="ajaxPut">
|
||||
{% include "firstCodes.twig" %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
17
Source/assets/html/footer.twig
Normal file
17
Source/assets/html/footer.twig
Normal file
@@ -0,0 +1,17 @@
|
||||
<footer>
|
||||
<p><span class="copyleft">©</span> JKA Network 2017</p>
|
||||
<p xmlns:dct="http://purl.org/dc/terms/" xmlns:vcard="http://www.w3.org/2001/vcard-rdf/3.0#">
|
||||
<a rel="license"
|
||||
href="http://creativecommons.org/publicdomain/zero/1.0/">
|
||||
<img src="http://i.creativecommons.org/p/zero/1.0/88x31.png" style="border-style: none;" alt="CC0" />
|
||||
</a>
|
||||
<br />
|
||||
<span resource="[_:publisher]" rel="dct:publisher">
|
||||
<span property="dct:title">JKA Network</span></span>
|
||||
makes all the content hosted in CodeShare, included uploaded content, go to the public domain as far as the law allows it.
|
||||
<br>
|
||||
This work is published from:
|
||||
<span property="vcard:Country" datatype="dct:ISO3166"
|
||||
content="ES" about="[_:publisher]">Spain</span>.
|
||||
</p>
|
||||
</footer>
|
||||
4
Source/assets/html/header.twig
Normal file
4
Source/assets/html/header.twig
Normal file
@@ -0,0 +1,4 @@
|
||||
<header>
|
||||
<h2><a href="index.php" style="color: #333">CodeShare<sup>Beta</sup></a></h2>
|
||||
<h4>Simple solutions for common problems</h4>
|
||||
</header>
|
||||
126
Source/assets/html/loginregister.twig
Normal file
126
Source/assets/html/loginregister.twig
Normal file
@@ -0,0 +1,126 @@
|
||||
{% extends "base.twig" %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="col-sm-12">
|
||||
{% if page.state == 1 %}
|
||||
<p class="text-danger">Bad credentials</p>
|
||||
{% elseif page.state == 2 %}
|
||||
<p class="text-danger">Email already exits</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div id="login">
|
||||
<form class="form-horizontal" method="post">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="email">Email:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="email" class="form-control" required="required" name="email" placeholder="Enter email">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="pwd">Password:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="password" class="form-control" required="required" name="pwd" placeholder="Enter password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="submit" class="btn btn-success">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-offset-1 col-sm-12">
|
||||
<button onclick="nowRegister()" id="registerbtn" class="btn btn-primary">Don't have an account yet? Sing up</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div id="register" style="display:none;">
|
||||
<form class="form-horizontal" method="post">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="emailre">Email:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="email" class="form-control" required="required" name="emailre" id="emailre" placeholder="Enter email">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="emailre-re">Repeat email:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="email" class="form-control" required="required" name="emailre-re" id="emailre-re" placeholder="Repeat email">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="pwdre">Password:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="password" class="form-control" required="required" name="pwdre" id="pwdre" placeholder="Enter password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="pwdre-re">Repeat password:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="password" class="form-control" required="required" name="pwdre-re" id="pwdre-re" placeholder="Repeat password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="name">Nickname:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" required="required" name="name" id="pwdre-re" placeholder="Enter your nickname for public identification">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-3" for="tos">You agree to our <a href="?page=tos">Terms of service</a></label>
|
||||
<div class="col-sm-9">
|
||||
<input type="checkbox" required="required" name="tos" id="tos">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="submit" class="btn btn-success">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-offset-1 col-sm-12">
|
||||
<button onclick="nowLogin()" id="loginbtn" class="btn btn-primary">Already have an account? Sign in</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<script>
|
||||
|
||||
function checkPassword() {
|
||||
if ($('#pwdre').val() != $("#pwdre-re").val()) {
|
||||
$("#pwdre-re")[0].setCustomValidity('Password do not match');
|
||||
} else {
|
||||
$("#pwdre-re")[0].setCustomValidity('');
|
||||
}
|
||||
//console.log($('#pwdre').val());
|
||||
}
|
||||
|
||||
function checkEmail() {
|
||||
if ($('#emailre').val() != $("#emailre-re").val()) {
|
||||
$("#emailre-re")[0].setCustomValidity('Email do not match');
|
||||
} else {
|
||||
$("#emailre-re")[0].setCustomValidity('');
|
||||
}
|
||||
}
|
||||
|
||||
function nowRegister() {
|
||||
$("#login").css("display", "none");
|
||||
$("#register").css("display", "");
|
||||
}
|
||||
function nowLogin() {
|
||||
$("#register").css("display", "none");
|
||||
$("#login").css("display", "");
|
||||
}
|
||||
|
||||
document.getElementById("pwdre").onchange = checkPassword;
|
||||
document.getElementById("pwdre-re").onchange = checkPassword;
|
||||
document.getElementById("emailre").onchange = checkEmail;
|
||||
document.getElementById("emailre-re").onchange = checkEmail;
|
||||
|
||||
{% if page.page == "register" or page.state == 2 %}
|
||||
nowRegister();
|
||||
{% endif %}
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
53
Source/assets/html/nav.twig
Normal file
53
Source/assets/html/nav.twig
Normal file
@@ -0,0 +1,53 @@
|
||||
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#nav" style="color:white">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse" id="nav" aria-expanded="false" style="height: 1px">
|
||||
<ul class="nav navbar-nav navbar-left">
|
||||
<li {% if page.page == "home" %}class="active"{% endif %}>
|
||||
<a href="index.php">Home</a>
|
||||
</li>
|
||||
<li {% if page.page == "add" %}class="active"{% endif %}>
|
||||
<a href="?page=add">Submit code</a>
|
||||
</li>
|
||||
<li {% if page.page == "doc" %}class="active"{% endif %}>
|
||||
<a href="?page=doc">Documentation</a>
|
||||
</li>
|
||||
<li {% if page.page == "about" %}class="active"{% endif %}>
|
||||
<a href="?page=about">About</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<form class="nav navbar-nav navbar-form navbar-left" method="post">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="search" placeholder="Search">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-sm">Submit</button>
|
||||
</form>
|
||||
</li>
|
||||
{% if user.nick is defined %}
|
||||
<li {% if page.page == "user" %}class="active"{% endif %}>
|
||||
<a href="?page=user">{{ user.nick }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?page=logout">Log out</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li {% if page.page == "login" %}class="active"{% endif %}>
|
||||
<a href="?page=login">Log in</a>
|
||||
</li>
|
||||
<li {% if page.page == "register" %}class="active"{% endif %}>
|
||||
<a href="?page=register">Register</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
4
Source/assets/html/otherVersion.twig
Normal file
4
Source/assets/html/otherVersion.twig
Normal file
@@ -0,0 +1,4 @@
|
||||
{% extends "base.twig" %}
|
||||
{% block content %}
|
||||
{% include "firstCodes.twig" %}
|
||||
{% endblock %}
|
||||
65
Source/assets/html/user.twig
Normal file
65
Source/assets/html/user.twig
Normal file
@@ -0,0 +1,65 @@
|
||||
{% extends "base.twig" %}
|
||||
{% block content %}
|
||||
<h4 style="text-align: center" xmlns="http://www.w3.org/1999/html">{{ user.nick }}</h4>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<p class="col-md-1"><strong>Nickname</strong></p>
|
||||
<p class="col-md-11">{{ user.nick }}</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<p class="col-md-1"><strong>Email</strong></p>
|
||||
<p class="col-md-11">{{ user.email }}</p>
|
||||
</div>
|
||||
<hr/>
|
||||
</div>
|
||||
<div class="container">
|
||||
{% if page.status == 1 %}
|
||||
<p class="text-success">Password updated successfully</p>
|
||||
{% elseif page.status == 2 %}
|
||||
<p class="text-danger">Old password incorrect</p>
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
<h5 class="col-sm-offset-1">Change password</h5>
|
||||
</div>
|
||||
<div class="row">
|
||||
<form class="form-horizontal" method="post">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="passact">Current password:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="password" class="form-control" required="required" name="passact" id="passact" placeholder="Current password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="newpass">New password:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="password" class="form-control" required="required" name="newpass" id="newpass" onchange="onPasswordChange()" placeholder="New password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="newpass-re">Repeat new password:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="password" class="form-control" required="required" name="newpass-re" id="newpass-re" onchange="onPasswordChange()" placeholder="Repear new password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="submit" class="btn btn-success">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<script>
|
||||
function onPasswordChange() {
|
||||
if($("#newpass-re").val()!=$("#newpass").val()){
|
||||
$("#newpass-re")[0].setCustomValidity('Passwords do not match');
|
||||
}else{
|
||||
$("#newpass-re")[0].setCustomValidity('');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user