Commits

Martyn CLEMENT  committed 8312560

Share FB and Tweet and homepage link

  • Participants
  • Parent commits 105e153

Comments (0)

Files changed (4)

File apps/cms/sitemap.py

+from django.contrib.sitemaps import Sitemap
+from cms.models import Article, Category
+
+
+class ArticleSitemap(Sitemap):
+    changefreq = "monthly"
+    priority = 0.6
+    
+    def items(self):
+        return Article.objects.all()
+    
+    def location(self, obj):
+        if obj.url_override:
+            location = "/%s/" % obj.slug
+        else:
+            location = obj.get_absolute_url()
+        return location
+    
+    def lastmod(self, obj):
+        return obj.created_date

File projects/hah/settings.py

     'django.contrib.sessions',
     'django.contrib.sites',
     'django.contrib.admin',
+    'django.contrib.sitemaps',
     
     'public',
     'cms',

File projects/hah/urls.py

 from django.conf.urls.defaults import *
 from django.contrib import admin
 from django.conf import settings
+from cms.sitemap import ArticleSitemap
 admin.autodiscover()
 
+
+sitemaps = {
+    'articles': ArticleSitemap,
+}
+
 urlpatterns = patterns('',
     url(r'^$', 'public.views.home', name='root_url'),
     (r'^admin/', include(admin.site.urls)),
     (r'^', include('cms.urls')),
     (r'^medias/(?P<path>.*)$', 'django.views.static.serve',
             {'document_root': settings.MEDIA_ROOT}),
+    (r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps})
 )

File templates/public/division_zero.html

 
 
 {% block page %}
+	<a href="http://hardcoreanalhydrogen.com/news/" id="mainlink"></a>
 	<div id="album_frame">
 		<div class='span-3'>
 			<br/><br/>
 		<div class='span-10'>
 			<img src="{{ MEDIA_URL }}images/HAH_DIVISION_ZERO_FRONT.jpg" width="365" height="362" alt="HAH DIVISION ZERO FRONT" />
 		</div>
-		<div class='span-9'>
+		<div class='span-9' style="margin-bottom:60px;">
 			<h1>Division Zero</h1>
 			<p class='grey'>
 			08 avr. 2011<br/>Studio Phebes - Le logoscope (Monaco)
 		
 		<div class="span-1"><br/></div>
 		
+		
+		<div class='span-7'>
+			<h3 class="mid">Soutenir</h3>
+			Soutiens Hardcore Anal Hydrogen, partage, aide à propager le message<br/>
+			<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=121802224572363&amp;xfbml=1"></script><fb:like href="http://division-zero.hardcoreanalhydrogen.com/" send="true" layout="button_count" width="250" show_faces="true" font=""></fb:like>
+			<br/><br/>
+			<a href="http://twitter.com/?status=has just downloaded %23DivisionZero the last %40hardcoreanal album http%3a%2f%2fbit.ly%2fhE7Yss" target="_blank">Poster un Tweet</a>
+		</div>
+		
 		<div class='span-7'>
 			<h3 class="mid">Acheter</h3>
 			<p>
 		<div class='span-7'>
 			<h3 class="mid">Télécharger</h3>
 			<p>
-				Télécharger gratuitement l'album en entier. <br/>
+				Télécharger gratuitement l'album en entier <br/>
 				<ul id="dl_list">
 					<li><a href="">MP3 256Kbits</a> <span class='grey'>Bonne qualité</span></li>
 					<li><a href="">MP3 128Kbits</a> <span class='grey'>Connexions lentes</span></li>
 				</ul>
-				
+				N'oubliez pas de nous soutenir en partageant.
 			</p>
 			
 		</div>
 		
-		<div class='span-7'>
-			<h3 class="mid">Soutenir</h3>
-			Soutenez HAH, parlez de nous<br/>
-			<!-- AddThis Button BEGIN -->
-			<div class="addthis_toolbox addthis_default_style ">
-			<a href="http://www.addthis.com/bookmark.php?v=250&amp;pubid=xa-4d99c3747e2708d7" class="addthis_button_compact">Partager</a>
-			</div>
-			<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4d99c3747e2708d7"></script>
-			<!-- AddThis Button END -->
-		</div>
+
 		
 		
 	</div>
 
 {% block analytics %}
 <script type="text/javascript">
-
   var _gaq = _gaq || [];
   _gaq.push(['_setAccount', 'UA-22502231-2']);
   _gaq.push(['_trackPageview']);
-
   (function() {
     var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
   })();
-
 </script>
 {% endblock %}
 
 
 {% block extrahead %}
 	<style type="text/css" media="screen">
+		#mainlink{
+			display:block;
+			position:absolute;
+			border:none;
+			text-decoration:none;
+			width:800px;
+			height:200px;
+			margin:0 auto;
+			top:0;
+			z-index:5;
+		}
 		#album_frame{margin-top:50px;}
 		.grey{color:#444!important;}
 	</style>