호라이즌 MyPanel

1 개요[ | ]

호라이즌 MyPanel

2 panel.py[ | ]

from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.mydashboard import dashboard

class Mypanel(horizon.Panel):
    name = _("Mypanel")
    slug = "mypanel"

dashboard.Mydashboard.register(Mypanel)

3 urls.py[ | ]

from django.conf.urls import url
from openstack_dashboard.dashboards.mydashboard.mypanel import views

urlpatterns = [
    url(r'^$', views.IndexView.as_view(), name='index'),
]

4 views.py[ | ]

from horizon import views

class IndexView(views.APIView):
    template_name = 'mydashboard/mypanel/index.html'
    def get_data(self, request, context, *args, **kwargs):
        return context

5 templates/mypanel/index.html[ | ]

{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "Mypanel" %}{% endblock %}

{% block page_header %}
  {% include "horizon/common/_page_header.html" with title=_("Mypanel") %}
{% endblock page_header %}

{% block main %}
{% endblock %}

6 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}