allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [04/40] allura git commit: [#8004] remove tool icons from [[projects]] macro, and display_mode=grid too since it is even less good now
Date Tue, 27 Oct 2015 17:07:21 GMT
[#8004] remove tool icons from [[projects]] macro, and display_mode=grid too since it is even
less good now


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/7147ad9e
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/7147ad9e
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/7147ad9e

Branch: refs/heads/ib/7924
Commit: 7147ad9e23326f9771f28378755119b36a8c4246
Parents: d7ee057
Author: Dave Brondsema <dave@brondsema.net>
Authored: Thu Oct 22 12:21:23 2015 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Thu Oct 22 12:21:23 2015 -0400

----------------------------------------------------------------------
 Allura/allura/lib/macro.py                      | 25 ++++++------
 Allura/allura/lib/widgets/project_list.py       | 20 +---------
 Allura/allura/nf/allura/css/site_style.css      | 40 --------------------
 Allura/allura/templates/neighborhood_help.html  |  6 +--
 .../templates/widgets/project_list_widget.html  |  4 +-
 .../templates/widgets/project_summary.html      | 24 ------------
 Allura/allura/tests/functional/test_root.py     |  7 ++--
 Allura/allura/tests/test_globals.py             | 12 ------
 8 files changed, 21 insertions(+), 117 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/7147ad9e/Allura/allura/lib/macro.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/macro.py b/Allura/allura/lib/macro.py
index fd0ef58..5aca72d 100644
--- a/Allura/allura/lib/macro.py
+++ b/Allura/allura/lib/macro.py
@@ -164,10 +164,9 @@ def project_blog_posts(max_number=5, sort='timestamp', summary=False,
mount_poin
 
 
 def get_projects_for_macro(
-        category=None, display_mode='grid', sort='last_updated',
+        category=None, sort='last_updated',
         show_total=False, limit=100, labels='', award='', private=False,
         columns=1, show_proj_icon=True, show_download_button=False, show_awards_banner=True,
-        grid_view_tools='',
         initial_q={}):
     from allura.lib.widgets.project_list import ProjectList
     from allura.lib import utils
@@ -250,11 +249,11 @@ def get_projects_for_macro(
 
     pl = ProjectList()
     g.resource_manager.register(pl)
-    response = pl.display(projects=projects, display_mode=display_mode,
+    response = pl.display(projects=projects,
                           columns=columns, show_proj_icon=show_proj_icon,
                           show_download_button=show_download_button,
                           show_awards_banner=show_awards_banner,
-                          grid_view_tools=grid_view_tools)
+                          )
     if show_total:
         if total is None:
             total = 0
@@ -267,24 +266,26 @@ def get_projects_for_macro(
 
 
 @macro('neighborhood-wiki')
-def projects(category=None, display_mode='grid', sort='last_updated',
+def projects(category=None, sort='last_updated',
              show_total=False, limit=100, labels='', award='', private=False,
              columns=1, show_proj_icon=True, show_download_button=False, show_awards_banner=True,
-             grid_view_tools=''):
+             display_mode=None, grid_view_tools='',  # old & unused now
+             ):
     initial_q = dict(neighborhood_id=c.project.neighborhood_id)
     return get_projects_for_macro(
-        category=category, display_mode=display_mode, sort=sort,
+        category=category, sort=sort,
         show_total=show_total, limit=limit, labels=labels, award=award, private=private,
         columns=columns, show_proj_icon=show_proj_icon, show_download_button=show_download_button,
-        show_awards_banner=show_awards_banner, grid_view_tools=grid_view_tools,
+        show_awards_banner=show_awards_banner,
         initial_q=initial_q)
 
 
 @macro('userproject-wiki')
-def my_projects(category=None, display_mode='grid', sort='last_updated',
+def my_projects(category=None, sort='last_updated',
                 show_total=False, limit=100, labels='', award='', private=False,
                 columns=1, show_proj_icon=True, show_download_button=False, show_awards_banner=True,
-                grid_view_tools=''):
+                display_mode=None, grid_view_tools='',  # old & unused now
+                ):
 
     myproj_user = c.project.user_project_of
     if myproj_user is None:
@@ -296,10 +297,10 @@ def my_projects(category=None, display_mode='grid', sort='last_updated',
 
     initial_q = dict(_id={'$in': ids})
     return get_projects_for_macro(
-        category=category, display_mode=display_mode, sort=sort,
+        category=category, sort=sort,
         show_total=show_total, limit=limit, labels=labels, award=award, private=private,
         columns=columns, show_proj_icon=show_proj_icon, show_download_button=show_download_button,
-        show_awards_banner=show_awards_banner, grid_view_tools=grid_view_tools,
+        show_awards_banner=show_awards_banner,
         initial_q=initial_q)
 
 

http://git-wip-us.apache.org/repos/asf/allura/blob/7147ad9e/Allura/allura/lib/widgets/project_list.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/project_list.py b/Allura/allura/lib/widgets/project_list.py
index b5aa619..a4e3311 100644
--- a/Allura/allura/lib/widgets/project_list.py
+++ b/Allura/allura/lib/widgets/project_list.py
@@ -29,7 +29,6 @@ class ProjectSummary(ew_core.Widget):
     template = 'jinja:allura:templates/widgets/project_summary.html'
     defaults = dict(
         ew_core.Widget.defaults,
-        sitemap=None,
         icon=None,
         value=None,
         icon_url=None,
@@ -38,22 +37,11 @@ class ProjectSummary(ew_core.Widget):
         show_proj_icon=True,
         show_download_button=True,
         show_awards_banner=True,
-        grid_view_tools='')
+        )
 
     def prepare_context(self, context):
         response = super(ProjectSummary, self).prepare_context(context)
         value = response['value']
-        if response['sitemap'] is None:
-            response['sitemap'] = [s for s in value.sitemap() if s.url]
-
-        if response['grid_view_tools'] != '':
-            view_tools_list = response['grid_view_tools'].split(',')
-            icon_tool_list = ["tool-%s" % vt.lower() for vt in view_tools_list]
-            old_sitemap = response['sitemap']
-            response['sitemap'] = []
-            for sm in old_sitemap:
-                if sm.ui_icon is not None and sm.ui_icon.lower() in icon_tool_list:
-                    response['sitemap'].append(sm)
 
         if response['icon_url'] is None:
             if value.icon:
@@ -90,15 +78,13 @@ class ProjectList(ew_core.Widget):
         ew_core.Widget.defaults,
         projects=[],
         project_summary=ProjectSummary(),
-        display_mode='list',
-        sitemaps=None,
         icon_urls=None,
         accolades_index=None,
         columns=1,
         show_proj_icon=True,
         show_download_button=True,
         show_awards_banner=True,
-        grid_view_tools='')
+        )
 
     def prepare_context(self, context):
         response = super(ProjectList, self).prepare_context(context)
@@ -110,8 +96,6 @@ class ProjectList(ew_core.Widget):
         for opt in ['show_proj_icon', 'show_download_button', 'show_awards_banner']:
             response[opt] = asbool(response[opt])
 
-        if response['sitemaps'] is None and response['display_mode'] != 'list':
-            response['sitemaps'] = M.Project.menus(projects)
         if response['icon_urls'] is None and response['show_proj_icon']:
             response['icon_urls'] = M.Project.icon_urls(projects)
         if response['accolades_index'] is None and response['show_awards_banner']:

http://git-wip-us.apache.org/repos/asf/allura/blob/7147ad9e/Allura/allura/nf/allura/css/site_style.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/site_style.css b/Allura/allura/nf/allura/css/site_style.css
index 7bda3ee..d702ca9 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -2286,17 +2286,6 @@ div.attachment_thumb .file_type span {
   margin-top: 10px;
 }
 
-.border {
-  -moz-border-radius: 5px;
-  -webkit-border-radius: 5px;
-  -o-border-radius: 5px;
-  -ms-border-radius: 5px;
-  -khtml-border-radius: 5px;
-  border-radius: 5px;
-  padding: 5px 10px;
-  border-bottom: 1px solid #fff;
-}
-
 .card {
   position: relative;
   -moz-border-radius: 4px;
@@ -2351,23 +2340,6 @@ div.attachment_thumb .file_type span {
 .card .desc {
   margin: 5px 0 0;
 }
-.card .quik {
-  position: absolute;
-  bottom: 10px;
-  left: 10px;
-}
-.card .quik a {
-  margin: 0;
-  color: #000;
-  text-shadow: #fff 0 1px;
-  border: none;
-  width: 24px;
-  height: 24px;
-  display: inline-block;
-}
-.card .quik a span {
-  display: none;
-}
 .card .feature {
   position: absolute;
   top: -1px;
@@ -2393,18 +2365,6 @@ div.attachment_thumb .file_type span {
   background-image: -webkit-gradient(linear, 50% 100%, 100% 0%, color-stop(0.9, white), color-stop(0.9,
#555555));
   background-image: -moz-linear-gradient(100% 25% 230deg, #555555, white, white 1%);
 }
-.card hr {
-  visibility: hidden;
-}
-.card.sm {
-  height: 46px;
-  width: 34px;
-}
-.card.sm .box {
-  height: 48px;
-  margin: 0 0 0 -7px;
-  padding: 0;
-}
 .list.card {
   width: 740px;
   display: inline;

http://git-wip-us.apache.org/repos/asf/allura/blob/7147ad9e/Allura/allura/templates/neighborhood_help.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/neighborhood_help.html b/Allura/allura/templates/neighborhood_help.html
index 5c5d27a..18f2568 100644
--- a/Allura/allura/templates/neighborhood_help.html
+++ b/Allura/allura/templates/neighborhood_help.html
@@ -38,18 +38,16 @@
   to list all the projects in your neighborhood.
   </p>
   <p>
-  Example: <code>[[projects display_mode=list columns=2 show_download_button=no limit=50]]</code>
+  Example: <code>[[projects columns=2 show_download_button=no limit=50]]</code>
   </p>
   <p>Display options:</p>
   <ul>
-    <li><code>display_mode</code> = grid/list.  Default is 'grid'</li>
     <li><code>show_proj_icon</code> = yes/no.  Default 'yes'</li>
-    <li><code>grid_view_tools</code> = git,hg,svn,tickets,wiki... Limit
the tools shown in project list. Multivalue option (example grid_view_tools=git,wiki).  Default
''</li>
     <li><code>show_download_button</code> = yes/no.  Default 'no'</li>
 	<li><code>show_awards_banner</code> = yes/no.  Default 'yes'</li>
     <li><code>sort</code> = last_updated/alpha/random/last_registered.
 Default 'last_updated'</li>
     <li><code>show_total</code> = yes/no.  Adds a sentence with a total
count of how many projects are listed. Default 'no'</li>
-    <li><code>columns</code> = 1, 2, or 3.  Works with 'list' display_mode.
 Default 1</li>
+    <li><code>columns</code> = 1, 2, or 3.  Default 1</li>
   </ul>
   <p>Filter options:</p>
   <ul>

http://git-wip-us.apache.org/repos/asf/allura/blob/7147ad9e/Allura/allura/templates/widgets/project_list_widget.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/project_list_widget.html b/Allura/allura/templates/widgets/project_list_widget.html
index 13fccca..3f3ae4e 100644
--- a/Allura/allura/templates/widgets/project_list_widget.html
+++ b/Allura/allura/templates/widgets/project_list_widget.html
@@ -29,13 +29,11 @@
             value=project, 
             icon_url=icon_urls[project._id], 
             accolades=accolades_index[project._id],
-            sitemap=sitemaps[project._id],
-            display_mode=display_mode,
             columns=columns,
             show_proj_icon=show_proj_icon,
             show_download_button=show_download_button,
             show_awards_banner=show_awards_banner,
-            grid_view_tools=grid_view_tools)}}
+            )}}
       {% endif %}
     {% endfor %}
     {% do g.set_project(old_project) %}

http://git-wip-us.apache.org/repos/asf/allura/blob/7147ad9e/Allura/allura/templates/widgets/project_summary.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/project_summary.html b/Allura/allura/templates/widgets/project_summary.html
index 72c96a6..bc69f2f 100644
--- a/Allura/allura/templates/widgets/project_summary.html
+++ b/Allura/allura/templates/widgets/project_summary.html
@@ -16,7 +16,6 @@
        specific language governing permissions and limitations
        under the License.
 -#}
-{% if display_mode == 'list' %}
 <div class="list card{% if show_proj_icon%} proj_icon{% endif %}"
 	{%- if columns == 2 %} style="width: 330px"{% elif columns == 3 %} style="width: 220px"{%
endif %}>
   {% if accolades %}
@@ -35,26 +34,3 @@
   <p class="desc">{% if value.summary %}{{value.summary}}{% else %}{{h.text.truncate(value.short_description,
50)}}{% endif %}</p>
   {% if show_download_button %}{{g.markdown_wiki.convert('[[download_button]]')}}{% endif
%}
 </div>
-{% else %}
-  <div class="border card">
-    {% if accolades %}
-      <div class="box notch sponsor">
-        <div class="feature">
-          <a href="{{accolades[0].award_url}}" title="{{accolades[0].comment}}">{{accolades[0].award.short}}</a>
-        </div>
-        {% if icon_url %}<img src="{{icon_url}}" alt="{{value.name}} Logo"/>{% endif
%}
-      </div>
-    {% elif icon_url %}
-      <div class="box">
-        <img src="{{icon_url}}" alt="{{value.name}} Logo"/>
-      </div>
-    {% endif %}
-    <h2><a href="{{value.url()}}">{{value.name}}</a></h2>
-    <p class="desc">{% if value.summary %}{{value.summary}}{% else %}{{h.text.truncate(value.short_description,
50)}}{% endif %}</p>
-    <div class="quik">
-      {% for s in sitemap %}
-      <a href="{{s.url}}" class="ui-icon-{{(s.ui_icon or 'admin').lower()}}-24" title="{{s.label}}"><span>{{s.label}}</span></a>
-      {% endfor %}
-    </div>
-  </div>
-{% endif %}

http://git-wip-us.apache.org/repos/asf/allura/blob/7147ad9e/Allura/allura/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_root.py b/Allura/allura/tests/functional/test_root.py
index bc54d65..5aae3e5 100644
--- a/Allura/allura/tests/functional/test_root.py
+++ b/Allura/allura/tests/functional/test_root.py
@@ -112,10 +112,9 @@ class TestRootController(TestController):
             p.install_app('home', 'home', 'Home', ordinal=0)
 
         response = self.app.get('/adobe/')
-        projects = response.html.findAll('div', {'class': 'border card'})
-        assert len(projects) == 2
-        cat_links = response.html.find(
-            'div', {'id': 'sidebar'}).findAll('ul')[1].findAll('li')
+        projects = response.html.findAll('div', {'class': 'list card proj_icon'})
+        assert_equal(len(projects), 2)
+        cat_links = response.html.find('div', {'id': 'sidebar'}).findAll('ul')[1].findAll('li')
         assert len(cat_links) == 3, cat_links
         assert cat_links[0].find('a').get('href') == '/adobe/browse/clustering'
         assert cat_links[0].find('a').find('span').string == 'Clustering'

http://git-wip-us.apache.org/repos/asf/allura/blob/7147ad9e/Allura/allura/tests/test_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_globals.py b/Allura/allura/tests/test_globals.py
index bb5d80e..139250e 100644
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -585,18 +585,6 @@ def test_projects_macro():
         assert two_column_style not in r
 
 
-@td.with_wiki
-def test_limit_tools_macro():
-    p_nbhd = M.Neighborhood.query.get(name='Adobe')
-    with h.push_context(p_nbhd.neighborhood_project._id, 'wiki'):
-        r = g.markdown_wiki.convert('[[projects]]')
-        assert '<span>Admin</span>' in r
-        r = g.markdown_wiki.convert('[[projects grid_view_tools=wiki]]')
-        assert '<span>Admin</span>' not in r
-        r = g.markdown_wiki.convert('[[projects grid_view_tools=wiki,admin]]')
-        assert '<span>Admin</span>' in r
-
-
 @td.with_user_project('test-admin')
 @td.with_user_project('test-user-1')
 def test_myprojects_macro():


Mime
View raw message