Render a module's input page. Forms are created based on objects in
    the module's WebAPI class.
557191
def script_input(module_name):
    ''''''
    if module_name not in registered_modules:
        return page_not_found(module_name)
    form = registered_modules[module_name].WebAPI()
    return render_template('script_index.html',
                           form=form,
                           scripts=registered_modules,
                           module_name=module_name)
229469
def render_form(form):
    """"""

    if 'crispy_forms' in settings.INSTALLED_APPS:
        from crispy_forms.templatetags.crispy_forms_filters import as_crispy_form
        return as_crispy_form(form)

    template = get_template("bootstrap/form.html")
    form = _preprocess_fields(form)

    return template.render({"form": form})
1266872
function (form) {
        render(req, res, 'organization-select', {
          form: form,
          formActionUri: formActionUri,
          formModel: organizationSelectFormModel
        });
      }
105351
function (form) {
        render(req, res, 'organization-select', {
          form: form,
          formActionUri: formActionUri,
          formModel: organizationSelectFormModel,
          formErrors: collectFormErrors(form)
        });
      }
570385
function render() {
  var content = $($.parseHTML(template));
  var compiler = Handlebars.compile(content.filter("#layout").html());

  Handlebars.registerPartial({
    leftPanel: content.filter("#left-panel").html(),
    rightPanel: content.filter("#right-panel").html(),
    transactionList: content.filter("#transaction-list").html(),
    transactionDetails: content.filter("#transaction-details").html(),
    transactionOther: content.filter("#transaction-other").html(),
  });

  // Adds selected class to selected transaction item.
  Handlebars.registerHelper('isSelected', function(options) {
    var resp =
      (this.business === dataView.selectedTransaction.business) ?
      "selected" : "";
    return options.fn(resp);
  });

  // Returns fake detail monthly total.
  Handlebars.registerHelper('monthlyTotal', function(options) {
    var total = toCurrency(parseFloat(this.selectedTransaction.amount) * 12);
    return options.fn(total);
  });

  // Returns fake detail yearly total.
  Handlebars.registerHelper('yearlyTotal', function(options) {
    var total = toCurrency(parseFloat(this.selectedTransaction.amount) * 40);
    return options.fn(total);
  });

  var html = compiler(dataView);
  $("#demo-app").html(html);

  addClickHandler();
}
650157
public function render()
    {
        $this->setupDefaultOptions();

        if (!empty($this->value)) {
            $this->attribute('data-initial-preview', $this->preview());
            $this->attribute('data-initial-caption', $this->initialCaption($this->value));

            $this->setupPreviewOptions();
        }

        $this->options(['overwriteInitial' => true]);

        $options = json_encode($this->options);

        $this->script = <<<EOT

$("input{$this->getElementClassSelector()}").fileinput({$options});

EOT;

        return parent::render();
    }
1228016
function renderView(router, view, template, params) {
  router.$viewport.css('opacity', 0);

  setTimeout(() => {
    router.$viewport.removeChildren();
    // TODO Remove all event listeners in $viewport, to avoid memory leaks.
    $body.scrollTop = 0;
    router.$viewport.html = template;
    Browser.resize();
    Browser.replaceSvgImports();
    router.$viewport.css({ opacity: 1, 'pointer-events': 'all' });
    document.title = router.$viewport.$('title').text;
    router.initialise(router.$viewport, params);
    if (view.enter) view.enter(router.$viewport, params);
    router.trigger('afterChange', {$viewport: router.$viewport});
  }, 350);
}
369690
public void render() {
    try {
      this.response.setHeader("Content-type", "text/html; charset=UTF-8");
      this.response.setCharacterEncoding("UTF-8");
      this.response.setContentType(this.mimeType);
      this.engine.mergeTemplate(this.template, "UTF-8", this.context, this.response.getWriter());
    } catch (final Exception e) {
      throw new PageRenderException(e);
    }
  }
1036374
def render(self, name=None, value=None, attrs=None):
        
        attrs = {} or attrs
        self.attrs = attrs
        self.name = name
        self.value = value

        id_ = self.attrs.get('id')
        output = []
        for i, choice in enumerate(self.choices):
            choice_value, choice_label = choice
            if isinstance(choice_label, (tuple, list)):
                attrs_plus = self.attrs.copy()
                if id_:
                    attrs_plus['id'] += '_{}'.format(i)
                sub_ul_renderer = self.__class__(
                    attrs=attrs_plus,
                    choices=choice_label,
                )
                sub_ul_renderer.choice_input_class = self.choice_input_class
                output.append(html.format_html(
                    self.inner_html, choice_value=choice_value,
                    sub_widgets=sub_ul_renderer.render(),
                ))
            else:
                w = self.choice_input_class(
                    self.name, self.value, self.attrs.copy(), choice, i)
                output.append(html.format_html(
                    self.inner_html,
                    choice_value=force_text(w),
                    sub_widgets=''))
        return html.format_html(
            self.outer_html,
            id_attr=html.format_html(' id="{}"', id_) if id_ else '',
            content=mark_safe('\n'.join(output)),
        )
