<!DOCTYPE html>
<!--

Monomotapa - A Micro CMS
Copyright (C) 2014, Paul Munday.

PO Box 28228, Portland, OR, USA 97228
paul at paulmunday.net

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero  Public License as published by
the Free Software Foundation, either version 3 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 Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

There should also be a copy of the AGPL in src/license.md that should be
accessible by going to <a href ="/license">/license<a> on this site.
-->
<html>
<head>
<title>{% if title -%}{{title}}{% endif %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="stylesheet" type="text/css" title="oscuro" href="/static/style_rmgss.css">
<link rel="alternate stylesheet" type="text/css" title="claro" href="/static/style_rmgss_claro.css">

<!-- {%- if css -%} -->
<!-- {%- for file in css %} -->
<!--     <link href="{{ url_for('static', filename=file) }}" rel="stylesheet" type="text/css"  /> -->
<!--     {%- endfor -%} -->
<!-- {%- endif %} -->
{% if internal_css %}
  <style type="text/css">
    {{internal_css}}
  </style>
{% endif %}
{%- if hlinks -%}
  {%- for item in hlinks -%}
    <link 
       {%- if item.href %} href="{{item.href}}"{% endif -%}
       {%- if item.rel %} rel="{{item.rel}}"{% endif -%} 
       {%- if item.type %} type="{{item.type}}"{% endif -%}
       {%- if item.media %} type="{{item.media}}"{% endif -%}
       {%- if item.hreflang %} type="{{item.hreflang}}"{% endif -%}
       {%- if item.charset %} type="{{item.charset}}"{% endif -%}
       >
     {% endfor %}
   {%- endif -%}



<link rel="apple-touch-icon" sizes="76x76" href="{{ url_for('static', filename='imgs/favicon/apple-touch-icon.png')}}">

<link rel="icon" type="image/png" sizes="32x32" href="{{ url_for('static', filename='imgs/favicon/favicon-32x32.png')}}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ url_for('static', filename='imgs/favicon/favicon-16x16.png')}}">
<link rel="manifest" href="{{ url_for('static', filename='imgs/favicon/site.webmanifest')}}">
<link rel="mask-icon" href="{{ url_for('static', filename='imgs/favicon/safari-pinned-tab.svg')}}" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">

{# <link rel="shortcut icon" type="image/png" href="/{{ url_for('static', filename='imgs/favicon.png') }}> #}
</head>

<body onload="set_style_from_cookie()">

<div id="wrap">
    <div class="row">
	
	<div class="col fifth">
	    <!-- Importante dejar este -->
	</div>
	<!-- Contenido -->
	<div class="col fill">
	    
	    <!-- <button type="button" -->
	    <!--   onclick="document.getElementById('nav_right').style.color = 'red'"> -->
	    <!--   Click Me!</button> -->
	    <!-- Cabecera -->
	    <div>
		<p> 
		    <a href="/">
			<img src="/static/imgs/cabecera1.png">
		    </a>
		    <br>
		    <span style="font-size:11px;">
			<q><b>sitio personal</b> de Rodrigo Garcia.</q>
		    </span>
		</p>
	    </div>

	    <div style="margin-bottom: 7px">
		<form>
		    <input type="submit" onclick="switch_style('oscuro'); return false;" name="theme" value="☻" id="oscuro" style="background-color: #333933; color: #C3C4C2; border-radius:3px;">
		    
		    <input type="submit" onclick="switch_style('claro');return false;" name="theme" value="☺" id="claro" style="background-color: #D1E9D3; color: #131914; border-radius:3px;">
		</form> 
	    </div>
	    <!-- Contenido -->
	    {% block content %}{% endblock %}

	</div>

	<div class="col fifth">
	    <div id="nav_right">
		<h3>Lugares</h3>
		
		<ul>
		    <dd>
			<a href="/">
			    <img src="/static/imgs/inicio.png" width="32" heigth="32">
			    Inicio
			</a>
		    </dd>
		    <dd>
			<a href="/posts">
			    <img src="/static/imgs/entradas.png" width="32" heigth="32">
			    Posts/Noticias
			</a>		
			<ul>
			    <dd>
				<a href="/posts/categorias">
				    <img src="/static/imgs/categorias.png" width="16" heigth="16">
				    Categorías
				</a>
			    </dd>
			    <dd>
				<a href="/posts/recientes">
				    <img src="/static/imgs/reloj1.png" width="16" heigth="16">
				    Recientes
				</a>
			    </dd>
			</ul>
		    </dd>
		    <dd>	
			<img src="/static/imgs/misc.png" width="32" heigth="32">
			Misc.
			<ul>
			    <dd>
				<a href="http://botadero.rmgss.net">
				    <img src="/static/imgs/botadero.png" width="16" heigth="16">
				    Botadero
				</a>
			    </dd>
			    <dd>
				<a href="/repositorios">
				    <img src="/static/imgs/repos.png" width="16" heigth="16">
				    Repositorios
				</a>
			    </dd>

			    <dd>
				<a href="/posts/categoria/fotos">
				    <img src="/static/imgs/fotos.png" width="16" heigth="16">
				    Fotos
				</a>
			    </dd>

			    <dd>
				<a href="/posts/categoria/software">
				    <img src="/static/imgs/sf.png" width="16" heigth="16">
				    Software
				</a>
			    </dd>
			    <dd>
				<a href="/posts/categoria/proyectos">
				    <img src="/static/imgs/proyectos.png" width="16" heigth="16">
				    Proyectos
				</a>
			    </dd>
			    <dd>
				<a href="/acerca_de_mi">
				    <img src="/static/imgs/acercade.png" width="16" heigth="16">
				    Acerca de mi
				</a>
			    </dd>

			</ul>

			
		    </dd>

		    <dd>	
			<a href="/contacto">
			    <img src="/static/imgs/contacto.png" width="16" heigth="16">
			    Contacto
			</a>
			
		    </dd>
		</ul>
		<ul>
		    <hr>
		    {%- for item in navigation.navigation.values() -%}
			<li><a href="
				     {%- if item.url -%}{{item.url}}
				     {%- elif item.urlfor -%}
				     {%- if item.urlfor == "source" -%}
				     {{ url_for(item.urlfor, page=navigation.page) }}
				     {%- else -%}
				     {{ url_for(item.urlfor) }}
				     {%- endif -%}
				     {%- else -%}
				     {{ url_for('staticpage', page=item.base) }}
				     {%- endif -%}
				     
				     {%- if item.rel -%}
				     " rel="{{item.rel}} 
				     {%- endif -%}
				     ">{{item.link_text}}</a></li>
		    {% endfor -%}
		</ul>
		<p>
		    <a href="/rss" >
			<img src="/static/imgs/rss.png" width="24" heigth="24">
			RSS
		    </a>
		</p>
	    </div>

	    <!-- Noticias Realcionadas si es un post -->
	    {% if contexto is defined %}
		{% if contexto['relacionadas'] is defined %}
		    <h3>Posts/Noticias relacionadas</h3>
		    {% for post_relacionado in contexto['relacionadas'] %}
			<p>
			    <a href="/posts/{{ post_relacionado }}">
				{{ post_relacionado|n_heading }}
			    </a>
			</p>
			<hr>

		    {% endfor %}
		{% endif %}
	    {% endif %}

	    <div id="consejo_del_dia">
		<b>Consejo del día</b>
		<hr>
		{% if contexto %}
		  {{ contexto['consejo']|safe }}
		{% endif %}
	    </div>

	</div>

    </div> <!-- row -->




</div>

<div id="footer">
    <p id="footer">
	Este sitio web es software libre aquí el <a href="https://notabug.org/strysg/monimatapa">código fuente</a>.<br>
	El contenido de este sitio esta bajo una licencia Creative Commons <a href="https://creativecommons.org/licenses/by/4.0/">Attribution 4.0 International (CC BY 4.0)</a> a menos que se indique lo contrario.
	<!-- footer goes here -->
	{% if footer %}
            {{footer}}
	{% endif %}

    </p>
</div>

<!-- javascript -->
<script language="javascript">
 // *** TO BE CUSTOMISED ***

 var style_cookie_name = "style" ;
 var style_cookie_duration = 15 ;
 var style_domain = "rmgss.net" ;

 // *** END OF CUSTOMISABLE SECTION ***
 // You do not need to customise anything below this line

 function switch_style ( css_title )
 {
     // You may use this script on your site free of charge provided
     // you do not remove this notice or the URL below. Script from
     // https://www.thesitewizard.com/javascripts/change-style-sheets.shtml
     var i, link_tag ;
     for (i = 0, link_tag = document.getElementsByTagName("link") ;
	 i < link_tag.length ; 
	 i++ ) {
	 if ((link_tag[i].rel.indexOf( "stylesheet" ) != -1) &&
	     link_tag[i].title) {
	     link_tag[i].disabled = true ;
	     if (link_tag[i].title == css_title) {
		 link_tag[i].disabled = false ;
	     }
	 }
	 set_cookie( style_cookie_name, css_title,
		     style_cookie_duration, style_domain );
     }
 }
 function set_style_from_cookie()
 {
     var css_title = get_cookie( style_cookie_name );
     if (css_title.length) {
	 switch_style( css_title );
     }
 }
 function set_cookie ( cookie_name, cookie_value,
		       lifespan_in_days, valid_domain )
 {
     // https://www.thesitewizard.com/javascripts/cookies.shtml
     var domain_string = valid_domain ?
			 ("; domain=" + valid_domain) : '' ;
     document.cookie = cookie_name +
                       "=" + encodeURIComponent( cookie_value ) +
                       "; max-age=" + 60 * 60 *
     24 * lifespan_in_days +
                       "; path=/" + domain_string ;
 }
 function get_cookie ( cookie_name )
 {
     // https://www.thesitewizard.com/javascripts/cookies.shtml
     var cookie_string = document.cookie ;
     if (cookie_string.length != 0) {
         var cookie_value = cookie_string.match (
             '(^|;)[\s]*' +
             cookie_name +
             '=([^;]*)' );
         return decodeURIComponent ( cookie_value[2] ) ;
     }
     return '' ;
 }
</script>
<!-- --->

</body>
</html>
