diff --git a/article/management/commands/news_from_old.py b/article/management/commands/news_from_old.py index e8706c32..aac5f958 100644 --- a/article/management/commands/news_from_old.py +++ b/article/management/commands/news_from_old.py @@ -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']) diff --git a/article/models.py b/article/models.py index 9844340e..59b6dd0f 100644 --- a/article/models.py +++ b/article/models.py @@ -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) diff --git a/conference/urls.py b/conference/urls.py index d7e88f96..e5907ab2 100644 --- a/conference/urls.py +++ b/conference/urls.py @@ -31,8 +31,19 @@ urlpatterns = patterns('', url(r'conference/city/(?P.*)/$', ConferenceCityCatalog.as_view(), {'meta_id':26}), # theme catalog url(r'conference/theme/$', ConferenceByTheme.as_view(), {'meta_id':50}), + url(r'conference/theme/(?P.*)/country/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), + url(r'conference/theme/(?P.*)/country/(?P.*)/(?P\d+)/(?P.*)/$', ConferenceThemeCatalog.as_view()), + url(r'conference/theme/(?P.*)/country/(?P.*)/(?P\d+)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), + url(r'conference/theme/(?P.*)/country/(?P.*)/(?P\d+)/$', ConferenceThemeCatalog.as_view()), url(r'conference/theme/(?P.*)/country/(?P.*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), url(r'conference/theme/(?P.*)/country/(?P.*)/$', ConferenceThemeCatalog.as_view()), + url(r'conference/theme/(?P.*)/city/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), + url(r'conference/theme/(?P.*)/city/(?P.*)/(?P\d+)/(?P.*)/$', ConferenceThemeCatalog.as_view()), + url(r'conference/theme/(?P.*)/city/(?P.*)/(?P\d+)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), + url(r'conference/theme/(?P.*)/city/(?P.*)/(?P\d+)/$', ConferenceThemeCatalog.as_view()), + url(r'conference/theme/(?P.*)/city/(?P.*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), + + url(r'conference/theme/(?P.*)/city/(?P.*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), url(r'conference/theme/(?P.*)/city/(?P.*)/$', ConferenceThemeCatalog.as_view()), url(r'conference/theme/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view(), {'meta_id':31}), diff --git a/settings/conference_old_urls.py b/settings/conference_old_urls.py index f4d015cd..c741904a 100644 --- a/settings/conference_old_urls.py +++ b/settings/conference_old_urls.py @@ -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.*)/year-(?P\d+)/month-(?P.*)$', old_redirect, {'redirect_url': '/conference/city/{city}/{year}/{month}/'}), + + url(r'^conference/city-(?P.*)/theme-(?P.*)/year-(?P\d+)/month-(?P.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/city/{city}/{year}/'}), + url(r'^conference/city-(?P.*)/theme-(?P.*)/year-(?P\d+)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/city/{city}/{year}/'}), + url(r'^conference/city-(?P.*)/theme-(?P.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/city/{city}/'}), + url(r'^conference/city-(?P.*)/year-(?P\d+)/month-(?P.*)/$', old_redirect, {'redirect_url': '/conference/city/{city}/{year}/{month}/'}), url(r'^conference/city-(?P.*)/year-(?P\d+)/$', old_redirect, {'redirect_url': '/conference/city/{city}/{year}/'}), url(r'^conference/city-(?P.*)/$', old_redirect, {'redirect_url': '/conference/city/{city}/'}), #url(r'^conference/(?P.*)/$', old_redirect, {'redirect_url': '/conference/city/{city}/'}), # перенести # country - url(r'^conference/country-(?P.*)/year-(?P\d+)/month-(?P.*)$', old_redirect, {'redirect_url': '/conference/country/{country}/{year}/{month}/'}), + + url(r'^conference/country-(?P.*)/theme-(?P.*)/year-(?P\d+)/month-(?P.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/country/{country}/{year}/'}), + url(r'^conference/country-(?P.*)/theme-(?P.*)/year-(?P\d+)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/country/{country}/{year}/'}), + url(r'^conference/country-(?P.*)/theme-(?P.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/country/{country}/'}), + + url(r'^conference/country-(?P.*)/year-(?P\d+)/month-(?P.*)/$', old_redirect, {'redirect_url': '/conference/country/{country}/{year}/{month}/'}), url(r'^conference/country-(?P.*)/year-(?P\d+)/$', old_redirect, {'redirect_url': '/conference/country/{country}/{year}/'}), url(r'^conference/country-(?P.*)/$', old_redirect, {'redirect_url': '/conference/country/{country}/'}), #url(r'/conference/(?P.*)/$', old_redirect, {'redirect_url': '/conference/country/{country}/'}), # перенести @@ -23,6 +32,13 @@ urlpatterns = patterns('', url(r'^conference/theme-(?P.*)/city-(?P.*)/year-(?P\d+)/month-(?P.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/city/{city}/{year}/'}), url(r'^conference/theme-(?P.*)/city-(?P.*)/year-(?P\d+)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/city/{city}/{year}/'}), url(r'^conference/theme-(?P.*)/city-(?P.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/city/{city}/'}), + url(r'^conference/theme-(?P.*)/country-(?P.*)/year-(?P\d+)/month-(?P.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/country/{country}/{year}/'}), + url(r'^conference/theme-(?P.*)/country-(?P.*)/year-(?P\d+)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/country/{country}/{year}/'}), + url(r'^conference/theme-(?P.*)/country-(?P.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/country/{country}/'}), #url(r'^conference/theme/(?P.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/'}), # перенести + + + url(r'^conference/theme-(?P.*)/page-(?P\d+)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/page/{page}/'}), + url(r'^conference/theme-(?P.*)/page/(?P\d+)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/page/{page}/'}), url(r'^conference/theme-(?P.*)/$', old_redirect, {'redirect_url': '/conference/theme/{theme}/'}), ) diff --git a/settings/old_urls.py b/settings/old_urls.py index f1479ac0..7d4b57f5 100644 --- a/settings/old_urls.py +++ b/settings/old_urls.py @@ -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
\d+)/(?P.*)$', old_redirect, {'redirect_url': '/blogs/{article}/'}), url(r'^news.php/news_id/(?P
\d+)/(?P.*)$', old_redirect, {'redirect_url': '/news/{article}/'}), + url(r'^newsp.php/news_id/(?P\d+)/(?P.*)$', old_redirect, {'redirect_url': '/news/{news_p}/'}), # users url(r'^users/(?P.*)$', old_redirect, {'redirect_url': '/{user}/'}), url(r'^account_edit.php$', old_profile), diff --git a/settings/redirect_views.py b/settings/redirect_views.py index 672a9400..9fe69ca0 100644 --- a/settings/redirect_views.py +++ b/settings/redirect_views.py @@ -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): diff --git a/templates/admin/includes/staff_nav.html b/templates/admin/includes/staff_nav.html index 24bdf99a..82b42488 100644 --- a/templates/admin/includes/staff_nav.html +++ b/templates/admin/includes/staff_nav.html @@ -9,10 +9,6 @@
  • Конференция
  • Семинар
  • Вебинар
  • -
  • -
  • Импорт
  • -
  • Экспорт
  • - diff --git a/templates/client/robots.txt b/templates/client/robots.txt index de54334f..f98ce0b4 100644 --- a/templates/client/robots.txt +++ b/templates/client/robots.txt @@ -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/ diff --git a/templates/registration/activation_email.html b/templates/registration/activation_email.html index 3a97ff83..a450ee54 100644 --- a/templates/registration/activation_email.html +++ b/templates/registration/activation_email.html @@ -22,17 +22,16 @@
      -
    • RSS
    • -
    • Facebook
    • -
    • LinkedIn
    • -
    • В контакте
    • -
    • Twitter
    • +
    • Facebook
    • +
    • LinkedIn
    • +
    • В контакте
    • +
    • Twitter
    @@ -92,9 +91,9 @@ @@ -102,7 +101,7 @@
    - © 2018 — 2013 Expomap.ru + © 2007 — 2015 Expomap.ru