allura
Revisão | 2e4e6411f3a9e97dda6006e4f84a1ede24eac8d5 (tree) |
---|---|
Hora | 2012-06-27 01:46:44 |
Autor | Jenny Steele <jsteele@geek...> |
Commiter | Dave Brondsema |
[#4180] Added ability for a neighborhood to make a custom link for their nav and added text to make the neighborhood home link more obvious
@@ -475,6 +475,7 @@ class NeighborhoodAdminController(object): | ||
475 | 475 | self.neighborhood.project_template = project_template |
476 | 476 | self.neighborhood.allow_browse = kw.get('allow_browse', False) |
477 | 477 | self.neighborhood.show_title = kw.get('show_title', False) |
478 | + self.neighborhood.project_list_url = kw.get('project_list_url', '') | |
478 | 479 | tracking_id = kw.get('tracking_id', '') |
479 | 480 | if tracking_id != self.neighborhood.tracking_id: |
480 | 481 | c.project = self.neighborhood.neighborhood_project |
@@ -140,6 +140,7 @@ class NeighborhoodOverviewForm(ForgeForm): | ||
140 | 140 | validator=V.JsonValidator(if_empty='')) |
141 | 141 | icon = ew.FileField() |
142 | 142 | tracking_id = ew.TextField() |
143 | + project_list_url = ew.TextField(validator=fev.URL()) | |
143 | 144 | |
144 | 145 | def from_python(self, value, state): |
145 | 146 | if value.features['css'] == "picker": |
@@ -55,6 +55,7 @@ class Neighborhood(MappedClass): | ||
55 | 55 | site_specific_html = FieldProperty(str, if_missing='') |
56 | 56 | project_template = FieldProperty(str, if_missing='') |
57 | 57 | tracking_id = FieldProperty(str, if_missing='') |
58 | + project_list_url = FieldProperty(str, if_missing='') | |
58 | 59 | level = FieldProperty(S.Deprecated) |
59 | 60 | allow_private = FieldProperty(S.Deprecated) |
60 | 61 | features = FieldProperty(dict( |
@@ -59,7 +59,7 @@ | ||
59 | 59 | {{theme_macros.header(c.user.username, c.user._id, c.user.display_name, g.login_url, '/auth/logout')}} |
60 | 60 | {% set flash = tg.flash_obj.render('flash', use_js=False) %} |
61 | 61 | <section id="page-body" class="{{g.document_class(neighborhood)}}"> |
62 | - <div class="grid-24"> | |
62 | + <div class="grid-24" id="nav_menu_holder"> | |
63 | 63 | {% block nav_menu %} |
64 | 64 | {% include g.theme.nav_menu %} |
65 | 65 | {% endblock %} |
@@ -5,7 +5,17 @@ | ||
5 | 5 | {% else %} |
6 | 6 | {% if c.project.neighborhood.icon %} |
7 | 7 | <a href="{{c.project.neighborhood.url()}}"><img src="{{c.project.neighborhood.url()}}/icon" class="neighborhood_icon" |
8 | - alt="Return to {{c.project.neighborhood.name}} Neighborhood" title="Return to {{c.project.neighborhood.name}} Neighborhood"></a> | |
8 | + alt="Return to {{c.project.neighborhood.name}}" title="Return to {{c.project.neighborhood.name}}"></a> | |
9 | + <div class="neighborhood_title"> | |
10 | + <h1><a href="{{c.project.neighborhood.url()}}">{{c.project.neighborhood.name}}</a></h1> | |
11 | + {% if c.project.neighborhood.project_list_url %} | |
12 | + <div class="neighborhood_title_link"> | |
13 | + <a href="{{c.project.neighborhood.project_list_url}}"> | |
14 | + View More Projects | |
15 | + </a> | |
16 | + </div> | |
17 | + {% endif %} | |
18 | + </div> | |
9 | 19 | {% endif %} |
10 | 20 | <a href="{{c.project.url()}}"> |
11 | 21 | {% if c.project.user_project_of %} |
@@ -1,11 +1,15 @@ | ||
1 | 1 | {% if not neighborhood or not neighborhood.show_title %} |
2 | 2 | <div id="nav_menu_missing"></div> |
3 | 3 | {% else %} |
4 | - | |
5 | - <a href="{{neighborhood.url()}}"> | |
6 | 4 | {% if neighborhood.icon %} |
7 | - <img src="{{neighborhood.url()}}/icon" class="project_icon" alt="{{neighborhood.name}} Logo"/> | |
5 | + <a href="{{neighborhood.url()}}"><img src="{{neighborhood.url()}}/icon" class="project_icon" alt="{{neighborhood.name}} Logo"/></a> | |
8 | 6 | {% endif %} |
9 | - <h1 class="project_title">{{neighborhood.name}}</h1> | |
10 | - </a> | |
7 | + <h1 class="project_title"><a href="{{neighborhood.url()}}">{{neighborhood.name}}</a></h1> | |
8 | + {% if neighborhood.project_list_url %} | |
9 | + <div class="project_title_link"> | |
10 | + <a href="{{neighborhood.project_list_url}}"> | |
11 | + View Projects | |
12 | + </a> | |
13 | + </div> | |
14 | + {% endif %} | |
11 | 15 | {% endif %} |
@@ -28,6 +28,8 @@ | ||
28 | 28 | <label class="grid-4">Analytics Tracking ID</label> |
29 | 29 | <div class="grid-14">{{widget.display_field(widget.fields.tracking_id)}}</div> |
30 | 30 | {% endif %} |
31 | + <label class="grid-4">Project List URL</label> | |
32 | + <div class="grid-14">{{widget.display_field(widget.fields.project_list_url)}}</div> | |
31 | 33 | <label class="grid-4"> </label> |
32 | 34 | <div class="grid-14"><input type="submit" value="Save"/></div> |
33 | 35 | </form> |