• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


Commit MetaInfo

Révisionf3e3ff65de5fc6b1c56035b4ce4abedb5d981267 (tree)
l'heure2011-06-22 23:44:48
AuteurRick Copeland <rcopeland@geek...>
CommiterRick Copeland

Message de Log

[#2078] Some fixes to deal with Zarkov crazy classes being included in the data model

Signed-off-by: Rick Copeland <rcopeland@geek.net>

Change Summary

Modification

--- a/Allura/allura/command/show_models.py
+++ b/Allura/allura/command/show_models.py
@@ -3,7 +3,7 @@ from collections import defaultdict
33
44 from pylons import c, g
55
6-from ming.orm import mapper, Mapper
6+from ming.orm import mapper, session, Mapper
77 from ming.orm.declarative import MappedClass
88
99 import allura.tasks.index_tasks
@@ -121,7 +121,7 @@ class EnsureIndexCommand(base.Command):
121121 base.log.info('... skipping abstract class %s', cls)
122122 continue
123123 base.log.info('... for class %s', cls)
124- if cls.__mongometa__.session in (
124+ if session(cls) in (
125125 M.main_orm_session, M.repository_orm_session):
126126 idx = main_indexes[cname]
127127 else:
--- /dev/null
+++ b/Allura/allura/templates/site_admin.html
@@ -0,0 +1,29 @@
1+{% set hide_left_bar=False %}
2+{% extends g.theme.master %}
3+
4+{% block title %}Forge Site Admin{% endblock %}
5+{% block header %}Forge Site Admin{% endblock %}
6+
7+{% block nav_menu %}
8+<div class="column grid_1">
9+ <img src="{{g.forge_static('images/project_default.png')}}" class="project_icon" alt=""/>
10+</div>
11+<div class="column grid_9">
12+ <h1 class="project_title">Site Admin</h1>
13+</div>
14+<div class="column grid_2">&nbsp;</div>
15+{% endblock %}
16+
17+{% block sidebar_menu %}
18+<div id="sidebar">
19+ <div>&nbsp;</div>
20+ <ul>
21+ <li class="{{page=='index' and 'active' or ''}}"><a href="."><b data-icon="{{g.icons['admin'].char}}" class="ico {{g.icons['admin'].css}}"></b>Home</a></li>
22+ <li class="{{page=='stats' and 'active' or ''}}"><a href="stats"><b data-icon="{{g.icons['stats'].char}}" class="ico {{g.icons['stats'].css}}"></b>Stats</a></li>
23+ <li class="{{page=='cpa_stats' and 'active' or ''}}"><a href="cpa_stats"><b data-icon="{{g.icons['stats'].char}}" class="ico {{g.icons['stats'].css}}"></b>CPA Stats</a></li>
24+ <li class="{{page=='api_tickets' and 'active' or ''}}"><a href="api_tickets"><b data-icon="{{g.icons['admin'].char}}" class="ico {{g.icons['admin'].css}}"></b>API Tickets</a></li>
25+ </ul>
26+</div>
27+{% endblock %}
28+
29+{% block inner_grid %}{% endblock %}
--- a/Allura/allura/tests/functional/test_site_admin.py
+++ b/Allura/allura/tests/functional/test_site_admin.py
@@ -37,20 +37,6 @@ class TestSiteAdmin(TestController):
3737 assert headers[4].contents[0] == 'Template'
3838 assert headers[5].contents[0] == 'Total Time'
3939
40- def test_cpa(self):
41- r = self.app.get('/nf/admin/cpa_stats', extra_environ=dict(
42- username='test-user'), status=403)
43- r = self.app.get('/nf/admin/cpa_stats', extra_environ=dict(
44- username='root'))
45- assert 'Forge Site Admin' in r.html.find('h2',{'class':'dark title'}).contents[0]
46- stats_table = r.html.find('table')
47- headers = stats_table.findAll('th')
48- assert headers[0].contents[0] == 'Tool Name'
49- assert headers[1].contents[0] == 'Class Name'
50- assert headers[2].contents[0] == 'Create'
51- assert headers[3].contents[0] == 'Modify'
52- assert headers[4].contents[0] == 'Delete'
53-
5440 def test_tickets_access(self):
5541 r = self.app.get('/nf/admin/api_tickets', extra_environ=dict(
5642 username='test-user'), status=403)
--- a/scripts/restore_project.py
+++ b/scripts/restore_project.py
@@ -64,7 +64,7 @@ def get_repo_collections():
6464 res = {}
6565 for m in Mapper.all_mappers():
6666 cls = m.mapped_class
67- cname = cls.__mongometa__.name
67+ cname = m.collection.m.collection_name
6868 if issubclass(cls, M.Repository): res[cname] = cls
6969 return res
7070