The gray project icon placeholder doesn't look very good. So if there is no project icon, don't show the placeholder in the project header. Just the project name.
--- old +++ new @@ -1,3 +1,3 @@The gray project icon placeholder doesn't look awesome when used everywhere, so only show it to project admins (to encourage them to upload an icon). This will be consistent with sfpy also.
-Make sure this affects neighborhoods too, so there is no placeholder at https://sourceforge.net/p/+Make sure this affects neighborhoods too, so there is no placeholder at https://sourceforge.net/p/ And the project-card display on pages using the `[[projects ...]]` macro.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
--- old +++ new @@ -1,3 +1,1 @@The gray project icon placeholder doesn't look awesome when used everywhere, so only show it to project admins (to encourage them to upload an icon). This will be consistent with sfpy also.
--Make sure this affects neighborhoods too, so there is no placeholder at https://sourceforge.net/p/ And the project-card display on pages using the `[[projects ...]]` macro.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
summary: Only show project icon placeholder to admins --> Don't show project icon placeholder
Description has changed:
Diff:
--- old +++ new @@ -1,1 +1,1 @@-The gray project icon placeholder doesn't look awesome when used everywhere, so only show it to project admins (to encourage them to upload an icon). This will be consistent with sfpy also.+The gray project icon placeholder doesn't look very good. So if there is no project icon, don't show the placeholder in the project header. Just the project name.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Created ticket #50: [1532] Don't show project icon placeholder (1cp)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-05-17
Originally by: stilgar-dev
Hi!
I've made necessary changes to all the places where this image have been used as project icon placeholder (but not where it's used as temporary non-configurable label for another purposes).
That changes broke 7 tests, that expecting each project to have an icon. I'm trying to set icon where it's required, but having problem with that.
Essential: Allura/allura/tests/functional/test_root:TestRootController.test_index fails, as there is no tag outputted in template Allura/allura/templates/widgets/project_summary.html, that is used by widget Allura/allura/lib/widgets/project_list.py:ProjectSummary, because there is no icon of the project.
Excuse me, there will be a large amount of text to give all necessary information.
That is expected to happen, as in appropriate template I've made tag to not be outputted when there is no icon.
I'm trying to fix those tests by setting project icons where necessary, but having problem setting icon. To achieve that, at the end of TestRootController.setUp() in Allura/allura/tests/functional/test_root.py I've added
Take a notice that _id of created ProjectFile doesn't match _id of icon. That looks like icon is being set in setUp() and can't be changed. Problem is that ProjectSummary widget, that generates page requested in test doesn't see an icon in that project.
Pdb session started in setUp() after assigning icon:
So I don't understand how setting project icon works and, maybe, why widget ProjectFile doesn't see an icon in project. Can you please give me a hint on what I'm doing wrong or point me to some documentation?
Thank you those who at least achieved reading to this point. :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It also seems strange that after calling M.ProjectFile.remove there still was a value for p_adobe1.icon. Perhaps what is needed is to flush the ming ORM session after saving and deleting. ThreadLocalORMSession.flush_all() is a common way to do it, but if you grep for flush you can see other examples (e.g. if you already have a session reference).
It's not really necessary for test_index to assert that an icon is there, so if this continues to be difficult to change, you could just remove that assertion. But I do think it would be valuable to have an icon set up for the test, so hopefully that will work.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Nice work. It'd be slightly better to use context managers (with statement) for opening files and for saving & restoring the Allura context (e.g. with h.push_context(...):), but its not necessary to change that for this code since it's already done and working.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Diff:
Diff:
Diff:
Created ticket #50: [1532] Don't show project icon placeholder (1cp)
Originally by: stilgar-dev
Hi!
I've made necessary changes to all the places where this image have been used as project icon placeholder (but not where it's used as temporary non-configurable label for another purposes).
That changes broke 7 tests, that expecting each project to have an icon. I'm trying to set icon where it's required, but having problem with that.
Essential: Allura/allura/tests/functional/test_root:TestRootController.test_index fails, as there is no tag outputted in template Allura/allura/templates/widgets/project_summary.html, that is used by widget Allura/allura/lib/widgets/project_list.py:ProjectSummary, because there is no icon of the project.
Excuse me, there will be a large amount of text to give all necessary information.
Error message of the first failing test:
That is expected to happen, as in appropriate template I've made tag to not be outputted when there is no icon.
I'm trying to fix those tests by setting project icons where necessary, but having problem setting icon. To achieve that, at the end of TestRootController.setUp() in Allura/allura/tests/functional/test_root.py I've added
I've used code in ProjectAdminController.update() in Allura/allura/ext/admin/admin_main.py as reference.
But test Allura/allura/tests/functional/test_root.py:TestRootController.test_index is still failing in the same way.
Here's some information from pdb session started in test method (after I've added code to setUp()):
Take a notice that _id of created ProjectFile doesn't match _id of icon. That looks like icon is being set in setUp() and can't be changed. Problem is that ProjectSummary widget, that generates page requested in test doesn't see an icon in that project.
Pdb session started in setUp() after assigning icon:
So I don't understand how setting project icon works and, maybe, why widget ProjectFile doesn't see an icon in project. Can you please give me a hint on what I'm doing wrong or point me to some documentation?
Thank you those who at least achieved reading to this point. :-)
It also seems strange that after calling
M.ProjectFile.remove
there still was a value forp_adobe1.icon
. Perhaps what is needed is to flush the ming ORM session after saving and deleting.ThreadLocalORMSession.flush_all()
is a common way to do it, but if you grep forflush
you can see other examples (e.g. if you already have a session reference).It's not really necessary for test_index to assert that an icon is there, so if this continues to be difficult to change, you could just remove that assertion. But I do think it would be valuable to have an icon set up for the test, so hopefully that will work.
We've finished with the ticket, all changes are in 42cc_1532
Nice work. It'd be slightly better to use context managers (with statement) for opening files and for saving & restoring the Allura context (e.g.
with h.push_context(...):
), but its not necessary to change that for this code since it's already done and working.