diff --git a/src/acl/__init__.py b/src/acl/__init__.py index e69de29b..df665ba2 100644 --- a/src/acl/__init__.py +++ b/src/acl/__init__.py @@ -0,0 +1 @@ +default_app_config = 'acl.apps.AclConfig' \ No newline at end of file diff --git a/src/acl/admin.py b/src/acl/admin.py index 1c6f77ea..c0d3ddf8 100644 --- a/src/acl/admin.py +++ b/src/acl/admin.py @@ -7,6 +7,7 @@ class RolePermissionInline(admin.TabularInline): class RoleAdmin(admin.ModelAdmin): + list_display = ['community', 'title', 'based_on'] inlines = [ RolePermissionInline ] diff --git a/src/acl/apps.py b/src/acl/apps.py new file mode 100644 index 00000000..c0352842 --- /dev/null +++ b/src/acl/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig +from django.utils.translation import ugettext_lazy as _ + + +class AclConfig(AppConfig): + name = 'acl' + verbose_name = _("Access Control Logic") diff --git a/src/acl/locale/he/LC_MESSAGES/django.mo b/src/acl/locale/he/LC_MESSAGES/django.mo new file mode 100644 index 00000000..428a9066 Binary files /dev/null and b/src/acl/locale/he/LC_MESSAGES/django.mo differ diff --git a/src/acl/locale/he/LC_MESSAGES/django.po b/src/acl/locale/he/LC_MESSAGES/django.po new file mode 100644 index 00000000..7bb6ed68 --- /dev/null +++ b/src/acl/locale/he/LC_MESSAGES/django.po @@ -0,0 +1,271 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +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" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: he\n" +"X-Generator: Poedit 1.7.6\n" + +#: .\apps.py:7 +#, fuzzy +#| msgid "Access Community" +msgid "Access Control Logic" +msgstr "גישה לקהילה" + +#: .\core_permissions.py:6 +msgid "Access Community" +msgstr "גישה לקהילה" + +#: .\core_permissions.py:11 +msgid "View Upcoming Meeting" +msgstr "צפייה בפגישה הקרובה" + +#: .\core_permissions.py:16 +msgid "View Upcoming Meeting Before Published" +msgstr "צפייה בפגישה הקרובה לפני פירסום" + +#: .\core_permissions.py:21 +msgid "Edit Upcoming Agenda" +msgstr "עריכת סדר יום בפגישה הקרובה" + +#: .\core_permissions.py:26 +msgid "Manage Upcoming Meeting Participants" +msgstr "ניהול משתתפים בפגישה הקרובה" + +#: .\core_permissions.py:31 +msgid "Edit Summary" +msgstr "עריכת תקציר הפגישה" + +#: .\core_permissions.py:36 +msgid "Edit Upcoming" +msgstr "עריכת הפגישה" + +#: .\core_permissions.py:41 +msgid "Invite Member" +msgstr "הזמנת חברים לקהילה" + +#: .\core_permissions.py:46 +msgid "Acceptclosed Proposal" +msgstr "קבל/דחה הצעה" + +#: .\core_permissions.py:51 +msgid "Acceptopen Proposal" +msgstr "קבל/פתח הצעה" + +#: .\core_permissions.py:56 +msgid "Add Issue" +msgstr "הוספת נושא" + +#: .\core_permissions.py:61 +msgid "Add Issuecomment" +msgstr "הוספת הערה לנושא" + +#: .\core_permissions.py:66 +msgid "Add Proposal" +msgstr "הוספת הצעה" + +#: .\core_permissions.py:71 +msgid "Chairman Vote" +msgstr "הצבעת ועד" + +#: .\core_permissions.py:76 +msgid "Edit Referendum" +msgstr "ערוך משאל" + +#: .\core_permissions.py:81 +msgid "Edit Closed Issue" +msgstr "ערוך/סגור נושא" + +#: .\core_permissions.py:86 +msgid "Edit Closed Issuecomment" +msgstr "ערוך/סגור הערה על נושא" + +#: .\core_permissions.py:91 +msgid "Edit Closed Proposal" +msgstr "ערוך/סגור הצעה" + +#: .\core_permissions.py:96 +msgid "Edit Open Issue" +msgstr "ערוך/פתח נושא" + +#: .\core_permissions.py:101 +msgid "Edit Open Issuecomment" +msgstr "ערוך/פתח הערה על נושא" + +#: .\core_permissions.py:106 +msgid "Edit Open Proposal" +msgstr "ערוך/פתח הצעה" + +#: .\core_permissions.py:111 +msgid "Edit Task Proposal" +msgstr "ערוך הצעת משימה" + +#: .\core_permissions.py:116 +msgid "Move To Referendum" +msgstr "עבור למשאל" + +#: .\core_permissions.py:121 +msgid "Proposal Board Vote" +msgstr "הצבעת ועד על החלטה" + +#: .\core_permissions.py:126 +msgid "Proposal Board Vote Self" +msgstr "הצבעת ועד אישית" + +#: .\core_permissions.py:131 +msgid "View Proposal In Discussion" +msgstr "צפייה בהחלטה במהלך דיון" + +#: .\core_permissions.py:136 +msgid "View Referendum Results" +msgstr "צפייה בתוצאות המשאל" + +#: .\core_permissions.py:141 +msgid "View Update Status" +msgstr "צפייה ועריכת סטטוס" + +#: .\core_permissions.py:146 +msgid "View straw vote result" +msgstr "צפייה בתוצאות הצבעת שבשבת" + +#: .\core_permissions.py:151 +msgid "View Closed Issue" +msgstr "צפייה בנושא סגור" + +#: .\core_permissions.py:156 +msgid "View Closed Proposal" +msgstr "צפייה בהצעה סגורה" + +#: .\core_permissions.py:161 +msgid "View Open Issue" +msgstr "צפייה בנושא פתוח" + +#: .\core_permissions.py:166 +msgid "View Open Proposal" +msgstr "צפייה בהצעה פתוחה" + +#: .\core_permissions.py:171 +msgid "Vote" +msgstr "הצבעה" + +#: .\core_permissions.py:176 +msgid "Vote Ranking" +msgstr "דירוג הצבעות" + +#: .\core_permissions.py:181 +msgid "Add Meeting" +msgstr "הוספת פגישה" + +#: .\core_permissions.py:186 +msgid "View Meeting" +msgstr "צפייה בפגישה" + +#: .\core_permissions.py:191 +msgid "Show Member Profile" +msgstr "צפייה בפרופיל משתמש" + +#: .\default_roles.py:16 +msgid "Viewer" +msgstr "צופה" + +#: .\default_roles.py:17 +msgid "Observer" +msgstr "משקיף" + +#: .\default_roles.py:18 +msgid "Participant" +msgstr "משתתף" + +#: .\default_roles.py:19 +msgid "Proposer" +msgstr "מציע" + +#: .\default_roles.py:20 +msgid "Contributor" +msgstr "תורם" + +#: .\default_roles.py:21 +msgid "Editor" +msgstr "עורך" + +#: .\default_roles.py:22 +msgid "Operator" +msgstr "מתפעל" + +#: .\default_roles.py:23 +msgid "Decider" +msgstr "מחליט" + +#: .\default_roles.py:24 +msgid "Manager" +msgstr "מנהל" + +#: .\default_roles.py:119 +msgid "member" +msgstr "חבר קהילה" + +#: .\default_roles.py:120 +msgid "board" +msgstr "חבר ועד" + +#: .\default_roles.py:121 +msgid "secretary" +msgstr "מזכיר" + +#: .\default_roles.py:122 +msgid "chairman" +msgstr "יושב ראש" + +#: .\models.py:11 +msgid "Limit to community" +msgstr "מוגבל לקהילה" + +#: .\models.py:12 +msgid "ordinal" +msgstr "סדר" + +#: .\models.py:13 +msgid "title" +msgstr "כותרת" + +#: .\models.py:14 +msgid "based on" +msgstr "מבוסס על" + +#: .\models.py:36 +msgid "Permission" +msgstr "הרשאה" + +#: .\templates\acl\role_detail.html:7 .\templates\acl\role_detail.html:15 +#: .\templates\acl\role_form.html:9 .\templates\acl\role_list.html:7 +#: .\templates\acl\role_list.html.py:14 +msgid "Roles" +msgstr "" + +#: .\templates\acl\role_detail.html:21 +msgid "Based on" +msgstr "מבוסס על" + +#: .\templates\acl\role_form.html:12 +msgid "Edit Role" +msgstr "" + +#: .\templates\acl\role_form.html:14 .\templates\acl\role_list.html:27 +msgid "New Role" +msgstr "" + +#: .\templates\acl\role_form.html:23 +msgid "Save" +msgstr "שמירה" diff --git a/src/acl/migrations/0002_auto_20150607_1525.py b/src/acl/migrations/0002_auto_20150607_1525.py new file mode 100644 index 00000000..73795a44 --- /dev/null +++ b/src/acl/migrations/0002_auto_20150607_1525.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('acl', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='role', + name='community', + field=models.ForeignKey(related_name='roles', verbose_name='Limit to community', blank=True, to='communities.Community', null=True), + ), + migrations.AlterField( + model_name='role', + name='title', + field=models.CharField(max_length=200, verbose_name='title'), + ), + migrations.AlterUniqueTogether( + name='role', + unique_together=set([('community', 'title')]), + ), + ] diff --git a/src/acl/models.py b/src/acl/models.py index 57f76e6d..e90dd6ba 100644 --- a/src/acl/models.py +++ b/src/acl/models.py @@ -6,14 +6,18 @@ class Role(models.Model): - community = models.ForeignKey('communities.Community', null=True, - blank=True, - verbose_name=_("Limit to community")) + community = models.ForeignKey('communities.Community', null=True, blank=True, verbose_name=_("Limit to community"), + related_name='roles') ordinal = models.IntegerField(_("ordinal"), default=0) - title = models.CharField(_("title"), max_length=200, unique=True) + title = models.CharField(_("title"), max_length=200) based_on = models.CharField(_("based on"), max_length=50, null=True, blank=True, choices=DefaultRoles.choices) + class Meta: + unique_together = ( + ('community', 'title'), + ) + def get_absolute_url(self): return reverse('role:view', kwargs={'pk': self.id}) diff --git a/src/communities/admin.py b/src/communities/admin.py index be6bf803..f764e5f0 100644 --- a/src/communities/admin.py +++ b/src/communities/admin.py @@ -12,10 +12,12 @@ class CommunityConfidentialReasonInline(TabularInline): class CommunityGroupRoleInline(TabularInline): model = models.CommunityGroupRole + extra = 1 class CommunityGroupInline(TabularInline): model = models.CommunityGroup + extra = 1 class CommunityMembershipInline(TabularInline): @@ -44,11 +46,13 @@ class CommitteeAdmin(ModelAdmin): class CommunityGroupRoleAdmin(ModelAdmin): - pass + list_display = ['committee', 'group', 'role'] + list_display_links = ['committee', 'group', 'role'] class CommunityGroupAdmin(ModelAdmin): - pass + list_display = ['community', 'title'] + list_display_links = ['community', 'title'] site.register(models.Community, CommunityAdmin) diff --git a/src/communities/legacy_mapping.py b/src/communities/legacy_mapping.py index 3a97f591..fb6c5fb1 100644 --- a/src/communities/legacy_mapping.py +++ b/src/communities/legacy_mapping.py @@ -1,4 +1,4 @@ -#encoding: utf8 +#encoding: utf-8 from __future__ import unicode_literals TITLE_TO_SLUG = { diff --git a/src/communities/locale/he/LC_MESSAGES/django.mo b/src/communities/locale/he/LC_MESSAGES/django.mo index 7ac0b646..54ace599 100644 Binary files a/src/communities/locale/he/LC_MESSAGES/django.mo and b/src/communities/locale/he/LC_MESSAGES/django.mo differ diff --git a/src/communities/locale/he/LC_MESSAGES/django.po b/src/communities/locale/he/LC_MESSAGES/django.po index 8b3f8d5d..8ccfe67d 100644 --- a/src/communities/locale/he/LC_MESSAGES/django.po +++ b/src/communities/locale/he/LC_MESSAGES/django.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Open Community\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-05-14 15:04+0300\n" -"PO-Revision-Date: 2015-05-14 15:04+0200\n" +"POT-Creation-Date: 2015-06-07 13:13+0300\n" +"PO-Revision-Date: 2015-06-07 12:37+0200\n" "Last-Translator: Yaniv Mirel \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -44,185 +44,203 @@ msgstr "רקע" msgid "Send to" msgstr "נמענים" -#: .\models.py:27 .\models.py:34 +#: .\models.py:29 .\models.py:36 msgid "Me only (review)" msgstr "רק לי (לבדיקה)" -#: .\models.py:28 +#: .\models.py:30 msgid "Only attendees" msgstr "למשתתפים בפגישה בלבד" -#: .\models.py:29 .\models.py:35 +#: .\models.py:31 .\models.py:37 msgid "The board" msgstr "לועד בלבד" -#: .\models.py:30 .\models.py:36 +#: .\models.py:32 .\models.py:38 msgid "All members" msgstr "לכל חברי הקהילה" -#: .\models.py:41 .\models.py:131 .\models.py:570 +#: .\models.py:43 .\models.py:133 .\models.py:573 #: .\templates\communities\participants_form.html:95 msgid "Name" msgstr "שם" -#: .\models.py:42 .\models.py:132 +#: .\models.py:44 .\models.py:134 msgid "Friendly URL" msgstr "URL ידידותי" -#: .\models.py:43 .\models.py:133 +#: .\models.py:45 .\models.py:135 msgid "Public community" msgstr "פתוחה לציבור" -#: .\models.py:45 +#: .\models.py:47 msgid "Community logo" msgstr "לוגו קהילה" -#: .\models.py:47 +#: .\models.py:49 msgid "Community identifier" msgstr "מזהה קהילה" -#: .\models.py:51 .\models.py:173 +#: .\models.py:53 .\models.py:175 msgid "Straw voting enabled" msgstr "אפשר הצבעת קש" -#: .\models.py:55 .\models.py:177 +#: .\models.py:57 .\models.py:179 msgid "Issue ranking votes enabled" msgstr "אפשר תיעדוף נושאים" -#: .\models.py:57 .\models.py:179 +#: .\models.py:59 .\models.py:181 msgid "Straw Vote ends at" msgstr "הצבעת שבשבת עד" -#: .\models.py:60 .\models.py:182 +#: .\models.py:62 .\models.py:184 msgid "Referendum started" msgstr "משאל התחיל" -#: .\models.py:63 .\models.py:185 +#: .\models.py:65 .\models.py:187 msgid "Referendum started at" msgstr "משאל התחיל ב" -#: .\models.py:66 .\models.py:188 +#: .\models.py:68 .\models.py:190 msgid "Referendum ends at" msgstr "משאל הסתיים ב" -#: .\models.py:69 .\models.py:191 +#: .\models.py:71 .\models.py:193 msgid "Default quorum" msgstr "" -#: .\models.py:73 .\models.py:195 +#: .\models.py:75 .\models.py:197 msgid "Allow links inside emails" msgstr "אפשר קישורים בתוך אימייל" -#: .\models.py:75 .\models.py:197 +#: .\models.py:77 .\models.py:199 msgid "Send mails to invitees" msgstr "שלח מייל למוזמנים" -#: .\models.py:79 .\models.py:201 +#: .\models.py:81 .\models.py:203 msgid "Register missing board members" msgstr "רישום חברי ועד חסרים" -#: .\models.py:82 .\models.py:204 +#: .\models.py:84 .\models.py:206 msgid "Inform System Manager" msgstr "להודיע למנהל המערכת" -#: .\models.py:85 +#: .\models.py:87 msgid "Community without meetings?" msgstr "קהילות ללא פגישות?" -#: .\models.py:88 .\models.py:130 +#: .\models.py:90 .\models.py:132 msgid "Community" msgstr "קהילה" -#: .\models.py:89 +#: .\models.py:91 msgid "Communities" msgstr "קהילות" -#: .\models.py:135 +#: .\models.py:137 msgid "Committee logo" msgstr "לוגו ועדה" -#: .\models.py:137 +#: .\models.py:139 msgid "Committee identifier" msgstr "מזהה ועדה" -#: .\models.py:141 +#: .\models.py:143 msgid "Meeting started" msgstr "הפגישה התחילה" -#: .\models.py:143 +#: .\models.py:145 msgid "Upcoming meeting title" msgstr "כותרת הפגישה הקרובה" -#: .\models.py:147 +#: .\models.py:149 msgid "Upcoming meeting scheduled at" msgstr "מועד הפגישה הקרובה" -#: .\models.py:149 +#: .\models.py:151 msgid "Upcoming meeting location" msgstr "מיקום הפגישה הקרובה" -#: .\models.py:150 +#: .\models.py:152 msgid "Upcoming meeting background" msgstr "רקע לפגישה הקרובה" -#: .\models.py:155 +#: .\models.py:157 msgid "Participants in upcoming meeting" msgstr "משתתפים בפגישה הקרובה" -#: .\models.py:158 +#: .\models.py:160 msgid "Guests in upcoming meeting" msgstr "אורחים בפגישה הקרובה" -#: .\models.py:159 +#: .\models.py:161 msgid "Enter each guest in a separate line" msgstr "נא לרשום כל שם בשורה נפרדת" -#: .\models.py:162 +#: .\models.py:164 msgid "Upcoming meeting version" msgstr "מספר גרסת נתוני הפגישה הקרובה" -#: .\models.py:165 +#: .\models.py:167 msgid "Upcoming meeting is published" msgstr "האם הפגישה הקרובה פורסמה?" -#: .\models.py:168 +#: .\models.py:170 msgid "Upcoming meeting published at" msgstr "מועד פרסום הפגישה הקרובה" -#: .\models.py:170 +#: .\models.py:172 msgid "Upcoming meeting summary" msgstr "סיכום הפגישה הקרובה" -#: .\models.py:207 +#: .\models.py:209 msgid "Committee without meetings?" msgstr "ועדה ללא פגישות?" -#: .\models.py:210 +#: .\models.py:212 msgid "Committee" msgstr "ועדה" -#: .\models.py:211 .\templates\_community_panel.html:10 +#: .\models.py:213 .\templates\_community_panel.html:10 msgid "Committees" msgstr "ועדות" -#: .\models.py:559 +#: .\models.py:562 msgid "Confidential Reason" msgstr "סיבה עבור נושא חסוי" -#: .\models.py:560 +#: .\models.py:563 msgid "Confidential Reasons" msgstr "סיבות עבור נושאים חסויים" -#: .\models.py:566 +#: .\models.py:569 msgid "" "A reason that can be used for marking items as confidential in your " "community." msgstr "הגדרת סיבה עבור נושאים חסויים" -#: .\models.py:572 +#: .\models.py:575 msgid "The title to give this reason." msgstr "כותרת עבור סיבה זו" +#: .\models.py:586 +msgid "Group" +msgstr "קבוצה" + +#: .\models.py:587 .\templates\communities\communitygroup_detail.html:4 +#: .\templates\communities\communitygroup_form.html:4 +#: .\templates\communities\communitygroup_list.html:4 +msgid "Groups" +msgstr "קבוצות" + +#: .\models.py:606 +msgid "Group Role" +msgstr "קבוצת Role" + +#: .\models.py:607 +msgid "Group Roles" +msgstr "קבוצות Role" + #: .\south_migrations\0011_auto__add_field_community_register_missing_board_members__chg_field_co.py:17 #: .\templates\communities\participants_form.html:27 msgid "Board" @@ -358,6 +376,20 @@ msgstr "הקודם" msgid "Next" msgstr "הבא" +#: .\templates\communities\communitygroup_detail.html:9 +#: .\templates\communities\participants_form.html:10 +#: .\templates\communities\upcoming.html:69 +msgid "Edit" +msgstr "עריכה" + +#: .\templates\communities\communitygroup_form.html:4 +msgid "Create" +msgstr "צור" + +#: .\templates\communities\communitygroup_list.html:21 +msgid "Create Group" +msgstr "צור קבוצה" + #: .\templates\communities\edit_summary.html:5 msgid "Edit summary" msgstr "ערוך סיכום" @@ -597,11 +629,6 @@ msgstr "רשימה" msgid "List of participants" msgstr "רשימת משתתפים בפגישה" -#: .\templates\communities\participants_form.html:10 -#: .\templates\communities\upcoming.html:69 -msgid "Edit" -msgstr "עריכה" - #: .\templates\communities\participants_form.html:33 #: .\templates\communities\participants_form.html:180 #: .\templates\emails\_protocol.html:70 @@ -923,6 +950,10 @@ msgstr "מספר עמוד צריך להיות 1 או יותר." msgid "No such page!" msgstr "דף לא קיים!" +#: .\views.py:430 +msgid "Group already exists" +msgstr "קבוצה בשם זה כבר קיימת" + #~ msgid "Board name" #~ msgstr "שם הועד" @@ -959,9 +990,6 @@ msgstr "דף לא קיים!" #~ msgid "Additional Issues" #~ msgstr "נושאים נוספים" -#~ msgid "Create Issue" -#~ msgstr "צור נושא" - #~ msgid "By rank" #~ msgstr "משוקלל" diff --git a/src/communities/locale/he/LC_MESSAGES/djangojs.mo b/src/communities/locale/he/LC_MESSAGES/djangojs.mo index 42ca9cd9..f69bbedd 100644 Binary files a/src/communities/locale/he/LC_MESSAGES/djangojs.mo and b/src/communities/locale/he/LC_MESSAGES/djangojs.mo differ diff --git a/src/communities/locale/he/LC_MESSAGES/djangojs.po b/src/communities/locale/he/LC_MESSAGES/djangojs.po index 034e00f4..b7b4b9e5 100644 --- a/src/communities/locale/he/LC_MESSAGES/djangojs.po +++ b/src/communities/locale/he/LC_MESSAGES/djangojs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Open Community\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-05-14 15:04+0300\n" +"POT-Creation-Date: 2015-06-07 13:13+0300\n" "PO-Revision-Date: 2014-02-11 12:50+0200\n" "Last-Translator: Yaniv Mirel \n" "Language-Team: LANGUAGE \n" diff --git a/src/communities/models.py b/src/communities/models.py index 02b3bdc2..725ccfb0 100644 --- a/src/communities/models.py +++ b/src/communities/models.py @@ -578,16 +578,6 @@ def __unicode__(self): return self.title -@receiver(post_save, sender=Community) -def set_default_confidental_reasons(sender, instance, created, - dispatch_uid='set_default_confidental_reasons', - **kwargs): - if created: - for reason in settings.OPENCOMMUNITY_DEFAULT_CONFIDENTIAL_REASONS: - CommunityConfidentialReason.objects.create(community=instance, - title=ugettext(reason)) - - class CommunityGroup(models.Model): community = models.ForeignKey(Community, related_name="groups") title = models.CharField(max_length=200) @@ -620,4 +610,15 @@ class Meta: ) def __unicode__(self): - return u"{}: {}".format(self.committee.title, self.group) + return u"{}: {}".format(self.committee.name, self.group) + + +@receiver(post_save, sender=Community) +def set_default_confidental_reasons(sender, instance, created, + dispatch_uid='set_default_confidental_reasons', + **kwargs): + if created: + for reason in settings.OPENCOMMUNITY_DEFAULT_CONFIDENTIAL_REASONS: + CommunityConfidentialReason.objects.create(community=instance, title=ugettext(reason)) + for group in settings.OPENCOMMUNITY_DEFAULT_GROUPS: + CommunityGroup.objects.create(community=instance, title=ugettext(group)) diff --git a/src/issues/locale/he/LC_MESSAGES/django.mo b/src/issues/locale/he/LC_MESSAGES/django.mo index 639319bf..346e131d 100644 Binary files a/src/issues/locale/he/LC_MESSAGES/django.mo and b/src/issues/locale/he/LC_MESSAGES/django.mo differ diff --git a/src/issues/locale/he/LC_MESSAGES/django.po b/src/issues/locale/he/LC_MESSAGES/django.po index b1d8545a..b24d151f 100644 --- a/src/issues/locale/he/LC_MESSAGES/django.po +++ b/src/issues/locale/he/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Open Community\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-05-14 15:04+0300\n" +"POT-Creation-Date: 2015-06-07 13:13+0300\n" "PO-Revision-Date: 2015-05-14 13:18+0200\n" "Last-Translator: Yaniv Mirel \n" "Language-Team: \n" diff --git a/src/issues/locale/he/LC_MESSAGES/djangojs.mo b/src/issues/locale/he/LC_MESSAGES/djangojs.mo index 62f5e2fc..6a729470 100644 Binary files a/src/issues/locale/he/LC_MESSAGES/djangojs.mo and b/src/issues/locale/he/LC_MESSAGES/djangojs.mo differ diff --git a/src/issues/locale/he/LC_MESSAGES/djangojs.po b/src/issues/locale/he/LC_MESSAGES/djangojs.po index 16559d05..3d9b60e1 100644 --- a/src/issues/locale/he/LC_MESSAGES/djangojs.po +++ b/src/issues/locale/he/LC_MESSAGES/djangojs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Open Community\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-05-14 15:04+0300\n" +"POT-Creation-Date: 2015-06-07 13:13+0300\n" "PO-Revision-Date: 2015-03-05 16:27+0200\n" "Last-Translator: Yaniv Mirel \n" "Language-Team: \n" diff --git a/src/meetings/locale/he/LC_MESSAGES/django.mo b/src/meetings/locale/he/LC_MESSAGES/django.mo index 434392fd..1d136313 100644 Binary files a/src/meetings/locale/he/LC_MESSAGES/django.mo and b/src/meetings/locale/he/LC_MESSAGES/django.mo differ diff --git a/src/meetings/locale/he/LC_MESSAGES/django.po b/src/meetings/locale/he/LC_MESSAGES/django.po index 92da3128..213de226 100644 --- a/src/meetings/locale/he/LC_MESSAGES/django.po +++ b/src/meetings/locale/he/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Open Community\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-05-14 15:04+0300\n" +"POT-Creation-Date: 2015-06-07 13:13+0300\n" "PO-Revision-Date: 2015-05-14 13:18+0200\n" "Last-Translator: Yaniv Mirel \n" "Language-Team: \n" diff --git a/src/ocd/locale/he/LC_MESSAGES/django.mo b/src/ocd/locale/he/LC_MESSAGES/django.mo index 6cbe86ee..3dfe71ee 100644 Binary files a/src/ocd/locale/he/LC_MESSAGES/django.mo and b/src/ocd/locale/he/LC_MESSAGES/django.mo differ diff --git a/src/ocd/locale/he/LC_MESSAGES/django.po b/src/ocd/locale/he/LC_MESSAGES/django.po index 47a43e27..4f48d88a 100644 --- a/src/ocd/locale/he/LC_MESSAGES/django.po +++ b/src/ocd/locale/he/LC_MESSAGES/django.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Open Community\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-05-14 15:04+0300\n" -"PO-Revision-Date: 2015-04-08 23:19+0200\n" +"POT-Creation-Date: 2015-06-07 13:13+0300\n" +"PO-Revision-Date: 2015-06-07 13:14+0200\n" "Last-Translator: Yaniv Mirel \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -15,7 +15,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Language: he\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 1.7.5\n" +"X-Generator: Poedit 1.7.6\n" #: .\base_models.py:13 msgid "HTML content" @@ -31,19 +31,28 @@ msgid "" "pass onconfidentiality." msgstr "" -#: .\settings.py:296 +#: .\settings.py:300 +msgid "Admin" +msgstr "אדמין" + +#: .\settings.py:301 .\templates\search\search.html:14 +#: .\templates\search\search.html.py:18 .\templates\search\search.html:22 +msgid "All" +msgstr "כל חברי הקהילה" + +#: .\settings.py:305 msgid "Privacy" msgstr "פרטיות" -#: .\settings.py:297 +#: .\settings.py:306 msgid "Commercial" msgstr "מסחרי" -#: .\settings.py:298 +#: .\settings.py:307 msgid "Security" msgstr "ביטחון" -#: .\settings.py:299 +#: .\settings.py:308 msgid "Legal" msgstr "משפטי" @@ -155,7 +164,7 @@ msgstr "כותרת עמוד" msgid "Attention" msgstr "שים לב" -#: .\templates\base.html:59 .\templates\dialog.html:25 +#: .\templates\base.html:59 .\templates\dialog.html:24 msgid "Close" msgstr "סגור" @@ -179,7 +188,7 @@ msgstr "מבית הסדנא" msgid "Version" msgstr "גרסא" -#: .\templates\dialog.html:26 +#: .\templates\dialog.html:25 msgid "Save" msgstr "שמור" @@ -295,11 +304,6 @@ msgstr "אפס סיסמא" msgid "Search" msgstr "חיפוש" -#: .\templates\search\search.html:14 .\templates\search\search.html.py:18 -#: .\templates\search\search.html:22 -msgid "All" -msgstr "הכל" - #: .\templates\search\search.html:15 .\templates\search\search.html.py:19 #: .\templates\search\search.html:23 msgid "Issues" diff --git a/src/ocd/settings.py b/src/ocd/settings.py index d0ff3b3c..dba40891 100644 --- a/src/ocd/settings.py +++ b/src/ocd/settings.py @@ -6,6 +6,8 @@ QA_SERVER = False # triggers minor UI changes +OCD_PROJECT_DIR = os.path.abspath(os.path.dirname(__file__)) + PROJECT_DIR = os.path.abspath( os.path.join(os.path.dirname(__file__), '..', '..')) @@ -62,9 +64,9 @@ DATABASES['default'] = {'ENGINE': 'django.db.backends.sqlite3'} TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' LANGUAGE_CODE = 'en' -LOCALE_PATHS = ( - ABSDIR('src/ocd/locale'), -) +# LOCALE_PATHS = ( +# ABSDIR('src/ocd/locale'), +# ) # If you set this to False, Django will not use timezone-aware datetimes. USE_TZ = True @@ -139,7 +141,7 @@ TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': ['ocd/templates', ], + 'DIRS': [os.path.join(OCD_PROJECT_DIR, 'templates')], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ @@ -294,6 +296,11 @@ # } } +OPENCOMMUNITY_DEFAULT_GROUPS = [ + gettext('Admin'), + gettext('All') +] + OPENCOMMUNITY_DEFAULT_CONFIDENTIAL_REASONS = [ gettext('Privacy'), gettext('Commercial'), diff --git a/src/users/admin.py b/src/users/admin.py index 286bc912..ba77285a 100644 --- a/src/users/admin.py +++ b/src/users/admin.py @@ -40,9 +40,9 @@ class UserChangeForm(forms.ModelForm): password hash display field. """ password = ReadOnlyPasswordHashField(label=_("Password"), - help_text=_("Raw passwords are not stored, so there is no way to see " - "this user's password, but you can change the password " - "using this form.")) + help_text=_("Raw passwords are not stored, so there is no way to see " + "this user's password, but you can change the password " + "using this form.")) class Meta: model = OCUser @@ -59,17 +59,19 @@ class UserMembershipInline(admin.TabularInline): model = Membership fk_name = 'user' -class MembershipAdmin(admin.ModelAdmin): +class MembershipAdmin(admin.ModelAdmin): list_display = ( - 'community', - 'default_group_name', - 'user', - 'created_at', - ) - - list_filter = ('community', 'default_group_name',) - + 'community', + 'group_name', + 'default_group_name', + 'user', + 'created_at', + ) + + list_filter = ('community', 'group_name',) + + class OCUserAdmin(UserAdmin): # The forms to add and change user instances form = UserChangeForm @@ -98,14 +100,17 @@ class OCUserAdmin(UserAdmin): inlines = [UserMembershipInline] + admin.site.register(OCUser, OCUserAdmin) admin.site.unregister(Group) admin.site.register(Membership, MembershipAdmin) + class InvitationAdmin(admin.ModelAdmin): list_display = ('community', 'name', 'email', 'default_group_name', 'last_sent_at', 'status') ordering = ('community', 'last_sent_at') + admin.site.register(Invitation, InvitationAdmin) diff --git a/src/users/locale/he/LC_MESSAGES/django.mo b/src/users/locale/he/LC_MESSAGES/django.mo index 73bb871d..731470a7 100644 Binary files a/src/users/locale/he/LC_MESSAGES/django.mo and b/src/users/locale/he/LC_MESSAGES/django.mo differ diff --git a/src/users/locale/he/LC_MESSAGES/django.po b/src/users/locale/he/LC_MESSAGES/django.po index 30b7ddfe..e6cfaa4d 100644 --- a/src/users/locale/he/LC_MESSAGES/django.po +++ b/src/users/locale/he/LC_MESSAGES/django.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Open Community\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-05-14 15:04+0300\n" -"PO-Revision-Date: 2015-05-14 13:19+0200\n" +"POT-Creation-Date: 2015-06-07 13:13+0300\n" +"PO-Revision-Date: 2015-06-07 12:38+0200\n" "Last-Translator: Yaniv Mirel \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -18,7 +18,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 1.7.6\n" -#: .\admin.py:42 .\forms.py:38 +#: .\admin.py:42 .\forms.py:39 msgid "Password" msgstr "סיסמא" @@ -35,38 +35,22 @@ msgstr "" msgid "Users, memberships & rolls" msgstr "משתמשים, חברי קהילה, תפקידים והזמנות" -#: .\default_roles.py:101 -msgid "member" -msgstr "חבר" - -#: .\default_roles.py:102 -msgid "board" -msgstr "ועד" - -#: .\default_roles.py:103 -msgid "secretary" -msgstr "מזכיר" - -#: .\default_roles.py:104 -msgid "chairman" -msgstr "יושב ראש" - -#: .\forms.py:11 +#: .\forms.py:12 #, python-format msgid "" "Please enter a correct %(username)s and password. Note that both fields may " "be case-sensitive." msgstr "אנא הכנס %(username)s וסיסמא תיקניים. שים לב לאותיות קטנות וגדולות." -#: .\forms.py:39 +#: .\forms.py:40 msgid "Password confirmation" msgstr "אימות סיסמא" -#: .\forms.py:53 +#: .\forms.py:54 msgid "Passwords don't match" msgstr "סיסמא לא תואמת" -#: .\forms.py:96 +#: .\forms.py:97 msgid "Upload CSV file to import" msgstr "העלאת קובץ csv" @@ -375,11 +359,64 @@ msgstr "מההחלטות בהם לא הצביע התקבלו" msgid "of decisions voted against were rejected" msgstr "מההחלטות בהם הצביע 'נגד' נדחו" +#: .\templates\users\membership_groups.html:6 #: .\templates\users\membership_list.html:6 #: .\templates\users\membership_list.html:34 msgid "Members" msgstr "חברים" +#: .\templates\users\membership_groups.html:22 +msgid "Search members" +msgstr "חיפוש חברי קהילה" + +#: .\templates\users\membership_groups.html:62 +msgid "A-C" +msgstr "" + +#: .\templates\users\membership_groups.html:65 +msgid "D-F" +msgstr "" + +#: .\templates\users\membership_groups.html:68 +msgid "G-I" +msgstr "" + +#: .\templates\users\membership_groups.html:71 +msgid "J-L" +msgstr "" + +#: .\templates\users\membership_groups.html:74 +msgid "M-O" +msgstr "" + +#: .\templates\users\membership_groups.html:77 +msgid "P-R" +msgstr "" + +#: .\templates\users\membership_groups.html:80 +msgid "S-U" +msgstr "" + +#: .\templates\users\membership_groups.html:83 +msgid "V-Z" +msgstr "" + +#: .\templates\users\membership_groups.html:86 +msgid "Add to list" +msgstr "הוסף לרשימה" + +#: .\templates\users\membership_groups.html:94 +msgid "Add to groups" +msgstr "הוסף לקבוצות" + +#: .\templates\users\membership_groups.html:107 +msgid "Choose groups" +msgstr "בחר קבוצות" + +#: .\templates\users\membership_groups.html:114 +msgid "Add to group" +msgstr "הוסף לקבוצה" + #: .\templates\users\membership_list.html:51 msgid "No members." msgstr "אין חברים בקהילה" @@ -396,7 +433,7 @@ msgstr "הזמן" msgid "Open invitations" msgstr "הזמנות פתוחות" -#: .\tests\invitation_test.py:80 .\views.py:69 +#: .\tests\invitation_test.py:80 .\views.py:69 .\views.py:385 msgid "Form error. Please supply a valid email." msgstr "יש בעיה בטופס. אנא בדוק את כתובת האימייל" @@ -417,6 +454,18 @@ msgstr "אופס. משהו השתבש. אנה נסה שוב." msgid "%d Invitations sent" msgstr "%d הזמנות נשלחו" +#~ msgid "member" +#~ msgstr "חבר" + +#~ msgid "board" +#~ msgstr "ועד" + +#~ msgid "secretary" +#~ msgstr "מזכיר" + +#~ msgid "chairman" +#~ msgstr "יושב ראש" + #~ msgid "Board" #~ msgstr "ועד" diff --git a/src/users/migrations/0002_auto_20150607_1350.py b/src/users/migrations/0002_auto_20150607_1350.py new file mode 100644 index 00000000..79d2a48f --- /dev/null +++ b/src/users/migrations/0002_auto_20150607_1350.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('communities', '0010_auto_20150607_1148'), + ('users', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='membership', + name='group_name', + field=models.ForeignKey(related_name='memberships', verbose_name='Group', blank=True, to='communities.CommunityGroup', null=True), + ), + migrations.AlterField( + model_name='membership', + name='default_group_name', + field=models.CharField(max_length=50, verbose_name='Old group', choices=[(b'member', 'member'), (b'board', 'board'), (b'secretary', 'secretary'), (b'chairman', 'chairman')]), + ), + ] diff --git a/src/users/migrations/0003_auto_20150607_1606.py b/src/users/migrations/0003_auto_20150607_1606.py new file mode 100644 index 00000000..a05bef15 --- /dev/null +++ b/src/users/migrations/0003_auto_20150607_1606.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals +from acl.models import Role +from communities.models import Community, CommunityGroup, Committee, CommunityGroupRole +from django.db import models, migrations + + +def create_default_groups(apps, schema_editor): + Membership = apps.get_model("users", "Membership") + communities = Community.objects.all() + committees = Committee.objects.all() + + for c in communities: + # Creating groups to existing communities, similar to what they have before. + CommunityGroup.objects.bulk_create([ + CommunityGroup(community=c, title='chairman', _order=0), + CommunityGroup(community=c, title='board', _order=1), + CommunityGroup(community=c, title='member', _order=2) + ]) + # Creating roles for existing communities, similar to what they have before. + Role.objects.bulk_create([ + Role(community=c, title='chairman', based_on='manager'), + Role(community=c, title='board', based_on='participant'), + Role(community=c, title='member', based_on='observer') + ]) + # Assigning new group field values (FK). + for member in c.memberships.all(): + member.group_name = c.groups.get(title=member.default_group_name) + member.save() + + for c in committees: + # Creating community group roles. + CommunityGroupRole.objects.bulk_create([ + CommunityGroupRole(committee=c, role=c.community.roles.get(title="chairman"), + group=c.community.groups.get(title="chairman")), + CommunityGroupRole(committee=c, role=c.community.roles.get(title="board"), + group=c.community.groups.get(title="board")), + CommunityGroupRole(committee=c, role=c.community.roles.get(title="member"), + group=c.community.groups.get(title="member")) + ]) + + +class Migration(migrations.Migration): + dependencies = [ + ('users', '0002_auto_20150607_1350'), + ] + + operations = [ + migrations.RunPython(create_default_groups), + ] diff --git a/src/users/models.py b/src/users/models.py index b461403f..11b690d3 100644 --- a/src/users/models.py +++ b/src/users/models.py @@ -117,15 +117,11 @@ def none_board(self): class Membership(models.Model): - community = models.ForeignKey('communities.Community', verbose_name=_("Community"), - related_name='memberships') - user = models.ForeignKey(OCUser, verbose_name=_("User"), - related_name='memberships') - default_group_name = models.CharField(_('Group'), max_length=50, - choices=DefaultGroups.CHOICES) - - created_at = models.DateTimeField(auto_now_add=True, - verbose_name=_("Created at")) + community = models.ForeignKey('communities.Community', verbose_name=_("Community"), related_name='memberships') + user = models.ForeignKey(OCUser, verbose_name=_("User"), related_name='memberships') + group_name = models.ForeignKey('communities.CommunityGroup', verbose_name=_('Group'), related_name='memberships', null=True, blank=True) + default_group_name = models.CharField(_('Old group'), max_length=50, choices=DefaultGroups.CHOICES) + created_at = models.DateTimeField(auto_now_add=True, verbose_name=_("Created at")) invited_by = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_("Invited by"), related_name="members_invited", null=True, @@ -139,15 +135,14 @@ class Meta: verbose_name_plural = _("Community Members") def __unicode__(self): - return "%s: %s (%s)" % (self.community.name, self.user.display_name, - self.get_default_group_name_display()) + return "%s: %s (%s)" % (self.community.name, self.user.display_name, self.group_name.title) @models.permalink def get_absolute_url(self): - return "member_profile", (self.community.id, self.id) + return "member_profile", (self.community.slug, self.id) def get_permissions(self): - return DefaultGroups.permissions[self.default_group_name] + return DefaultGroups.permissions[self.group_name.title] def total_meetings(self): """ In the future we'll check since joined to community or rejoined """