local changes from server
authorJan Szejko <janek37@gmail.com>
Mon, 29 Aug 2016 13:17:00 +0000 (15:17 +0200)
committerJan Szejko <janek37@gmail.com>
Mon, 29 Aug 2016 13:17:00 +0000 (15:17 +0200)
prawokultury/models.py [new file with mode: 0644]
prawokultury/settings.d/35-search.py
prawokultury/settings.d/50-static.py
prawokultury/static/css/base.css
prawokultury/static/css/base.scss
prawokultury/static/css/forms.css
prawokultury/static/img/960x150_ogolny.jpg [new file with mode: 0644]
prawokultury/templates/base.html
questions/static/questions/tagcloud.css [new file with mode: 0644]
schema.xml [new file with mode: 0644]

diff --git a/prawokultury/models.py b/prawokultury/models.py
new file mode 100644 (file)
index 0000000..c759e4d
--- /dev/null
@@ -0,0 +1,33 @@
+from django.conf import settings
+from django.contrib.comments.signals import comment_will_be_posted
+import re
+
+def spamfilter(sender, comment, **kwargs):
+    return False
+    ban = [
+'cialis', 
+'viagra', 'generic', 'first time', 'genital', 'ficken', 'cheap', 'affiliate', 'herpes', ' your blog '
+'priceless',
+'find out more',
+' product ',
+' concerns ',
+'cheats',
+'this site',
+'fantastic read',
+'features',
+'your website',
+'this blog',
+'this info',
+'thank you',
+'thanks',
+'tips and tricks',
+]
+    for b in ban:
+        if b in comment.user_name.lower(): return False
+        if b in comment.user_url.lower(): return False
+        if b in comment.comment.lower(): return False
+    if 'http://' in comment.user_name.lower(): return False
+    return comment.ip_address not in getattr(settings, 'COMMENTS_IP_BLOCKED', ())
+comment_will_be_posted.connect(spamfilter)
+
+
index 78453e2..7d0847f 100644 (file)
@@ -6,4 +6,4 @@ HAYSTACK_CONNECTIONS = {
 }
 
 HAYSTACK_DOCUMENT_FIELD = "text"
-HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
+#HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
index 48c84a5..a6af4e6 100644 (file)
@@ -27,7 +27,7 @@ PIPELINE_CSS = {
           'css/prevnext.scss',
           'css/forms.scss',
           'events/events.scss',
-          #'fnpdjango/annoy/annoy.css',
+          'fnpdjango/annoy/annoy.css',
         ),
         'output_filename': 'compressed/base.css',
     },
@@ -43,7 +43,7 @@ PIPELINE_JS = {
         'source_filenames': (
             'js/promobox.js',
             'shop/shop.js',
-            #'fnpdjango/annoy/annoy.js',
+            'fnpdjango/annoy/annoy.js',
         ),
         'output_filename': 'compressed/base.js',
     },
