allura
修訂 | ffc2e4f149028ffa87a078d64b19e678209feb1b (tree) |
---|---|
時間 | 2012-04-03 21:04:22 |
作者 | bolkimen <bolkimen@yaho...> |
Commiter | bolkimen |
ticket:36 add more columns values
@@ -32,6 +32,9 @@ class ProjectSummary(ew_core.Widget): | ||
32 | 32 | if response['accolades'] is None: |
33 | 33 | response['accolades'] = value.accolades |
34 | 34 | |
35 | + if type(response['columns']) == unicode: | |
36 | + response['columns'] = int(response['columns']) | |
37 | + | |
35 | 38 | true_list = ['true', 't', '1', 'yes', 'y'] |
36 | 39 | if type(response['show_proj_icon']) == unicode: |
37 | 40 | if response['show_proj_icon'].lower() in true_list: |
@@ -76,7 +79,10 @@ class ProjectList(ew_core.Widget): | ||
76 | 79 | display_mode='list', |
77 | 80 | sitemaps=None, |
78 | 81 | icon_urls=None, |
79 | - accolades_index=None) | |
82 | + accolades_index=None, | |
83 | + columns=3, | |
84 | + show_proj_icon=True, | |
85 | + show_download_button=True) | |
80 | 86 | |
81 | 87 | def prepare_context(self, context): |
82 | 88 | response = super(ProjectList, self).prepare_context(context) |
@@ -90,6 +96,22 @@ class ProjectList(ew_core.Widget): | ||
90 | 96 | response['icon_urls'] = M.Project.icon_urls(projects) |
91 | 97 | if response['accolades_index'] is None: |
92 | 98 | response['accolades_index'] = M.Project.accolades_index(projects) |
99 | + | |
100 | + if type(response['columns']) == unicode: | |
101 | + response['columns'] = int(response['columns']) | |
102 | + | |
103 | + true_list = ['true', 't', '1', 'yes', 'y'] | |
104 | + if type(response['show_proj_icon']) == unicode: | |
105 | + if response['show_proj_icon'].lower() in true_list: | |
106 | + response['show_proj_icon'] = True | |
107 | + else: | |
108 | + response['show_proj_icon'] = False | |
109 | + if type(response['show_download_button']) == unicode: | |
110 | + if response['show_download_button'].lower() in true_list: | |
111 | + response['show_download_button'] = True | |
112 | + else: | |
113 | + response['show_download_button'] = False | |
114 | + | |
93 | 115 | return response |
94 | 116 | |
95 | 117 | def resources(self): |
@@ -1,5 +1,5 @@ | ||
1 | 1 | {% if display_mode == 'list' %} |
2 | -<div class="list card"{% if columns == '2' %} style="width: 330px"{% endif %}> | |
2 | +<div class="list card"{% if columns == 2 %} style="width: 330px"{% elif columns == 1 %} style="width: 660px"{% endif %}> | |
3 | 3 | {% if show_proj_icon == True %} |
4 | 4 | {% if accolades %} |
5 | 5 | <div class="box notch sponsor"> |