Skip to content

Commit

Permalink
Implementando pygments
Browse files Browse the repository at this point in the history
  • Loading branch information
lesthack committed Aug 9, 2011
1 parent c6659ac commit 38f68e5
Show file tree
Hide file tree
Showing 5 changed files with 210 additions and 139 deletions.
250 changes: 159 additions & 91 deletions media/css/style.css
@@ -1,165 +1,233 @@
* { * {
padding: 0px; padding: 0px;
margin: 0px; margin: 0px;
} }
html, body{ html, body{
background: #DDD; background: #DDD;
font-family: "Droid Sans Mono", Helvetica, serif; font-family: "Droid Sans Mono", Helvetica, serif;
font-size: 12px; font-size: 12px;
} }
a { a {
text-decoration: none; text-decoration: none;
} }
#menu{ #menu{
position: absolute; position: absolute;
top: 100px; top: 100px;
left: 0px; left: 0px;
} }
#menu a{ #menu a{
display: block; display: block;
padding-left: 5px; padding-left: 5px;
padding-right: 5px; padding-right: 5px;
color: #444; color: #444;
font-weight: bold; font-weight: bold;
background: #DDD; background: #DDD;
margin-top: 2px; margin-top: 2px;
margin-bottom: 2px; margin-bottom: 2px;
} }
#menu a:hover{ #menu a:hover{
background: #CCC; background: #CCC;
} }
#panel_head{ #panel_head{
position: absolute; position: absolute;
top: 0px; top: 0px;
right: 60px; right: 60px;
} }
#panel_code{ #panel_code{
position: absolute; position: absolute;
top: 50px; top: 50px;
left: 150px; left: 150px;
right: 50px; right: 50px;
bottom: 20px; bottom: 20px;
background: #fff; background: #fff;
-moz-border-radius: 6px; -moz-border-radius: 6px;
-webkit-border-radius: 6px; -webkit-border-radius: 6px;
overflow: auto; overflow: auto;
} }
#panel_code .code{ #panel_code .code{
} }
#list_form { #list_form {
margin: 15px; margin: 15px;
margin-top: 25px; margin-top: 25px;
} }
#list_form p{ #list_form p{
width: 95%; width: 95%;
text-align: justify; text-align: justify;
} }
#list_form table{ #list_form table{
font-size: 12px; font-size: 12px;
width: 99%; width: 99%;
cursor: default; cursor: default;
} }
#list_form table tbody tr.one{ #list_form table tbody tr.one{
background: #EEE; background: #EEE;
} }
#list_form table tbody tr:hover{ #list_form table tbody tr:hover{
background: #DDD; background: #DDD;
} }
#list_form table tbody td{ #list_form table tbody td{
padding-left: 15px; padding-left: 15px;
} }
#list_form table tbody td a{ #list_form table tbody td a{
color: blue; color: blue;
} }
#list_form table tbody tr:hover a{ #list_form table tbody tr:hover a{
color: green; color: green;
} }
#paginator{ #paginator{
width: 95%; width: 95%;
text-align: right; text-align: right;
margin-top: 10px; margin-top: 10px;
position: absolute; position: absolute;
bottom: 10px; bottom: 10px;
} }
#form_code{ #form_code{
margin: 15px; margin: 15px;
} }
#about{ #about{
padding: 20px; padding: 20px;
} }
#about .picture{ #about .picture{
float: left; float: left;
margin: 10px; margin: 10px;
} }
#about .description{ #about .description{
float: left; float: left;
margin-top: 30px; margin-top: 30px;
width: 500px; width: 500px;
} }
#about .me{ #about .me{
margin-bottom: 10px; margin-bottom: 10px;
} }
#about ol{ #about ol{
list-style-image: none; list-style-image: none;
list-style-type: none; list-style-type: none;
margin-left: 10px; margin-left: 10px;
margin-bottom: 20px; margin-bottom: 20px;
} }
form label{ form label{
display: block; display: block;
} }
form input.text{ form input.text{
border: 1px solid #DDD; border: 1px solid #DDD;
padding: 4px 10px; padding: 4px 10px;
-moz-border-radius: 6px; -moz-border-radius: 6px;
-webkit-border-radius: 6px; -webkit-border-radius: 6px;
} }
form input.text:focus{ form input.text:focus{
border:1px solid #BBB; border:1px solid #BBB;
} }
form input.button{ form input.button{
border: 1px solid #BBB; border: 1px solid #BBB;
background: #DDD; background: #DDD;
margin: 5px; margin: 5px;
padding: 4px 15px; padding: 4px 15px;
} }
form input.button:hover{ form input.button:hover{
background: #CCC; background: #CCC;
} }
form input.button:active{ form input.button:active{
background: #AAA; background: #AAA;
} }
form select{ form select{
padding: 4px 0px; padding: 4px 0px;
background: #fff; background: #fff;
border:1px solid #DDD; border:1px solid #DDD;
} }
form select:focus{ form select:focus{
border:1px solid #BBB; border:1px solid #BBB;
} }
form select optgroup option{ form select optgroup option{
margin-left: 15px; margin-left: 15px;
color: blue; color: blue;
} }
form textarea.textarea{ form textarea.textarea{
border:1px solid #DDD; border:1px solid #DDD;
width: 95%; width: 95%;
height: 350px; height: 350px;
} }
form textarea:focus{ form textarea:focus{
border:1px solid #BBB; border:1px solid #BBB;
} }
div.row_form{ div.row_form{
margin-bottom: 5px; margin-bottom: 5px;
} }
div.row_form .errors{ div.row_form .errors{
color: red; color: red;
} }
div.info{ div.info{
margin-left: 20px; margin-left: 20px;
margin-top: 10px; margin-top: 10px;
} }
.highlight{
padding: 5px 10px;
margin-top: 10px;
border-top: 1px solid #999;
border-bottom: 1px solid #999;
}
.highlight .hll { background-color: #ffffcc }
.highlight { background: #f8f8f8; }
.highlight .c { color: #408080; font-style: italic } /* Comment */
.highlight .err { border: 1px solid #FF0000 } /* Error */
.highlight .k { color: #008000; font-weight: bold } /* Keyword */
.highlight .o { color: #666666 } /* Operator */
.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #BC7A00 } /* Comment.Preproc */
.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */
.highlight .cs { color: #408080; font-style: italic } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
.highlight .go { color: #808080 } /* Generic.Output */
.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #0040D0 } /* Generic.Traceback */
.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008000 } /* Keyword.Pseudo */
.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #B00040 } /* Keyword.Type */
.highlight .m { color: #666666 } /* Literal.Number */
.highlight .s { color: #BA2121 } /* Literal.String */
.highlight .na { color: #7D9029 } /* Name.Attribute */
.highlight .nb { color: #008000 } /* Name.Builtin */
.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */
.highlight .no { color: #880000 } /* Name.Constant */
.highlight .nd { color: #AA22FF } /* Name.Decorator */
.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0000FF } /* Name.Function */
.highlight .nl { color: #A0A000 } /* Name.Label */
.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #19177C } /* Name.Variable */
.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #666666 } /* Literal.Number.Float */
.highlight .mh { color: #666666 } /* Literal.Number.Hex */
.highlight .mi { color: #666666 } /* Literal.Number.Integer */
.highlight .mo { color: #666666 } /* Literal.Number.Oct */
.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */
.highlight .sc { color: #BA2121 } /* Literal.String.Char */
.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #BA2121 } /* Literal.String.Double */
.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */
.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
.highlight .sx { color: #008000 } /* Literal.String.Other */
.highlight .sr { color: #BB6688 } /* Literal.String.Regex */
.highlight .s1 { color: #BA2121 } /* Literal.String.Single */
.highlight .ss { color: #19177C } /* Literal.String.Symbol */
.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #19177C } /* Name.Variable.Class */
.highlight .vg { color: #19177C } /* Name.Variable.Global */
.highlight .vi { color: #19177C } /* Name.Variable.Instance */
.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
57 changes: 29 additions & 28 deletions pub/models.py
Expand Up @@ -4,36 +4,37 @@
from time import strftime from time import strftime


class language(models.Model): class language(models.Model):
name = models.CharField(max_length=50) name = models.CharField(max_length=50)
def __str__(self): complete_name = models.CharField(max_length=100)
return self.name def __str__(self):
return self.complete_name


class codes(models.Model): class codes(models.Model):
owner = models.CharField(max_length=100, blank=True) owner = models.CharField(max_length=100, blank=True)
name = models.CharField(max_length=200, blank=True) name = models.CharField(max_length=200, blank=True)
description = models.CharField(max_length=500, blank=True) description = models.CharField(max_length=500, blank=True)
code = models.TextField() code = models.TextField()
date = models.DateTimeField(default=strftime("%Y-%m-%d %H:%M:%S")) date = models.DateTimeField(default=strftime("%Y-%m-%d %H:%M:%S"))
language = models.ForeignKey(language) language = models.ForeignKey(language)


def __str__(self): def __str__(self):
return self.name return self.name


class codesForm(ModelForm): class codesForm(ModelForm):
class Meta: class Meta:
model = codes model = codes
fields = ('owner', 'name', 'description', 'code', 'language') fields = ('owner', 'name', 'description', 'code', 'language')
widgets = { widgets = {
'name': TextInput(attrs={'class':'text', 'size':'20'}), 'name': TextInput(attrs={'class':'text', 'size':'20'}),
'owner': TextInput(attrs={'class':'text', 'size':'20'}), 'owner': TextInput(attrs={'class':'text', 'size':'20'}),
'description': TextInput(attrs={'class':'text', 'size':'50'}), 'description': TextInput(attrs={'class':'text', 'size':'50'}),
'code': Textarea(attrs={'class':'textarea'}), 'code': Textarea(attrs={'class':'textarea'}),
} }
def clean_date(self): def clean_date(self):
return strftime("%Y-%m-%d %H:%M:%S") return strftime("%Y-%m-%d %H:%M:%S")
class languageForm(ModelForm): class languageForm(ModelForm):
class Meta: class Meta:
model = language model = language
Binary file modified pub/models.pyc
Binary file not shown.

0 comments on commit 38f68e5

Please sign in to comment.