index 9f3b9d9..feddf60 100644 (file)
@@ -1,4 +1,6 @@
-@import url(//fonts.googleapis.com/css?family=Lato:400,700,400italic);
+@import url(//static.mdrn.pl/fonts/Lato-2.010/Lato-Regular.css);
+@import url(//static.mdrn.pl/fonts/Lato-2.010/Lato-Bold.css);
+@import url(//static.mdrn.pl/fonts/Lato-2.010/Lato-Italic.css);
 body {
   font-family: 'Lato', sans-serif;
   font-size: .625em;
index 5e9b743..18a955a 100644 (file)
@@ -1,4 +1,7 @@
-@import url(//fonts.googleapis.com/css?family=Lato:400,700,400italic);
+@import url(//static.mdrn.pl/fonts/Lato-2.010/Lato-Regular.css);
+@import url(//static.mdrn.pl/fonts/Lato-2.010/Lato-Bold.css);
+@import url(//static.mdrn.pl/fonts/Lato-2.010/Lato-Italic.css);
+
 
 body {
     font-family: 'Lato', sans-serif;
index 70930a0..2f732dd 100644 (file)
@@ -7,7 +7,7 @@
 .submit-form {
   margin-top: 3em; }
   .submit-form table {
-    border-spacing: 0 0.5em; }
+    border-spacing: 0 .5em; }
   .submit-form tr {
     background-color: #fdfdfd; }
   .submit-form label {
@@ -17,7 +17,7 @@
     color: #e41b13;
     font-size: 1.2em;
     padding: 0 0 0 1.3em;
-    margin: 0 0 0.5em 0;
+    margin: 0 0 .5em 0;
     list-style: url("/static/img/read-more.png"); }
   .submit-form input, .submit-form textarea, .submit-form select {
     font-size: 1.2em;
@@ -26,7 +26,7 @@
     color: #363A3B;
     width: 100%;
     margin-bottom: .5em;
-    border: 1px solid #edece7; }
+    border: 1px solid #EDECE7; }
   .submit-form th, .submit-form td {
     text-align: left;
     font-weight: normal;
diff --git a/prawokultury/static/img/960x150_ogolny.jpg b/prawokultury/static/img/960x150_ogolny.jpg
new file mode 100644 (file)
index 0000000..e04ac94
Binary files /dev/null and b/prawokultury/static/img/960x150_ogolny.jpg differ
index 011ebff..a7ba6e8 100644 (file)
@@ -23,7 +23,7 @@
         {% block "headextra" %}{% endblock %}
     </head>
     <body>
-    {# 1%  {% load fnp_annoy %}{% annoy %}  #}
+    {% load fnp_annoy %}{% annoy %}
     <div id="body">
         <div id="header-bar">
         <div class="bar-left">
         <div style="clear: both;"></div>
         </div>
 
-        <div id="main-bar">
+        {% comment %}
+        <a style="width: 100%; display: inline-block;" href="https://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/">
+            <img src="{% static 'img/960x150_ogolny.jpg' %}">
+        </a>
+        {% endcomment %}
+
+        <div id="main-bar" style='clear: both;'>
         <div id="sidebar" class="bar-right">
             {% block "sidebar" %}
                 <div class="sidebar-box">
diff --git a/questions/static/questions/tagcloud.css b/questions/static/questions/tagcloud.css
new file mode 100644 (file)
index 0000000..1d35d00
--- /dev/null
@@ -0,0 +1,13 @@
+#questions-filter div {
+  margin: 10px 0; }
+
+#questions-categories {
+  margin-bottom: 10px;
+  display: inline; }
+  #questions-categories a.selected {
+    cursor: default;
+    text-decoration: none;
+    color: black; }
+
+.questions-tags-group {
+  display: none; }
diff --git a/schema.xml b/schema.xml
new file mode 100644 (file)
index 0000000..3f8ad90
--- /dev/null
@@ -0,0 +1,186 @@
+<?xml version="1.0" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<schema name="default" version="1.4">
+  <types>
+    <fieldtype name="string"  class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
+    <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>
+    <fieldtype name="binary" class="solr.BinaryField"/>
+
+    <!-- Numeric field types that manipulate the value into
+         a string value that isn't human-readable in its internal form,
+         but with a lexicographic ordering the same as the numeric ordering,
+         so that range queries work correctly. -->
+    <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
+    <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
+    <fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
+    <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" omitNorms="true" sortMissingLast="true" positionIncrementGap="0"/>
+
+    <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
+    <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
+    <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
+    <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
+
+    <fieldType name="date" class="solr.TrieDateField" omitNorms="true" precisionStep="0" positionIncrementGap="0"/>
+    <!-- A Trie based date field for faster date range queries and date faceting. -->
+    <fieldType name="tdate" class="solr.TrieDateField" omitNorms="true" precisionStep="6" positionIncrementGap="0"/>
+
+    <fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
+    <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
+    <fieldtype name="geohash" class="solr.GeoHashField"/>
+
+    <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
+      <analyzer type="index">
+        <tokenizer class="solr.StandardTokenizerFactory"/>
+        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
+        <!-- in this example, we will only use synonyms at query time
+        <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
+        -->
+        <filter class="solr.LowerCaseFilterFactory"/>
+      </analyzer>
+      <analyzer type="query">
+        <tokenizer class="solr.StandardTokenizerFactory"/>
+        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
+        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
+        <filter class="solr.LowerCaseFilterFactory"/>
+      </analyzer>
+    </fieldType>
+
+    <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
+      <analyzer type="index">
+        <tokenizer class="solr.StandardTokenizerFactory"/>
+        <filter class="solr.StopFilterFactory"
+                ignoreCase="true"
+                words="stopwords_en.txt"
+                enablePositionIncrements="true"
+                />
+        <filter class="solr.LowerCaseFilterFactory"/>
+        <filter class="solr.EnglishPossessiveFilterFactory"/>
+        <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
+        <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
+          <filter class="solr.EnglishMinimalStemFilterFactory"/>
+        -->
+        <filter class="solr.PorterStemFilterFactory"/>
+      </analyzer>
+      <analyzer type="query">
+        <tokenizer class="solr.StandardTokenizerFactory"/>
+        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
+        <filter class="solr.StopFilterFactory"
+                ignoreCase="true"
+                words="stopwords_en.txt"
+                enablePositionIncrements="true"
+                />
+        <filter class="solr.LowerCaseFilterFactory"/>
+        <filter class="solr.EnglishPossessiveFilterFactory"/>
+        <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
+        <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
+          <filter class="solr.EnglishMinimalStemFilterFactory"/>
+        -->
+        <filter class="solr.PorterStemFilterFactory"/>
+      </analyzer>
+    </fieldType>
+
+    <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
+      <analyzer>
+        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+      </analyzer>
+    </fieldType>
+
+    <fieldType name="ngram" class="solr.TextField" >
+      <analyzer type="index">
+        <tokenizer class="solr.KeywordTokenizerFactory"/>
+        <filter class="solr.LowerCaseFilterFactory"/>
+        <filter class="solr.NGramFilterFactory" minGramSize="3" maxGramSize="15" />
+      </analyzer>
+      <analyzer type="query">
+        <tokenizer class="solr.KeywordTokenizerFactory"/>
+        <filter class="solr.LowerCaseFilterFactory"/>
+      </analyzer>
+    </fieldType>
+
+    <fieldType name="edge_ngram" class="solr.TextField" positionIncrementGap="1">
+      <analyzer type="index">
+        <tokenizer class="solr.WhitespaceTokenizerFactory" />
+        <filter class="solr.LowerCaseFilterFactory" />
+        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
+        <filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="15" side="front" />
+      </analyzer>
+      <analyzer type="query">
+        <tokenizer class="solr.WhitespaceTokenizerFactory" />
+        <filter class="solr.LowerCaseFilterFactory" />
+        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
+      </analyzer>
+    </fieldType>
+  </types>
+
+  <fields>
+    <!-- general -->
+    <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="true"/>
+    <field name="django_ct" type="string" indexed="true" stored="true" multiValued="false"/>
+    <field name="django_id" type="string" indexed="true" stored="true" multiValued="false"/>
+
+    <dynamicField name="*_i"  type="int"    indexed="true"  stored="true"/>
+    <dynamicField name="*_s"  type="string"  indexed="true"  stored="true"/>
+    <dynamicField name="*_l"  type="long"   indexed="true"  stored="true"/>
+    <dynamicField name="*_t"  type="text_en"    indexed="true"  stored="true"/>
+    <dynamicField name="*_b"  type="boolean" indexed="true"  stored="true"/>
+    <dynamicField name="*_f"  type="float"  indexed="true"  stored="true"/>
+    <dynamicField name="*_d"  type="double" indexed="true"  stored="true"/>
+    <dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
+    <dynamicField name="*_p" type="location" indexed="true" stored="true"/>
+    <dynamicField name="*_coordinate"  type="tdouble" indexed="true"  stored="false"/>
+
+
+    <field name="place_en" type="text_en" indexed="true" stored="true" multiValued="false" />
+
+    <field name="organizer_pl" type="text_en" indexed="true" stored="true" multiValued="false" />
+
+    <field name="organizer_en" type="text_en" indexed="true" stored="true" multiValued="false" />
+
+    <field name="text" type="text_en" indexed="true" stored="true" multiValued="false" />
+
+    <field name="title_en" type="text_en" indexed="true" stored="true" multiValued="false" />
+
+    <field name="place_pl" type="text_en" indexed="true" stored="true" multiValued="false" />
+
+    <field name="lead_en" type="text_en" indexed="true" stored="true" multiValued="false" />
+
+    <field name="author" type="text_en" indexed="true" stored="true" multiValued="false" />
+
+    <field name="title_pl" type="text_en" indexed="true" stored="true" multiValued="false" />
+
+    <field name="date" type="date" indexed="true" stored="true" multiValued="false" />
+
+    <field name="lead_pl" type="text_en" indexed="true" stored="true" multiValued="false" />
+
+    <field name="body_en" type="text_en" indexed="true" stored="true" multiValued="false" />
+
+    <field name="answer" type="text_en" indexed="true" stored="true" multiValued="false" />
+
+  </fields>
+
+  <!-- field to use to determine and enforce document uniqueness. -->
+  <uniqueKey>id</uniqueKey>
+
+  <!-- field for the QueryParser to use when an explicit fieldname is absent -->
+  <defaultSearchField>text</defaultSearchField>
+
+  <!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
+  <solrQueryParser defaultOperator="AND"/>
+</schema>
+