Commits

Anonymous committed e48db18

Further nuking of components.

  • Participants
  • Parent commits 1f5238b

Comments (0)

Files changed (21)

File transifex/actionlog/models.py

         
         Useful for presenting an image signifying an action type. Example::
         >>> from notification.models import  NoticeType
-        >>> nt = NoticeType(label='project_component_added')
+        >>> nt = NoticeType(label='project_added')
         >>> zlog = LogEntry(action_type=nt)
         >>> nt
-        <NoticeType: project_component_added>
+        <NoticeType: project_added>
         >>> zlog.action_type
-        <NoticeType: project_component_added>
+        <NoticeType: project_added>
         >>> zlog.action_type_short
         'added'
         """
 
     Usage::
 
-        al = 'project_component_added'
-        context = {'component': object}
+        al = 'project_added'
+        context = {'project': object}
         action_logging(request.user, [object], al , context=context):
     """
     if not getattr(settings, 'ACTIONLOG_ENABLED', None):

File transifex/addons/locks/templates/locks/comp_stats_table.html

-{% load locks_tags %}
-{% block extra_buttons %}
-{% pofile_lock stat %}
-{% endblock %}

File transifex/addons/locks/templates/pofile_lock.html

 {% load permissions %}
 {% load locks_tags %}
 {% load txcommontags %}
-{% url component_file_unlock pofile.object.project.slug pofile.object.slug pofile.filename as url_unlock %}
-{% url component_file_lock pofile.object.project.slug pofile.object.slug pofile.filename as url_lock %}
+{% url resource_file_unlock pofile.object.project.slug pofile.object.slug pofile.filename as url_unlock %}
+{% url resource_file_lock pofile.object.project.slug pofile.object.slug pofile.filename as url_lock %}
 {% with pofile.locks.get.owner as owner %}
 {% with forloop.counter as pofile_id %}
 {% get_permission "project_perm.maintain" for request.user and pofile.object.project as "is_maintainer" %}

File transifex/addons/locks/tests/test_locking.py

         # Generate URLs
         url_args = [self.pofile.object.project.slug,
             self.pofile.object.slug, self.pofile.filename]
-        self.url_lock = reverse('component_file_lock', args=url_args)
-        self.url_unlock = reverse('component_file_unlock', args=url_args)
-        self.url_component = reverse('component_detail', args=url_args[:2])
-        self.url_submit = reverse('component_submit_file', args=url_args)
-        self.url_start_lotte = reverse('component_edit_file', args=url_args)
+        self.url_lock = reverse('resource_file_lock', args=url_args)
+        self.url_unlock = reverse('resource_file_unlock', args=url_args)
+        self.url_resource = reverse('resource_detail', args=url_args[:2])
+        self.url_submit = reverse('resource_submit_file', args=url_args)
+        self.url_start_lotte = reverse('resource_edit_file', args=url_args)
 
         # Sanity checks
         self.assertEqual( POFileLock.objects.all().count(), 0)
 
     def test_submission(self):
         def get_file_handle(pof):
-            return open(self.component.trans.tm.get_file_path(pof.filename))
+            return open(self.resource.trans.tm.get_file_path(pof.filename))
 
         # Enable submission        
-        self.component.allows_submission = True
-        self.component.save()
+        self.resource.allows_submission = True
+        self.resource.save()
 
         # Try to submit file as translator: should succeed
         resp = self.client['team_member'].post(self.url_submit, {'submitted_file':
                     logger.debug("Trying to lock as: %s (Should succeed) ..." % locker_nick)
                     self.assertEqual( resp.status_code, 200 )
                     url, code = resp.redirect_chain[0]
-                    self.assertTrue( self.url_component in url )
+                    self.assertTrue( self.url_resource in url )
                     self.assertEqual( code, 302 )
                     self.assertEqual( POFileLock.objects.valid().count(), 1)
                     lock = POFileLock.objects.valid().get()
         management.call_command('cron', interval='daily')
         self.assertEqual(POFileLock.objects.all().count(), 0)
 
-        self.pofiles = POFile.objects.filter(component = self.component)
+        self.pofiles = POFile.objects.filter(resource = self.resource)
         pofile = self.pofiles[0]

File transifex/addons/locks/views.py

         response={}
         try:
             lock = Lock.objects.create_update(resource, language, request.user)
-            #cache.delete(TFC_CACHING_PREFIX +'.component.'+component.full_name)
+            #cache.delete(TFC_CACHING_PREFIX +'.resource.'+resource.full_name)
             response['status'] = "OK"
             response['message'] = _("Lock created.")
             response['timeuntil'] = timeuntil(lock.expires)
         if lock:
             try:
                 lock.delete_by_user(request.user)
-                #cache.delete(TFC_CACHING_PREFIX +'.component.'+component.full_name)
+                #cache.delete(TFC_CACHING_PREFIX +'.resource.'+resource.full_name)
                 response['status'] = "OK"
                 response['message'] = _("Lock removed.")
             except LockError, e:

File transifex/addons/watches/views.py

     url = reverse('project_toggle_watch', args=(project_slug,))
 
     project_signals = ['project_changed',
-                       'project_deleted',
-                       'project_component_added',
-                       'project_component_changed',
-                       'project_component_deleted']
+                       'project_deleted',]
     try:
         result = {
             'style': 'watch_add',

File transifex/media/css/icons.css

 .i16.release { background-image: url('../images/icons/date.png'); }
 .i16.release_date { background-image: url('../images/icons/date_go.png'); }
 .i16.repository { background-image: url('../images/icons/drive_network.png'); }
+.i16.resource { background-image: url('../images/icons/brick.png'); }
 .i16.reviews { background-image: url('../images/icons/page_white_ruby.png'); }
 .i16.save { background-image: url('../images/icons/disk.png'); }
 .i16.override_save { background-image: url('../images/icons/disk.png'); }

File transifex/media/js/tablesorted.js

         }
     });
 
+    // FIXME: If this is not used, remove it.
     // ordering for Component stats table
         // Just enable sorting for the stats column if there are stats
         if (typeof calcstats == "undefined" || calcstats == true){
             }
         });
 
+    // FIXME: If this is not used, remove it.
     // ordering for Component Multifile Language stats table
     $("#stats_comp_lang").tablesorter({
         widgets: ['zebra'],

File transifex/projects/forms.py

 class ReleaseForm(forms.ModelForm):
 
     resources = AutoCompleteSelectMultipleField('resources', required=True,
-        help_text=_('Search for a component'))
+        help_text=_('Search for a resource'))
 
     class Meta:
         model = Release

File transifex/projects/permissions/project.py

     checks = ('maintain', 'coordinate_team', 'submit_file', 
         'submit_translations')
 
-    def maintain(self, project=None, component=None):
+    def maintain(self, project=None):
         if project:
             if project.maintainers.filter(id=self.user.id):
                 return True

File transifex/projects/signals.py

 post_submit_translation = Signal(providing_args=['request', 'resource', 'language', 'modified'])
 
 # This is obsolete:
-sig_refresh_cache = Signal(providing_args=["component"])
+sig_refresh_cache = Signal(providing_args=["resource"])
 pre_refresh_cache = sig_refresh_cache
-post_refresh_cache = Signal(providing_args=["component"])
+post_refresh_cache = Signal(providing_args=["resource"])
 
 # This is obsolete:
-sig_clear_cache = Signal(providing_args=["component"])
+sig_clear_cache = Signal(providing_args=["resource"])
 pre_clear_cache = sig_clear_cache
-post_clear_cache = Signal(providing_args=["component"])
+post_clear_cache = Signal(providing_args=["resource"])
 
 # These are obsolete:
-sig_submit_file_post = Signal(providing_args=["component"])
+sig_submit_file_post = Signal(providing_args=["resource"])
 sig_submit_file = sig_submit_file_post
-sig_submit_file_pre  = Signal(providing_args=['filename', 'component', 'user',
+sig_submit_file_pre  = Signal(providing_args=['filename', 'resource', 'user',
     'stream', 'file_dict'])
 
 post_submit_file = sig_submit_file_post

File transifex/projects/templates/feeds/latest_description.html

 {% firstof obj.description|escape obj.name|escape %}
 <br/>
-<br/>Components: {% for comp in obj.component_set.all %}<a href="{{ comp.get_absolute_url }}">{{ comp.name }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}
+<br/>Resources: {% for res in obj.resources.all %}<a href="{{ res.get_absolute_url }}">{{ res.name }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}

File transifex/releases/models.py

 class Release(models.Model):
 
     """
-    A release of a project, as in 'a set of specific components'.
+    A release of a project, as in 'a set of specific resources'.
     
     Represents the packaging and releasing of a software project (big or
     small) on a particular date, for which makes sense to track

File transifex/templates/about.html

 translations from contributors, and translators to collaborate together to
 send their contributors to upstream in an easy way.</p>
 
-<h2>Features</h2>
-
-<p>Here is a quick list of what Transifex supports:</p>
-
-<ul>
-<li>Multiple versioning systems: CVS, SVN, hg, git, bzr</li> 
-<li>Translation statistics calculation for multiple i18n methods: POT, msgmerged POs and intltool</li>
-<li>Projects with multiple components/branches</li>
-<li>Project releases for grouping packages together (eg. Fedora 10, GNOME 3.0)</li>
-<li>PO and POT file viewing and direct downloading</li>
-<li>Software releases (eg. KDE 4.2.1)</li>
-<li>RSS feeds for everything</li>
-<li>User accounts and authentication through OpenID</li>
-<li>Notifications for project additions</li>
-<li>Tagging! For ever easier grouping</li> 
-<li>Rich descriptions using Markdown syntax for ease of use</li>
-</ul>
-
 <p>And many more to come. :)</p>
 
 {% endblock %}

File transifex/templates/helptext/project_form_helptext.html

 {% blocktrans %}
 Maintainers are the people responsible for the administration of the project.
 They have permissions to edit the project and to add translators. They can
-also add, edit remove components of a project.
+also add, edit remove resources of a project.
 {% endblocktrans %}
 </p>
 <p>

File transifex/templates/notification/project_report_weekly_maintainers/full.txt

 {% load i18n %}{% load txcommontags %}{% url project_timeline project.slug as project_timeline_url %}{% with project.name as project_name %}
 {% blocktrans %}I am bringing you the weekly translation report for your project '{{ project_name }}'.{% endblocktrans %}
-{% for component in project.component_set.all %}
-{{ project.name }} » {{ component.name }}
+{% for resource in project.resources.all %}
+{{ project.name }} » {{ resource.name }}
 
-- Repository: {{ component.unit.root }}
-{% if component.unit.branch %}- Branch: {{ component.unit.branch }}{% endif %}
-- Last updated: {{ component.unit.last_checkout|date:"G:i Y-n-d" }}
-
-{{ component.trans.get_rest_stats }}{% endfor %}
+{{ resource.get_rest_stats }}{% endfor %}
 {% blocktrans %}Activity report from past week (last 30 actions):{% endblocktrans %}
 
 {% for actionlog in actionlogs %}- {{ actionlog.message|strip_tags }} by {{actionlog.user}} on {{actionlog.action_time|date:"D M j, G:i"}}.

File transifex/templates/projects/project_list.html

       <h3 class="name"><a href="{{ project.get_absolute_url }}">{{ project.name }}</a></h3>
       <p class="description">{{ project.description }}</p>
       <p>
-        <span class="i16 component compact">
-          {% for resource in project.resources.all|slice:"0:4" %}<a class="component" title="{% firstof comp.description|escape comp.name|escape %}" href="{{ resource.get_absolute_url }}">{{ resource.name }}</a> {% endfor %}
+        <span class="i16 resource compact">
+          {% for resource in project.resources.all|slice:"0:4" %}<a class="resource" title="{% firstof resource.description|escape resource.name|escape %}" href="{{ resource.get_absolute_url }}">{{ resource.name }}</a> {% endfor %}
         </span>
       {% if project.tags %}| <span class="i16 tag compact">{% trans "Tags:" %} {% for tag in project.tagsobj.all|slice:"0:6" %}<a class="tag" href="{% url project_tag_list tag=tag %}">{{ tag }}</a> {% endfor %}</span>{% endif %}
       </p>

File transifex/templates/projects/release_detail.html

       <td>
         {% with release.resources.all|dictsort:"project.slug"|dictsort:"slug" as resource_list %}
         {% with resource_list|length as resources_number %}
-        <span id="resource-list-toggler" class="buttonized_simple" title="{% trans "Click here to show or hide the component list" %}">
+        <span id="resource-list-toggler" class="buttonized_simple" title="{% trans "Click here to show or hide the resource list" %}">
         {% blocktrans %}This release has {{ resources_number }} resourses.{% endblocktrans %}
         </span>
         <ul id="resource-list" class="simple links" style="display:none;">

File transifex/txcommon/decorators.py

     
       @one_perm_required_or_403(pr_set_stats, 
           (Project, 'slug__contains', 'project_slug'))
-      def component_set_stats(request, project_slug, component_slug):
+      def set_stats(request, project_slug, resource_slug):
           bla bla bla
         
     In the example above the decorator checks for the `maintain` permission
     for a Project object, taking the project_slug from the view 
-    `component_set_stats`. If the user IS NOT a maintainer of that project, the
+    `set_stats`. If the user IS NOT a maintainer of that project, the
     second and general permission is checked.
     
     If at least one of the permissions checks in the list returns True, the 

File transifex/txcommon/notifications.py

                 "default": 2,
                 "show_to_user": True,
             },
-            {
-                "label": "project_component_file_submitted",
-                "display": _("File Submitted"),
-                "description": _("when a component file of a project "
-                                 "is submitted"),
-                "default": 2,
-                "show_to_user": False,
-            },
 
             # Project releases
 

File transifex/txcommon/views.py

                 Q(homepage__icontains=term) |
                 Q(slug__icontains = term) |
                 Q(feed__icontains=term) |
-                Q(long_description__icontains=term) |
-                Q(component__long_description = term) |
-                Q(component__name = term) |
-                Q(component__slug = term) |
-                Q(component___unit__root__icontains = term) |
-                Q(component___unit__type__icontains = term)
+                Q(long_description__icontains=term)
                 )
         results = results.filter(query).distinct()
     else: