diff options
author | tilly-Q <nattilypigeonfowl@gmail.com> | 2013-09-23 13:20:18 -0400 |
---|---|---|
committer | tilly-Q <nattilypigeonfowl@gmail.com> | 2013-09-23 13:20:18 -0400 |
commit | 6483b37060062ef7c7d40d9ae712c99a7e73775a (patch) | |
tree | d35aaad7910526f2e32768b5e2614435533637e3 /mediagoblin/templates | |
parent | 045fe0ee9d43aa825de6fbf14fe8fd48953d4eff (diff) | |
download | mediagoblin-6483b37060062ef7c7d40d9ae712c99a7e73775a.tar.lz mediagoblin-6483b37060062ef7c7d40d9ae712c99a7e73775a.tar.xz mediagoblin-6483b37060062ef7c7d40d9ae712c99a7e73775a.zip |
At this point, I am very close to done with this code! I made one big change at
paroneayea's request, which was to make to possible to turn off user's ability
to file reports through a mediagoblin.ini setting. Aside from this, I had to
make it possible for the Moderation User Panel to display more than 10 users.
And aside from that, I just had to fix some errors which cropped up with my
most recent additions. I also fixed some tests that were broken because I had
changed the checks for whether or not a user is active. Nearing the end!
===============================================================================
Made it possible to turn off reports through a mediagoblin.ini setting
===============================================================================
--\ mediagoblin.ini
--\ mediagoblin/config_spec.ini
--\ mediagoblin/decorators.py
--\ mediagoblin/moderation/views.py
--\ mediagoblin/templates/mediagoblin/user_pages/media.html
--\ mediagoblin/user_pages/views.py
===============================================================================
Made User Panel capable of showing more than 1 page of users
===============================================================================
--\ mediagoblin/moderation/forms.py
--\ mediagoblin/moderation/views.py
--\ mediagoblin/templates/mediagoblin/moderation/user_panel.html
===============================================================================
Fixed Broken Tests
===============================================================================
--\ mediagoblin/tests/test_notifications.py
--\ mediagoblin/tests/test_openid.py
--\ mediagoblin/tests/test_persona.py
--\ mediagoblin/tests/test_reporting.py
===============================================================================
Fixed errors in code
===============================================================================
--\ mediagoblin/db/migrations.py
--| Set nullable to True for MediaReports' and CommentReports' content foreign
|keys
--\ mediagoblin/db/models.py
--| Got rid of cascading rules for MediaReports' and CommentReports' content
|foreign keys. This makes it possible for the Reports to continue to exist
|after the content is deleted.
--\ mediagoblin/moderation/tools.py
--| Fixed formatting of Report Resolution Methods
--| Took out pieces of code used in debugging
--\ mediagoblin/templates/mediagoblin/base.html
--\ mediagoblin/templates/mediagoblin/moderation/report.html
--| Made reports details page able to tell what is a deleted archived report.
--\ mediagoblin/templates/mediagoblin/moderation/report_panel.html
--\ mediagoblin/templates/mediagoblin/utils/report.html
Diffstat (limited to 'mediagoblin/templates')
6 files changed, 55 insertions, 25 deletions
diff --git a/mediagoblin/templates/mediagoblin/base.html b/mediagoblin/templates/mediagoblin/base.html index 945d5ee3..94ca7aa5 100644 --- a/mediagoblin/templates/mediagoblin/base.html +++ b/mediagoblin/templates/mediagoblin/base.html @@ -92,11 +92,10 @@ "javascript:;" {% endif %} >{% trans %}log out{% endtrans %}</a> - <a class="button_action" href="{{ request.urlgen('mediagoblin.submit.collection') }}"> - {%- trans %}Create new collection{% endtrans -%} - </a> <p class="fine_print"> - <a href="{{ request.urlgen('terms_of_service') }}">Terms of Service</a> + <a href="{{ request.urlgen('terms_of_service') }}"> + {%- trans %}Terms of Service{%- endtrans %} + </a> </p> {% endif %} {%- elif auth %} @@ -141,6 +140,9 @@ <a class="button_action" href="{{ request.urlgen('mediagoblin.submit.start') }}"> {%- trans %}Add media{% endtrans -%} </a> + <a class="button_action" href="{{ request.urlgen('mediagoblin.submit.collection') }}"> + {%- trans %}Create new collection{% endtrans -%} + </a> {% if request.user.has_privilege('admin','moderator') %} <p> <span class="dropdown_title">Moderation powers:</span> @@ -157,9 +159,6 @@ </a> </p> {% endif %} - <a class="button_action" href="{{ request.urlgen('mediagoblin.submit.collection') }}"> - {%- trans %}Create new collection{% endtrans -%} - </a> <p class="fine_print"> <a href="{{ request.urlgen('terms_of_service') }}">Terms of Service</a> </p> diff --git a/mediagoblin/templates/mediagoblin/moderation/report.html b/mediagoblin/templates/mediagoblin/moderation/report.html index 062ec24a..cb717cde 100644 --- a/mediagoblin/templates/mediagoblin/moderation/report.html +++ b/mediagoblin/templates/mediagoblin/moderation/report.html @@ -30,7 +30,7 @@ title="Return to Reports Panel"> {% trans %}Return to Reports Panel{% endtrans %}</a> <h2>{% trans %}Report{% endtrans %} #{{ report.id }}</h2> - {% if report.comment %} + {% if report.is_comment_report() and report.comment %} {% trans %}Reported comment{% endtrans %}: {% set comment = report.comment %} @@ -62,7 +62,7 @@ {% endautoescape %} </div> </div> - {% elif report.media_entry %} + {% elif report.is_media_entry_report() and report.media_entry %} {% set media_entry = report.media_entry %} <div class="media_thumbnail"> diff --git a/mediagoblin/templates/mediagoblin/moderation/report_panel.html b/mediagoblin/templates/mediagoblin/moderation/report_panel.html index 988dd292..4eb16b2b 100644 --- a/mediagoblin/templates/mediagoblin/moderation/report_panel.html +++ b/mediagoblin/templates/mediagoblin/moderation/report_panel.html @@ -33,6 +33,7 @@ </p> <h2>{% trans %}Active Reports Filed{% endtrans %}</h2> +{% if report_list.count() %} {% if not active_settings.last_page == 1 %} {% if 'active_p='~active_settings.current_page in request.query_string %} {% set query_string = request.query_string %}{% else %} @@ -70,7 +71,6 @@ curr_page !=p %} {% endif %} </div> {% endif %} -{% if report_list.count() %} <table class="admin_panel processing"> <tr> <th></th> @@ -121,6 +121,7 @@ curr_page !=p %} <p><em>{% trans %}No open reports found.{% endtrans %}</em></p> {% endif %} <h2>{% trans %}Closed Reports{% endtrans %}</h2> +{% if closed_report_list.count() %} {% if not closed_settings.last_page == 1 %} {% if 'closed_p='~closed_settings.current_page in request.query_string %} {% set query_string = request.query_string %}{% else %} @@ -161,7 +162,6 @@ curr_page !=p %} {% endif %} </div> {% endif %} -{% if closed_report_list.count() %} <table class="media_panel processing"> <tr> <th></th> diff --git a/mediagoblin/templates/mediagoblin/moderation/user_panel.html b/mediagoblin/templates/mediagoblin/moderation/user_panel.html index 54ef7c11..4949960e 100644 --- a/mediagoblin/templates/mediagoblin/moderation/user_panel.html +++ b/mediagoblin/templates/mediagoblin/moderation/user_panel.html @@ -34,6 +34,42 @@ <h2>{% trans %}Active Users{% endtrans %}</h2> {% if user_list.count() %} + {% if not last_page == 1 %} + {% if 'p='~current_page in request.query_string %} + {% set query_string = request.query_string %}{% else %} + {% set query_string = +'p='~current_page~"&"+request.query_string %} + {% endif %} + <div class="right_align"> + {% set first_vis = current_page-3 %} + {% set last_vis = current_page+3 %} + {% if 1 == current_page %}<b>1</b>{% else %} + <a href ="?{{ query_string.replace( + 'p='~current_page, + 'p='~1) }}"> + 1</a>{% endif %} + {% if first_vis > 1 %}...{% endif %} + {% for p in range(first_vis,last_vis+1) %} + {% if p > 1 and p < last_page and +current_page !=p %} + <a href="?{{ query_string.replace( + 'p='~current_page, + 'p='~p) }}"> + {{ p }}</a> + {% elif p > 1 and p < last_page %} + <b>{{ p }}</b> + {% endif %} + {% endfor %} + {% if last_vis < last_page %}...{% endif %} + {% if last_page != current_page %} + <a href ="?{{ query_string.replace( + 'p='~current_page, + 'p='~last_page) }}"> + {{ last_page }}</a> + {% else %}<b>{{ last_page }}</b> + {% endif %} + </div> + {% endif %} <table class="admin_panel processing"> <tr> <th>{% trans %}ID{% endtrans %}</th> diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 62c2a48c..81e5013e 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -147,15 +147,13 @@ {%- endautoescape %} </div> <div> - <a {% if not request.user -%} - href="{{ request.urlgen('mediagoblin.auth.login') }}" - {%- else %} - href="{{ request.urlgen('mediagoblin.user_pages.media_home.report_comment', + {% if app_config.allow_reporting %} + <a href="{{ request.urlgen('mediagoblin.user_pages.media_home.report_comment', user=media.get_uploader.username, media=media.slug_or_id, - comment=comment.id) }}" - {%- endif %}> - {% trans %} Report {% endtrans %}</a> + comment=comment.id) }}"> + {% trans %}Report{% endtrans %}</a> + {% endif %} </div> </li> {% endfor %} @@ -181,7 +179,9 @@ {% include "mediagoblin/utils/collections.html" %} - {% include "mediagoblin/utils/report.html" %} + {% if app_config.allow_reporting %} + {% include "mediagoblin/utils/report.html" %} + {% endif %} {% include "mediagoblin/utils/license.html" %} diff --git a/mediagoblin/templates/mediagoblin/utils/report.html b/mediagoblin/templates/mediagoblin/utils/report.html index 2fa4f959..3829de97 100644 --- a/mediagoblin/templates/mediagoblin/utils/report.html +++ b/mediagoblin/templates/mediagoblin/utils/report.html @@ -18,14 +18,9 @@ {% block report_content -%} <p> - <a - {% if not request.user -%} - href="{{ request.urlgen('mediagoblin.auth.login') }}" - {% else %} - href="{{ request.urlgen('mediagoblin.user_pages.media_home.report_media', + <a href="{{ request.urlgen('mediagoblin.user_pages.media_home.report_media', user=media.get_uploader.username, media=media.slug_or_id) }}" - {% endif %} class="button_action" id="button_reportmedia" title="Report media"> {% trans %}Report media{% endtrans %} </a> |