Skip to content

Commit

Permalink
Fixed cperms syntex in templates.
Browse files Browse the repository at this point in the history
Fixed required permission syntex in views.
Changed groups to groups role in membership model.
Added committee permission lookup.

#TODO: change default_group to group_role in Invitation model.
  • Loading branch information
yaniv14 committed Jun 7, 2015
1 parent b76aa07 commit 278662d
Show file tree
Hide file tree
Showing 48 changed files with 316 additions and 195 deletions.
Binary file modified src/acl/locale/he/LC_MESSAGES/django.mo
Binary file not shown.
18 changes: 8 additions & 10 deletions src/acl/locale/he/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-06-07 13:13+0300\n"
"PO-Revision-Date: 2015-06-07 12:32+0200\n"
"POT-Creation-Date: 2015-06-08 00:02+0300\n"
"PO-Revision-Date: 2015-06-08 00:04+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand All @@ -19,10 +19,8 @@ msgstr ""
"X-Generator: Poedit 1.7.6\n"

#: .\apps.py:7
#, fuzzy
#| msgid "Access Community"
msgid "Access Control Logic"
msgstr "גישה לקהילה"
msgstr "היגיון בקרת גישה"

#: .\core_permissions.py:6
msgid "Access Community"
Expand Down Expand Up @@ -228,23 +226,23 @@ msgstr "מזכיר"
msgid "chairman"
msgstr "יושב ראש"

#: .\models.py:11
#: .\models.py:9
msgid "Limit to community"
msgstr "מוגבל לקהילה"

#: .\models.py:12
#: .\models.py:11
msgid "ordinal"
msgstr "סדר"

#: .\models.py:13
#: .\models.py:12
msgid "title"
msgstr "כותרת"

#: .\models.py:14
#: .\models.py:13
msgid "based on"
msgstr "מבוסס על"

#: .\models.py:36
#: .\models.py:40
msgid "Permission"
msgstr "הרשאה"

Expand Down
2 changes: 1 addition & 1 deletion src/acl/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_absolute_url(self):
return reverse('role:view', kwargs={'pk': self.id})

def __unicode__(self):
return self.title
return u"{}: {}".format(self.community, self.title)

def all_perms(self):
perms = set()
Expand Down
Binary file modified src/communities/locale/he/LC_MESSAGES/django.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion src/communities/locale/he/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Open Community\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-06-07 13:13+0300\n"
"POT-Creation-Date: 2015-06-08 00:02+0300\n"
"PO-Revision-Date: 2015-06-07 12:37+0200\n"
"Last-Translator: Yaniv Mirel <[email protected]>\n"
"Language-Team: \n"
Expand Down
Binary file modified src/communities/locale/he/LC_MESSAGES/djangojs.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion src/communities/locale/he/LC_MESSAGES/djangojs.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Open Community\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-06-07 13:13+0300\n"
"POT-Creation-Date: 2015-06-08 00:02+0300\n"
"PO-Revision-Date: 2014-02-11 12:50+0200\n"
"Last-Translator: Yaniv Mirel <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion src/communities/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ class Meta:
)

def __unicode__(self):
return self.title
return u"{}: {}".format(self.community, self.title)

def get_absolute_url(self):
return reverse("group:detail", args=(self.community.slug, self.pk))
Expand Down
8 changes: 4 additions & 4 deletions src/communities/templates/_committee_panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- <li class="hidden-xs" style="width: 50px;height: 40px;"></li> -->

{% comment "Navbar issues - remove from navbar for now" %}
{% if cperms.issues.viewopen_issue %}
{% if 'viewopen_issue' in cperms %}
<li>
<a {% if pill == 'issues' %}class="active"{% endif %} href="{% url 'issues' committee.community.slug committee.slug %}">
{% if LANGUAGE_CODE == 'he' and committee.no_meetings_community %}{% trans "No meetings issues" %}{% else %}{% trans "Issues" %}{% endif %}</a>
Expand All @@ -13,7 +13,7 @@
{% endcomment %}

