Commit feb4f6a5 authored by Olga Brani's avatar Olga Brani
Browse files

Different table pagination

Style fixes and minor corrections
parent c88fa52f
...@@ -22,13 +22,14 @@ ...@@ -22,13 +22,14 @@
.1form-row .dk_options { display:block; } .1form-row .dk_options { display:block; }
.form-row .dk_options { box-shadow:none; border-radius:0; z-index:3; margin:6px -1px 0; width:auto; left:0;} .form-row .dk_options { box-shadow:none; border-radius:0; z-index:3; margin:6px -1px 0; width:auto; left:0;}
.form-row .dk_options li { float:none; margin:0; padding:0; } .form-row .dk_options li { float:none; margin:0; padding:0; }
.form-row .dk_options a { font-weight:normal;color:#808080; padding:5px 0; text-indent:1.5em; border-bottom-color: #ccc;height:auto; width:auto; } .form-row .dk_options a { font-weight:normal;color:#808080; padding:5px 1.5em; border-bottom-color: #ccc;height:auto; width:auto; }
.form-row .dk_options a:hover { border-bottom-color: #ccc } .form-row .dk_options a:hover { border-bottom-color: #ccc }
.form-row .dk_options_inner { padding:0; margin:0; box-shadow:none; text-shadow:none; border-radius:0; border:1px solid #ccc ; margin-top:4px;} .form-row .dk_options_inner { padding:0; margin:0; box-shadow:none; text-shadow:none; border-radius:0; border:1px solid #ccc ; margin-top:4px;}
.form-row .dk-options_inner li { list-style:none outside; } .form-row .dk-options_inner li { list-style:none outside; }
.form-row .dk_options a:hover, .form-row .dk_options a:hover,
.form-row .dk_option_current a { text-shadow:none; background-color: #fff; text-decoration:none; color:#F89A1C} .form-row .dk_option_current a { text-shadow:none; background-color: #fff; text-decoration:none; color:#F89A1C}
.form-row .dk_toggle { height:17px; overflow:hidden; }
.form-row .dk_toggle span { padding-right:45px; }
/* end custom theme */ /* end custom theme */
......
...@@ -38,11 +38,11 @@ form select { font-family: 'Didact Gothic', Verdana, sans-serif; font-we ...@@ -38,11 +38,11 @@ form select { font-family: 'Didact Gothic', Verdana, sans-serif; font-we
form textarea:focus, form textarea:focus,
form input.text:focus, form input.text:focus,
form input[type="text"]:focus, form input[type="text"]:focus,
form input[type="password"]:focus {position: relative; border: 1px solid #000; z-index: 100;} form input[type="password"]:focus {position: relative; border: 1px solid #000; z-index: 3;}
form textarea:focus label, form textarea:focus label,
form input.text:focus label, form input.text:focus label,
form input[type="text"]:focus label, form input[type="text"]:focus label,
form input[type="password"]:focus label { z-index: 300;} form input[type="password"]:focus label { z-index: 5;}
form input.submit, form input.submit,
form input[type="submit"], form input[type="submit"],
a.submit { font-family: 'Open Sans', sans-serif; font-size: 14px; font-weight: normal; line-height: 22px; letter-spacing:1px; background-color: #f89a1c;color: #ffffff; border: none; padding: 10px 22px;font-size: 1em; margin:15px 0 0 223px; height:43px; } a.submit { font-family: 'Open Sans', sans-serif; font-size: 14px; font-weight: normal; line-height: 22px; letter-spacing:1px; background-color: #f89a1c;color: #ffffff; border: none; padding: 10px 22px;font-size: 1em; margin:15px 0 0 223px; height:43px; }
...@@ -72,7 +72,7 @@ div.form-stacked { margin-bottom: 4em; } ...@@ -72,7 +72,7 @@ div.form-stacked { margin-bottom: 4em; }
form.withlabels .checkbox-widget { margin-top:12px; } form.withlabels .checkbox-widget { margin-top:12px; }
form.innerlabels .checkbox-widget + label { position:static; line-height:36px; color:#808080; } form.innerlabels .checkbox-widget + label { position:static; line-height:36px; color:#808080; }
form.innerlabels .checkbox-widget + label + a { border-bottom:1px solid #F89A1C; font-size: 1.1em; } form.innerlabels .checkbox-widget + label + a { border-bottom:1px solid #F89A1C; font-size: 1.1em; }
form span.info { position:absolute;z-index:101; top:10px; } form span.info { position:absolute;z-index:7; top:10px; }
form.innerlabels span.info { left: 290px; } form.innerlabels span.info { left: 290px; }
form.withlabels span.info { left:485px; } form.withlabels span.info { left:485px; }
form span.info em { display:block; overflow:hidden; position:absolute; left:0; text-indent:-100px; top:0; height:21px; width:21px; background:url(../images/symbols.png) no-repeat -4px -31px;cursor:pointer; } form span.info em { display:block; overflow:hidden; position:absolute; left:0; text-indent:-100px; top:0; height:21px; width:21px; background:url(../images/symbols.png) no-repeat -4px -31px;cursor:pointer; }
......
...@@ -234,14 +234,15 @@ table.alt-style tr th a { color:#3582AC } ...@@ -234,14 +234,15 @@ table.alt-style tr th a { color:#3582AC }
table.alt-style tr td { color:#222; } table.alt-style tr td { color:#222; }
table.alt-style tr td:first-child, table.alt-style tr td:first-child,
table.alt-style tr th:first-child { padding-left:5px; } table.alt-style tr th:first-child { padding-left:5px; }
table.alt-style tr td a { margin:0 0 0 5px; } table.alt-style tr td a { margin:0; }
table.alt-style tr td:first-child a { margin:0; } table.alt-style tr td:first-child a { margin:0; }
table.complex tr th a.sortable { padding-right:20px; background:url(../images/arrow_th_bg.png) no-repeat right -48px; } table.alt-style tr th.sortable a { padding-right:20px; background:url(../images/arrow_th_bg.png) no-repeat right -48px; }
table.complex tr th a.asc { background-position:right 6px } table.alt-style tr th.asc a { background-position:right 6px }
table.alt-style tr th:first-child,
table.alt-style tr td:first-child { width:40% }
.content a.submit { margin:0; display:inline-block; margin:10px 0 ; height:auto; min-width:100px; text-align:center;} .content a.submit { margin:0; display:inline-block; margin:10px 0 ; height:auto; min-width:100px; text-align:center;}
table.alt-style tr:nth-child(2n) td { background:#F2F2F2 } table.alt-style tr:nth-child(2n) td { background:#F2F2F2 }
dl.alt-style { width:500px; } dl.alt-style dt { width:30%; float:left; color:#3582AC; font-weight:normal;}
dl.alt-style dt { width:50%; float:left; color:#3582AC; font-weight:normal;}
dl.alt-style dt:nth-child(2n) { background:black; } dl.alt-style dt:nth-child(2n) { background:black; }
.projects { padding-bottom:30px; position:relative; } .projects { padding-bottom:30px; position:relative; }
.projects h2 span { color:#3582AC;} .projects h2 span { color:#3582AC;}
......
...@@ -172,6 +172,7 @@ def action_extra_context(project, table, self): ...@@ -172,6 +172,7 @@ def action_extra_context(project, table, self):
# Table classes # Table classes
class UserProjectApplicationsTable(tables.Table): class UserProjectApplicationsTable(tables.Table):
caption = _('My projects')
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
self.user = None self.user = None
...@@ -187,10 +188,11 @@ class UserProjectApplicationsTable(tables.Table): ...@@ -187,10 +188,11 @@ class UserProjectApplicationsTable(tables.Table):
name = tables.LinkColumn('astakos.im.views.project_detail', args=(A('pk'),)) name = tables.LinkColumn('astakos.im.views.project_detail', args=(A('pk'),))
issue_date = tables.DateColumn(format=DEFAULT_DATE_FORMAT) issue_date = tables.DateColumn(format=DEFAULT_DATE_FORMAT)
start_date = tables.DateColumn(format=DEFAULT_DATE_FORMAT) start_date = tables.DateColumn(format=DEFAULT_DATE_FORMAT)
end_date = tables.DateColumn(format=DEFAULT_DATE_FORMAT)
members_count = tables.Column(verbose_name=_("Enrolled"), default=0, members_count = tables.Column(verbose_name=_("Enrolled"), default=0,
sortable=False) sortable=False)
membership_status = tables.Column(verbose_name=_("My status"), empty_values=(), membership_status = tables.Column(verbose_name=_("Status"), empty_values=(),
orderable=False) sortable=False)
project_action = RichLinkColumn(verbose_name=_('Action'), project_action = RichLinkColumn(verbose_name=_('Action'),
extra_context=action_extra_context, extra_context=action_extra_context,
sortable=False) sortable=False)
...@@ -205,9 +207,8 @@ class UserProjectApplicationsTable(tables.Table): ...@@ -205,9 +207,8 @@ class UserProjectApplicationsTable(tables.Table):
class Meta: class Meta:
model = ProjectApplication model = ProjectApplication
fields = ('name', 'membership_status', 'issue_date', 'start_date', 'members_count') fields = ('name', 'membership_status', 'issue_date', 'start_date','end_date', 'members_count')
attrs = {'id': 'projects-list', 'class': 'my-projects alt-style'} attrs = {'id': 'projects-list', 'class': 'my-projects alt-style'}
caption = _('My projects')
template = "im/table_render.html" template = "im/table_render.html"
......
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
{% endif %} {% endif %}
<div class="full-dotted"> <div class="full-dotted">
<p> <p>
<a href="{% url project_list %}">back to Projects &gt;</a> <a href="{% url project_list %}">&lt; Back to Projects</a>
</p> </p>
</ul> </ul>
</div> </div>
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
{% endif %} {% endif %}
{% block table %} {% block table %}
<table{% if table.attrs %} {{ table.attrs.as_html }}{% endif %}> <table{% if table.attrs %} {{ table.attrs.as_html }}{% endif %}>
{% if table.attrs.caption %} {% if table.caption %}
<caption>{{ table.attrs.caption }}</caption> <caption>{{ table.caption }}</caption>
{% endif %} {% endif %}
{% nospaceless %} {% nospaceless %}
{% block table.thead %} {% block table.thead %}
...@@ -53,11 +53,40 @@ ...@@ -53,11 +53,40 @@
{% with table.page.paginator.count as total %} {% with table.page.paginator.count as total %}
{% with table.page.object_list|length as count %} {% with table.page.object_list|length as count %}
{% block pagination %} {% block pagination %}
<div class="pagination clearfix">
<p class="next-prev">
{% if table.page.has_previous %}
{% nospaceless %}{% block pagination.previous %}<a href="{% querystring table.prefixed_page_field=table.page.previous_page_number %}#{{ table.attrs.id }}">&lt;{% trans "Previous" %}</a>{% endblock pagination.previous %}{% endnospaceless %}
{% else %}
<a href="" class="disabled">&lt; {% trans "Previous" %}</a>
{% endif %}
{% if table.page.has_next %}
{% nospaceless %}{% block pagination.next %}<a href="{% querystring table.prefixed_page_field=table.page.next_page_number %}#{{ table.attrs.id }}">{% trans "Next" %} &gt;</a>{% endblock pagination.next %}{% endnospaceless %}
{% else %}
<a href="" class="disabled">{% trans "Next" %} &gt;</a>
{% endif %}
</p>
<span class="num">
{% if table.page.has_previous or table.page.has_next %}
{% nospaceless %}{% block pagination.current %} {% blocktrans with table.page.number as current and table.paginator.num_pages as total %}Page {{ current }} of {{ total }}{% endblocktrans %} {% endblock pagination.current %}{% endnospaceless %}
{% endif %}
{% comment %}
( {% nospaceless %}{% block pagination.cardinality %}{% if total != count %}{% blocktrans %}{{ count }} of {{ total }}{% endblocktrans %}{% else %}{{ total }}{% endif %} {% if total == 1 %}{{ table.data.verbose_name }}{% else %}{{ table.data.verbose_name_plural }}{% endif %}{% endblock pagination.cardinality %}{% endnospaceless %} )
{% endcomment %}
</span>
</div>
<ul class="pagination"> <ul class="pagination">
{% comment %}
{% if table.page.has_previous %} {% if table.page.has_previous %}
{% nospaceless %}{% block pagination.previous %}<li class="previous"><a href="{% querystring table.prefixed_page_field=table.page.previous_page_number %}#{{ table.attrs.id }}">{% trans "Previous" %}</a></li>{% endblock pagination.previous %}{% endnospaceless %} {% nospaceless %}{% block pagination.previous %}<li class="previous"><a href="{% querystring table.prefixed_page_field=table.page.previous_page_number %}#{{ table.attrs.id }}">{% trans "Previous" %}</a></li>{% endblock pagination.previous %}{% endnospaceless %}
{% endif %} {% endif %}
{% if table.page.has_previous or table.page.has_next %} {% if table.page.has_previous or table.page.has_next %}
{% nospaceless %}{% block pagination.current %}<li class="current">{% blocktrans with table.page.number as current and table.paginator.num_pages as total %}Page {{ current }} of {{ total }}{% endblocktrans %}</li>{% endblock pagination.current %}{% endnospaceless %} {% nospaceless %}{% block pagination.current %}<li class="current">{% blocktrans with table.page.number as current and table.paginator.num_pages as total %}Page {{ current }} of {{ total }}{% endblocktrans %}</li>{% endblock pagination.current %}{% endnospaceless %}
{% endif %} {% endif %}
...@@ -65,8 +94,8 @@ ...@@ -65,8 +94,8 @@
{% if table.page.has_next %} {% if table.page.has_next %}
{% nospaceless %}{% block pagination.next %}<li class="next"><a href="{% querystring table.prefixed_page_field=table.page.next_page_number %}#{{ table.attrs.id }}">{% trans "Next" %}</a></li>{% endblock pagination.next %}{% endnospaceless %} {% nospaceless %}{% block pagination.next %}<li class="next"><a href="{% querystring table.prefixed_page_field=table.page.next_page_number %}#{{ table.attrs.id }}">{% trans "Next" %}</a></li>{% endblock pagination.next %}{% endnospaceless %}
{% endif %} {% endif %}
{% endcomment %}
{% nospaceless %}{% block pagination.cardinality %}<li class="cardinality">{% if total != count %}{% blocktrans %}{{ count }} of {{ total }}{% endblocktrans %}{% else %}{{ total }}{% endif %} {% if total == 1 %}{{ table.data.verbose_name }}{% else %}{{ table.data.verbose_name_plural }}{% endif %}</li>{% endblock pagination.cardinality %}{% endnospaceless %}
</ul> </ul>
{% endblock pagination %} {% endblock pagination %}
{% endwith %} {% endwith %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment