Skip to content

Commit

Permalink
Added mobile version layout
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavohenrique committed Jul 23, 2011
1 parent 40f3182 commit 9b7827b
Show file tree
Hide file tree
Showing 29 changed files with 658 additions and 41 deletions.
Binary file added media/css/mobile/images/.DS_Store
Binary file not shown.
Binary file added media/css/mobile/images/arrow_li.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/css/mobile/images/bg_menu.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/css/mobile/images/bg_quote.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/css/mobile/images/bt_g.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/css/mobile/images/bt_ga.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/css/mobile/images/bt_gh.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/css/mobile/images/icon_accept.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/css/mobile/images/icon_error.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/css/mobile/images/icon_home.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/css/mobile/images/icon_info.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/css/mobile/images/icon_warning.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/css/mobile/images/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
402 changes: 402 additions & 0 deletions media/css/mobile/screen.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions settings.py
Expand Up @@ -60,11 +60,11 @@

ROOT_URLCONF = 'urls'


MAIN_TEMPLATE_DIR=os.path.join(PROJECT_ROOT_PATH, 'templates')

WEB_TEMPLATE_DIR=os.path.join(MAIN_TEMPLATE_DIR, 'web')
TEMPLATE_DIRS = (
os.path.join(MAIN_TEMPLATE_DIR, 'web')
WEB_TEMPLATE_DIR,
os.path.join(WEB_TEMPLATE_DIR, 'tips')
)

