简体   繁体   English

如何将新字体真棒图标添加到我的 odoo 模块?

[英]how to add new font awesome icon to my odoo module?

I'm working on customizing web_notify oca module which sends a pop-up notification to screen, it contains some varients of notification each one has a font awesome icons that appear on the notification it defines the icons in this js file我正在定制 web_notify oca 模块,它向屏幕发送弹出通知,它包含一些通知的变体,每个都有一个字体真棒图标出现在它定义这个 js 文件中的图标的通知上

odoo.define('web_notify.Notification', function (require) {
"use strict";

var Notification = require('web.Notification');

Notification.include({
    icon_mapping: {
        'success': 'fa-thumbs-up',
        'danger': 'fa-exclamation-triangle',
        'warning': 'fa-exclamation',
        'info': 'fa-info',
        'default': 'fa-lightbulb-o',
    },
    init: function () {
        this._super.apply(this, arguments);
        // Delete default classes
        this.className = this.className.replace(' o_error', '');
        // Add custom icon and custom class
        this.icon = (this.type in this.icon_mapping) ?
            this.icon_mapping[this.type] :
            this.icon_mapping['default'];
        this.className += ' o_' + this.type;
    },
});

}); 

I'm searching on awesome website and I need to to add an icon that I found it declaration我在很棒的网站上搜索,我需要添加一个我发现它的图标声明

  <i class="fas fa-mosque">
  </i>

say if I need to replace fa-thumbs-up with the new one how can I do that说如果我需要用新的替换 fa-thumbs-up 我该怎么做

Did you include the latest stylesheet link for font awesome?It seems to work fine here.您是否包含了 font awesome 的最新样式表链接?它似乎在这里工作正常。

 <html> <head> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css"> </head> <body> <i class="fas fa-mosque"> </i> <body> </html>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM