Commits

offline committed 66dfe79

filmfeed paginator added

Comments (0)

Files changed (3)

ninjapaginator/templates/paginator.html

     <span class="digg_nextprev_disabled">Next &gt;&gt;</span>
 {% endif %}
 {% endif %}
+
+{% if filmfeed %}
+{% for i in page_numbers %}
+    {% ifequal i page_num %}
+        <span class="filmfeed_pages_disabled">{{ i }}</span>
+    {% else %}
+        <a href='?page={{ i }}' class="filmfeed_pages">{{ i }}</a>
+    {% endifequal %}
+{% endfor %}
+{% endif %}

ninjapaginator/util.py

             self.output['right_page_numbers'] = range(self.pages -1, self.pages +1)
         return self.output
 
+    def filmfeed_style(self):
+        if self.pages < self.frame_size:
+            self.output['page_numbers'] = range(1, self.pages + 1)
+        elif self.page_num < (self.frame_size / 2) + 1:
+            self.output['page_numbers'] = range(1, self.frame_size + 1)
+        elif self.page_num >= (self.frame_size / 2) + 1 and self.pages - (self.frame_size / 2) <= self.page_num:
+            self.output['page_numbers'] = range(self.pages - self.frame_size + 1, self.pages + 1)
+        elif self.page_num >= (self.frame_size / 2) + 1:
+            start = self.page_num - (self.frame_size / 2)
+            end = self.page_num + (self.frame_size / 2)
+            self.output['page_numbers'] = range(start, end + 1)
+        return self.output
     float: left;
     font-size: 8px;
     padding: 10px 5px 0px 5px;
-}
+}
+
+
+a.filmfeed_pages {
+    border: 1px solid #2B2B2B;
+    background-color: #000000;
+    color: #808080;
+    display: block;
+    float: left;
+    font-size: 20px;
+    margin-bottom: 0.5em;
+    margin-right: 0.3em;
+    margin-top: 0.15em;
+    padding: 0.1em 0.5em 0.1em 0.4em;
+}
+
+
+span.filmfeed_pages_disabled {
+    background-color:#3B3B3B;
+    border-color:#3B3B3B;
+    color:#000000;
+    border:1px solid #2B2B2B;
+    display:block;
+    float:left;
+    font-size:20px;
+    margin-bottom:0.5em;
+    margin-right:0.3em;
+    margin-top:0.15em;
+    padding:0.1em 0.5em 0.1em 0.4em;
+}