imio.prettylink


Nameimio.prettylink JSON
Version 1.22 PyPI version JSON
download
home_pagehttp://pypi.python.org/pypi/imio.prettylink
SummaryManage generation of a pretty link to an element including coloration, leading icons, ...
upload_time2024-02-08 14:36:35
maintainer
docs_urlNone
authorGauthier Bastien
requires_python
licenseGPL
keywords plone pretty link utils dev imio
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: https://github.com/IMIO/imio.prettylink/actions/workflows/main.yml/badge.svg
   :target: https://github.com/IMIO/imio.prettylink/actions/workflows/main.yml

.. image:: https://coveralls.io/repos/IMIO/imio.prettylink/badge.png?branch=master
   :target: https://coveralls.io/r/IMIO/imio.prettylink?branch=master


====================
imio.prettylink
====================

Manage generation of a pretty link to an element including coloration, leading icons, ...

Changelog
=========

1.22 (2024-02-08)
-----------------

- When displaying `contentIcon`, use `typeInfo.Title` method instead translating
  the `typeInfo.title` as `typeInfo.Title` manages various case where title is
  `unicode`, `string` or else.
  [gbastien]

1.21 (2023-08-24)
-----------------

- Adapted call to `imio.helpers.cache.obj_modified` as parameter `asstring=False`
  was removed, we just use the default result type that is `float`.
  [gbastien]

1.20 (2022-06-14)
-----------------

- Escape link content to avoid malicious behaviour.
  [gbastien]

1.19 (2022-01-12)
-----------------

- Used now `imio.helpers.cache.obj_modified` in `getLink_cachekey` to include
  annotation change in modification date.
  [sgeulette]
- Updated git fetch url
  [sgeulette]

1.18 (2021-03-08)
-----------------

- Improve check for file when adding `@@download` in url.
  [laz, boulch]

1.17 (2020-10-06)
-----------------

- Set icons `<img>` tag `width=16px` and `height=16px` to make `tooltipster`
  happy (computed area to display depends on displayed content).
  [gbaastien]

1.16 (2020-01-10)
-----------------

- While generating not viewable URL, avoid double blank before tag title.
  [gbastien]
- Adapted `PrettyLinkAdapter.CSSClasses` to manage `<a>` tag CSS classes and
  `<span>` tag CSS classes. `additionalCSSClasses` are set on the `<a>` tag.
  [gbastien]

1.15 (2019-11-26)
-----------------

- Removed `unittest2`.
  [gbastien]
- Moved the state related CSS class from the `<a>/<div>` tag to the `<span>`
  inner tag, this way it is easier to define CSS compatible for
  `imio.prettylink` and `imio.history`.
  [gbastien]

1.14 (2019-05-16)
-----------------

- Use context.UID instead context in ram.cache cachekey.
  [gbastien]
- Moved rendering link HTML pattern to the link_pattern so it can be changed.
  [gbastien]

1.13 (2019-01-31)
-----------------

- Fixed `getLink` cachekey to use `SERVER_URL` instead `ACTUAL_URL` or value is
  computed depending on current URL and it leads to be computed on several
  places (dashboard, view, ...).  What we need is just to compute if application
  is accessed thru different portal URL.
  [gbastien]

1.12 (2018-08-22)
-----------------

- Small fixes, `isort`, do not compute `icons_tag` at 2 places and
  `self.notViewableHelpMessage` is always defined.
  [gbastien]

1.11 (2018-07-24)
-----------------

- Use `self.context.wl_isLocked()` to show locking icon so it does not break
  on non lockable objects.
  [gbastien]
- Added boolean `display_tag_title` parameter.
  [sgeulette]

1.10 (2018-01-06)
-----------------

- Handle icon path correctly.
  [sgeulette]

1.9 (2017-02-17)
----------------

- Do simplify link to file the download by just appending the @@download to
  the URL, this is enough if current context has a primary field.
  [gbastien]

1.8 (2017-02-13)
----------------

- Take `ACTUAL_URL` stored in the REQUEST into account in the `getLink` caching
  cachekey to manage the fact that the URL to the element changed.  This can
  be the case when accessing element thru different domains or if a parent
  of the element was renamed.
  [gbastien]

1.7 (2017-02-02)
----------------

- Do not break in `PrettyLinkAdapter.getLink_cachekey` if context does not have
  a workflow.
  [gbastien]

1.6 (2017-02-01)
----------------

- Added caching for `PrettyLinkAdapter.getLink`, the cachekey returns context,
  modified, is_locked, review_state and every parameters defined in
  `PrettyLinkAdapter.__init__`.
  [gbastien]
- Moved link computation from `PrettyLinkAdapter.getLink` that is now a cached
  method to `PrettyLinkAdapter._getLink` so it is possible to call it directly
  without caching or to override it.
  [gbastien]
- Finalized testing configuration to be able to test the getLink caching.
  [gbastien]