863297
def render(self):
        """"""
        if not self.validate():
            raise ValidationError

        self.process_request()
        self.clean()

        return self.response
894007
def get(self, request, *args, **kwargs):
        
        #noinspection PyAttributeOutsideInit
        self.object_list    = self.get_queryset()
        context             = self.get_context_data(force_search=True)

        if self.form_class:
            context.update({'form': self.get_form()})

        if 'q' in request.GET or 'p' in request.GET:
            return render(
                request,
                '{0}/results.html'.format(self.template_dir),
                context
            )
        else:
            return render_modal_workflow(
                request,
                '{0}/chooser.html'.format(self.template_dir),
                '{0}/chooser.js'.format(self.template_dir),
                context
            )
546514
def render_formset(formset, **kwargs):
    
    renderer_cls = get_formset_renderer(**kwargs)
    return renderer_cls(formset, **kwargs).render()
519038
public function render()
	{
		if ($this->filterFormFactory) {
			$this['form']['filter']->setDefaults($this->filter);
		}

		$this->template->form = $this['form'];
		$this->template->data = $this->getData();
		$this->template->columns = $this->columns;
		$this->template->editRowKey = $this->editRowKey;
		$this->template->rowPrimaryKey = $this->rowPrimaryKey;
		$this->template->paginator = $this->paginator;
		$this->template->sendOnlyRowParentSnippet = $this->sendOnlyRowParentSnippet;
		$this->template->cellsTemplates = $this->getCellsTemplates();
		$this->template->showFilterCancel = $this->filterDataSource != $this->filterDefaults; // @ intentionaly
		$this->template->setFile(__DIR__ . '/Datagrid.latte');

		$this->onRender($this);
		$this->template->render();
	}
292218
def render_to_response(self, context, **response_kwargs):
        
        response_kwargs['content_type'] = 'application/json'
        return self.response_class(
            self.convert_context_to_json(context),
            **response_kwargs
        )
733983
def respond(template, context={}, request=None, **kwargs):
    ""
    from django.http import HttpResponse
    from django.template import RequestContext
    from django.template.loader import render_to_string    

    if request:
        default = context_processors.default(request)
        default.update(context)
    else:
        default = context.copy()
    
    rendered = render_to_string(template, default, context_instance=request and RequestContext(request) or None)
    return HttpResponse(rendered, **kwargs)
1196704
function render(name, data) {
    var template;

    if (name !== 'login') {
      template = this.template(name, data || {});

      template.where('name').is('username').use('username').as('value');
      template.where('name').is('password').use('password').as('value');

      if (data && data.error) {
        template.className('error').use('error');
      } else {
        template.className('error').remove();
      }

      if (data && data.success) {
        template.className('success').use('success');
      } else {
        template.className('success').remove();
      }
    } else if (data && data.error) {
      // Hide the spinner and show the close button.
      $('.modal .close').removeClass('gone');
      $('.modal .spinner').addClass('gone');

      // Login request, but with data.. so the login failed
      $('.modal input[name="username"], .modal input[name="password"]').set(
        'readOnly',
        false
      );

      $('.modal button[type="submit"]')
        .removeClass('disabled loading')
        .set('innerHTML', 'Log in')
        .set('disabled', '');

      $('.modal .error').removeClass('gone').set('innerHTML', data.error);
    }

    Cortex.app('modal')
      .render(template)
      .once('done', this.close.bind(this, name));

    //
    // Check if we need to create a hidden input field with a redirect directive.
    //
    if (this.redirect) {
      $('.modal form input[name="redirect"]').set('value', this.redirect);
    }

    return this;
  }
507973
function generatePage(output, page) {
    var book = output.getBook();
    var engine = createTemplateEngine(output);

    return timing.measure(
        'page.generate',
        Promise(page)
        .then(function(resultPage) {
            var file = resultPage.getFile();
            var filePath = file.getPath();
            var parser = file.getParser();
            var context = JSONUtils.encodeOutputWithPage(output, resultPage);

            if (!parser) {
                return Promise.reject(error.FileNotParsableError({
                    filename: filePath
                }));
            }

            // Call hook "page:before"
            return callPageHook('page:before', output, resultPage)

            // Escape code blocks with raw tags
            .then(function(currentPage) {
                return parser.preparePage(currentPage.getContent());
            })

            // Render templating syntax
            .then(function(content) {
                var absoluteFilePath = path.join(book.getContentRoot(), filePath);
                return Templating.render(engine, absoluteFilePath, content, context);
            })

            .then(function(output) {
                var content = output.getContent();

                return parser.parsePage(content)
                .then(function(result) {
                    return output.setContent(result.content);
                });
            })

            // Post processing for templating syntax
            .then(function(output) {
                return Templating.postRender(engine, output);
            })

            // Return new page
            .then(function(content) {
                return resultPage.set('content', content);
            })

            // Call final hook
            .then(function(currentPage) {
                return callPageHook('page', output, currentPage);
            });
        })
    );
}