Marged with production

remotes/origin/1203
Kotiuk Nazarii 11 years ago
commit e87e82c2ac
  1. 14
      article/management/commands/news_from_old.py
  2. 1
      article/models.py
  3. 11
      conference/urls.py
  4. 20
      settings/conference_old_urls.py
  5. 1
      settings/old_urls.py
  6. 7
      settings/redirect_views.py
  7. 4
      templates/admin/includes/staff_nav.html
  8. 6
      templates/client/robots.txt
  9. 23
      templates/registration/activation_email.html

@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
import datetime
import MySQLdb
from MySQLdb.cursors import DictCursor
from django.core.management.base import BaseCommand, CommandError
@ -22,16 +23,15 @@ class Command(BaseCommand):
cid as author,
date_added as created
FROM `latest_news`
FROM `payed_news`
WHERE status = 1
AND `date_added` >= '2015-04-03'
order by created DESC"""
cursor.execute(sql)
result = cursor.fetchall()
user = User.objects.get(id=1)
now = datetime.datetime.now()
#Article.objects.news().delete()
for a in result:
@ -51,8 +51,9 @@ class Command(BaseCommand):
article = Article(type=Article.news,
id=a['id'],
created=a['created'])
old_id=a['id'],
publish_date=a['created'],
created=now)
if a['author']:
try:
author = User.objects.get(id=a['author'])
@ -72,8 +73,5 @@ class Command(BaseCommand):
except :
print ('error. id:%d'%a['id'])
#print(a['main_title'])

@ -78,6 +78,7 @@ class Article(TranslatableModel):
#set manager of this model
objects = ArticleManager()
slug = models.SlugField(unique=True, max_length=255)
old_id = models.IntegerField(blank=True, null=True)
logo = ImageField(upload_to='articles_preview', blank=True)
theme = models.ManyToManyField('theme.Theme')
tag = models.ManyToManyField('theme.Tag', related_name='tags',blank=True, null=True)

@ -31,8 +31,19 @@ urlpatterns = patterns('',
url(r'conference/city/(?P<slug>.*)/$', ConferenceCityCatalog.as_view(), {'meta_id':26}),
# theme catalog
url(r'conference/theme/$', ConferenceByTheme.as_view(), {'meta_id':50}),
url(r'conference/theme/(?P<slug>.*)/country/(?P<country_slug>.*)/(?P<year>\d+)/(?P<month>.*)/page/(?P<page>\d+)/$', ConferenceThemeCatalog.as_view()),
url(r'conference/theme/(?P<slug>.*)/country/(?P<country_slug>.*)/(?P<year>\d+)/(?P<month>.*)/$', ConferenceThemeCatalog.as_view()),
url(r'conference/theme/(?P<slug>.*)/country/(?P<country_slug>.*)/(?P<year>\d+)/page/(?P<page>\d+)/$', ConferenceThemeCatalog.as_view()),
url(r'conference/theme/(?P<slug>.*)/country/(?P<country_slug>.*)/(?P<year>\d+)/$', ConferenceThemeCatalog.as_view()),
url(r'conference/theme/(?P<slug>.*)/country/(?P<country_slug>.*)/page/(?P<page>\d+)/$', ConferenceThemeCatalog.as_view()),
url(r'conference/theme/(?P<slug>.*)/country/(?P<country_slug>.*)/$', ConferenceThemeCatalog.as_view()),
url(r'conference/theme/(?P<slug>.*)/city/(?P<city_slug>.*)/(?P<year>\d+)/(?P<month>.*)/page/(?P<page>\d+)/$', ConferenceThemeCatalog.as_view()),
url(r'conference/theme/(?P<slug>.*)/city/(?P<city_slug>.*)/(?P<year>\d+)/(?P<month>.*)/$', ConferenceThemeCatalog.as_view()),
url(r'conference/theme/(?P<slug>.*)/city/(?P<city_slug>.*)/(?P<year>\d+)/page/(?P<page>\d+)/$', ConferenceThemeCatalog.as_view()),
url(r'conference/theme/(?P<slug>.*)/city/(?P<city_slug>.*)/(?P<year>\d+)/$', ConferenceThemeCatalog.as_view()),
url(r'conference/theme/(?P<slug>.*)/city/(?P<city_slug>.*)/page/(?P<page>\d+)/$', ConferenceThemeCatalog.as_view()),
url(r'conference/theme/(?P<slug>.*)/city/(?P<city_slug>.*)/page/(?P<page>\d+)/$', ConferenceThemeCatalog.as_view()),
url(r'conference/theme/(?P<slug>.*)/city/(?P<city_slug>.*)/$', ConferenceThemeCatalog.as_view()),
url(r'conference/theme/(?P<slug>.*)/(?P<year>\d+)/(?P<month>.*)/page/(?P<page>\d+)/$', ConferenceThemeCatalog.as_view(), {'meta_id':31}),

@ -8,12 +8,21 @@ from redirect_views import old_redirect, old_profile
urlpatterns = patterns('',
url(r'/rubricator.php?result_type=conference$', old_redirect, {'redirect_url': '/conference/'}), #???
# city
url(r'^conference/city-(?P<city>.*)/year-(?P<year>\d+)/month-(?P<month>.*)$', old_redirect, {'redirect_url': '/conference/city/{city}/{year}/{month}/'}),
url(r'^conference/city-(?P<city>.*)/theme-(?P<theme>.*)/year-(?P<year>\d+)/month-(?P<month>.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/city/{city}/{year}/'}),
url(r'^conference/city-(?P<city>.*)/theme-(?P<theme>.*)/year-(?P<year>\d+)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/city/{city}/{year}/'}),
url(r'^conference/city-(?P<city>.*)/theme-(?P<theme>.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/city/{city}/'}),
url(r'^conference/city-(?P<city>.*)/year-(?P<year>\d+)/month-(?P<month>.*)/$', old_redirect, {'redirect_url': '/conference/city/{city}/{year}/{month}/'}),
url(r'^conference/city-(?P<city>.*)/year-(?P<year>\d+)/$', old_redirect, {'redirect_url': '/conference/city/{city}/{year}/'}),
url(r'^conference/city-(?P<city>.*)/$', old_redirect, {'redirect_url': '/conference/city/{city}/'}),
#url(r'^conference/(?P<city>.*)/$', old_redirect, {'redirect_url': '/conference/city/{city}/'}), # перенести
# country
url(r'^conference/country-(?P<country>.*)/year-(?P<year>\d+)/month-(?P<month>.*)$', old_redirect, {'redirect_url': '/conference/country/{country}/{year}/{month}/'}),
url(r'^conference/country-(?P<country>.*)/theme-(?P<theme>.*)/year-(?P<year>\d+)/month-(?P<month>.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/country/{country}/{year}/'}),
url(r'^conference/country-(?P<country>.*)/theme-(?P<theme>.*)/year-(?P<year>\d+)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/country/{country}/{year}/'}),
url(r'^conference/country-(?P<country>.*)/theme-(?P<theme>.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/country/{country}/'}),
url(r'^conference/country-(?P<country>.*)/year-(?P<year>\d+)/month-(?P<month>.*)/$', old_redirect, {'redirect_url': '/conference/country/{country}/{year}/{month}/'}),
url(r'^conference/country-(?P<country>.*)/year-(?P<year>\d+)/$', old_redirect, {'redirect_url': '/conference/country/{country}/{year}/'}),
url(r'^conference/country-(?P<country>.*)/$', old_redirect, {'redirect_url': '/conference/country/{country}/'}),
#url(r'/conference/(?P<country>.*)/$', old_redirect, {'redirect_url': '/conference/country/{country}/'}), # перенести
@ -23,6 +32,13 @@ urlpatterns = patterns('',
url(r'^conference/theme-(?P<theme>.*)/city-(?P<city>.*)/year-(?P<year>\d+)/month-(?P<month>.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/city/{city}/{year}/'}),
url(r'^conference/theme-(?P<theme>.*)/city-(?P<city>.*)/year-(?P<year>\d+)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/city/{city}/{year}/'}),
url(r'^conference/theme-(?P<theme>.*)/city-(?P<city>.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/city/{city}/'}),
url(r'^conference/theme-(?P<theme>.*)/country-(?P<country>.*)/year-(?P<year>\d+)/month-(?P<month>.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/country/{country}/{year}/'}),
url(r'^conference/theme-(?P<theme>.*)/country-(?P<country>.*)/year-(?P<year>\d+)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/country/{country}/{year}/'}),
url(r'^conference/theme-(?P<theme>.*)/country-(?P<country>.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/country/{country}/'}),
#url(r'^conference/theme/(?P<theme>.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/'}), # перенести
url(r'^conference/theme-(?P<theme>.*)/page-(?P<page>\d+)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/page/{page}/'}),
url(r'^conference/theme-(?P<theme>.*)/page/(?P<page>\d+)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/page/{page}/'}),
url(r'^conference/theme-(?P<theme>.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/'}),
)

@ -36,6 +36,7 @@ urlpatterns = patterns('',
url(r'^news.php/news/archive/', old_redirect, {'redirect_url': '/news/'}),
url(r'^article_info.php/articles_id/(?P<article>\d+)/(?P<some>.*)$', old_redirect, {'redirect_url': '/blogs/{article}/'}),
url(r'^news.php/news_id/(?P<article>\d+)/(?P<some>.*)$', old_redirect, {'redirect_url': '/news/{article}/'}),
url(r'^newsp.php/news_id/(?P<news_p>\d+)/(?P<some>.*)$', old_redirect, {'redirect_url': '/news/{news_p}/'}),
# users
url(r'^users/(?P<user>.*)$', old_redirect, {'redirect_url': '/{user}/'}),
url(r'^account_edit.php$', old_profile),

@ -79,11 +79,16 @@ class PageRedirect(object):
def get_object_url(self,key, value):
return {key: value}
class News_p(object):
def get_object_url(self,key, value):
obj = get_object_or_404(Article, old_id=value)
return {key: obj.slug}
old_params = {'city': CityRedirect, 'country': CountryRedirect, 'theme': ThemeRedirect, 'tag': TagRedirect,
'event': EventRedirect, 'company': Company, 'article': ArticleRedirect, 'user': UserRedirect,
'page': PageRedirect}
'page': PageRedirect, 'news_p': News_p}
def old_redirect(request, *args, **kwargs):

@ -9,10 +9,6 @@
<li><a href="/admin/conference/all">Конференция</a></li>
<li><a href="/admin/seminar/all">Семинар</a></li>
<li><a href="/admin/webinar/all">Вебинар</a></li>
<li class="divider"></li>
<li><a href="/admin/import-event">Импорт</a></li>
<li><a href="/admin/export-event">Экспорт</a></li>
</ul>
</li>

@ -1,5 +1,7 @@
User-agent: *
Disallow: /templates/
Disallow: /images/
Disallow: /social/
Disallow: /profile/
Disallow: /export/
Disallow: /download/
@ -99,6 +101,8 @@ Sitemap: http://expomap.ru/sitemap.xml
User-agent: Googlebot
Disallow: /templates/
Disallow: /images/
Disallow: /social/
Disallow: /profile/
Disallow: /export/
Disallow: /download/
@ -198,6 +202,8 @@ Sitemap: http://expomap.ru/sitemap.xml
User-agent: Yandex
Disallow: /templates/
Disallow: /images/
Disallow: /social/
Disallow: /profile/
Disallow: /export/
Disallow: /download/

@ -22,17 +22,16 @@
</td>
<td style="vertical-align: top; padding-top: 22px;">
<ul class="t-links" style="margin: 0 0 15px; padding: 0; list-style: none; text-align: right; font-size: 16px; line-height: 17px; font-weight: bold;">
<li style="display: inline-block;"><a style="text-decoration: none; color: #ff6600" href="#">СОБЫТИЯ</a></li>
<li style="display: inline-block; margin-left: 20px;"><a style="text-decoration: none; color: #ff6600" href="#">МЕСТА</a></li>
<li style="display: inline-block; margin-left: 20px;"><a style="text-decoration: none; color: #ff6600" href="#">УЧАСТНИКИ</a></li>
<li style="display: inline-block;"><a target="_blank" style="text-decoration: none; color: #ff6600" href="http://expomap.ru/expo/">СОБЫТИЯ</a></li>
<li style="display: inline-block; margin-left: 20px;"><a target="_blank" style="text-decoration: none; color: #ff6600" href="http://expomap.ru/places/">МЕСТА</a></li>
<li style="display: inline-block; margin-left: 20px;"><a target="_blank" style="text-decoration: none; color: #ff6600" href="http://expomap.ru/members/">УЧАСТНИКИ</a></li>
</ul>
<ul class="soc-media-buttons" style="margin: 0; padding: 0; list-style: none; text-align: right;">
<li style="display: inline-block;"><a href="#"><img src="cid:rss" title="RSS" alt="RSS" /></a></li>
<li style="display: inline-block; margin-left: 5px;"><a href="#"><img src="cid:fb" title="Facebook" alt="Facebook" /></a></li>
<li style="display: inline-block; margin-left: 5px;"><a href="#"><img src="cid:linkedin" title="LinkedIn" alt="LinkedIn" /></a></li>
<li style="display: inline-block; margin-left: 5px;"><a href="#"><img src="cid:vk" title="В контакте" alt="В контакте" /></a></li>
<li style="display: inline-block; margin-left: 5px;"><a href="#"><img src="cid:twit" title="Twitter" alt="Twitter" /></a></li>
<li style="display: inline-block; margin-left: 5px;"><a target="_blank" href="https://www.facebook.com/Expomap"><img src="cid:fb" title="Facebook" alt="Facebook" /></a></li>
<li style="display: inline-block; margin-left: 5px;"><a target="_blank" href="http://www.linkedin.com/company/expomap-ru/"><img src="cid:linkedin" title="LinkedIn" alt="LinkedIn" /></a></li>
<li style="display: inline-block; margin-left: 5px;"><a target="_blank" href="http://vk.com/expomap"><img src="cid:vk" title="В контакте" alt="В контакте" /></a></li>
<li style="display: inline-block; margin-left: 5px;"><a target="_blank" href="https://twitter.com/expomap_ru"><img src="cid:twit" title="Twitter" alt="Twitter" /></a></li>
</ul>
</td>
</tr>
@ -92,9 +91,9 @@
</td>
<td style="vertical-align: top; padding: 25px 0 5px;">
<ul class="t-links" style="margin: 0 0 15px; padding: 0; list-style: none; text-align: right; font-size: 14px; line-height: 15px; font-weight: bold;">
<li style="display: inline-block;"><a style="text-decoration: none; color: #ff6600" href="#">СОБЫТИЯ</a></li>
<li style="display: inline-block; margin-left: 20px;"><a style="text-decoration: none; color: #ff6600" href="#">МЕСТА</a></li>
<li style="display: inline-block; margin-left: 20px;"><a style="text-decoration: none; color: #ff6600" href="#">УЧАСТНИКИ</a></li>
<li style="display: inline-block;"><a target="_blank" style="text-decoration: none; color: #ff6600" href="http://expomap.ru/expo/">СОБЫТИЯ</a></li>
<li style="display: inline-block; margin-left: 20px;"><a target="_blank" style="text-decoration: none; color: #ff6600" href="http://expomap.ru/places/">МЕСТА</a></li>
<li style="display: inline-block; margin-left: 20px;"><a target="_blank" style="text-decoration: none; color: #ff6600" href="http://expomap.ru/members/">УЧАСТНИКИ</a></li>
</ul>
</td>
</tr>
@ -102,7 +101,7 @@
<table cellpadding="0" cellspacing="0" border="0" width="600" style="width: 600px; font-size: 12px; line-height: 15px;">
<tr>
<td style="vertical-align: top; padding: 15px 0 15px; color: #a2a2a2; text-align: right;">
© 2018 — 2013 <a style="color: #a2a2a2; text-decoration: none;" href="#">Expomap.ru</a>
© 2007 — 2015 <a style="color: #a2a2a2; text-decoration: none;" href="http://expomap.ru/">Expomap.ru</a>
</td>
</tr>
</table>

Loading…
Cancel
Save