1.5 (2017-01-25)
----------------

- Added submethod _get_url that does the url computation.
  Additionally it manages the fact that context is a Dexterity file and
  append relevant part to the url (/@@download/...).
  [gbastien]
- Do not break if icon name contains special characters.
  [gbastien]

1.4 (2016-08-17)
----------------

- Added CSS class 'no_access' to <span> "can_not_access_this_element"
  in addition to class 'discreet' so it may be customized if necessary.
  [gbastien]
- Initialize the 'title' attribute with contentValue, this way if a
  content is cropped to be displayed (maxLength=...), the complete content
  is displayed on hover.
  [gbastien]

1.3 (2016-04-20)
----------------

- Make sure quotes used in title are not breaking formatted strings,
  we escape it by replacing quotes by it's HTML entity &#39;
  [gbastien]

1.2 (2016-02-16)
----------------

- If 'isViewable' is True (default), check that current user have
  'View' on the linked element, if it is forced to False, leave it False.
  This way, 'View' check to linked element is managed by imio.prettylink.
  [gbastien]

1.1 (2015-11-13)
----------------

- When using 'showColors', do not fail if element has no workflow.
  [gbastien]
- Makes 'showContentIcon' work, fixed several bugs.
  [gbastien]

1.0 (2015-07-14)
----------------

- Initial release.
  [gbastien]
            

