allura
修訂 | 6650c1def7fb7b4d731a0bee3da76db3907f076c (tree) |
---|---|
時間 | 2012-04-17 01:23:24 |
作者 | bolkimen <bolkimen@yaho...> |
Commiter | Dave Brondsema |
ticket:13 add column option and hide icon option
@@ -134,7 +134,8 @@ def project_blog_posts(max_number=5, sort='timestamp', summary=False, mount_poin | ||
134 | 134 | |
135 | 135 | @macro('neighborhood-wiki') |
136 | 136 | def projects(category=None, display_mode='grid', sort='last_updated', |
137 | - show_total=False, limit=100, labels='', award='', private=False): | |
137 | + show_total=False, limit=100, labels='', award='', private=False, | |
138 | + columns=3, skip_proj_icon='off'): | |
138 | 139 | from allura.lib.widgets.project_list import ProjectList |
139 | 140 | from allura.lib import utils |
140 | 141 | from allura import model as M |
@@ -208,7 +209,8 @@ def projects(category=None, display_mode='grid', sort='last_updated', | ||
208 | 209 | |
209 | 210 | pl = ProjectList() |
210 | 211 | g.resource_manager.register(pl) |
211 | - response = pl.display(projects=projects, display_mode=display_mode) | |
212 | + response = pl.display(projects=projects, display_mode=display_mode, | |
213 | + columns=columns, skip_proj_icon=skip_proj_icon) | |
212 | 214 | if show_total: |
213 | 215 | if total is None: |
214 | 216 | total = 0 |
@@ -2266,7 +2266,6 @@ div.attachment_thumb .file_type span { | ||
2266 | 2266 | box-shadow: rgba(0, 0, 0, 0.4) 0 1px 5px 0; |
2267 | 2267 | background-color: #f5f5f5; |
2268 | 2268 | border: 1px solid #cccccc; |
2269 | - width: 220px; | |
2270 | 2269 | display: inline; |
2271 | 2270 | float: left; |
2272 | 2271 | overflow: hidden; |
@@ -2283,6 +2282,9 @@ div.attachment_thumb .file_type span { | ||
2283 | 2282 | background-image: -moz-linear-gradient(100% 100% 90deg, #e5e5e5, white, white 25%); |
2284 | 2283 | margin: 0 0 10px 10px; |
2285 | 2284 | } |
2285 | +.twocol { width: 330px; } | |
2286 | +.threecol { width: 220px; } | |
2287 | + | |
2286 | 2288 | .card .box { |
2287 | 2289 | border: none; |
2288 | 2290 | -moz-border-radius: 8px; |
@@ -12,7 +12,9 @@ | ||
12 | 12 | icon_url=icon_urls[project._id], |
13 | 13 | accolades=accolades_index[project._id], |
14 | 14 | sitemap=sitemaps[project._id], |
15 | - display_mode=display_mode)}} | |
15 | + display_mode=display_mode, | |
16 | + columns=columns, | |
17 | + skip_proj_icon=skip_proj_icon)}} | |
16 | 18 | {% endif %} |
17 | 19 | {% endfor %} |
18 | 20 | {% do g.set_project(old_project) %} |
@@ -1,30 +1,34 @@ | ||
1 | 1 | {% if display_mode == 'list' %} |
2 | -<div class="list card"> | |
3 | - {% if accolades %} | |
2 | +<div class="list card {% if columns == '2' %}twocol{% else %}threecol{% endif %}"> | |
3 | + {% if skip_proj_icon == 'off' %} | |
4 | + {% if accolades %} | |
4 | 5 | <div class="box notch sponsor"> |
5 | 6 | <div class="feature">{{accolades[0].award.short}}</div> |
6 | 7 | <img src="{{icon_url}}" alt="{{value.name}} Logo"/> |
7 | 8 | </div> |
8 | - {% else %} | |
9 | + {% else %} | |
9 | 10 | <div class="box"> |
10 | 11 | <img src="{{icon_url}}" alt="{{value.name}} Logo"/> |
11 | 12 | </div> |
13 | + {% endif %} | |
12 | 14 | {% endif %} |
13 | - <h2><a href="{{value.url()}}">{{value.name}}</a></h2> | |
15 | + <h2><a href="{{value.url()}}">{{value.name}}{{ skip_proj_icon }}</a></h2> | |
14 | 16 | <p class="desc">{% if value.summary %}{{value.summary}}{% else %}{{h.text.truncate(value.short_description, 50)}}{% endif %}</p> |
15 | 17 | {{g.markdown_wiki.convert('[[download_button]]')}} |
16 | 18 | </div> |
17 | 19 | {% else %} |
18 | 20 | <div class="border card"> |
19 | - {% if accolades %} | |
21 | + {% if skip_proj_icon == 'off' %} | |
22 | + {% if accolades %} | |
20 | 23 | <div class="box notch sponsor"> |
21 | 24 | <div class="feature">{{accolades[0].award.short}}</div> |
22 | 25 | <img src="{{icon_url}}" alt="{{value.name}} Logo"/> |
23 | 26 | </div> |
24 | - {% else %} | |
27 | + {% else %} | |
25 | 28 | <div class="box"> |
26 | 29 | <img src="{{icon_url}}" alt="{{value.name}} Logo"/> |
27 | 30 | </div> |
31 | + {% endif %} | |
28 | 32 | {% endif %} |
29 | 33 | <h2><a href="{{value.url()}}">{{value.name}}</a></h2> |
30 | 34 | <p class="desc">{% if value.summary %}{{value.summary}}{% else %}{{h.text.truncate(value.short_description, 50)}}{% endif %}</p> |
@@ -34,4 +38,4 @@ | ||
34 | 38 | {% endfor %} |
35 | 39 | </div> |
36 | 40 | </div> |
37 | -{% endif %} | |
\ No newline at end of file | ||
41 | +{% endif %} |