|
a/Allura/allura/controllers/project.py |
|
b/Allura/allura/controllers/project.py |
|
... |
|
... |
6 |
import pkg_resources
|
6 |
import pkg_resources
|
7 |
import Image
|
7 |
import Image
|
8 |
from tg import expose, flash, redirect, validate, request, response
|
8 |
from tg import expose, flash, redirect, validate, request, response
|
9 |
from tg.decorators import with_trailing_slash, without_trailing_slash
|
9 |
from tg.decorators import with_trailing_slash, without_trailing_slash
|
10 |
from pylons import c, g
|
10 |
from pylons import c, g
|
|
|
11 |
from paste.httpheaders import CACHE_CONTROL
|
11 |
from webob import exc
|
12 |
from webob import exc
|
12 |
from pymongo.bson import ObjectId
|
13 |
from pymongo.bson import ObjectId
|
13 |
import pymongo
|
14 |
import pymongo
|
14 |
from formencode import validators
|
15 |
from formencode import validators
|
15 |
|
16 |
|
|
... |
|
... |
18 |
import allura
|
19 |
import allura
|
19 |
from allura import model as M
|
20 |
from allura import model as M
|
20 |
from allura.app import SitemapEntry
|
21 |
from allura.app import SitemapEntry
|
21 |
from allura.lib.base import BaseController
|
22 |
from allura.lib.base import BaseController
|
22 |
from allura.lib import helpers as h
|
23 |
from allura.lib import helpers as h
|
|
|
24 |
from allura.lib import utils
|
23 |
from allura.controllers.error import ErrorController
|
25 |
from allura.controllers.error import ErrorController
|
24 |
from allura.lib.security import require, has_project_access, has_neighborhood_access, has_artifact_access
|
26 |
from allura.lib.security import require, has_project_access, has_neighborhood_access, has_artifact_access
|
25 |
from allura.lib.widgets import form_fields as ffw
|
27 |
from allura.lib.widgets import form_fields as ffw
|
26 |
from allura.lib.widgets import forms as forms
|
28 |
from allura.lib.widgets import forms as forms
|
27 |
from allura.lib.widgets import project_list as plw
|
29 |
from allura.lib.widgets import project_list as plw
|
|
... |
|
... |
178 |
return fp.read()
|
180 |
return fp.read()
|
179 |
return icon.filename
|
181 |
return icon.filename
|
180 |
|
182 |
|
181 |
@expose('jinja:jinja_master/site_style.css', content_type='text/css')
|
183 |
@expose('jinja:jinja_master/site_style.css', content_type='text/css')
|
182 |
@without_trailing_slash
|
184 |
@without_trailing_slash
|
183 |
def site_style(self):
|
185 |
def site_style(self, **kw):
|
184 |
"""Display the css for the default theme."""
|
186 |
"""Display the css for the default theme."""
|
185 |
theme = M.Theme.query.find(dict(neighborhood_id=self.neighborhood._id)).first()
|
187 |
theme = M.Theme.query.find(dict(neighborhood_id=self.neighborhood._id)).first()
|
186 |
if theme == None:
|
188 |
if theme == None:
|
187 |
theme = M.Theme.query.find(dict(name='forge_default')).first()
|
189 |
theme = M.Theme.query.find(dict(name='forge_default')).first()
|
188 |
|
190 |
|
189 |
response.headers['Content-Type'] = ''
|
191 |
response.headers['Content-Type'] = ''
|
190 |
response.content_type = 'text/css'
|
192 |
response.content_type = 'text/css'
|
|
|
193 |
utils.cache_forever()
|
191 |
|
194 |
|
192 |
return dict(
|
195 |
return dict(
|
193 |
color1=theme.color1,
|
196 |
color1=theme.color1,
|
194 |
color2=theme.color2,
|
197 |
color2=theme.color2,
|
195 |
color3=theme.color3,
|
198 |
color3=theme.color3,
|