Commit 9fee0433f957f5b6b601753d8de6d4ca881057dc
1 parent
f85498c3
Exists in
master
and in
22 other branches
ActionItem24: display unknown.png when there is no icon for that mime type
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1138 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
4 changed files
with
74 additions
and
22 deletions
Show diff stats
app/helpers/cms_helper.rb
| ... | ... | @@ -11,7 +11,15 @@ module CmsHelper |
| 11 | 11 | |
| 12 | 12 | def icon_for_article(article) |
| 13 | 13 | icon = article.icon_name |
| 14 | - (icon =~ /\//) ? icon : "icons-mime/#{article.icon_name}" | |
| 14 | + if (icon =~ /\//) | |
| 15 | + icon | |
| 16 | + else | |
| 17 | + if File.exists?(File.join(RAILS_ROOT, 'public', 'images', 'icons-mime', "#{icon}.png")) | |
| 18 | + "icons-mime/#{icon}" | |
| 19 | + else | |
| 20 | + "icons-mime/unknown.png" | |
| 21 | + end | |
| 22 | + end | |
| 15 | 23 | end |
| 16 | 24 | |
| 17 | 25 | end | ... | ... |
public/images/icons-mime/README
| 1 | -dlg-neu icons in Noosfero | |
| 2 | -========================= | |
| 1 | +mime icons in Noosfero | |
| 2 | +====================== | |
| 3 | 3 | |
| 4 | -The icons in this directory are taken from the dlg-neu icon theme for GNOME, | |
| 5 | -section "mimetypes/". We take the SVG files and convert to 64x64 PNG images, so | |
| 6 | -these icons are in fact derived works based on dlg-neu's SVG files. | |
| 4 | +Icon Source Theme License | |
| 5 | +------------------------ -------------- ------- | |
| 6 | +gnome-mime-text-html.png dlg-neu GPLV2+ | |
| 7 | +gnome-mime-empty.png Nuovo GPLV2+ | |
| 8 | +ico-feed-on.png <None> GPLv3 | |
| 7 | 9 | |
| 8 | -Exception: ico-feed-on.png was made by Aurélio A. Heckert | |
| 9 | -<aurelio@colivre.coop.br> and is licensed under the GNU General Public License, | |
| 10 | -version 3. | |
| 10 | +The icons in this directory are taken from some GNOME theme with compatible | |
| 11 | +license (i.e. GPLV2+ or GPLv3), section "mimetypes/". We take the SVG files and | |
| 12 | +convert to 24x24 PNG images, so these icons are in fact derived works of those | |
| 13 | +in the themes. | |
| 14 | + | |
| 15 | +Some icons are not taken from themes (e.g. ico-feed-on.png was made by Aurélio | |
| 16 | +A. Heckert <aurelio@colivre.coop.br> and is licensed under the GNU General | |
| 17 | +Public License, version 3.) | |
| 11 | 18 | |
| 12 | 19 | Structure |
| 13 | 20 | ========= |
| 14 | 21 | |
| 15 | -To keep a trace back to dlg-neu theme, when rasterizing the SVG files we keep | |
| 22 | +To keep a trace back to original themes, when rasterizing the SVG files we keep | |
| 16 | 23 | the original filenames (replacing .svg by .png, obviously) and create symbolic |
| 17 | 24 | links with names more sensible for Noosfero. |
| 18 | 25 | |
| ... | ... | @@ -22,29 +29,65 @@ Icons rasterization |
| 22 | 29 | With rsvg, from the librsvg2-bin package (i.e. we use the same rasterization |
| 23 | 30 | library as GNOME, so the icons must look like they do in GNOME). |
| 24 | 31 | |
| 25 | -$ rsvg -w 64 -h 64 <ICON>.svg <ICON>.png | |
| 32 | +$ rsvg -w 24 -h 24 <ICON>.svg <ICON>.png | |
| 26 | 33 | |
| 27 | 34 | Licensing |
| 28 | 35 | ========= |
| 29 | 36 | |
| 30 | -Their License is as follows (taken from | |
| 31 | -/usr/share/doc/gnome-icon-theme-dlg-neu/copyright on a Debian system): | |
| 37 | +dlg-neu icons (according to /usr/share/doc/gnome-icon-theme-dlg-neu/copyright | |
| 38 | +on a Debian system): | |
| 39 | + | |
| 40 | + Copyright Holders: Silvestre Herrera (silvestre.herrera@gmail.com) | |
| 41 | + | |
| 42 | + This package is free software; you can redistribute it and/or modify | |
| 43 | + it under the terms of the GNU General Public License as published by | |
| 44 | + the Free Software Foundation; either version 2 of the License, or | |
| 45 | + (at your option) any later version. | |
| 46 | + | |
| 47 | + This package is distributed in the hope that it will be useful, | |
| 48 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 49 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 50 | + GNU General Public License for more details. | |
| 51 | + | |
| 52 | + You should have received a copy of the GNU General Public License | |
| 53 | + along with this package; if not, write to the Free Software | |
| 54 | + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
| 55 | + 02110-1301 USA | |
| 56 | + | |
| 57 | +Nuovo icons (according to /usr/share/doc/gnome-icon-theme-nuovo/copyright on a | |
| 58 | +Debian system): | |
| 59 | + | |
| 60 | + Copyright Holders: Silvestre Herrera <silvestre.herrera@gmail.com> | |
| 32 | 61 | |
| 33 | - This package is free software; you can redistribute it and/or modify | |
| 62 | + This package is free software; you can redistribute it and/or modify | |
| 63 | + it under the terms of the GNU General Public License as published by | |
| 64 | + the Free Software Foundation; either version 2 of the License, or | |
| 65 | + (at your option) any later version. | |
| 66 | + | |
| 67 | + This package is distributed in the hope that it will be useful, | |
| 68 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 69 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 70 | + GNU General Public License for more details. | |
| 71 | + | |
| 72 | + You should have received a copy of the GNU General Public License | |
| 73 | + along with this package; if not, write to the Free Software | |
| 74 | + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
| 75 | + 02110-1301 USA | |
| 76 | + | |
| 77 | +ico-feed-on.png: | |
| 78 | + | |
| 79 | + Copyright holders: Aurélio A. Heckert <aurelio@colivre.coop.br> | |
| 80 | + | |
| 81 | + This program is free software: you can redistribute it and/or modify | |
| 34 | 82 | it under the terms of the GNU General Public License as published by |
| 35 | - the Free Software Foundation; either version 2 of the License, or | |
| 83 | + the Free Software Foundation, either version 3 of the License, or | |
| 36 | 84 | (at your option) any later version. |
| 37 | 85 | |
| 38 | - This package is distributed in the hope that it will be useful, | |
| 86 | + This program is distributed in the hope that it will be useful, | |
| 39 | 87 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 40 | 88 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 41 | 89 | GNU General Public License for more details. |
| 42 | 90 | |
| 43 | 91 | You should have received a copy of the GNU General Public License |
| 44 | - along with this package; if not, write to the Free Software | |
| 45 | - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
| 46 | - 02110-1301 USA | |
| 47 | - | |
| 48 | -On Debian systems, the complete text of the GNU General | |
| 49 | -Public License can be found in `/usr/share/common-licenses/GPL'. | |
| 92 | + along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 50 | 93 | ... | ... |
540 Bytes