Raw data

            {
    "_id": null,
    "home_page": "http://pypi.python.org/pypi/imio.prettylink",
    "name": "imio.prettylink",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "plone pretty link utils dev imio",
    "author": "Gauthier Bastien",
    "author_email": "gauthier.bastien@imio.be",
    "download_url": "https://files.pythonhosted.org/packages/c1/74/8312ee8fb53e88b8eaaa6b5705fd1489f9a817f79bc72e569a56e70745c2/imio.prettylink-1.22.tar.gz",
    "platform": null,
    "description": ".. image:: https://github.com/IMIO/imio.prettylink/actions/workflows/main.yml/badge.svg\n   :target: https://github.com/IMIO/imio.prettylink/actions/workflows/main.yml\n\n.. image:: https://coveralls.io/repos/IMIO/imio.prettylink/badge.png?branch=master\n   :target: https://coveralls.io/r/IMIO/imio.prettylink?branch=master\n\n\n====================\nimio.prettylink\n====================\n\nManage generation of a pretty link to an element including coloration, leading icons, ...\n\nChangelog\n=========\n\n1.22 (2024-02-08)\n-----------------\n\n- When displaying `contentIcon`, use `typeInfo.Title` method instead translating\n  the `typeInfo.title` as `typeInfo.Title` manages various case where title is\n  `unicode`, `string` or else.\n  [gbastien]\n\n1.21 (2023-08-24)\n-----------------\n\n- Adapted call to `imio.helpers.cache.obj_modified` as parameter `asstring=False`\n  was removed, we just use the default result type that is `float`.\n  [gbastien]\n\n1.20 (2022-06-14)\n-----------------\n\n- Escape link content to avoid malicious behaviour.\n  [gbastien]\n\n1.19 (2022-01-12)\n-----------------\n\n- Used now `imio.helpers.cache.obj_modified` in `getLink_cachekey` to include\n  annotation change in modification date.\n  [sgeulette]\n- Updated git fetch url\n  [sgeulette]\n\n1.18 (2021-03-08)\n-----------------\n\n- Improve check for file when adding `@@download` in url.\n  [laz, boulch]\n\n1.17 (2020-10-06)\n-----------------\n\n- Set icons `<img>` tag `width=16px` and `height=16px` to make `tooltipster`\n  happy (computed area to display depends on displayed content).\n  [gbaastien]\n\n1.16 (2020-01-10)\n-----------------\n\n- While generating not viewable URL, avoid double blank before tag title.\n  [gbastien]\n- Adapted `PrettyLinkAdapter.CSSClasses` to manage `<a>` tag CSS classes and\n  `<span>` tag CSS classes. `additionalCSSClasses` are set on the `<a>` tag.\n  [gbastien]\n\n1.15 (2019-11-26)\n-----------------\n\n- Removed `unittest2`.\n  [gbastien]\n- Moved the state related CSS class from the `<a>/<div>` tag to the `<span>`\n  inner tag, this way it is easier to define CSS compatible for\n  `imio.prettylink` and `imio.history`.\n  [gbastien]\n\n1.14 (2019-05-16)\n-----------------\n\n- Use context.UID instead context in ram.cache cachekey.\n  [gbastien]\n- Moved rendering link HTML pattern to the link_pattern so it can be changed.\n  [gbastien]\n\n1.13 (2019-01-31)\n-----------------\n\n- Fixed `getLink` cachekey to use `SERVER_URL` instead `ACTUAL_URL` or value is\n  computed depending on current URL and it leads to be computed on several\n  places (dashboard, view, ...).  What we need is just to compute if application\n  is accessed thru different portal URL.\n  [gbastien]\n\n1.12 (2018-08-22)\n-----------------\n\n- Small fixes, `isort`, do not compute `icons_tag` at 2 places and\n  `self.notViewableHelpMessage` is always defined.\n  [gbastien]\n\n1.11 (2018-07-24)\n-----------------\n\n- Use `self.context.wl_isLocked()` to show locking icon so it does not break\n  on non lockable objects.\n  [gbastien]\n- Added boolean `display_tag_title` parameter.\n  [sgeulette]\n\n1.10 (2018-01-06)\n-----------------\n\n- Handle icon path correctly.\n  [sgeulette]\n\n1.9 (2017-02-17)\n----------------\n\n- Do simplify link to file the download by just appending the @@download to\n  the URL, this is enough if current context has a primary field.\n  [gbastien]\n\n1.8 (2017-02-13)\n----------------\n\n- Take `ACTUAL_URL` stored in the REQUEST into account in the `getLink` caching\n  cachekey to manage the fact that the URL to the element changed.  This can\n  be the case when accessing element thru different domains or if a parent\n  of the element was renamed.\n  [gbastien]\n\n1.7 (2017-02-02)\n----------------\n\n- Do not break in `PrettyLinkAdapter.getLink_cachekey` if context does not have\n  a workflow.\n  [gbastien]\n\n1.6 (2017-02-01)\n----------------\n\n- Added caching for `PrettyLinkAdapter.getLink`, the cachekey returns context,\n  modified, is_locked, review_state and every parameters defined in\n  `PrettyLinkAdapter.__init__`.\n  [gbastien]\n- Moved link computation from `PrettyLinkAdapter.getLink` that is now a cached\n  method to `PrettyLinkAdapter._getLink` so it is possible to call it directly\n  without caching or to override it.\n  [gbastien]\n- Finalized testing configuration to be able to test the getLink caching.\n  [gbastien]\n\n1.5 (2017-01-25)\n----------------\n\n- Added submethod _get_url that does the url computation.\n  Additionally it manages the fact that context is a Dexterity file and\n  append relevant part to the url (/@@download/...).\n  [gbastien]\n- Do not break if icon name contains special characters.\n  [gbastien]\n\n1.4 (2016-08-17)\n----------------\n\n- Added CSS class 'no_access' to <span> \"can_not_access_this_element\"\n  in addition to class 'discreet' so it may be customized if necessary.\n  [gbastien]\n- Initialize the 'title' attribute with contentValue, this way if a\n  content is cropped to be displayed (maxLength=...), the complete content\n  is displayed on hover.\n  [gbastien]\n\n1.3 (2016-04-20)\n----------------\n\n- Make sure quotes used in title are not breaking formatted strings,\n  we escape it by replacing quotes by it's HTML entity &#39;\n  [gbastien]\n\n1.2 (2016-02-16)\n----------------\n\n- If 'isViewable' is True (default), check that current user have\n  'View' on the linked element, if it is forced to False, leave it False.\n  This way, 'View' check to linked element is managed by imio.prettylink.\n  [gbastien]\n\n1.1 (2015-11-13)\n----------------\n\n- When using 'showColors', do not fail if element has no workflow.\n  [gbastien]\n- Makes 'showContentIcon' work, fixed several bugs.\n  [gbastien]\n\n1.0 (2015-07-14)\n----------------\n\n- Initial release.\n  [gbastien]",
    "bugtrack_url": null,
    "license": "GPL",
    "summary": "Manage generation of a pretty link to an element including coloration, leading icons, ...",
    "version": "1.22",
    "project_urls": {
        "Homepage": "http://pypi.python.org/pypi/imio.prettylink"
    },
    "split_keywords": [
        "plone",
        "pretty",
        "link",
        "utils",
        "dev",
        "imio"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c1748312ee8fb53e88b8eaaa6b5705fd1489f9a817f79bc72e569a56e70745c2",
                "md5": "67b25d90465c95598ea0f4aed150ff40",
                "sha256": "af993a2a493c5a10ca5cd7715690a2110fec0e6474c04bb13004d1178857adff"
            },
            "downloads": -1,
            "filename": "imio.prettylink-1.22.tar.gz",
            "has_sig": false,
            "md5_digest": "67b25d90465c95598ea0f4aed150ff40",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 22390,
            "upload_time": "2024-02-08T14:36:35",
            "upload_time_iso_8601": "2024-02-08T14:36:35.697705Z",
            "url": "https://files.pythonhosted.org/packages/c1/74/8312ee8fb53e88b8eaaa6b5705fd1489f9a817f79bc72e569a56e70745c2/imio.prettylink-1.22.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-08 14:36:35",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "imio.prettylink"
}
        
Elapsed time: 0.26303s