This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var token = null; | |
function init(event) { | |
var topic = ''; | |
if (window.getSelection) { | |
topic = window.getSelection().toString(); | |
} else if (document.selection) { | |
topic = document.selection.createRange().topic; | |
} else { | |
return topic; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'base.html' %} | |
{% load add_css is_checkbox field_type %} | |
{% block title %} Stock {% endblock title %} | |
{% block stylesheets %} | |
{{ block.super }} | |
{% endblock stylesheets %} | |
{% block content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from decouple import config | |
import dj_database_url | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.postgresql', | |
'NAME': 'name', | |
'USER': 'username', | |
'PASSWORD': 'password', | |
'HOST': 'localhost', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Employee(models.Model): | |
office = models.ForeignKey( | |
OfficeSetup, blank=False, null=False, on_delete=models.CASCADE) | |
name = models.CharField(max_length=150, blank=False, null=False) | |
designation = models.ForeignKey(Designation, blank=False, null=False) | |
section = models.ForeignKey(DepartmentSetup, blank=True, null=True) | |
phone_number = models.CharField(max_length=150, blank=True, null=True) | |
mobile_number = models.CharField(max_length=150, blank=True, null=True) | |
email = models.EmailField(max_length=150, blank=True, null=True) | |
gender = models.CharField( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import InputField from 'components/common/Forms/InputField'; | |
import { Button } from 'semantic-ui-react'; | |
const RulesInput = props => | |
<div> | |
<form className="form"> | |
<InputField | |
type="text" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import InputField from "components/common/Forms/InputField"; | |
import { Button } from "semantic-ui-react"; | |
const RulesInput = props => { | |
return ( | |
<form className="form"> | |
<InputField | |
label={`Rule ${props.num + 1}`} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const RulesInput = props => { | |
return ( | |
<form className="form"> | |
<InputField | |
label={`Rule ${props.num + 1}`} | |
type="text" | |
name={`${props.num}`} | |
value={props.value[props.num] || ""} | |
onChange={props.handleChange} | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { Editor, EditorState, RichUtils } from "draft-js"; | |
const handleEditorChange = editorState => props.editorChange(editorState); | |
const toggleBlockType = blockType => | |
handleEditorChange( | |
RichUtils.toggleBlockType(this.state.editorState, blockType) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// here server response and error is fetched from selectors and is passed to toaster | |
const mapStateToProps = createStructuredSelector({ | |
errorResponse: selectAgentApplicationError(), | |
successResponse: selectAgentApplicationResponse(), | |
}); | |
if (successResponse && typeof successResponse === 'string') { | |
message = <Toaster message={successResponse} timeout={1000} success />; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
const FeatureList = ({ feature, type }) => { | |
// type is the category of feature like media-technology, food-drinks etc | |
// feature is the list of features that falls under the specific type | |
return ( | |
<ul> | |
<h1>media-technology</h1> | |
<li> | |
Computer |