INSTALLED_APPS = (
Expand Down
13 changes: 13 additions & 0 deletions settings_mobile.py
@@ -0,0 +1,13 @@
# -*- coding:utf-8 -*-
import os
PROJECT_ROOT_PATH = os.path.dirname(os.path.abspath(__file__))

from settings import *

MAIN_TEMPLATE_DIR=os.path.join(PROJECT_ROOT_PATH, 'templates')
WEB_TEMPLATE_DIR=os.path.join(MAIN_TEMPLATE_DIR, 'mobile')
TEMPLATE_DIRS = (
WEB_TEMPLATE_DIR,
os.path.join(WEB_TEMPLATE_DIR, 'tips')
)

61 changes: 23 additions & 38 deletions templates/mobile/base_site.html
Expand Up @@ -12,23 +12,8 @@
<meta name="description" lang="en-us" content="Tips For Linux newbies and advanced users about how to use linux for system administration tasks of the day-to-day, to increase the productivity of developers and users to help solve a troubles" />
<meta name="description" lang="pt-br" content="Dicas para iniciantes e usuários avançados Linux sobre como usar o linux para as tarefas de administração do sistema do dia-a-dia, para aumentar a produtividade de desenvolvedores e para ajudar os usuários a resolverem problemas" />
<meta name="keywords" content="{% block meta_keywords %}linux, shell, ubuntu, samba, squid, ssh, network, wireless{% endblock %}" />


<!-- Website Title -->
<title>Full Admin - Mobile</title>

<!-- Meta data for SEO -->
<meta name="description" content=""/>
<meta name="keywords" content=""/>

<!-- Template stylesheet -->
<link rel="stylesheet" href="css/screen.css" type="text/css" media="all"/>

<link rel="stylesheet" type="text/css" media="all" href="{{ MEDIA_URL }}css/screen.css" />

<script type="text/javascript" src="{{ MEDIA_URL }}js/jquery.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}js/jquery/lib/jquery-ui.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}js/custom.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="{{ MEDIA_URL }}css/mobile/screen.css" />

<!-- google analytics -->
<script type="text/javascript">
Expand All @@ -54,28 +39,28 @@
<body>

<div id="wrapper">
<div id="top_bar">
<div class="inner">
<a href="/" title="Home"><img src="{{ MEDIA_URL }}css/images/logo.png" alt="Logo"/><h1>Tips for Linux newbies and advanced users</h1></a>
</div>
<div class="home">
<a href="/">
<img src="{{ MEDIA_URL }}css/images/mobile/icon_home.png" alt="" width="40" height="40"/>
</a>
</div>
</div>
<br/><br/>
<div id="content_wrapper">
<div class="search">
<form method="get" id="searchform" action="{% url tip-simple-search %}">
<p><input type="text" value="" onclick="this.value=''" name="text" id="s" class="search"/></p>
</form>
</div>
{% block main %} {% endblock %}
</div>
<div id="top_bar">
<div class="inner">
<a href="/" title="Home"><img src="{{ MEDIA_URL }}css/images/logo.png" width="250" height="50" alt="Logo"/></a>
</div>
<div class="home">
<a href="/">
<img src="{{ MEDIA_URL }}css/mobile/images/icon_home.png" alt="" width="40" height="40"/>
</a>
</div>
</div>
<br/><br/>
<div id="content_wrapper">
<div class="search">
<form method="get" id="searchform" action="{% url tip-simple-search %}">
<p><input type="text" value="Search" onfocus="this.value=''" onblur="this.value='Search'" name="text" id="s" class="search"/></p>
</form>
</div>
{% block main %} {% endblock %}
</div>

</div>

Expand Down
File renamed without changes.
File renamed without changes.
42 changes: 42 additions & 0 deletions templates/mobile/tips/index.html
@@ -0,0 +1,42 @@
{% extends "base_site.html" %}

{% block main %}

{% load truncate %}

{% if not tips %}
<div id="error404">
<img src="{{ MEDIA_URL }}css/images/sadpenguin.png" width="150" height="137" alt="Sad penguin"/>
<p>Sorry, no tips found.</p>
</div>
{% endif %}

{% load pagination_tags %}
{% autopaginate tips 10 %}


<ul class="list_data">
{% for tip in tips %}
<li>
<a href="{{ tip.get_absolute_url }}" title="{{ tip.title }}">
{% include 'post_title.html' %}
<span class="description">{{ tip.body|striptags|truncate:100|removetags:"div b span a p br table"|safe }}</span>
</a>
<br class="clear"/>
</li>
<!--
{% if tip.body|striptags|truncate:100|length > 100 %}
<div class="post-footer reply">
<a href="{{ tip.get_absolute_url }}" class="button">keep reading...</a>
</div>
{% endif %}
-->
{% endfor %}
</ul>

<br class="clear"/>

{% paginate %}


{% endblock %}
File renamed without changes.
17 changes: 17 additions & 0 deletions templates/mobile/tips/post_title.html
@@ -0,0 +1,17 @@
{% load truncate %}

<span class="header">
{{ tip.title|upper|truncate:47 }}
</span><br/>

<!--
<h1 class="post-title"><a href="{{ tip.get_absolute_url }}" title="{{ tip.title }}"><strong>{{ tip.title|upper|truncate:47 }}</strong></a></h1>
<h2 class="post-header-line1">{{ tip.pub_date|date:"F j, Y" }} by {{ tip.author }} {% if tip.get_tags %}| {{ tip.get_tags|safeseq|join:", " }} {% endif %}</h2>
{% ifequal request.user tip.author %}
<a href="{% url tip-edit tip.id %}" title="Edit"><div class="edit" style="float:left;margin-right:5px;"></div><noscript>Edit</noscript></a>
<a href="{% url tip-delete tip.id %}" title="Delete"><div class="delete" style="float:left;"></div><noscript>Delete</noscript></a>
<br/>
{% endifequal %}
-->
37 changes: 37 additions & 0 deletions templates/mobile/tips/read.html
@@ -0,0 +1,37 @@
{% extends 'base_site.html' %}

{% load comments %}
{% load gravatar %}
{% load truncate %}

{% block meta_keywords %}{{ tip.title }}{% endblock %}

{% block title %}
{{ block.super }} - {{ tip.title|lower }}
{% endblock %}

{% block main %}
<div class="inner">
<h2 class="header">{{ tip.title|upper|truncate:47 }}</h2>
<p>
{{ tip.body|striptags|linebreaksbr|safe }}
</p>
</div>

<br class="clear"/><br/>

<ul class="list_data">
{% get_comment_list for tip as comment_list %}
{% for comment in comment_list %}
<li>
<span class="avatar">
{% gravatar comment.user_email 48 %}
</span>
<span class="header with_avatar">{{ comment.name }} says</span><br/>
<span class="description">{{ comment.comment|linebreaks }}</span>
<br class="clear"/>
</li>
{% endfor %}
</ul>

{% endblock %}
19 changes: 19 additions & 0 deletions templates/web/tips/edit.html
@@ -0,0 +1,19 @@
{% extends 'base_site.html' %}

{% block main %}

<div class="info">
<h1>Edit Tip</h1>
</div>

<form id="formTipEdit" name="formTipEdit" action="{% url tip-update %}" method="post" class="genericform">
{% include 'form.html' %}

<div>
<input type="submit" value="Save" class="button">
<input type="button" value="Cancel" class="button" onclick="history.go(-1);">
</div>

</form>

{% endblock %}
9 changes: 9 additions & 0 deletions templates/web/tips/form.html
@@ -0,0 +1,9 @@
{% csrf_token %}

{{ form.id }}
<label class="title" for="id_title" accesskey="t">Title</label> {{ form.title }} <span class="errormessage">{{ form.title.errors }}</span>
<label class="title" for="id_body" accesskey="b">Tip</label> {{ form.body }} <span class="errormessage">{{ form.body.errors }}</span>
<label class="title" for="id_tags" accesskey="d">Tags</label> {{ form.tags }} <span class="errormessage">{{ form.tags.errors }}</span>
<label class="title" ></label>{{ form.is_public }}<label class="desc" for="id_is_public"> Is public?</label>
<label class="title" ></label>{{ form.enable_comments }}<label class="desc" for="id_enable_comments"> Enable comments?</label>
<p class="terms">Attention: Your tip may be rejected if it is considered improper or duplicate by Administrator.</p>
File renamed without changes.
93 changes: 93 additions & 0 deletions templates/web/tips/mytips.html
@@ -0,0 +1,93 @@
{% extends 'base_site.html' %}

{% block main %}

{% load pagination_tags %}

{% autopaginate tips 10 %}

<div class="tips">
<div class="info"><h1>My Tips</h1></div>

{% if tips %}
{% paginate %}
<table cellpadding="0" cellspacing="0" border="1">
<thead>
<td width="80">Posted in</td>
<td width="400">Title</td>
<td class="center">Hits</td>
<td class="center">Approved?</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</thead>
<tbody>
{% for tip in tips %}
<tr style="background:{% cycle '#ffffff' '#f8f8f8' %}">
<td>{{ tip.pub_date }}</td>
<td><a href="{{ tip.get_absolute_url }}">{{ tip.title }}</a></td>
<td class="center">{{ tip.hits }}</td>
<td class="center" style="color:{% if tip.approved %}green{% else %}red{% endif %}">{{ tip.approved|yesno }}</td>
<td><a href="{% url tip-edit tip.id %}" title="Edit"><div class="edit"></div><noscript>Edit</noscript></a></td>
<td><a href="{% url tip-delete tip.id %}" title="Delete"><div class="delete"></div><noscript>Delete</noscript></a></td>
</tr>
{% endfor %}
</tbody>
</table>

{% else %}
<p style="font-size:0.8em">No tips.</p>
{% endif %}

</div>

<br><br>

{% autopaginate bookmarked_tips 10 %}

<div class="tips">
<div class="info"><h1>Bookmarked Tips</h1></div>

{% if bookmarked_tips %}
<table cellpadding="0" cellspacing="0" border="1">
<thead>
<td width="80">Posted in</td>
<td width="400">Title</td>
<td width="150" class="center">Author</td>
<td>&nbsp;</td>
</thead>
<tbody>
{% for b in bookmarked_tips %}
<tr style="background:{% cycle '#ffffff' '#f8f8f8' %}">
<td>{{ b.tip.pub_date }}</td>
<td><a href="{{ b.tip.get_absolute_url }}">{{ b.tip.title }}</a></td>
<td class="center">{{ b.tip.author }}</td>
<td><a href="{% url tip-bookmark b.tip.id %}?action=delete" title="Delete"><div class="delete"></div><noscript>Delete</noscript></a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% paginate %}

{% else %}
<p style="font-size:0.8em">No bookmarked tips. You can't add on bookmark yourself tips.</p>
{% endif %}

</div>

<br><br>

<div class="info">
<h1>New Tip</h1>
<div></div>
</div>

<form id="formTipAdd" name="formTipAdd" action="{% url tip-add %}" method="post" class="genericform">
{% include 'form.html' %}

<div>
<input type="submit" value="Add" class="button">
</div>

</form>

{% endblock %}
File renamed without changes.
File renamed without changes.

0 comments on commit 9b7827b

Please sign in to comment.