new footer plugin added
This commit is contained in:
		
					parent
					
						
							
								4408f54a5c
							
						
					
				
			
			
				commit
				
					
						2ea1a11f2b
					
				
			
		
					 4 changed files with 117 additions and 0 deletions
				
			
		|  | @ -9,6 +9,7 @@ from .models import ( | |||
|     UngleichHeaderWithBackgroundImageSlider, | ||||
|     UngleichHeaderWithBackgroundImageSliderItem, | ||||
|     UngleichHeaderWithBackgroundVideoSliderItem, | ||||
|     UngleichFooter | ||||
| ) | ||||
| 
 | ||||
| 
 | ||||
|  | @ -359,3 +360,18 @@ class UngleichHTMLPlugin(CMSPluginBase): | |||
|         ) | ||||
|         context['instance'] = instance | ||||
|         return context | ||||
| 
 | ||||
| 
 | ||||
| @plugin_pool.register_plugin | ||||
| class UngleichFooterPlugin(CMSPluginBase): | ||||
|     name = "ungleich Footer Plugin" | ||||
|     model = UngleichFooter | ||||
|     render_template = "ungleich_page/ungleich/_footer.html" | ||||
|     cache = False | ||||
| 
 | ||||
|     def render(self, context, instance, placeholder): | ||||
|         context = super(UngleichFooterPlugin, self).render( | ||||
|             context, instance, placeholder | ||||
|         ) | ||||
|         context['instance'] = instance | ||||
|         return context | ||||
|  |  | |||
							
								
								
									
										40
									
								
								ungleich_page/migrations/0018_ungleichfooter.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								ungleich_page/migrations/0018_ungleichfooter.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,40 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| # Generated by Django 1.9.4 on 2018-02-06 19:17 | ||||
| from __future__ import unicode_literals | ||||
| 
 | ||||
| from django.db import migrations, models | ||||
| import django.db.models.deletion | ||||
| 
 | ||||
| 
 | ||||
| class Migration(migrations.Migration): | ||||
| 
 | ||||
|     dependencies = [ | ||||
|         ('cms', '0014_auto_20160404_1908'), | ||||
|         ('ungleich_page', '0017_auto_20171219_1856'), | ||||
|     ] | ||||
| 
 | ||||
|     operations = [ | ||||
|         migrations.CreateModel( | ||||
|             name='UngleichFooter', | ||||
|             fields=[ | ||||
|                 ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, | ||||
|                                                        parent_link=True, primary_key=True, serialize=False, to='cms.CMSPlugin')), | ||||
|                 ('copyright', models.CharField( | ||||
|                     blank=True, default='', max_length=100)), | ||||
|                 ('link_text', models.CharField( | ||||
|                     blank=True, max_length=100, null=True)), | ||||
|                 ('link_url', models.URLField(blank=True, | ||||
|                                              help_text='Url to the link in footer', null=True)), | ||||
|                 ('twitter_url', models.URLField( | ||||
|                     blank=True, help_text='If empty, twitter btn will not be visible', null=True)), | ||||
|                 ('linkedin_url', models.URLField( | ||||
|                     blank=True, help_text='If empty, linkedin btn will not be visible', null=True)), | ||||
|                 ('github_url', models.URLField( | ||||
|                     blank=True, help_text='If empty, github btn will not be visible', null=True)), | ||||
|             ], | ||||
|             options={ | ||||
|                 'abstract': False, | ||||
|             }, | ||||
|             bases=('cms.cmsplugin',), | ||||
|         ), | ||||
|     ] | ||||
|  | @ -222,3 +222,24 @@ class UngleichHTMLOnly(CMSPlugin): | |||
| 
 | ||||
|     def __str__(self): | ||||
|         return self.name | ||||
| 
 | ||||
| 
 | ||||
| class UngleichFooter(CMSPlugin): | ||||
|     copyright = models.CharField(max_length=100, default='', blank=True) | ||||
|     link_text = models.CharField(max_length=100, blank=True, null=True) | ||||
|     link_url = models.URLField( | ||||
|         blank=True, null=True, | ||||
|         help_text='Url to the link in footer' | ||||
|     ) | ||||
|     twitter_url = models.URLField( | ||||
|         blank=True, null=True, | ||||
|         help_text='If empty, twitter btn will not be visible' | ||||
|     ) | ||||
|     linkedin_url = models.URLField( | ||||
|         blank=True, null=True, | ||||
|         help_text='If empty, linkedin btn will not be visible' | ||||
|     ) | ||||
|     github_url = models.URLField( | ||||
|         blank=True, null=True, | ||||
|         help_text='If empty, github btn will not be visible' | ||||
|     ) | ||||
|  |  | |||
							
								
								
									
										40
									
								
								ungleich_page/templates/ungleich_page/ungleich/_footer.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								ungleich_page/templates/ungleich_page/ungleich/_footer.html
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,40 @@ | |||
| {% load static %} | ||||
| {% load i18n %} | ||||
| 
 | ||||
| <footer> | ||||
| 	<div class="container"> | ||||
| 		<div class="row"> | ||||
| 		  <div class="col-md-4"> | ||||
| 		    <span class="copyright">Copyright © {{instance.copyright}} {% now "Y" %}</span> | ||||
| 		  </div> | ||||
| 		  <div class="col-md-4"> | ||||
| 		    <ul class="list-inline social-buttons"> | ||||
| 		    	{% if instance.twitter_url %} | ||||
| 			      <li> | ||||
| 			      	<a href="{{instance.twitter_url}}"><i class="fa fa-twitter"></i></a> | ||||
| 			      </li> | ||||
| 		    	{% endif %} | ||||
| 		    	{% if instance.github_url %} | ||||
| 			      <li> | ||||
| 			      	<a href="{{instance.github_url}}"><i class="fa fa-github"></i></a> | ||||
| 			      </li> | ||||
| 		    	{% endif %} | ||||
| 		    	{% if instance.linkedin_url %} | ||||
| 			      <li> | ||||
| 			      	<a href="{{instance.linkedin_url}}"><i class="fa fa-linkedin"></i></a> | ||||
| 			      </li> | ||||
| 		    	{% endif %} | ||||
| 		    </ul> | ||||
| 		  </div> | ||||
| 		  <div class="col-md-4"> | ||||
| 		  	{% if instance.link_text %} | ||||
| 			    <ul class="list-inline quicklinks"> | ||||
| 			      <li> | ||||
| 			      	<a href="instance.link_url">{{instance.link_text}}</a> | ||||
| 			      </li> | ||||
| 			    </ul> | ||||
| 		  	{% endif %} | ||||
| 		  </div> | ||||
| 		</div> | ||||
| 	</div> | ||||
| </footer> | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue