diff --git a/dashboard/memory_storage.py b/dashboard/memory_storage.py index f6669fb15..446ae441e 100644 --- a/dashboard/memory_storage.py +++ b/dashboard/memory_storage.py @@ -27,6 +27,7 @@ class CachedMemoryStorage(MemoryStorage): # common indexes self.records = {} + self.primary_key_index = {} self.record_types_index = {} self.module_index = {} self.user_id_index = {} @@ -34,6 +35,7 @@ class CachedMemoryStorage(MemoryStorage): self.release_index = {} self.indexes = { + 'primary_key': self.primary_key_index, 'record_type': self.record_types_index, 'company_name': self.company_index, 'module': self.module_index, @@ -109,6 +111,13 @@ class CachedMemoryStorage(MemoryStorage): for i in record_ids: yield self.records[i] + def get_record_by_primary_key(self, primary_key): + record_id = list(self.primary_key_index[primary_key]) + if record_id: + return self.records[record_id[0]] + else: + return None + def get_original_company_name(self, company_name): normalized = company_name.lower() if normalized not in self.company_name_mapping: diff --git a/dashboard/templates/overview.html b/dashboard/templates/overview.html index fb6685e29..71a4fdd52 100644 --- a/dashboard/templates/overview.html +++ b/dashboard/templates/overview.html @@ -29,7 +29,11 @@ url: make_uri("/data/activity.json"), dataType: "json", success: function (data) { - $("#activity_template").tmpl(data["activity"]).appendTo("#activity_container"); + {% if metric == 'marks' %} + $("#review_activity_template").tmpl(data["activity"]).appendTo("#activity_container"); + {% else %} + $("#commit_activity_template").tmpl(data["activity"]).appendTo("#activity_container"); + {% endif %} } }); }); @@ -61,7 +65,7 @@ {# Templates #} - + +