{% if committee %}
{% if cperms.communities.viewupcoming_community %}
{% if 'viewupcoming_community' in cperms %}
<li>
<a {% if pill == 'upcoming' %}class="active"{% endif %} href="{% url 'committee' committee.community.slug committee.slug %}">
{% if LANGUAGE_CODE == 'he' and committee.no_meetings_community %}{% trans "Updates" %}{% else %}{% trans "Meetings" %}{% endif %}</a>
Expand All @@ -31,7 +31,7 @@
{% endcomment %}

{% if committee %}
{% if cperms.issues.viewopen_issue %}
{% if 'viewopen_issue' in cperms %}
{% if not committee.no_meetings_community %}
<li class="just_slash hidden-xs">/</li>
<li>
Expand All @@ -46,7 +46,7 @@
{% endif %}

{% if committee %}
{% if cperms.community.invite_member %}
{% if 'invite_member' in cperms %}
<li class="just_slash hidden-xs">/</li>
<li>
<a href="{% url 'members' committee.community.slug %}">{% trans "Members" %}</a>
Expand Down
2 changes: 1 addition & 1 deletion src/communities/templates/_community_panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</ul>
</li>
{% endif %}
{% if cperms.community.invite_member %}
{% if 'invite_member' in cperms %}
<li class="just_slash hidden-xs">/</li>
<li>
<a href="{% url 'members' community.slug %}">{% trans "Members" %}</a>
Expand Down
8 changes: 4 additions & 4 deletions src/communities/templates/communities/_additional_issue.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{{i.title}}
</a>

{% if cperms.community.editagenda_community and not i.changed_in_current and not i.completed %}
{% if 'editagenda_community' in cperms and not i.changed_in_current and not i.completed %}
<div class="timer{% if not object.upcoming_meeting_started and i.is_upcoming %} timer_extra{% endif %}" data-url="{% url 'issue_set_length' community.id i.id %}">
<span data-strict="{{i.length_in_minutes|minutes_strict}}">{{i.length_in_minutes|minutes|default:'--:--'}}</span>
</div>
Expand All @@ -22,15 +22,15 @@
<a href="#" class="addremove"></a>
</div>
{% else %}
{% if i.can_straw_vote and cperms.issues.vote and user.id and not object.upcoming_meeting_started and i.is_upcoming %}
{% if i.can_straw_vote and 'vote' in cperms and user.id and not object.upcoming_meeting_started and i.is_upcoming %}
<div class="user_votes_on_issue">
{% user_votes_on_issue %}
</div>
{% endif %}
{% if object.upcoming_meeting_started %}
<div class="agenda_plus_minus
{% if i.completed and cperms.issues.view_update_status %}tick{% else %}
{% if i.changed_in_current and cperms.issues.view_update_status %}cog{% endif %}
{% if i.completed and 'view_update_status' in cperms %}tick{% else %}
{% if i.changed_in_current and 'view_update_status' in cperms %}cog{% endif %}
{% endif %}"></div>
{% endif %}
{% endif %}
Expand Down
12 changes: 6 additions & 6 deletions src/communities/templates/communities/_issue.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load opencommunity voting_tags %}

<li class="{% if i.is_confidential %}is_confidential {% endif %}issue oc_li" data-issue="{{i.id}}">
{% if cperms.community.editagenda_community %}
{% if 'editagenda_community' in cperms %}
<div class="grab"></div>
{% endif %}
<div class="available-issue-date">
Expand All @@ -12,7 +12,7 @@
{{i.title}}
</a>

{% if cperms.community.editagenda_community and not i.changed_in_current and not i.completed %}
{% if 'editagenda_community' in cperms and not i.changed_in_current and not i.completed %}
<div class="timer{% if not object.upcoming_meeting_started and i.is_upcoming %} timer_extra{% endif %}" data-url="{% url 'issue_set_length' committee.community.slug committee.slug i.id %}">
<span data-strict="{{i.length_in_minutes|minutes_strict}}">{{i.length_in_minutes|minutes|default:'--:--'}}</span>
</div>
Expand All @@ -25,16 +25,16 @@
<a href="#" class="addremove"></a>
</div>
{% else %}
{% if i.can_straw_vote and cperms.issues.vote and user.id and not object.upcoming_meeting_started and i.is_upcoming %}
{% if i.can_straw_vote and 'vote' in cperms and user.id and not object.upcoming_meeting_started and i.is_upcoming %}
<div class="user_votes_on_issue">
{% user_votes_on_issue %}
</div>
{% endif %}
{% if object.upcoming_meeting_started %}
<div class="agenda_plus_minus
{% if i.completed and cperms.issues.view_update_status %}tick{% else %}
{% if i.changed_in_current and cperms.issues.view_update_status %}cog{% endif %}
{% endif %}"{% if i.changed_in_current and cperms.issues.view_update_status %} data-toggle="tooltip" data-placement="top" title="{% trans 'Issue in discussion' %}"{% endif %}></div>
{% if i.completed and 'view_update_status' in cperms %}tick{% else %}
{% if i.changed_in_current and 'view_update_status' in cperms %}cog{% endif %}
{% endif %}"{% if i.changed_in_current and 'view_update_status' in cperms %} data-toggle="tooltip" data-placement="top" title="{% trans 'Issue in discussion' %}"{% endif %}></div>
{% endif %}
{% endif %}
</li>
2 changes: 1 addition & 1 deletion src/communities/templates/communities/base_meeting.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2>
</h2>
<ul class="meetings_list">
{% comment %} show upcoming meeting entry only if published or the current user has permission to view the draft {% endcomment %}
{% if community.upcoming_meeting_is_published or cperms.communities.viewupcoming_draft %}
{% if community.upcoming_meeting_is_published or 'viewupcoming_draft' in cperms %}
<li>
{% if object == committee %} <div class="pull-right" style="width: 15px;"><span class="active_meeting pull-right"></span></div>{% endif %}
<a href="{{ committee.get_absolute_url }}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

{% block content %}

<a href="{% url 'group:update' community.id object.id %}">{% trans "Edit" %}</a>
<a href="{% url 'group:update' community.slug object.id %}">{% trans "Edit" %}</a>

