Giter Site home page Giter Site logo

feedback_app's Introduction

Installation

clone files to your project

cd .../project_name
git clone https://github.com/Klyaus/feedback_app

Add 'feedback_app' to your config Make sure that 'django.contrib.staticfiles' is set up properly and add to INSTALLED_APPS

INSTALLED_APPS = (
    # ...
    'django.contrib.staticfiles',
    # ...
    'feedback_app',
)

'feedback_app' is mostly implemented in a middleware. Enable it in your settings module as follows:

MIDDLEWARE_CLASSES  =  ( 
    # ... 
    'feedback_app.middleware.PolMiddleware' , 
    # ... 
)

In urls.py import views form feedback_app and url feedback_app/

from feedback_app import views
urlpatterns = [
    #...
    path('feedback_app/', views.FeedbackView.as_view()),
]

Do not forget to migrate!!!

Configuration

FEEDBACK_APP_CONFIG This dictionary contains all configuration options.

'insert_before'

Default: '</body>'

'feedback_app' searches for this string in the HTML and inserts itself just before.

'fm_title'

Default: 'Send message'

Modal window title text.

'fm_tooltip'

Default: 'Send an error message or a wish'

Icon tooltip text

'fm_alert_message'

Default: 'Message sent!'

Alert text after sending

'fm_send_button'

Default: 'Send'

Button "Send" text

'fm_fields'

Default: ['name', 'email', 'phone']

List of fields displayed in the modal window. The field "message" - will be displayed necessarily.

'fm_fields_placeholders'

Must be dictionary

Default: {"name": "Name", "email": "E-mail", "phone": "Phone", "message": "Enter your message*"}

Dictionary of fields and placeholders displayed in the modal window.

Example:

FEEDBACK_APP_CONFIG = {
    'insert_before': '</body>',
    'fm_title': 'New message',
    'fm_tooltip': 'Send your message',
    'fm_fields': ['name', 'email'],
    "fm_fields_placeholders": {"name": "Name", "email": "E-mail", "message": "Enter your message*"}
}

feedback_app's People

Contributors

klyaus avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.