diff --git a/citoplasma/generate_admin_class.py b/citoplasma/generate_admin_class.py
index 53d4e54..85fa0aa 100644
--- a/citoplasma/generate_admin_class.py
+++ b/citoplasma/generate_admin_class.py
@@ -1,10 +1,10 @@
-from citoplasma.lists import SimpleList
+from paramecio.citoplasma.lists import SimpleList
from bottle import request, redirect
-from citoplasma.urls import add_get_parameters
-from citoplasma.templates import set_flash_message
-from cromosoma.formsutils import show_form
-from citoplasma.i18n import I18n
-from citoplasma.httputils import GetPostFiles
+from paramecio.citoplasma.urls import add_get_parameters
+from paramecio.citoplasma.mtemplates import set_flash_message
+from paramecio.cromosoma.formsutils import show_form
+from paramecio.citoplasma.i18n import I18n
+from paramecio.citoplasma.httputils import GetPostFiles
class GenerateAdminClass:
diff --git a/citoplasma/lists.py b/citoplasma/lists.py
index 21a6d68..e9aca85 100644
--- a/citoplasma/lists.py
+++ b/citoplasma/lists.py
@@ -1,9 +1,9 @@
#By default id is not showed
-from citoplasma.pages import Pages
-from citoplasma.urls import add_get_parameters
-from citoplasma.sessions import get_session
-from citoplasma.i18n import I18n
+from paramecio.citoplasma.pages import Pages
+from paramecio.citoplasma.urls import add_get_parameters
+from paramecio.citoplasma.sessions import get_session
+from paramecio.citoplasma.i18n import I18n
from bottle import request
import sys
diff --git a/citoplasma/mtemplates.py b/citoplasma/mtemplates.py
index 8b16022..2b041dd 100644
--- a/citoplasma/mtemplates.py
+++ b/citoplasma/mtemplates.py
@@ -46,6 +46,10 @@ class ptemplate:
self.add_filter(add_js_home)
+ self.add_filter(add_css_home_local)
+
+ self.add_filter(add_js_home_local)
+
self.add_filter(add_header_home)
#self.auto_reload=True
@@ -56,11 +60,15 @@ class ptemplate:
HeaderHTML.js=[]
HeaderHTML.header=[]
HeaderHTML.cache_header=[]
+ HeaderHTML.css_local={}
+ HeaderHTML.js_local={}
def clean_header_cache(self):
HeaderHTML.css=[]
HeaderHTML.js=[]
+ HeaderHTML.css_local={}
+ HeaderHTML.js_local={}
HeaderHTML.header=[]
HeaderHTML.cache_header=[]
@@ -80,8 +88,8 @@ class ptemplate:
#Standard templates
- standard_templates=path.dirname(__name__)+'/templates'
-
+ standard_templates=path.dirname(__file__)+'/templates'
+ #print(standard_templates)
return TemplateLookup(directories=[theme_templates, module_templates, standard_templates], default_filters=['h'], input_encoding='utf-8', encoding_errors='replace')
#return Environment(autoescape=self.guess_autoescape, auto_reload=True, loader=FileSystemLoader([theme_templates, module_templates]))
@@ -128,6 +136,10 @@ class HeaderHTML:
for js in HeaderHTML.js:
final_js.append('')
+ for module, arr_js in HeaderHTML.js_local.items():
+ for js in arr_js:
+ final_js.append('')
+
return "\n".join(final_js)
def css_home():
@@ -137,6 +149,12 @@ class HeaderHTML:
for css in HeaderHTML.css:
final_css.append('')
+ for module, arr_css in HeaderHTML.css_local.items():
+
+ for css in arr_css:
+
+ final_css.append('')
+
return "\n".join(final_css)
@@ -158,15 +176,35 @@ def add_css_home(css):
if not css in HeaderHTML.css:
HeaderHTML.css.append(css)
-
- return ""
-
+
+ return ''
+
def add_js_home(js):
if not js in HeaderHTML.js:
HeaderHTML.js.append(js)
+
+ return ''
+
+def add_css_home_local(css, module):
- return ""
+ if not css in HeaderHTML.css_local:
+
+ HeaderHTML.css_local[module]=HeaderHTML.css_local.get(module, [])
+
+ HeaderHTML.css_local[module].append(css)
+
+ return ''
+
+def add_js_home_local(js, module):
+
+ if not js in HeaderHTML.js_local:
+
+ HeaderHTML.js_local[module]=HeaderHTML.js_local.get(module, [])
+
+ HeaderHTML.js_local[module].append(js)
+
+ return ''
def set_flash_message(message):
diff --git a/citoplasma/pages.py b/citoplasma/pages.py
index 2e2794b..9411c9b 100644
--- a/citoplasma/pages.py
+++ b/citoplasma/pages.py
@@ -1,8 +1,8 @@
#!/usr/bin/python3
from math import ceil, floor
-from citoplasma.urls import add_get_parameters
-from citoplasma.i18n import I18n
+from paramecio.citoplasma.urls import add_get_parameters
+from paramecio.citoplasma.i18n import I18n
class Pages:
diff --git a/citoplasma/templates/admin/home.html b/citoplasma/templates/admin/home.html
index c53ff91..f74b14f 100644
--- a/citoplasma/templates/admin/home.html
+++ b/citoplasma/templates/admin/home.html
@@ -5,10 +5,10 @@
${title}
-${add_css_home('admin/admin.css')}
-${add_css_home('font-awesome.min.css')}
+${add_css_home_local('admin.css', 'admin')}
+${add_css_home_local('font-awesome.min.css', 'admin')}
${HeaderHTML.css_home()|n}
-${add_js_home('jquery.min.js')}
+${add_js_home_local('jquery.min.js', 'admin')}
${HeaderHTML.js_home()|n}
${HeaderHTML.header_home()|n}
diff --git a/citoplasma/templates/admin/login.phtml b/citoplasma/templates/admin/login.phtml
index 446455c..d27d2b2 100644
--- a/citoplasma/templates/admin/login.phtml
+++ b/citoplasma/templates/admin/login.phtml
@@ -4,9 +4,9 @@
<%block name="title">${lang('admin', 'login', 'Paramecio Login')}%block>
- ${add_js_home('jquery.min.js')}
- ${add_css_home('admin/login.css')}
- ${add_css_home('font-awesome.min.css')}
+ ${add_js_home_local('jquery.min.js', 'admin')}
+ ${add_css_home_local('login.css', 'admin')}
+ ${add_css_home_local('font-awesome.min.css', 'admin')}
${HeaderHTML.css_home()|n}
${HeaderHTML.js_home()|n}
<%block name="ajax">
diff --git a/cromosoma/.gitignore b/cromosoma/.gitignore
new file mode 100644
index 0000000..bdd28c8
--- /dev/null
+++ b/cromosoma/.gitignore
@@ -0,0 +1,4 @@
+*~
+*.pyc
+__pycache__
+
diff --git a/cromosoma/LICENSE b/cromosoma/LICENSE
new file mode 100644
index 0000000..d6a9326
--- /dev/null
+++ b/cromosoma/LICENSE
@@ -0,0 +1,340 @@
+GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ {description}
+ Copyright (C) {year} {fullname}
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ {signature of Ty Coon}, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
+
diff --git a/cromosoma/README.md b/cromosoma/README.md
new file mode 100644
index 0000000..7531f86
--- /dev/null
+++ b/cromosoma/README.md
@@ -0,0 +1 @@
+# A very simple ORM for Python 3
diff --git a/cromosoma/__init__.py b/cromosoma/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/cromosoma/corefields.py b/cromosoma/corefields.py
new file mode 100644
index 0000000..f54c638
--- /dev/null
+++ b/cromosoma/corefields.py
@@ -0,0 +1,100 @@
+from paramecio.cromosoma.webmodel import PhangoField
+from paramecio.cromosoma import coreforms
+from paramecio.citoplasma.i18n import I18n
+
+class IntegerField(PhangoField):
+
+ def __init__(self, name, size=11, required=False):
+ super(IntegerField, self).__init__(name, size, required)
+
+ def check(self, value):
+
+ self.error=None
+ self.txt_error=''
+
+ try:
+
+ value=str(int(value))
+
+ if value==0 and self.required==True:
+ self.txt_error="The value is zero"
+ self.error=True
+ except:
+
+ self.error=True
+
+ return value
+
+ def get_type_sql(self):
+
+ return 'INT('+str(self.size)+') NOT NULL DEFAULT "0"'
+
+class CharField(PhangoField):
+
+ pass
+
+class ForeignKeyField(IntegerField):
+
+ def __init__(self, name, related_table, size=11, required=False, identifier_field='id', named_field="id", select_fields=[]):
+
+ self.table_id=related_table.name_field_id
+
+ self.table_name=related_table.name
+
+ self.identifier_field=identifier_field
+
+ self.named_field=named_field
+
+ self.select_fields=select_fields
+
+ super(ForeignKeyField, self).__init__(name, size, required)
+
+ self.foreignkey=True
+
+class BooleanField(IntegerField):
+
+ def __init__(self, name, size=1):
+
+ required=False
+
+ self.yes=I18n.lang('common', 'yes', 'Yes')
+ self.no=I18n.lang('common', 'no', 'No')
+
+ super(IntegerField, self).__init__(name, size, required)
+
+ def check(self, value):
+
+ self.error=False
+ self.txt_error=''
+
+ try:
+
+ value=int(value)
+
+ if value<0 or value>1:
+ self.txt_error="Need 0 or 1 value"
+ self.error=True
+
+ except:
+
+ self.error=True
+ value=0
+
+ value=str(value)
+
+ return value
+
+ def get_type_sql(self):
+
+ return 'BOOLEAN NOT NULL DEFAULT "0"'
+
+ def show_formatted(self, value):
+
+ value=int(value)
+
+ if value==0:
+ value=self.yes_text
+ else:
+ value=self.no_text
+
+ return value
diff --git a/cromosoma/coreforms.py b/cromosoma/coreforms.py
new file mode 100644
index 0000000..9c64fab
--- /dev/null
+++ b/cromosoma/coreforms.py
@@ -0,0 +1,76 @@
+#!/usr/bin/python3
+
+from collections import OrderedDict
+
+#Forms para python3
+
+class BaseForm:
+
+ def __init__(self, name, value):
+
+ self.label=name
+ self.name=name
+ self.default_value=value
+ self.css=''
+ self.type='text'
+ self.field=None
+ self.required=False
+ self.txt_error=''
+
+ def form(self):
+
+ return ''
+
+ def show_formatted(self, value):
+
+ return value
+
+ #Method for escape value for html input. DON'T CHANGE IF YOU DON'T KNOWN WHAT ARE YOU DOING
+
+ def setform(self, value):
+
+ value=str(value)
+
+ return value.replace('"', '"')
+
+class TextForm(BaseForm):
+
+ def __init__(self, name, value):
+ super(TextForm, self).__init__(name, value)
+
+class PasswordForm(BaseForm):
+
+ def __init__(self, name, value):
+ super(PasswordForm, self).__init__(name, value)
+ self.type='password'
+
+ def setform(self, value):
+ return ""
+
+class HiddenForm(BaseForm):
+
+ def __init__(self, name, value):
+ super(HiddenForm, self).__init__(name, value)
+ self.type='hidden'
+
+
+class SelectForm(BaseForm):
+
+ def __init__(self, name, value):
+ super(SelectForm, self).__init__(name, value)
+ self.arr_select=OrderedDict()
+
+ def form(self):
+
+ the_form='\n'
+
+ return the_form
+
\ No newline at end of file
diff --git a/cromosoma/databases/mysql.py b/cromosoma/databases/mysql.py
new file mode 100644
index 0000000..714d7c3
--- /dev/null
+++ b/cromosoma/databases/mysql.py
@@ -0,0 +1,75 @@
+#!/usr/bin/python3
+
+import sys
+import pymysql.cursors
+
+class SqlClass:
+
+ error_connection=""
+ connection={}
+
+ def dummy_connect(self, connection, name_connection="default"):
+ pass
+
+ def connect_to_db(self, connection, name_connection="default"):
+
+ try:
+
+ self.connection[name_connection] = pymysql.connect(connection['host'],
+ user=connection['user'],
+ password=connection['password'],
+ db=connection['db'],
+ charset='utf8mb4',
+ cursorclass=pymysql.cursors.DictCursor)
+
+
+ except:
+ e = sys.exc_info()[0]
+ v = sys.exc_info()[1]
+
+ self.error_connection="Error in connection: %s %s" % (e, v)
+
+ #return False
+ raise NameError(self.error_connection)
+
+ #Make def query more simple if not debugging.
+
+ def query(self, sql_query, arguments=[], name_connection="default"):
+
+ #if fetch_type=="ASSOC":
+ #fetch_type=pymysql.cursors.DictCursor
+
+ with self.connection[name_connection].cursor(pymysql.cursors.DictCursor) as cursor:
+
+ try:
+
+ cursor.execute(sql_query, arguments)
+ self.connection[name_connection].commit()
+
+ return cursor
+
+ except:
+ e = sys.exc_info()[0]
+ v = sys.exc_info()[1]
+
+ if hasattr(cursor, '_last_executed'):
+ sql_query=cursor._last_executed
+
+ self.error_connection="Error in query ||"+sql_query+"||: %s %s" % (e, v)
+
+ #return False
+ raise NameError(self.error_connection)
+
+ #Fetcho row return dictionary if is defined in query.
+
+ #def fetch(self, cursor):
+
+ #return cursor.fetchone()
+
+ def close(self, name_connection="default"):
+
+ self.connection[name_connection].close()
+
+ pass
+
+
\ No newline at end of file
diff --git a/cromosoma/dbadmin.py b/cromosoma/dbadmin.py
new file mode 100644
index 0000000..82a8d0c
--- /dev/null
+++ b/cromosoma/dbadmin.py
@@ -0,0 +1,338 @@
+#!/usr/bin/python3
+
+import argparse
+import os,traceback
+import sys, inspect
+import shutil
+from datetime import date
+from pathlib import Path
+from colorama import init, Fore, Back, Style
+from importlib import import_module, reload
+from paramecio.cromosoma.webmodel import WebModel
+
+#from models import books
+
+def start():
+
+ parser = argparse.ArgumentParser(description='A tool for create tables in databases using models from Cromosoma')
+
+ parser.add_argument('--model', help='Model python path', required=True)
+
+ parser.add_argument('--config', help='The config file', required=False)
+
+ args = parser.parse_args()
+
+ init()
+
+ #Import config
+
+ config_file='config'
+
+ if args.config!=None:
+ config_file=args.config
+
+ try:
+
+ config=import_module('settings.'+config_file)
+
+ except:
+ e = sys.exc_info()[0]
+ v = sys.exc_info()[1]
+
+ print(Fore.WHITE+Back.RED+Style.BRIGHT+"Config file not found: %s %s" % (e, v))
+
+ exit(1)
+
+ #print(WebModel.connections)
+
+ try:
+
+ model=import_module(args.model)
+
+ for name, obj in inspect.getmembers(sys.modules[model.__name__]):
+ if inspect.isclass(obj):
+ if obj.__module__==args.model and hasattr(obj, 'webmodel'):
+
+ WebModel.model[name.lower()]=obj()
+
+
+ #WebModel.modelobj
+
+ except:
+ """
+ e = sys.exc_info()[0]
+ v = sys.exc_info()[1]
+
+ print(Fore.WHITE+Back.RED+Style.BRIGHT +"Error, file with model not found: %s %s" % (e, v))
+ """
+ print("Exception in user code:")
+ print("-"*60)
+ traceback.print_exc(file=sys.stdout)
+ print("-"*60)
+
+ exit(1)
+
+ #load the table of databases
+
+ cursor=WebModel.query(WebModel, "show tables")
+
+ table_exists=[]
+
+ for row in cursor:
+ table=list(row.values())[0]
+
+ if table in WebModel.model:
+ table_exists.append(table)
+
+ #If don't want order
+ #set([1,2,3,4]) - set([2,5])
+
+ tables=list(WebModel.model.keys())
+
+ #Array diff ordered
+
+ new_tables=[x for x in tables if x not in table_exists]
+
+ #If don't want order
+ #new_tables=set(tables)-set(table_exists)
+
+ #Need order new_tables
+
+ changes=0
+
+ #Create new tables
+
+ if len(new_tables)>0:
+ print(Style.BRIGHT+"Creating new tables...")
+
+ changes+=1
+
+ for table in new_tables:
+ print(Style.NORMAL+"--Creating table "+table+"...")
+ WebModel.query(WebModel, WebModel.model[table].create_table())
+ print("--Adding indexes and constraints for the new table")
+
+ for k_field, index in WebModel.arr_sql_index[table].items():
+ print("---Added index to "+k_field)
+ WebModel.query(WebModel, index)
+
+ for k_set, index_set in WebModel.arr_sql_set_index[table].items():
+
+ if index_set!="":
+ WebModel.query(WebModel, index_set)
+ print("---Added constraint to "+k_set)
+
+ print("--Adding uniques elements for the new table")
+
+ #See if changes exists
+
+ #Check if created tables are modified.
+
+ try:
+
+ model_old=import_module('backups.'+args.model)
+
+ for name, obj in inspect.getmembers(sys.modules[model_old.__name__]):
+ if inspect.isclass(obj):
+ if obj.__module__=='backups.'+args.model and hasattr(obj, 'webmodel'):
+
+ WebModel.model['old_'+name.lower()]=obj()
+
+ print(Style.BRIGHT+"Checking old versions of model for find changes...")
+
+ for table in tables:
+ #WebModel.query(WebModel, "")
+ #Check if new table
+
+ #fields_to_add, fields_to_modify, fields_to_add_index, fields_to_add_constraint, fields_to_add_unique, fields_to_delete_index, fields_to_delete_unique, fields_to_delete_constraint, fields_to_delete
+
+ fields_to_add=[]
+ fields_to_modify=[]
+ fields_to_add_index=[]
+ fields_to_add_constraint=[]
+ fields_to_add_unique=[]
+ fields_to_delete_index=[]
+ fields_to_delete_unique=[]
+ fields_to_delete_constraint=[]
+ fields_to_delete=[]
+
+ old_table='old_'+table
+
+ for f, v in WebModel.model[table].fields.items():
+
+ if not f in WebModel.model[old_table].fields:
+
+ fields_to_add.append(f)
+
+ #Add index
+
+ if v.indexed==True:
+
+ fields_to_add_index.append(f)
+
+ changes+=1
+
+ #Add unique
+
+ if v.unique==True:
+
+ fields_to_add_unique.append(f)
+
+ changes+=1
+
+ #Add constraint
+
+ if v.foreignkey==True:
+
+ fields_to_add_constraint.append(f)
+
+ changes+=1
+
+ changes+=1
+
+ #If exists field in old webmodel and new
+
+ else:
+
+ v_old=WebModel.model[old_table].fields[f]
+
+ if v.get_type_sql()!=v_old.get_type_sql():
+
+ fields_to_modify.append(f)
+
+ changes+=1
+
+ #Add index
+
+ if v.indexed==True and v_old.indexed==False:
+
+ fields_to_add_index.append(f)
+
+ changes+=1
+
+ if v.indexed==False and v_old.indexed==True:
+
+ fields_to_delete_index.append(f)
+
+ changes+=1
+
+ #Add unique
+
+ if v.unique==True and v_old.unique==False:
+
+ fields_to_add_unique.append(f)
+
+ changes+=1
+
+ if v.unique==False and v_old.unique==True:
+
+ fields_to_delete_unique.append(f)
+
+ changes+=1
+
+ #Add constraint
+
+ if v.foreignkey==True and v_old.foreignkey==False:
+
+ fields_to_add_constraint.append(f)
+
+ changes+=1
+
+ if v.foreignkey==False and v_old.foreignkey==True:
+
+ fields_to_delete_constraint.append(f)
+
+ changes+=1
+
+ for f, v in WebModel.model[old_table].fields.items():
+
+ if not f in WebModel.model[table].fields:
+
+ #Add constraint
+
+ if v.foreignkey==True:
+
+ fields_to_delete_constraint.append(f)
+
+ changes+=1
+
+ fields_to_delete.append(f)
+
+ changes+=1
+
+ WebModel.model[table].update_table(fields_to_add, fields_to_modify, fields_to_add_index, fields_to_add_constraint, fields_to_add_unique, fields_to_delete_index, fields_to_delete_unique, fields_to_delete_constraint, fields_to_delete)
+
+ #for field_update in arr_update:
+
+
+ #Make a for in fields, if the field not exist in old model, create, if is not same type, recreate. If no have index now, delete index, if is a new index, create, same thing with uniques
+
+ #for field in WebModel.model
+
+ except ImportError:
+
+ pass
+
+ except:
+
+ print("Exception in user code:")
+ print("-"*60)
+ traceback.print_exc(file=sys.stdout)
+ print("-"*60)
+
+ exit(1)
+
+ original_file_path=args.model.replace('.', '/')+'.py'
+
+ backup_path='backups/'+original_file_path
+
+ if changes>0:
+ print(Style.BRIGHT+"Creating backup of the model. WARNING: DON'T DELETE BACKUPS DIRECTORY IF YOU WANT MAKE CHANGES IN THE FUTURE WITHOUT MODIFY DIRECTLY THE DATABASE")
+
+ create_backup(original_file_path, backup_path)
+
+ else:
+ if not os.path.isfile(backup_path):
+ create_backup(original_file_path, backup_path)
+
+
+ print(Style.BRIGHT+"All tasks finished")
+
+def create_backup(original_file_path, file_path):
+
+ #Create copy
+
+ path=os.path.dirname(file_path)
+
+ p=Path(path)
+
+ if not p.is_dir():
+ p.mkdir(0o755, True)
+
+ #Create path
+
+ if os.path.isfile(file_path):
+ today = date.today()
+ shutil.copy(file_path, file_path+'.'+today.strftime("%Y%M%d%H%M%S"))
+
+ new_file=""
+
+ f=open(original_file_path)
+
+ for line in f:
+ """
+ new_line=line.replace("model[\"", "model[\"old_")
+ new_line=new_line.replace("model['", "model['old_")
+
+ new_line=new_line.replace("WebModel(\"", "WebModel(\"old_")
+ new_line=new_line.replace("WebModel('", "WebModel('old_")
+ """
+ new_file+=line
+
+ f.close()
+
+ f=open(file_path, 'w')
+
+ f.write(new_file)
+
+ f.close()
diff --git a/cromosoma/extrafields/__init__.py b/cromosoma/extrafields/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/cromosoma/extrafields/emailfield.py b/cromosoma/extrafields/emailfield.py
new file mode 100644
index 0000000..f5c310a
--- /dev/null
+++ b/cromosoma/extrafields/emailfield.py
@@ -0,0 +1,18 @@
+from paramecio.cromosoma.corefields import CharField
+import re
+
+mail_pattern=re.compile("\w[\w\.-]*@\w[\w\.-]+\.\w+")
+
+class EmailField(CharField):
+
+ def check(self, value):
+
+ self.error=False
+ self.txt_error=''
+
+ if not mail_pattern.match(value):
+
+ self.error=True
+ self.txt_error='No valid format'
+
+ return value
\ No newline at end of file
diff --git a/cromosoma/extrafields/passwordfield.py b/cromosoma/extrafields/passwordfield.py
new file mode 100644
index 0000000..8f92311
--- /dev/null
+++ b/cromosoma/extrafields/passwordfield.py
@@ -0,0 +1,49 @@
+from paramecio.cromosoma.corefields import PhangoField
+from paramecio.cromosoma.coreforms import PasswordForm
+from passlib.hash import bcrypt
+
+class PasswordField(PhangoField):
+
+ def __init__(self, name, size=255, required=False):
+
+ super(PasswordField, self).__init__(name, size, required)
+ self.protected=True
+ self.name_form=PasswordForm
+ self.default_value=''
+
+ def check(self, value):
+
+ self.txt_error=''
+ self.error=False
+
+ value.strip()
+
+ if value=='':
+
+ if self.model!=None:
+
+ if self.model.updated==True:
+ self.required=False
+ self.check_blank=True
+ return ""
+ else:
+
+ self.txt_error="The value is empty"
+ self.error=True
+
+ else:
+ self.txt_error="The value is empty"
+ self.error=True
+
+ else:
+ value = bcrypt.encrypt(value)
+
+
+ return value
+
+ @staticmethod
+ def verify( password, h):
+
+ return bcrypt.verify(password, h)
+
+
\ No newline at end of file
diff --git a/cromosoma/formsutils.py b/cromosoma/formsutils.py
new file mode 100644
index 0000000..e6b8d23
--- /dev/null
+++ b/cromosoma/formsutils.py
@@ -0,0 +1,42 @@
+#!/usr/bin/python3
+
+from paramecio.cromosoma import corefields
+from bottle import request
+
+def pass_values_to_form(post, arr_form, yes_error=True):
+
+ for key, value in arr_form.items():
+ post[key]=post.get(key, '')
+
+ arr_form[key].default_value=post[key]
+
+ if arr_form[key].field==None:
+ arr_form[key].field=corefields.CharField(key, 255, required=False)
+
+ # Recheck value if no set error field
+ if arr_form[key].field.error == None:
+ arr_form[key].field.check(post[key])
+
+ arr_form[key].txt_error=""
+
+ if arr_form[key].required==True and arr_form[key].field.error==True and yes_error==True:
+ arr_form[key].txt_error=arr_form[key].field.txt_error
+
+ # Reset error on field.
+
+ arr_form[key].field.error=None
+
+ return arr_form
+
+def show_form(post, arr_form, t, yes_error=True, modelform_tpl='forms/modelform.phtml'):
+
+ pass_values_to_form(post, arr_form, yes_error)
+
+ return t.load_template(modelform_tpl, forms=arr_form)
+
+#Function for initial values for necessary fields.
+
+def ini_fields(fields):
+ pass
+
+
\ No newline at end of file
diff --git a/cromosoma/usermodel.py b/cromosoma/usermodel.py
new file mode 100644
index 0000000..3ec4ff8
--- /dev/null
+++ b/cromosoma/usermodel.py
@@ -0,0 +1,134 @@
+#!/usr/bin/python3
+
+from paramecio.cromosoma.webmodel import WebModel
+from paramecio.cromosoma.coreforms import PasswordForm
+from paramecio.citoplasma.i18n import I18n
+from paramecio.citoplasma.httputils import GetPostFiles
+
+class UserModel(WebModel):
+
+ def __init__(self, name_field_id="id"):
+
+ super().__init__(name_field_id)
+
+ self.password_field='password'
+ self.email_field='email'
+ self.username_field='username'
+ self.yes_repeat_password=True
+
+ def create_forms(self, arr_fields={}):
+
+ # Add password_repeat to forms from the model
+
+ super().create_forms(arr_fields)
+
+ if self.password_field in arr_fields and self.yes_repeat_password:
+
+ repeat_password=PasswordForm('repeat_password', '')
+
+ repeat_password.required=1
+
+ repeat_password.label=I18n.lang('common', 'repeat_password', 'Repeat Password')
+
+ self.create_form_after(self.password_field, repeat_password)
+ """
+ def insert(self, dict_values, external_agent=True):
+
+ if 'password' in dict_values:
+
+ dict_values['repeat_password']=dict_values.get('repeat_password', '')
+
+ if dict_values['repeat_password']!=dict_values[self.password_field]:
+ self.fields[self.password_field].error=True
+ self.fields['password'].txt_error=I18n.lang('common', 'error_passwords_no_match', 'Error: passwords doesn\'t match')
+
+ return super().insert(dict_values, external_agent)
+ """
+
+ def check_all_fields(self, dict_values, external_agent, yes_update=False, errors_set="insert"):
+
+ try:
+
+ fields, values, update_values=super().check_all_fields(dict_values, external_agent, yes_update, errors_set)
+ except:
+
+ return False
+
+ # Check if passwords matches
+
+ if self.password_field in dict_values:
+
+ dict_values['repeat_password']=dict_values.get('repeat_password', '')
+
+ if dict_values['repeat_password']!=dict_values[self.password_field]:
+
+ if dict_values[self.password_field].strip()!="":
+
+ self.fields[self.password_field].error=True
+ self.fields[self.password_field].txt_error=I18n.lang('common', 'error_passwords_no_match', 'Error: passwords doesn\'t match')
+
+ return False
+
+ # Check if exists user with same email or password
+
+ get_id=0
+
+ if self.updated:
+ # Need the id
+ GetPostFiles.obtain_get()
+ GetPostFiles.obtain_post()
+
+ get_id=GetPostFiles.get.get(self.name_field_id, '0')
+
+ post_id=GetPostFiles.post.get(self.name_field_id, '0')
+
+ if get_id!='0':
+ get_id=int(get_id)
+
+ if post_id!='0':
+ get_id=int(post_id)
+
+ pass
+
+ sql_id=''
+
+ original_conditions=self.conditions
+
+ self.reset_conditions()
+
+ if self.username_field in dict_values:
+
+ self.conditions=['WHERE username=%s', [dict_values[self.username_field]]]
+
+
+ if self.email_field in dict_values:
+
+ if len(self.conditions[1])>0:
+
+ self.conditions[0]+=' OR email=%s'
+ else:
+ self.conditions[0]='WHERE email=%s'
+ self.conditions[1]=[]
+
+ self.conditions[1].append([dict_values[self.email_field]])
+
+ if get_id>0:
+ self.conditions[0]=' AND '+self.username_field+'=%s'
+ self.conditions[1].append(get_id)
+
+
+ if self.select_count()>0:
+
+ self.fields[self.username_field].error=True
+ self.fields[self.username_field].txt_error=I18n.lang('common', 'error_username_or_password_exists', 'Error: username or email exists in database')
+
+ return False
+
+ self.conditions=original_conditions
+
+ return fields, values, update_values
+
+
+
+
+
\ No newline at end of file
diff --git a/cromosoma/webmodel.py b/cromosoma/webmodel.py
new file mode 100644
index 0000000..0c2c53b
--- /dev/null
+++ b/cromosoma/webmodel.py
@@ -0,0 +1,879 @@
+#!/usr/bin/python3
+
+import sys
+import re
+import uuid
+from importlib import import_module, reload
+from collections import OrderedDict
+from paramecio.cromosoma.databases.mysql import SqlClass
+from paramecio.cromosoma.coreforms import BaseForm, HiddenForm
+
+# The most important class for the framework
+#
+# Webmodel is a class for create objects that represent models. This models are a mirage of SQL tables. You can create fields, add indexes, foreign keys, and more.
+#
+#
+
+class WebModel:
+
+ #Globals class variables for internal tasks
+
+ arr_sql_index={}
+ arr_sql_set_index={}
+ arr_sql_unique={}
+ arr_sql_set_unique={}
+ last_query=""
+
+ make_connection=SqlClass.connect_to_db
+
+ #A dictionary for add models here
+
+ model=OrderedDict()
+
+ connections={'default': {'host': 'localhost', 'user': 'user', 'password': '', 'db': 'default', 'charset': 'utf8', 'set_connection': False} }
+
+ connection_id="default"
+
+ webmodel=True
+
+ # Init the class
+
+ def __init__(self, name_field_id="id"):
+
+ #The name of the table
+
+ self.name=type(self).__name__.lower()
+
+ self.label=self.name
+
+ self.label_general=self.name
+
+ self.name_field_id=name_field_id
+
+ #Fields of the table, inserte with register method
+
+ self.fields=OrderedDict()
+
+ #The tables related with foreignkeyfield to this table
+
+ self.related=[]
+
+ #A dictionary where forms of this model are saved
+
+ self.forms=OrderedDict()
+
+ self.cache_method=''
+
+ # A dictionary with the errors in fields.
+
+ self.fields_errors={}
+
+ self.errors={}
+
+ self.num_errors=0
+
+ self.query_error=""
+
+ self.conditions=["WHERE 1=1", []]
+
+ self.order_by="ORDER BY `"+self.name+"`.`id` ASC"
+
+ self.limit=""
+
+ self.related_models_deleted=[]
+
+ self.required_save={}
+
+ #Create id field
+ self.register(PrimaryKeyField(self.name_field_id))
+
+ #self.model[name]=self
+
+ self.yes_reset_conditions=True
+
+ self.create_fields()
+
+ self.updated=False
+
+ self.valid_fields=[]
+
+ # A method where create the new fields of this model
+
+ def create_fields(self):
+
+ pass
+
+ # A method for register the fields
+
+ def register(self, field_model):
+
+ #self.fields_required[field_model]=field_model.required
+
+ self.fields[field_model.name]=field_model
+
+ self.fields[field_model.name].model=self
+
+ # A method for create the id field.
+
+ def create_id_field(self, field_name="id"):
+ pass
+
+ # A method for select rows from a database.
+
+ def connect_to_db(self):
+
+ if WebModel.make_connection(SqlClass, self.connections[self.connection_id])==False:
+ raise NameError(SqlClass.error_connection)
+
+ WebModel.make_connection=SqlClass.dummy_connect
+
+ def dummy_connect(self, connection):
+ return True
+
+ # Static method for make queries
+ @staticmethod
+ def query(WebModel, str_query, args=[], connection_id='default'):
+ WebModel.connect_to_db(WebModel)
+ return SqlClass.query(SqlClass, str_query, args, connection_id)
+
+ # Insert method, for insert a row in database.using a dictionary
+ # External agent define if the update is in code or from external source, how a form.
+
+ def insert(self, dict_values, external_agent=True):
+
+ # Connect to db
+
+ self.connect_to_db()
+
+ self.query_error=''
+
+ self.fields[self.name_field_id].required=False
+
+ try:
+
+ fields, values, update_values=self.check_all_fields(dict_values, external_agent)
+
+ except:
+ self.query_error='Cannot insert the new row'
+ return False
+
+ sql="insert into `"+self.name+"` (`"+"`, `".join(fields)+"`) VALUES ("+", ".join(values)+")"
+
+ cursor=SqlClass.query(SqlClass, sql, self.conditions[1], self.connection_id)
+
+ if cursor.rowcount>0:
+
+ return True
+ else:
+ self.query_error='Cannot insert the new row'
+ return False
+
+ # Update method. For update one or many rows.
+
+ def update(self, dict_values, external_agent=True):
+
+ # Connect to db
+
+ self.fields[self.name_field_id].required=False
+
+ if self.name_field_id in dict_values:
+ del dict_values[self.name_field_id]
+
+ self.connect_to_db()
+
+ self.query_error=''
+
+ #try:
+ self.updated=True
+
+ try:
+
+ fields, values, update_values=self.check_all_fields(dict_values, external_agent, True, 'update')
+
+ except:
+ return False
+
+ sql="update `"+self.name+"` SET "+", ".join(update_values)+" "+self.conditions[0]
+
+ cursor=SqlClass.query(SqlClass, sql, self.conditions[1], self.connection_id)
+
+ if self.yes_reset_conditions:
+ self.reset_conditions()
+
+ return True
+
+ """
+ if cursor.rowcount>0:
+
+ if self.yes_reset_conditions:
+ self.reset_conditions()
+
+ return True
+
+ else:
+
+ self.query_error='Cannot update the row'
+
+ return False
+ """
+ """
+ except:
+
+ #self.query_error=SqlClass.error_connection
+ e = sys.exc_info()[0]
+ v = sys.exc_info()[1]
+
+ self.error_connection="Error in query: %s %s" % (e, v)
+
+ return False
+ """
+
+ def reset_conditions(self):
+
+ self.conditions=["WHERE 1=1", []]
+
+
+ # A method for select fields from a table in db. Support for foreignkeys.
+ #Type assoc can be assoc for return dictionaries
+
+ def select(self, arr_select=[], raw_query=0):
+
+ # Connect to db
+
+ self.connect_to_db()
+
+ conditions=self.conditions
+
+ final_fields=[]
+
+ extra_fields=[]
+
+ self.query_error=''
+
+ #First table selecction
+
+ tables_to_select=['`'+self.name+'`']
+
+ keys=list(self.fields.keys())
+
+ if len(arr_select)==0:
+ arr_select=keys
+
+ # Array intersect for obtain the valid fields
+
+ fields = list(set(keys) & set(arr_select))
+
+ #Creating the fields
+
+ for field in fields:
+
+ #Check if foreignkeyfield
+
+ if type(self.fields[field]).__name__=="ForeignKeyField" and raw_query==0:
+
+ table_name=self.fields[field].table_name
+
+ tables_to_select.append('`'+table_name+'`')
+
+ # Add field from related table
+ # as "+table_name+"_"+self.fields[field].named_field
+ extra_fields.append("`"+table_name+"`.`"+self.fields[field].named_field+"` as "+field)
+
+ # Add a condition to sql query for join the two tables.
+
+ conditions[0]+=" AND `"+table_name+"`.`"+self.fields[field].identifier_field+"`=`"+self.name+"`.`"+field+"`"
+
+ # Add extra fields from related table from select_fields ForeignKeyField class member
+
+ for extra_field in self.fields[field].select_fields:
+
+ extra_fields.append("`"+table_name+"`.`"+extra_field+"` as `"+table_name+"_"+extra_field+"`")
+ else:
+ # Add normal field to sql query
+
+ final_fields.append("`"+self.name+"`.`"+field+"`")
+
+ extra_sql_field=""
+
+ if len(extra_fields)>0:
+
+ extra_sql_field=", "+", ".join(extra_fields)
+
+ if len(final_fields)==0:
+ self.query_error="Error: without fields to search"
+ return False
+
+ sql= ("select "+", ".join(final_fields)+extra_sql_field+" from "+", ".join(tables_to_select)+' '+conditions[0]+' '+self.order_by+' '+self.limit).strip()
+
+ self.last_query=sql
+
+ if self.yes_reset_conditions:
+ self.reset_conditions()
+
+ cursor=SqlClass.query(SqlClass, sql, conditions[1], self.connection_id)
+
+ if cursor==False:
+ self.query_error=SqlClass.error_connection
+ return False
+ else:
+ return cursor
+
+ # Show results in a dictionary
+
+ def fetch(self, cursor):
+
+ return cursor.fetchone()
+
+ def insert_id(self, cursor):
+
+ return cursor.lastrowid
+
+ def element_exists(self, id):
+
+ self.conditions=['WHERE `'+self.name_field_id+'`=%s', [id]]
+
+ count=self.select_count(self.name_field_id)
+
+ if self.yes_reset_conditions:
+ self.reset_conditions()
+
+ if count>0:
+ return True
+
+ return False
+
+ def select_a_field(self, field):
+ pass
+
+ def select_a_row(self, id, fields_selected=[], raw_query=0):
+
+ self.conditions=['WHERE `'+self.name+'`.`'+self.name_field_id+'`=%s', [id]]
+
+ self.limit="limit 1"
+
+ cursor=self.select(fields_selected, raw_query)
+
+ self.reset_conditions()
+
+ row=cursor.fetchone()
+
+ if row==None:
+ row=False
+
+ return row
+
+ def select_a_row_where(self, fields_selected=[], raw_query=0):
+
+ self.limit="limit 1"
+
+ cursor=self.select(fields_selected, raw_query)
+
+ row=cursor.fetchone()
+
+ if row==None:
+ row=False
+
+ return row
+
+
+ def select_to_array(self, fields_selected=[], raw_query=0):
+
+ if len(fields_selected) > 0 and (self.name_field_id not in fields_selected):
+ fields_selected.append(self.name_field_id)
+
+ cursor=self.select(fields_selected, raw_query)
+
+ results={}
+
+ for row in cursor:
+
+ results[row[self.name_field_id]]=row
+
+ return results
+
+
+ # A method por count num rows affected for sql conditions
+
+ def select_count(self, field_to_count='id', raw_query=1):
+
+ # Connect to db
+
+ self.connect_to_db()
+
+ conditions=self.conditions
+
+ #First table selecction
+
+ tables_to_select=['`'+self.name+'`']
+
+ fields=list(self.fields.keys())
+
+ #Creating the fields
+
+ for field in fields:
+
+ #Check if foreignkeyfield
+
+ if type(self.fields[field]).__name__=="ForeignKeyField" and raw_query==0:
+
+ table_name=self.fields[field].table_name
+
+ tables_to_select.append('`'+table_name+'`')
+
+ # Add a condition to sql query for join the two tables.
+
+ conditions[0]+=" AND `"+table_name+"`.`"+self.fields[field].identifier_field+"`=`"+self.name+"`.`"+field+"`"
+
+ sql= "select count(`"+field_to_count+"`) from "+", ".join(tables_to_select)+conditions[0]
+
+ cursor=SqlClass.query(SqlClass, sql, conditions[1], self.connection_id)
+
+ count=list(cursor.fetchone().values())[0]
+
+ if self.yes_reset_conditions:
+ self.reset_conditions()
+
+ return count
+
+ #+' ORDER BY '+self.order_by+' '+self.limit).strip()
+
+ # A method for delete rows using sql conditions
+
+ def delete(self):
+
+ self.connect_to_db()
+
+ #Need delete rows from other related tables save in self.related_models_deleted
+
+ sql="delete from `"+self.name+"` "+self.conditions[0]
+
+ result=SqlClass.query(SqlClass, sql, self.conditions[1], self.connection_id)
+
+ if self.yes_reset_conditions:
+ self.reset_conditions()
+
+ return result
+
+ # Method for create sql tables
+
+ def create_table(self):
+
+ #self.connect_to_db()
+
+ self.arr_sql_index[self.name]={}
+ self.arr_sql_set_index[self.name]={}
+ self.arr_sql_unique[self.name]={}
+ self.arr_sql_set_unique[self.name]={}
+
+ #foreach($this->components as $field => $data)
+ table_fields=[]
+
+ #Create id field
+ #Not neccesary
+ #table_fields.append('`'+self.name_field_id+"` INT NOT NULL PRIMARY KEY AUTO_INCREMENT")
+
+ for field, data in self.fields.items():
+
+ table_fields.append('`'+field+'` '+data.get_type_sql())
+
+ #Check if indexed
+
+ if self.fields[field].indexed==True:
+
+ self.arr_sql_index[self.name][field]='CREATE INDEX `index_'+self.name+'_'+field+'` ON '+self.name+'(`'+field+'`);'
+ self.arr_sql_set_index[self.name][field]=""
+
+
+ #Check if unique
+
+ if self.fields[field].unique==True:
+
+ self.arr_sql_unique[self.name][field]='ALTER TABLE `'+self.name+'` ADD UNIQUE (`'+field+'`)'
+ self.arr_sql_set_unique[self.name][field]=""
+
+ if type(self.fields[field]).__name__=="ForeignKeyField":
+
+ self.arr_sql_index[self.name][field]='CREATE INDEX `index_'+self.name+'_'+field+'` ON '+self.name+'(`'+field+'`);'
+
+ table_related=self.fields[field].table_name
+
+ id_table_related=self.fields[field].table_id
+
+ self.arr_sql_set_index[self.name][field]='ALTER TABLE `'+self.name+'` ADD CONSTRAINT `'+field+'_'+self.name+'IDX` FOREIGN KEY ( `'+field+'` ) REFERENCES `'+table_related+'` (`'+id_table_related+'`) ON DELETE RESTRICT ON UPDATE RESTRICT;'
+
+ return "create table `"+self.name+"` (\n"+",\n".join(table_fields)+"\n) DEFAULT CHARSET=utf8;";
+
+ def update_table(self, fields_to_add, fields_to_modify, fields_to_add_index, fields_to_add_constraint, fields_to_add_unique, fields_to_delete_index, fields_to_delete_unique, fields_to_delete_constraint, fields_to_delete):
+
+ #Obtain new fields
+
+ for field in fields_to_modify:
+ print("---Updating "+field+" in "+self.name)
+ WebModel.query(WebModel, 'ALTER TABLE `'+self.name+'` MODIFY `'+field+'` '+self.fields[field].get_type_sql(), [], self.connection_id)
+
+ for field in fields_to_add:
+ print("---Adding "+field+" in "+self.name)
+ WebModel.query(WebModel, 'ALTER TABLE `'+self.name+'` ADD `'+field+'` '+self.fields[field].get_type_sql(), [], self.connection_id)
+
+ for field in fields_to_add_index:
+ print("---Adding index to "+field+" in "+self.name)
+ WebModel.query(WebModel, 'CREATE INDEX `index_'+self.name+'_'+field+'` ON '+self.name+' (`'+field+'`);', [], self.connection_id)
+
+ for field in fields_to_add_constraint:
+
+ print("---Adding foreign key to "+field+" in "+self.name)
+
+ table_related=self.fields[field].table_name
+
+ id_table_related=self.fields[field].table_id
+
+ WebModel.query(WebModel, 'ALTER TABLE `'+self.name+'` ADD CONSTRAINT `'+field+'_'+self.name+'IDX` FOREIGN KEY ( `'+field+'` ) REFERENCES `'+table_related+'` (`'+id_table_related+'`) ON DELETE RESTRICT ON UPDATE RESTRICT;', [], self.connection_id)
+
+ for field in fields_to_add_unique:
+
+ print("---Adding unique to "+field+" in "+self.name)
+
+ WebModel.query(WebModel, 'ALTER TABLE `'+self.name+'` ADD UNIQUE (`'+field+'`)', [], self.connection_id)
+
+ for field in fields_to_delete_index:
+
+ print("---Deleting index from "+field+" in "+self.name)
+
+ WebModel.query(WebModel, 'DROP INDEX `index_'+self.name+'_'+field+'` ON '+self.name, [], self.connection_id)
+
+ for field in fields_to_delete_unique:
+
+ print("---Deleting unique from "+field+" in "+self.name)
+
+ WebModel.query(WebModel, 'DROP INDEX `'+field+'` ON '+self.name, [], self.connection_id)
+
+ for field in fields_to_delete_constraint:
+
+ print("---Deleting foreignkey from "+field+" in "+self.name)
+
+ WebModel.query(WebModel, 'ALTER TABLE `'+self.name+'` DROP FOREIGN KEY '+field+'_'+self.name+'IDX', [], self.connection_id)
+
+ for field in fields_to_delete:
+
+ print("---Deleting "+field+" from "+self.name)
+
+ WebModel.query(WebModel, 'ALTER TABLE `'+self.name+'` DROP `'+field+'`', [], self.connection_id)
+ #Deleting indexes and constraints.
+
+ # Method for drop sql tables and related
+
+ def drop_table(name):
+ pass
+
+ #Return an array with all fields
+
+ def all_fields():
+ pass
+
+ #Check of all fields in table.
+
+ def check_all_fields(self, dict_values, external_agent, yes_update=False, errors_set="insert"):
+
+ fields=[]
+ values=[]
+ update_values=[]
+ self.errors[errors_set]=[]
+ self.num_errors=0
+ #A dictionary that define if update property is added
+
+ updated_field={}
+ updated_field['insert']=0
+ updated_field['update']=1
+
+
+ error=False
+
+ if yes_update==True:
+ f_update=lambda field, value: "`"+field+"`="+value+""
+ else:
+ f_update=lambda field, value: ""
+
+ # I can optimize this later
+
+ for k, v in self.fields.items():
+
+ #List where the errors are saved
+
+ self.fields_errors[k]=[]
+
+ if k in dict_values:
+
+ # If fields is protected, but external_agent =0, then insert
+ # If fields is not protected always insert if not error checking
+
+ value=dict_values[k]
+
+ # Need rewrite the error because shitty python don't clean nothing
+
+ self.fields[k].error=False
+
+ if (self.fields[k].protected==None or self.fields[k].protected==False or external_agent==False) and k in self.valid_fields:
+
+ self.fields[k].update=updated_field[errors_set]
+
+ value=self.fields[k].check(value)
+
+ if self.fields[k].check_blank==False or self.updated==False:
+
+ # If error checking, value=False
+
+ if self.fields[k].error==True and self.fields[k].required==True:
+
+ #Error, need this fields.
+ self.num_errors+=1
+
+ self.fields_errors[k].append("Error: "+v.label+" field required")
+
+ error=True
+
+ else:
+
+ fields.append(k)
+
+ final_value=self.fields[k].quot_open+value+self.fields[k].quot_close
+
+ values.append(final_value)
+
+ update_values.append(f_update(k, final_value))
+
+ else:
+ self.num_errors+=1
+
+ self.fields_errors[k].append("Error: "+self.fields[k].label+" is protected field")
+ self.fields[k].error=True
+ self.fields[k].txt_error="Error: "+self.fields[k].label+" is protected field"
+ error=True
+
+ elif v.required==True:
+
+ self.num_errors+=1
+
+ self.fields_errors[k].append("Error: "+v.label+" field required")
+ error=True
+
+ if len(fields)==0:
+
+ self.num_errors+=1
+
+ self.errors[errors_set].append("Error: no elements to insert in table")
+
+ error=True
+
+ if error==True:
+
+ self.num_errors+=1
+
+ self.errors[errors_set].append("Error: error checking the values of the table")
+
+ return False
+
+ return (fields, values, update_values)
+
+
+ #Reset the require field in fields
+
+ def reset_require(self):
+
+ for k, v in self.fields.items():
+
+ self.required_save[k]=self.fields[k].required
+ self.fields[k].required=0
+
+
+ #Reload the require field in fields
+
+ def reload_require(self):
+
+ for k,r in self.fields.items():
+ self.fields[k].required=r
+
+
+ #Create a form based in table.
+
+ def create_forms(self, arr_fields={}):
+
+ if len(arr_fields)==0:
+ arr_fields=self.fields.keys()
+
+ #for name_field, field in self.fields.items():
+ for name_field in arr_fields:
+ self.valid_fields.append(name_field)
+ self.forms[name_field]=self.fields[name_field].create_form()
+
+ def create_form_after(self, form_after, new_form):
+
+ new_dict=OrderedDict()
+
+ for name_form, form in self.forms.items():
+ new_dict[name_form]=form
+ if name_form==form_after:
+ new_dict[new_form.name]=new_form
+
+ self.forms=new_dict
+
+ @staticmethod
+ def close():
+ WebModel.make_connection=SqlClass.connect_to_db
+ SqlClass.close(SqlClass)
+
+ @staticmethod
+ def escape_sql(value):
+
+ value=str(value)
+
+ return value.replace("'","\\'").strip()
+
+
+class PhangoField:
+
+ def __init__(self, name, size=255, required=False):
+
+ # The name of the field in database table
+
+ self.name=name
+
+ # The label for the Field
+
+ self.label=name.replace('_', ' ').title()
+
+ # If field is required, self.required is True
+
+ self.required=required
+
+ # The size of field in database
+
+ self.size=size
+
+ # Protected, if this value != None, cannot use it in insert or update.
+
+ self.protected=None
+
+ # $quote_open is used if you need a more flexible sql sentence,
+ # @warning USE THIS FUNCTION IF YOU KNOW WHAT YOU ARE DOING
+
+ self.quot_open='\''
+
+ # $quote_close is used if you need a more flexible sql sentence,
+ # @warning USE THIS PROPERTY IF YOU KNOW WHAT YOU ARE DOING
+
+ self.quot_close='\''
+
+ # Variable where the basic text error is saved
+
+ self.error=None
+
+ self.txt_error=""
+
+ # Array for create initial parameters for form..
+ self.parameters=[]
+
+ # Themodel where this component or field live
+
+ self.model=None
+
+ # Property used for set this field how indexed in the database table.
+
+ self.indexed=False
+
+ # Property used for set this field how unique value in the database table.
+
+ self.unique=False
+
+ # Simple property for make more easy identify foreignkeyfields.
+
+ self.foreignkey=False
+
+ # Property that define the default value for this field
+
+ self.default_value=""
+
+ # Property that define if this field is in an update operation or insert operation
+
+ self.update=False
+
+ # Property used for check if this value cannot change if is in blank and is filled
+
+ self.check_blank=False
+
+ # Define the form, when is created forms with create_forms you can change the properties of this class
+
+ self.name_form=BaseForm
+
+ # This method is used for describe the new field in a sql language format.
+
+
+ def get_type_sql(self):
+
+ return 'VARCHAR('+str(self.size)+') NOT NULL DEFAULT "'+self.default_value+'"'
+
+ def show_formatted(self, value):
+
+ return value
+
+ # This method for check the value
+
+
+ def check(self, value):
+
+ self.error=False
+ self.txt_error=''
+
+ value=str(value)
+
+ value=WebModel.escape_sql(value)
+
+ if value=="":
+ self.txt_error="The field is in blank"
+ self.error=True
+
+
+ return value
+
+ def set_relationships(self):
+ pass
+
+ def create_form(self):
+ form=self.name_form(self.name, self.default_value)
+ form.default_value=self.default_value
+ form.required=self.required
+ form.label=self.label
+ form.field=self
+ return form
+
+class PrimaryKeyField(PhangoField):
+
+ def __init__(self, name, size=11, required=False):
+ super(PrimaryKeyField, self).__init__(name, size, required)
+ self.protected=True
+ self.name_form=HiddenForm
+ self.required=True
+
+ def check(self, value):
+
+ self.error=None
+ self.txt_error=''
+
+ if value=='':
+ value='0'
+
+ value=str(int(value))
+
+ if value==0:
+ self.txt_error="The value is zero"
+ self.error=True
+
+
+ return value
+
+ def get_type_sql(self):
+
+ return 'INT NOT NULL PRIMARY KEY AUTO_INCREMENT'
+
+
+
+
diff --git a/index.py b/index.py
index b5c58d1..b601158 100644
--- a/index.py
+++ b/index.py
@@ -8,6 +8,8 @@ from beaker.middleware import SessionMiddleware
#WARNING: only use this feature in development, not in production.
def create_app():
+
+ arr_module_path={}
if config.yes_static==True:
@@ -20,11 +22,11 @@ def create_app():
@route('/mediafrom//')
def send_static_module(module, filename):
- path_module=module+'/media/'
+ path_module=arr_module_path[module]+'/media/'
file_path_module=path_module+filename
- path=module+'/media/'
+ path='themes/'+config.theme+'/media/'+module
file_path=path+filename
@@ -52,6 +54,10 @@ def create_app():
controller_base=os.path.dirname(controller_path.__file__)
+ base_module=module.split('.')[-1]
+
+ arr_module_path[base_module]=controller_base
+
dir_controllers=os.listdir(controller_base)
for controller in dir_controllers:
@@ -95,10 +101,16 @@ def create_app():
os.makedirs(config.session_opts['session.data_dir'], 0o700, True)
app = SessionMiddleware(app, config.session_opts, environ_key=config.cookie_name)
-
- if __name__ == "__main__":
- run(app=app, host=config.host, server=config.server_used, port=config.port, debug=config.debug, reloader=config.reloader)
- else:
- return run(app=app, host=config.host, server=config.server_used, port=config.port, debug=config.debug, reloader=config.reloader)
+ return app
+
+def run_app(app):
+
+ run(app=app, host=config.host, server=config.server_used, port=config.port, debug=config.debug, reloader=config.reloader)
+"""
+if __name__ == "__main__":
+ run(app=app, host=config.host, server=config.server_used, port=config.port, debug=config.debug, reloader=config.reloader)
+ #else:
+ #return run(app=app, host=config.host, server=config.server_used, port=config.port, debug=config.debug, reloader=config.reloader)
+"""
diff --git a/modules/admin/admin/ausers.py b/modules/admin/admin/ausers.py
index cafd2ca..2301da2 100644
--- a/modules/admin/admin/ausers.py
+++ b/modules/admin/admin/ausers.py
@@ -1,10 +1,10 @@
#!/usr/bin/python3
-from modules.admin.models.admin import UserAdmin
-from citoplasma.urls import make_url
-from citoplasma.generate_admin_class import GenerateAdminClass
-from citoplasma.i18n import I18n
-from cromosoma.coreforms import SelectForm
+from paramecio.modules.admin.models.admin import UserAdmin
+from paramecio.citoplasma.urls import make_url
+from paramecio.citoplasma.generate_admin_class import GenerateAdminClass
+from paramecio.citoplasma.i18n import I18n
+from paramecio.cromosoma.coreforms import SelectForm
def admin(t):
diff --git a/modules/admin/index.py b/modules/admin/index.py
index 7580eb6..c5bf925 100644
--- a/modules/admin/index.py
+++ b/modules/admin/index.py
@@ -11,8 +11,8 @@ from settings import config_admin
from paramecio.citoplasma.lists import SimpleList
from paramecio.citoplasma.generate_admin_class import GenerateAdminClass
from paramecio.citoplasma.httputils import GetPostFiles
-from cromosoma.formsutils import show_form, pass_values_to_form
-from cromosoma.coreforms import PasswordForm
+from paramecio.cromosoma.formsutils import show_form, pass_values_to_form
+from paramecio.cromosoma.coreforms import PasswordForm
from importlib import import_module, reload
from bottle import redirect
from collections import OrderedDict
diff --git a/modules/admin/media/css/admin.css b/modules/admin/media/css/admin.css
new file mode 100644
index 0000000..051567e
--- /dev/null
+++ b/modules/admin/media/css/admin.css
@@ -0,0 +1,637 @@
+body
+{
+
+ margin:0px;
+ background-color:#f7f6f1;
+ font-family: sans, sans-serif, serif;
+}
+
+a
+{
+
+ color: #1c6280;
+
+}
+
+a:hover
+{
+
+ color: #d54e21;
+
+}
+
+#header
+{
+
+ width:100%;
+ height:47px;
+ color:#000;
+ font-size:22px;
+ font-family:sans, serif;
+ background-image:url('../images/background.png');
+ background-position:top;
+ background-repeat:repeat-x;
+ background-color:#959595;
+ line-height: 47px;
+
+}
+
+#title_phango
+{
+ font-size:28px;
+ padding-left:15px;
+ color: #ffffff;
+ font-style:italic;
+ text-shadow:#000000 1px 1px 1px;
+ filter: progid:DXImageTransform.Microsoft.Shadow(color='#000000', Direction=130, Strength=4);
+
+}
+
+#title_framework
+{
+
+ font-size:28px;
+ padding-right:15px;
+ color:#ff9b2f;
+ font-style:italic;
+ text-shadow:#000000 1px 1px 1px;
+ filter: progid:DXImageTransform.Microsoft.Shadow(color='#000000', Direction=130, Strength=4);
+
+}
+
+h1
+{
+
+ font-family:sans, serif;
+ font-size:26px;
+ font-weight:normal;
+ font-style:italic;
+ color:#04004e;
+ background-image:url('../images/button_head.png');
+ background-repeat: no-repeat;
+ /*padding-left:65px;*/
+ /*height:60px;
+ line-height:60px;*/
+
+
+}
+
+#logo_header
+{
+
+
+
+}
+
+#center_body {
+
+ background-position:left;
+ background-repeat:repeat-y;
+ height: auto !important;
+ width:100%;
+ margin-left:auto;
+ margin-right:auto;
+ overflow:auto;
+ height: auto !important;
+ min-height:300px;
+ position:relative;
+
+
+}
+
+#menu
+{
+
+ float:left;
+ width:18%;
+ margin-right:25px;
+ position:relative;
+}
+
+#menu a
+{
+
+ font-size:12px;
+ /*font-family:arial, sans;*/
+ font-weight:bold;
+ text-decoration:none;
+ color:#6183b0;
+ display:block;
+ border:solid #cccccc;
+ border-width:0px 1px 1px 1px;
+ padding:5px;
+ background: #ececec;
+}
+
+#menu a:hover
+{
+
+ text-decoration:underline;
+ color:#5072a0;
+ background: #e7e7e7;
+
+}
+
+#menu a.sub_module
+{
+
+ color:#6183b1;
+ background-color: #fbfbfb;
+ text-decoration:none;
+
+}
+
+.menu_title
+{
+
+ padding:5px;
+ font-size:14px;
+ /*font-family:arial, sans;*/
+ font-weight:bold;
+ padding:5px;
+ background-image:url('../images/background_title.png');
+ background-position:top;
+ background-repeat: repeat-x;
+ background-color: #fcf7fd;
+ border-radius: 8px 8px 0px 0px;
+ border:solid #cccccc;
+ border-width:1px 1px 1px 1px;
+ color: #333333;
+
+}
+
+.father_admin {
+
+ padding:5px;
+ font-size:14px;
+ display: block;
+ color: #fbfbfb;
+ font-weight:bold;
+ background: rgba(76,76,76,1);
+ background: -moz-linear-gradient(top, rgba(76,76,76,1) 0%, rgba(89,89,89,1) 12%, rgba(102,102,102,1) 25%, rgba(71,71,71,1) 39%, rgba(44,44,44,1) 50%, rgba(0,0,0,1) 51%, rgba(17,17,17,1) 60%, rgba(43,43,43,1) 76%, rgba(28,28,28,1) 91%, rgba(19,19,19,1) 100%);
+ background: -webkit-gradient(left top, left bottom, color-stop(0%, rgba(76,76,76,1)), color-stop(12%, rgba(89,89,89,1)), color-stop(25%, rgba(102,102,102,1)), color-stop(39%, rgba(71,71,71,1)), color-stop(50%, rgba(44,44,44,1)), color-stop(51%, rgba(0,0,0,1)), color-stop(60%, rgba(17,17,17,1)), color-stop(76%, rgba(43,43,43,1)), color-stop(91%, rgba(28,28,28,1)), color-stop(100%, rgba(19,19,19,1)));
+ background: -webkit-linear-gradient(top, rgba(76,76,76,1) 0%, rgba(89,89,89,1) 12%, rgba(102,102,102,1) 25%, rgba(71,71,71,1) 39%, rgba(44,44,44,1) 50%, rgba(0,0,0,1) 51%, rgba(17,17,17,1) 60%, rgba(43,43,43,1) 76%, rgba(28,28,28,1) 91%, rgba(19,19,19,1) 100%);
+ background: -o-linear-gradient(top, rgba(76,76,76,1) 0%, rgba(89,89,89,1) 12%, rgba(102,102,102,1) 25%, rgba(71,71,71,1) 39%, rgba(44,44,44,1) 50%, rgba(0,0,0,1) 51%, rgba(17,17,17,1) 60%, rgba(43,43,43,1) 76%, rgba(28,28,28,1) 91%, rgba(19,19,19,1) 100%);
+ background: -ms-linear-gradient(top, rgba(76,76,76,1) 0%, rgba(89,89,89,1) 12%, rgba(102,102,102,1) 25%, rgba(71,71,71,1) 39%, rgba(44,44,44,1) 50%, rgba(0,0,0,1) 51%, rgba(17,17,17,1) 60%, rgba(43,43,43,1) 76%, rgba(28,28,28,1) 91%, rgba(19,19,19,1) 100%);
+ background: linear-gradient(to bottom, rgba(76,76,76,1) 0%, rgba(89,89,89,1) 12%, rgba(102,102,102,1) 25%, rgba(71,71,71,1) 39%, rgba(44,44,44,1) 50%, rgba(0,0,0,1) 51%, rgba(17,17,17,1) 60%, rgba(43,43,43,1) 76%, rgba(28,28,28,1) 91%, rgba(19,19,19,1) 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4c4c4c', endColorstr='#131313', GradientType=0 );
+
+
+}
+
+.content_admin
+{
+
+ margin:auto;
+ background-color:#ffffff;
+ padding:10px 10px 10px 10px;
+ border:solid #dfdfdf;
+ border-width: 1px;
+ font-size:12px;
+ position:relative;
+ overflow:auto;
+ margin-bottom:40px;
+
+}
+
+.contents
+{
+ float:right;
+ width:79%;
+ padding:0px 0px 15px 0px;
+}
+
+.content
+{
+
+ /*border: solid #000 0px;
+ float:right;
+ width:80%;*/
+
+}
+
+.title
+{
+
+ font-size:18px;
+ font-weight:bold;
+ font-family:arial, sans;
+ text-decoration:none;
+ color:#000000;
+ padding:5px;
+ background-image:url('../images/background_title.png');
+ background-position:top;
+ background-repeat: repeat-x;
+ background-color: #fcf7fd;
+ border-radius: 8px 8px 0px 0px;
+ border:solid #cccccc;
+ border-width:1px 1px 1px 1px;
+}
+
+#inform {
+
+ margin:auto;
+
+}
+
+/*Styles for common templates...*/
+
+.form {
+
+ border: solid #cbcbcb 1px;
+ padding:10px;
+ margin:10px 0px 10px 0px;
+ border-radius:5px;
+
+}
+
+.form textarea {
+
+ width:100%;
+ height:200px;
+
+}
+
+.form label {
+ display: block;
+ /*width: 150px;*/
+ float: left;
+ margin-bottom: 10px;
+ text-align: left;
+ width: 350px;
+ padding-right: 20px;
+ /*border: #000000 solid;
+ border-width:1px;*/
+
+}
+
+
+
+.form p {
+ clear: left;
+}
+
+img {
+
+display:block;
+
+}
+
+.panel {
+
+display:block;
+float:left;
+/*clear:left;*/
+text-align:center;
+border: #000000 solid;
+border-width:0px;
+min-width:200px;
+width:200px !important;
+padding:0px;
+margin:0px;
+min-height:100px;
+height:100px !important;
+position:relative;
+
+
+}
+
+.panel p {
+
+position:absolute;
+bottom:0px;
+/*padding-bottom:0px;*/
+text-align:center;
+
+margin-left:auto;
+margin-right:auto;
+
+}
+
+.panel img {
+
+margin-left:auto;
+margin-right:auto;
+
+}
+
+.table_list {
+
+
+ width:100%;
+
+}
+
+.title_list td {
+
+ border:solid #cccccc;
+ border-width:1px;
+ padding:8px;
+ background-image:url('../images/background_title.png');
+ background-position:top;
+ background-repeat: repeat-x;
+ font-size:14px;
+ font-weight:bold;
+
+}
+
+.row_list td {
+
+ border:solid #cccccc;
+ border-width:1px;
+ padding:4px;
+
+}
+
+.cont_text, .cont
+{
+
+ margin:auto;
+ background-color:#ffffff;
+ padding:10px 10px 10px 10px;
+ border:solid #dfdfdf;
+ border-width: 0px 1px 1px 1px;
+ font-size:12px;
+ position:relative;
+ overflow:auto;
+ margin-bottom:10px;
+ border-radius: 0px 0px 5px 5px;
+
+}
+
+.cont_top {
+
+ border-width: 1px 1px 1px 1px;
+ border-radius: 5px 5px 5px 5px;
+}
+
+.search {
+
+ border-width: 1px;
+ border-radius:5px;
+ margin-top:5px;
+
+}
+
+.right_cont
+{
+
+ width:78%;
+
+}
+
+.none_cont
+{
+
+ /*width:100%;*/
+
+}
+
+.contview
+{
+
+ border:solid #cccccc;
+ border-width:1px 1px 1px 1px;
+ padding:15px;
+ margin: 0px 0px 5px 0px;
+
+}
+
+.error
+{
+
+ color: #ff0000;
+ font-weight:bold;
+
+}
+
+.hidden_form
+{
+
+ display: none;
+ /*clear:left;*/
+
+}
+
+.no_hidden_form
+{
+
+ display: inline;
+ /*float:left;
+ clear:left right;*/
+
+}
+
+a.no_choose_flag
+{
+
+ filter: Alpha(opacity=50);
+ -moz-opacity: .5;
+ opacity: .5;
+ float:left;
+ margin: 2px;
+
+}
+
+a.choose_flag
+{
+
+ filter: Alpha(opacity=100);
+ -moz-opacity: 100;
+ opacity: 100;
+ float:left;
+ margin: 2px;
+
+}
+
+a:hover.no_choose_flag
+{
+
+ filter: Alpha(opacity=100);
+ -moz-opacity: 100;
+ opacity: 100;
+ float:left;
+ margin: 2px;
+
+}
+
+#languages
+{
+ width:100%;
+ clear:left;
+
+}
+
+/** input **/
+
+#center_body input {
+
+ border: solid #bcbcbc;
+ border-width:1px;
+ height:20px;
+ border-radius:5px;
+ background: #eeeeee;
+
+}
+
+#center_body input:hover {
+
+ background: #fafafa;
+
+}
+
+#center_body input[type="submit"]
+{
+
+ font-family: arial,sans;
+ font-size:12px;
+ height:25px;
+ border-radius:25px;
+ background: #eee;
+
+}
+
+#center_body input:hover[type="submit"]
+{
+
+ background: #fff;
+
+}
+
+#center_body input[type="button"]
+{
+
+ font-family: arial,sans;
+ font-size:12px;
+ height:25px;
+ border-radius:25px;
+ background: #eee;
+
+}
+
+#center_body input:hover[type="button"]
+{
+
+ background: #fff;
+
+}
+
+#center_body textarea {
+
+ border: solid #bcbcbc;
+ border-width:1px;
+ border-radius:5px;
+
+}
+
+#center_body select {
+
+ border: solid #bcbcbc;
+ border-width:1px;
+ border-radius:5px;
+
+}
+
+#languages_general, #logout
+{
+
+ position:absolute;
+ margin: 0px 0px 0px 0px;
+ top:54px;
+ z-index:3;
+ right:0px;
+ width:50px;
+
+}
+
+#logout
+{
+
+ top:16px;
+ right:5px;
+ font-weight:bold;
+ font-size:12px;
+}
+
+a.no_choose_flag_general
+{
+
+ filter: Alpha(opacity=50);
+ -moz-opacity: .5;
+ opacity: .5;
+ float:left;
+ margin: 2px;
+
+}
+
+a.choose_flag_general
+{
+
+ filter: Alpha(opacity=100);
+ -moz-opacity: 100;
+ opacity: 100;
+ float:left;
+ margin: 2px;
+
+}
+
+a:hover.no_choose_flag_general
+{
+
+ filter: Alpha(opacity=100);
+ -moz-opacity: 100;
+ opacity: 100;
+ float:left;
+ margin: 2px;
+
+}
+
+a.form_button_tab, a.form_button_tab_selected
+{
+
+ border: solid #121212 1px;
+ border-radius:10px;
+ padding:10px;
+ display:inline-block;
+ text-decoration:none;
+ color:#fbfbfb;
+ background: #000;
+
+}
+
+a.form_button_tab_selected
+{
+
+ background:#fbfbfb;
+ color: #000;
+
+}
+
+a.form_button_tab:hover
+{
+
+
+ color:#000;
+ background:#fbfbfb;
+
+}
+
+.flash
+{
+ border-radius:15px;
+ margin-top:15px;
+ padding:25px;
+ color:#fbfbfb;
+ text-shadow:#000000 1px 1px 1px;
+ filter: progid:DXImageTransform.Microsoft.Shadow(color='#000000', Direction=130, Strength=4);
+
+ background: #ff3019; /* Old browsers */
+ background: -moz-linear-gradient(top, #ff3019 0%, #cf0404 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ff3019), color-stop(100%,#cf0404)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #ff3019 0%,#cf0404 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #ff3019 0%,#cf0404 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #ff3019 0%,#cf0404 100%); /* IE10+ */
+ background: linear-gradient(to bottom, #ff3019 0%,#cf0404 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ff3019', endColorstr='#cf0404',GradientType=0 ); /* IE6-9 */
+
+}
diff --git a/modules/admin/media/css/font-awesome.min.css b/modules/admin/media/css/font-awesome.min.css
new file mode 100644
index 0000000..ee4e978
--- /dev/null
+++ b/modules/admin/media/css/font-awesome.min.css
@@ -0,0 +1,4 @@
+/*!
+ * Font Awesome 4.4.0 by @davegandy - http://fontawesome.io - @fontawesome
+ * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
+ */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.4.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.4.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.4.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.4.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.4.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.4.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}
diff --git a/modules/admin/media/css/login.css b/modules/admin/media/css/login.css
new file mode 100644
index 0000000..d857657
--- /dev/null
+++ b/modules/admin/media/css/login.css
@@ -0,0 +1,266 @@
+body {
+
+ margin:0px;
+ background: #fbfbfb;
+ font-family: 'Open Sans', sans-serif;
+
+}
+
+#title {
+
+ padding:10px;
+ color: #fbfbfb;
+ background: #ff7153 url("../images/admin/background_title_login.png") right no-repeat;
+ font-size:1.5em;
+ /*text-shadow: 1px 1px 0px rgba(0, 0, 0, 1);*/
+
+}
+
+.form {
+
+ margin:10px 15px 10px 10px;
+ position:relative;
+
+}
+
+input {
+
+ width:100%;
+ border: solid #bcbcbc 1px;
+ font-size:2em;
+ border-radius:5px;
+ padding:2px;
+
+}
+
+input:focus {
+
+ border-color: #FF7052;
+ outline:1px;
+
+}
+
+.submit {
+
+ width:250px;
+ display: block;
+ margin: 0 auto 18px auto;
+ background: #fff;
+ border-radius: 10px;
+ border: 1px solid #FF7052;
+ color: #FF7052;
+ font-size: 24px;
+ cursor: pointer;
+ box-shadow: 0px 0px 0px 7px #fff;
+ transition: 0.2s ease-out;
+ position:relative;
+}
+
+.submit:hover,
+.submit:focus {
+ background: #FF7052;
+ color: #fff;
+ outline: 0;
+}
+
+.error {
+
+ font-weight:bold;
+ color: #ff0000;
+
+}
+
+#submit_block {
+
+ position:relative;
+
+}
+
+#loading {
+
+ top:10px;
+ right:40px;
+ position:absolute;
+ display:block;
+ width:16px;
+ height:16px;
+ border: solid #000 0px;
+ background: url('../images/ajax-loader.gif') center no-repeat;
+ display:none;
+
+}
+
+/* Phones */
+@media (max-width: 767px) {
+
+ #login {
+
+ width:100%;
+ border: solid #cbcbcb;
+ border-width:0px 0px 1px 0px;
+ margin-top:5px;
+ margin:0px;
+ overflow:hidden;
+ background: #eaeaea;
+
+ }
+
+}
+
+/* Tablets */
+@media (min-width: 780px) and (max-width: 979px) {
+
+ #login {
+
+ position:relative;
+ width:400px;
+ border: solid #cbcbcb 1px;
+ margin-top:5px;
+ margin-left:auto;
+ margin-right:auto;
+ overflow:hidden;
+ background: #eaeaea;
+
+ }
+}
+
+/* Desktops */
+@media (min-width: 980px) {
+
+ #login {
+
+ position:relative;
+ width:400px;
+ border: solid #cbcbcb 1px;
+ margin-top:5px;
+ margin-left:auto;
+ margin-right:auto;
+ overflow:hidden;
+ background: #eaeaea;
+ }
+
+}
+
+/*
+* {
+ -ms-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ margin: 0;
+ padding: 0;
+ border: 0;
+}
+html,
+body {
+ width: 100%;
+ height: 100%;
+ background: #cedeff;
+ font-family: 'Open Sans', sans-serif;
+ font-weight: 200;
+}
+.login {
+ position: relative;
+ top: 50%;
+ width: 250px;
+ display: table;
+ margin: -150px auto 0 auto;
+ background: #fff;
+ border-radius: 4px;
+}
+.legend {
+ position: relative;
+ width: 100%;
+ display: block;
+ background: #FF7052;
+ padding: 15px;
+ color: #fff;
+ font-size: 20px;
+}
+.legend:after {
+ content: "";
+ background-image: url(../images/admin/multy-user.png);
+ background-size: 100px 100px;
+ background-repeat: no-repeat;
+ background-position: 152px -16px;
+ opacity: 0.06;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ position: absolute;
+}
+.input {
+ position: relative;
+ width: 90%;
+ margin: 15px auto;
+}
+.input span {
+ position: absolute;
+ display: block;
+ color: #d4d4d4;
+ left: 10px;
+ top: 8px;
+ font-size: 20px;
+}
+.input input {
+ width: 100%;
+ padding: 10px 5px 10px 40px;
+ display: block;
+ border: 1px solid #EDEDED;
+ border-radius: 4px;
+ transition: 0.2s ease-out;
+ color: #a1a1a1;
+}
+.input input:focus {
+ padding: 10px 5px 10px 10px;
+ outline: 0;
+ border-color: #FF7052;
+}
+.submit {
+ width: 45px;
+ height: 45px;
+ display: block;
+ margin: 0 auto -15px auto;
+ background: #fff;
+ border-radius: 100%;
+ border: 1px solid #FF7052;
+ color: #FF7052;
+ font-size: 24px;
+ cursor: pointer;
+ box-shadow: 0px 0px 0px 7px #fff;
+ transition: 0.2s ease-out;
+}
+.submit:hover,
+.submit:focus {
+ background: #FF7052;
+ color: #fff;
+ outline: 0;
+}
+.feedback {
+ position: absolute;
+ bottom: -70px;
+ width: 100%;
+ text-align: center;
+ color: #fff;
+ background: #2ecc71;
+ padding: 10px 0;
+ font-size: 12px;
+ display: none;
+ opacity: 0;
+}
+.feedback:before {
+ bottom: 100%;
+ left: 50%;
+ border: solid transparent;
+ content: "";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+ border-color: rgba(46, 204, 113, 0);
+ border-bottom-color: #2ecc71;
+ border-width: 10px;
+ margin-left: -10px;
+}
+*/
\ No newline at end of file
diff --git a/modules/admin/media/css/style.css b/modules/admin/media/css/style.css
new file mode 100644
index 0000000..a22df9e
--- /dev/null
+++ b/modules/admin/media/css/style.css
@@ -0,0 +1,902 @@
+/* General styles */
+
+body
+{
+
+ margin:0px;
+ background:url('../images/background.png') repeat-y center #e0e5e6;
+
+}
+
+iframe
+{
+
+ width:100%;
+ border:solid #5b5b5b;
+ border-width:1px;
+ border: solid #bcbcbc;
+ border-width:1px;
+ border-radius:5px;
+}
+
+a
+{
+
+ font-size:12px;
+ font-family:verdana, verdana;
+ text-decoration:none;
+ color: #3434cc;
+ font-weight:bold;
+}
+
+a:hover
+{
+
+ font-size:12px;
+ font-family:verdana, verdana;
+ text-decoration:underline;
+ color: #4545dd;
+ font-weight:bold;
+
+}
+
+strong
+{
+
+ font-weight: bold;
+
+}
+
+img {
+
+/*display:block;*/
+
+}
+
+/** center_body is the principal class **/
+
+#center_body {
+
+ position:relative;
+ height: auto !important;
+ width:958px;
+ margin-left:auto;
+ margin-right:auto;
+ overflow:auto;
+ height: auto !important;
+ min-height:600px;
+
+
+}
+
+/** input **/
+
+#center_body input {
+
+ border: solid #bcbcbc;
+ border-width:1px;
+ height:20px;
+ border-radius:5px;
+ background: #eeeeee;
+
+}
+
+#center_body input:hover {
+
+ background: #fafafa;
+
+}
+
+#center_body input[type="submit"]
+{
+
+ font-family: verdana,arial,sans;
+ font-size:12px;
+ height:25px;
+ border-radius:25px;
+ background: #eee;
+
+}
+
+#center_body input:hover[type="submit"]
+{
+
+ background: #fff;
+
+}
+
+#center_body textarea {
+
+ border: solid #bcbcbc;
+ border-width:1px;
+ border-radius:5px;
+
+}
+
+#center_body select {
+
+ border: solid #bcbcbc;
+ border-width:1px;
+ border-radius:5px;
+
+}
+
+/* header elements classes */
+
+#header
+{
+
+ width:952px;
+ border:solid #000000;
+ border-width:0px;
+ border-right-width:0px;
+ padding-left:5px;
+ color: #676767;
+ text-align:middle;
+ height:120px;
+ margin-bottom:4px;
+ line-height: 35px;
+
+}
+
+#header a
+{
+
+ color: #555555;
+
+}
+
+#logo_img
+{
+
+ position:absolute;
+ top:20px;
+ left:0px;
+
+}
+
+#your_account
+{
+
+ position:absolute;
+ top:25px;
+ right:5px;
+ background-image: url('../images/my-account.png');
+ background-repeat: no-repeat;
+ background-position:left;
+ padding-left:25px;
+
+}
+
+#cart
+{
+
+ position:absolute;
+ top:50px;
+ right:5px;
+ background-image: url('../images/cart.gif');
+ background-repeat: no-repeat;
+ background-position:left;
+ padding-left:25px;
+ font-size:12px;
+
+}
+
+#change_currency
+{
+
+ position:absolute;
+ top:70px;
+ right:5px;
+ background-image: url('../images/currency.gif');
+ background-repeat: no-repeat;
+ background-position:left;
+ padding-left:25px;
+ font-size:12px;
+
+}
+
+/* Languages styles in header. */
+
+#languages
+{
+
+ position:absolute;
+ margin: 0px 0px 0px 0px;
+ top:10px;
+ right:5px;
+ /*right:50px;*/
+
+}
+
+a.no_choose_flag
+{
+
+ filter: Alpha(opacity=50);
+ -moz-opacity: .5;
+ opacity: .5;
+
+}
+
+a.choose_flag
+{
+
+ filter: Alpha(opacity=100);
+ -moz-opacity: 100;
+ opacity: 100;
+
+}
+
+a:hover.no_choose_flag
+{
+
+ filter: Alpha(opacity=100);
+ -moz-opacity: 100;
+ opacity: 100;
+
+}
+
+#menu_barr
+{
+
+ height:40px;
+ background-image:url('../images/background_barr.png');
+ background-repeat: repeat-x;
+ border:solid #cbcbcb;
+ border-width:1px;
+ border-radius:8px;
+ text-align:center;
+ font-size:16px;
+ line-height:40px;
+ margin-bottom:18px;
+
+}
+
+#menu_barr a
+{
+
+ font-size:16px;
+
+}
+
+/* Menus in left and right sides... */
+
+#menu
+{
+
+
+ width:175px;
+ /*border:solid #ffffff;
+ border-width:5px;*/
+ margin:0px 0px 5px 0px;
+ padding:0px;
+
+}
+
+#menu a
+{
+
+ font-size:14px;
+ font-family:verdana, verdana;
+ text-decoration:none;
+ color: #3434cc;
+ font-weight:bold;
+ padding:5px;
+}
+
+#menu a:hover
+{
+
+ font-size:14px;
+ font-family:verdana, verdana;
+ text-decoration:underline;
+ color: #4545dd;
+ padding:5px;
+
+}
+
+.title_block
+{
+
+ font-size:20px;
+ font-weight:normal;
+ font-family:verdana;
+ text-decoration:none;
+ color: #fff;
+ background-image:url('../images/block_bg.png');
+ background-repeat:repeat-x;
+ background-position:bottom;
+ background-color:#4e8df6;
+ border:solid #256753;
+ border-width:1px;
+ padding:8px 4px 0px 8px;
+ margin:0px;
+ position:relative;
+ height:40px;
+ border-radius: 8px 8px 0px 0px;
+
+}
+
+.url_block
+{
+
+ font-size:12px;
+ font-family:verdana;
+ text-decoration:none;
+ color: #676767;
+ border:solid #cbcbcb;
+ border-width:0px 1px 0px 1px;
+ padding:8px 4px 8px 4px;
+ margin:0px;
+ position:relative;
+
+
+}
+
+.static_block
+{
+
+ font-size:12px;
+ font-family:verdana;
+ text-decoration:none;
+ color: #676767;
+ /*background-image:url('../images/block_bg_link.png');*/
+ border:solid #cbcbcb;
+ border-width:0px 1px 0px 1px;
+ padding:4px;
+ margin:0px;
+ position:relative;
+
+
+}
+
+.block_end
+{
+
+ background-image:url('../images/block_end.png');
+ height:15px;
+ border:solid #cbcbcb;
+ border-width:0px 1px 1px 1px;
+ border-radius:0px 0px 5px 5px;
+ margin-bottom:5px;
+
+}
+
+.link_menu a
+{
+
+ color:#ff0000;
+
+}
+
+.menu_left
+{
+
+ float:left;
+
+}
+
+.menu_right
+{
+
+ float:right;
+
+}
+
+/* styles in content */
+
+#content
+{
+
+ display:block;
+ padding:0px 5px 0px 5px;
+ font-size:12px;
+ font-family:verdana, verdana;
+ text-decoration:none;
+ color: #676767;
+ margin-top:0px;
+ overflow:auto;
+ position:relative;
+ font-weight:lighter;
+
+
+
+}
+
+.content
+{
+
+ overflow:auto;
+ position:relative;
+
+}
+
+.content_all
+{
+
+ width:598px;
+ float:left;
+
+
+}
+
+.content_right
+{
+
+ width:772px;
+ float:left;
+
+
+}
+
+.title
+{
+
+ font-size:18px;
+ font-weight:bold;
+ font-family:verdana, verdana;
+ text-decoration:none;
+ color: #232323;
+ border:solid #cbcbcb;
+ border-width:1px;
+ padding:10px;
+ margin-bottom:5px;
+ background-color:#1ca34f;
+ background-image:url('../images/background_barr.png');
+ background-repeat:repeat-x;
+ border-radius:8px;
+ text-shadow: 1px 1px 2px rgba(150, 150, 150, 1);
+
+}
+
+.cont {
+
+ border:solid #dbdbdb;
+ border-width:1px 1px 1px 1px;
+ padding:10px 20px 10px 20px;
+ margin-bottom:5px;
+ position:relative;
+ /*text-align:justify;*/
+ overflow:hidden;
+ height:100%;
+
+}
+
+#inform {
+
+ margin:auto;
+
+}
+
+#options {
+
+ position:absolute;
+ top:50px;
+ left:600px;
+}
+
+/*Styles for common templates...*/
+
+.form label {
+ display: block;
+ width: 150px;
+ float: left;
+ margin-bottom: 10px;
+ text-align: left;
+ width: 300px;
+ padding-right: 20px;
+
+}
+
+.form textarea {
+
+ width:100%;
+ height:150px;
+ clear:both;
+
+}
+
+.form p {
+ clear: left;
+}
+
+.panel {
+
+
+}
+
+.panel p {
+
+text-align:center;
+
+}
+
+.panel img {
+
+display:block;
+margin-left:auto;
+margin-right:auto;
+
+}
+
+/* Table list config */
+
+.table_list {
+
+ border:solid #cbcbcb;
+ border-width:1px;
+ width:100%;
+ clear:left;
+ border-radius:8px;
+
+}
+
+.head_list
+{
+
+ /*width:100%;*/
+ margin:4px;
+ display:block;
+ position:relative;
+ float:left;
+ /*border:solid #ffffff;
+ border-width:1px;*/
+ width:60%;
+}
+
+.head_list_right
+{
+
+ /*width:100%;*/
+ margin:4px;
+ display:block;
+ position:relative;
+ /*clear:left;*/
+ float:right;
+ /*border:solid #ffffff;
+ border-width:1px;*/
+ width:35%;
+ bottom:0px;
+ text-align:right;
+
+
+}
+
+.title_list
+{
+
+
+ width:100%;
+ position:relative;
+ /*border:solid #ffffff;
+ border-width:1px 1px 1px 1px;*/
+
+}
+
+.title_list td
+{
+
+ font-size:14px;
+ font-weight:bold;
+ font-family:verdana, verdana;
+ text-decoration:none;
+ color: #fff;
+ border:solid #cbcbcb;
+ border-width:1px 1px 1px 1px;
+ padding:5px 5px 5px 5px;
+ margin:4px;
+ margin-bottom:5px;
+ background-color:#d75a09;
+ background-repeat:repeat-x;
+ text-align:center;
+ border-radius:8px;
+
+}
+
+.row_list
+{
+
+
+ width:100%;
+ position:relative;
+ /*border:solid #ffffff;
+ border-width:1px 1px 1px 1px;*/
+
+}
+
+.row_list td
+{
+
+ font-size:12px;
+ font-weight:bold;
+ font-family:verdana, verdana;
+ text-decoration:none;
+ color: #676767;
+ border:solid #ffffff;
+ border-width:1px 1px 1px 1px;
+ padding:5px 5px 5px 5px;
+ margin:4px;
+ margin-bottom:5px;
+ text-align:center;
+ /*background-color:#d75a09;
+ background-image:url('../images/fondo_titulo.png');
+ background-repeat:repeat-x;*/
+ /*float:left;*/
+
+}
+
+/* styles in private messages */
+
+.new_message
+{
+
+display:block;
+width:60px;
+height:30px;
+float:left;
+padding:0px;
+/*border:solid #ffffff;
+border-width:1px;*/
+background-image:url('../images/new_message.png');
+background-repeat:no-repeat;
+background-position:center;
+
+}
+
+.message
+{
+
+display:block;
+width:60px;
+height:30px;
+float:left;
+padding:0px;
+/*border:solid #ffffff;
+border-width:1px;*/
+background-image:url('../images/message.png');
+background-repeat:no-repeat;
+background-position:center;
+
+}
+
+.error
+{
+
+ color: #ff0000;
+ font-weight:bold;
+
+}
+
+#footer
+{
+
+ height:100px;
+ border: solid #bcbcbc;
+ border-width:1px;
+ border-radius:8px;
+ margin-bottom:15px;
+ text-align:center;
+ line-height:100px;
+ position:relative;
+ font-size:12px;
+ font-family:verdana;
+ color:#555555;
+ background-image:url('../images/background_foot.png');
+ background-repeat:repeat-x;
+ background-position:bottom;
+ background-color: #fff;
+
+
+}
+
+/*Products style*/
+
+.product
+{
+
+ display:block;
+ position:relative;
+ height:100%;
+ margin-bottom:10px;
+
+}
+
+.title_product
+{
+
+ border:solid #ffffff;
+ border-width:1px 0px 0px 0px;
+ font-size:15px;
+ font-weight:bold;
+ display:block;
+ /*clear:right;*/
+ margin-bottom:4px;
+ /*border:solid #ffffff;
+ border-width:1px;*/
+
+}
+
+.image_list_prod
+{
+
+ border:solid #ffffff;
+ border-width:1px;
+ float:left;
+ position:relative;
+ padding:0px;
+
+
+}
+
+.description_product
+{
+
+ float:left;
+ padding:20px;
+
+
+}
+
+.img_desc
+{
+
+ border:solid #ffffff;
+ border-width:1px;
+ margin-left:30px;
+ margin-right:30px;
+
+}
+
+.desc_product
+{
+
+ border:solid #ffffff;
+ border-width:0px 0px 1px 0px;
+ overflow:auto;
+ height:100%;
+ padding-bottom:5px;
+
+
+}
+
+a.ship {
+
+ display: block;
+ border: solid #cbcbcb;
+ border-width:1px;
+ border-radius:5px;
+ background-image:url('../images/background_barr.png');
+ background-position:bottom center;
+ background-repeat:repeat-x;
+ text-align:center;
+ min-width:100px;
+ min-height: 28px;
+ float:left;
+ line-height:28px;
+ padding:5px;
+ color: #868686;
+
+}
+
+a.ship:hover {
+
+ /*background-position: -87px 0px;*/
+
+}
+
+a.see {
+
+ display: block;
+ min-width: 126px;
+ min-height: 28px;
+ border: solid #cbcbcb;
+ border-width:1px;
+ border-radius:5px;
+ background-image:url('../images/background_barr.png');
+ background-position:bottom center;
+ background-repeat:repeat-x;
+ line-height:28px;
+ text-align:center;
+ float:left;
+ margin-right:2px;
+ padding:5px;
+ color: #868686;
+
+}
+
+.see_products {
+
+ display: block;
+ min-width: 126px;
+ min-height: 28px;
+ border: solid #cbcbcb;
+ border-width:1px;
+ border-radius:5px;
+ background-image:url('../images/background_barr.png');
+ background-position:bottom center;
+ background-repeat:repeat-x;
+ line-height:28px;
+ text-align:center;
+ /*border:solid #ffffff;
+ border-width:1px 1px 1px 1px;*/
+ float:left;
+ margin-right:2px;
+ padding:5px;
+ color: #868686;
+
+}
+#show_process_buying
+{
+
+ position:absolute;
+
+}
+
+/*view big image css*/
+
+#show_big_images
+{
+
+ display:none;
+ position:fixed;
+ width:100%;
+ height:100%;
+ z-index:150;
+ background-color: #000;
+
+}
+
+#center_frame_image
+{
+
+ position:absolute;
+ width:100%;
+ height:100%;
+ z-index:151;
+
+}
+
+#frame_image
+{
+ display:none;
+ width:300px;
+ height:300px;
+ border: solid #ffffff;
+ border-width:4px;
+ border-radius:10px;
+ margin-left:auto;
+ margin-right:auto;
+ margin-top:20px;
+ position:relative;
+ z-index:151;
+ background-image:url('../images/loading_image_black.gif');
+ background-position:center;
+ background-repeat: no-repeat;
+ background-color: #000;
+ overflow:visible;
+
+}
+
+#icon_close_frame_image
+{
+
+ position:absolute;
+ background-image:url('../images/close_black.png');
+ background-position:center;
+ background-repeat: no-repeat;
+ width:30px;
+ height:30px;
+ display:block;
+ z-index:152;
+ color:#fff;
+ right:0px;
+
+}
+
+.units
+{
+
+ width:40px;
+ text-align:center;
+
+}
\ No newline at end of file
diff --git a/modules/admin/media/images/admin/background.png b/modules/admin/media/images/admin/background.png
new file mode 100644
index 0000000..5660f22
Binary files /dev/null and b/modules/admin/media/images/admin/background.png differ
diff --git a/modules/admin/media/images/admin/background_title.png b/modules/admin/media/images/admin/background_title.png
new file mode 100644
index 0000000..c716ff3
Binary files /dev/null and b/modules/admin/media/images/admin/background_title.png differ
diff --git a/modules/admin/media/images/admin/background_title_login.png b/modules/admin/media/images/admin/background_title_login.png
new file mode 100644
index 0000000..99166e1
Binary files /dev/null and b/modules/admin/media/images/admin/background_title_login.png differ
diff --git a/modules/admin/media/images/ajax-loader.gif b/modules/admin/media/images/ajax-loader.gif
new file mode 100644
index 0000000..5516707
Binary files /dev/null and b/modules/admin/media/images/ajax-loader.gif differ
diff --git a/modules/admin/media/images/logo.png b/modules/admin/media/images/logo.png
new file mode 100644
index 0000000..8999282
Binary files /dev/null and b/modules/admin/media/images/logo.png differ
diff --git a/modules/admin/media/js/jquery.min.js b/modules/admin/media/js/jquery.min.js
new file mode 100644
index 0000000..0f60b7b
--- /dev/null
+++ b/modules/admin/media/js/jquery.min.js
@@ -0,0 +1,5 @@
+/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;
+
+return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="