{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@

{% endif %}

<a href="{% url 'group:create' community.id %}">{% trans "Create Group" %}</a>
<a href="{% url 'group:create' community.slug %}">{% trans "Create Group" %}</a>

{% endblock %}
32 changes: 16 additions & 16 deletions src/communities/templates/communities/upcoming.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,19 @@ <h5 style="font-weight: normal;">{% if m.title %}<i class="fa fa-calendar"></i>
{% endwith %}
</div>
<div class="col-xs-12">
{% if cperms.communities.viewupcoming_community %}
{% if cperms.communities.viewupcoming_draft or object.upcoming_meeting_is_published %}
{% if 'viewupcoming_community' in cperms %}
{% if 'viewupcoming_draft' in cperms or object.upcoming_meeting_is_published %}
<div class="pull-right">
{% if cperms.community.editupcoming_community %}
{% if 'editupcoming_community' in cperms %}
<i class="fa fa-edit"></i> <a data-rel="form" href="{% url 'upcoming_edit' committee.community.slug committee.slug %}" style="color: #6C6C6E;display: inline-block; text-align: left;"><span>{% trans "Edit" %}</span></a>
{% endif %}
</div>
{% endif %}
{% endif %}
<div class="pull-left">
<h1>
{% if object.upcoming_meeting_title and cperms.communities.viewupcoming_community %}
{% if cperms.community.editagenda_community or object.upcoming_meeting_is_published %}
{% if object.upcoming_meeting_title and 'viewupcoming_community' in cperms %}
{% if 'editagenda_community' in cperms or object.upcoming_meeting_is_published %}
{{object.upcoming_meeting_title}}
{% endif %}
{% else %}
Expand All @@ -87,8 +87,8 @@ <h1>
</h1>
</div>
</div>
{% if cperms.communities.viewupcoming_community %}
{% if cperms.communities.viewupcoming_draft or object.upcoming_meeting_is_published %}
{% if 'viewupcoming_community' in cperms %}
{% if 'viewupcoming_draft' in cperms or object.upcoming_meeting_is_published %}

{% if object.straw_voting_enabled and not object.straw_vote_ended and not user.id %}
<div class="text-center clear" style="margin-bottom: 10px;">
Expand All @@ -100,12 +100,12 @@ <h1>
<h5 class="pull-left" style="line-height: 1.3;">
<i class="fa fa-calendar"></i> {{ object|display_upcoming_time }}
{% if object.upcoming_meeting_location %}<i class="fa fa-map-marker"></i> {{ object.upcoming_meeting_location }}{% endif %}
{% if cperms.community.editparticipants_community and committee.upcoming_meeting_started %}
{% if 'editparticipants' in cperms_community and committee.upcoming_meeting_started %}
<i class="fa fa-group"></i> <a data-rel="form" href="{% url 'upcoming_edit_participants' committee.community.slug committee.slug %}" style="color: #6C6C6E;">{% trans "Participants" %}: {{object.full_participants}}</a>
{% endif %}
</h5>

{% if cperms.community.editupcoming_community %}
{% if 'editupcoming_community' in cperms %}
<h5 class="pull-right">
{% if object.upcoming_meeting_started %}
<form method="post" action="{% url 'upcoming_end' committee.community.slug committee.slug %}">
Expand Down Expand Up @@ -150,10 +150,10 @@ <h2 class="pull-left">
{% trans "Agenda items" %}
{% endif %}
<span class="loader"> <img src="{{STATIC_URL}}images/ajax-loader.gif" alt="Loading"/> </span></h2>
{% if cperms.community.editagenda_community %}
{% if 'editagenda_community' in cperms %}
<a class="btn btn-oc pull-right" data-rel="form" href="{% url 'issue_create_upcoming' committee.community.slug committee.slug %}"> <i class="fa fa-plus"></i> <span>{% trans "New issue" %}</span></a>
{% endif %}
{% if has_straw_votes and cperms.issues.vote and object.upcoming_meeting_is_published and user.id and not cperms.community.editagenda_community %}
{% if has_straw_votes and 'vote' in cperms and object.upcoming_meeting_is_published and user.id and not 'editagenda_community' in cperms %}
<h2 class="pull-right">
<span class="badge vote-badge">
{% trans "All proposals / Voted" %}
Expand All @@ -166,7 +166,7 @@ <h2 class="pull-right">
{% include "communities/_issue.html" %}
{% endfor %}
</ul>
{% if cperms.community.editagenda_community %}
{% if 'editagenda_community' in cperms %}
{% comment %}
<h2>{% trans 'New issue' %}</h2>
{% endcomment %}
Expand All @@ -188,7 +188,7 @@ <h2>{% trans 'New issue' %}</h2>
{% endif %}
</div>

{% if object.upcoming_meeting_started and cperms.community.editupcoming_community %}
{% if object.upcoming_meeting_started and 'editupcoming_community' in cperms %}

<h2 class="pull-left">
{% if LANGUAGE_CODE == 'he' and committee.no_meetings_committee %}
Expand All @@ -210,10 +210,10 @@ <h2 class="pull-left">

{% endif %}

{% if cperms.community.editagenda_community %}
{% if 'editagenda_community' in cperms %}
<div style="margin: 1em auto;text-align: center;clear: both;">
<a data-rel="form" href="{% url 'upcoming_publish' committee.community.slug committee.slug %}" class="btn btn-oc"> {% if object.upcoming_meeting_started %} <i class="fa fa-envelope-o"></i> <span>{% trans "Summary draft" %}</span> {% else %} <i class="fa fa-envelope-o"></i> <span>{% trans "Publish the agenda" %}</span> {% endif %}</a>
{% if object.upcoming_meeting_started and cperms.meetings.add_meeting %}
{% if object.upcoming_meeting_started and 'add_meeting' in cperms %}
<a href="{% url 'upcoming_close' committee.community.slug committee.slug %}" data-rel="form" class="btn btn-warning" style="margin: 0 20px;">
{% if LANGUAGE_CODE == 'he' and committee.no_meetings_committee %}
{% trans "Close update" %}
Expand All @@ -226,7 +226,7 @@ <h2 class="pull-left">
{% endif %}


{% if cperms.community.editagenda_community %}
{% if 'editagenda_community' in cperms %}
<div id="available-agenda" class="agenda-list">

{% if committee.issue_ranking_enabled %}
Expand Down
Loading

0 comments on commit 278662d

Please sign in to comment.