summaryrefslogtreecommitdiff
path: root/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/adminDashboardCreate.html
blob: 6170ba59238b00655ad22a1596074802220d17b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
{% extends "ndf/base.html" %}
{% load ndf_tags %}
{% load i18n %}
{% block title %} Admin {% endblock %}
{% block meta_content %}
     {% ifequal url 'data' %}
	{% get_class_list groupid class_name %}
     {% else %}
        {% get_class_type_list groupid class_name %}
     {% endifequal %}
{% endblock %}


{% block body_content %} 
<link rel="stylesheet" type="text/css" href="/static/ndf/orgitdown/skins/gstudio/style.css" />
<form method="post" action="" name="{{class_name}}">
{% csrf_token %}
{% if translate %}
<div class="large-12 columns">
<table class="large-6 columns">
<div class="row">
<div class="large-6 columns text-center">{{node.language|default_if_none:"en"}}</div>

<div class="large-6 columns">
<select name="lan" id="lan">
{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}
<option value={{ language.code }}>{{ language.name }}</option>
{% endfor %}
</select>
</div>
<hr style="height:5px;background-color: #0B6580;" />
</div>
</table></div>
{% endif %}
 
<h2>{{node.name}}</h2>
<div style="display:table;  border:1px;   border-spacing:15px; " class="small-12 columns">
{% for list in definitionlist %}
{% if translate %}
{% if list == "name" or list == "inverse_name" %}
<div style="display:table-row;">
      <div style="display:table-cell;"> 
	<font size="3"> {{list}}</font> 
      </div>

{% get_input_fields class_structure|get_dict_item:list list translate %}

</div>
{% endif %}
{% endif %}
  
{% endfor %}
</div>
{% if translate %}
<div style="display:table; display:none; border:1px;   border-spacing:15px;" class="small-12 columns">
{% else %}
<div style="display:table; border:1px;   border-spacing:15px;" class="small-12 columns">

{% endif %}

<dl class="accordion" data-accordion>
  <dd class="accordion-navigation">
    <a href="#definitionlist">Definition</a>
    <div id="definitionlist" class="content active">
      {% for list in definitionlist %}
      {% if translate and list != "language" %}
      <div style="display:table-row;">
	<div style="display:table-cell;"> 
	  <font size="3"> {{list}}</font> 
	</div>
	{% get_input_fields class_structure|get_dict_item:list list %}
	{% if list in  required_fields %}
	<div style="display:table-cell;">
          <font size="3" color="red"> * </font>
          <font id="{{list}}_required" style="display:none" color="red">This field required</font>
        </div>
        {% endif %}
      </div>
      {% endif %}
      
      {% if not translate %}
      <div style="display:table-row;">
        <div style="display:table-cell;"> 
	  <font size="3"> {{list}}</font> 
        </div>
        {% get_input_fields class_structure|get_dict_item:list list %}
        {% if list in  required_fields %}
        <div style="display:table-cell;">
          <font size="3" color="red"> * </font>
          <font id="{{list}}_required" style="display:none" color="red">This field required</font>
        </div>
        {% endif %}
      </div>
      {% endif %}
      {% endfor %}
    </div>
  </dd>
  <dd class="accordion-navigation">
    <a href="#contentlist">Content</a>
    <div id="contentlist" class="content">
      {% for list in contentlist %}
      <div class="medium-12 columns">
	{% include "ndf/add_editor.html" with var_name="content_org" var_placeholder="Enter the content here" var_value=node.content_org|default_if_none:"" node_id=node.pk %}
      </div>
      {% endfor %}
      <script type="text/javascript">
	$(".orgitdown .orgitdownButton1 a").css({"background-image":'url("/static/ndf/orgitdown/skins/gstudio/images/bold.png")','background-color':'#EEEEEE','background-position':'center center','background-repeat':'no-repeat'});
	$(".orgitdown .orgitdownButton2 a").css({"background-image":'url("/static/ndf/orgitdown/skins/gstudio/images/italic.png")','background-color':'#EEEEEE','background-position':'center center','background-repeat':'no-repeat'});
	$(".orgitdown .orgitdownButton3 a").css({"background-image":'url("/static/ndf/orgitdown/skins/gstudio/images/stroke.png")','background-color':'#EEEEEE','background-position':'center center','background-repeat':'no-repeat'});
	$(".orgitdown .orgitdownButton4 a").css({"background-image":'url("/static/ndf/orgitdown/skins/gstudio/images/list-bullet.png")','background-color':'#EEEEEE','background-position':'center center','background-repeat':'no-repeat'});
	$(".orgitdown .orgitdownButton5 a").css({"background-image":'url("/static/ndf/orgitdown/skins/gstudio/images/list-numeric.png")','background-color':'#EEEEEE','background-position':'center center','background-repeat':'no-repeat'});
	$(".orgitdown .orgitdownButton6 a").css({"background-image":'url("/static/ndf/orgitdown/skins/gstudio/images/picture.png")','background-color':'#EEEEEE','background-position':'center center','background-repeat':'no-repeat'});
	$(".orgitdown .orgitdownButton7 a").css({"background-image":'url("/static/ndf/orgitdown/skins/gstudio/images/link.png")','background-color':'#EEEEEE','background-position':'center center','background-repeat':'no-repeat'});
	$(".orgitdown .orgitdownButton8 a").css({"background-image":'url("/static/ndf/orgitdown/skins/gstudio/images/html.jpeg")','background-color':'#EEEEEE','background-position':'center center','background-repeat':'no-repeat'});
	$(".orgitdown .orgitdownButton9 a").css({"background-image":'url("/static/ndf/orgitdown/skins/gstudio/images/close.jpeg")','background-color':'#EEEEEE','background-position':'center center','background-repeat':'no-repeat'});
	$(document).ready(function(){
	$("#lan option[value={{node.language}}]").remove();
	{% if node %}
	{% get_possible_translations node as translations %}
	{% for each in translations %}
	{% for k,v in each.items %}
	$("#lan option[value={{v}}]").remove();
	{% endfor %}
	{% endfor %}
	{% endif %}
	});
      </script>
    </div>
  </dd>
  <dd class="accordion-navigation">
    <a href="#dependencylist">Dependency</a>
    <div id="dependencylist" class="content">
      {% for list in dependencylist %}
      <div style="display:table-row;">
	<div style="display:table-cell;"> 
	  <font size="3"> {{list}}</font> 
	</div>
	{% get_input_fields class_structure|get_dict_item:list list %}
      </div>
      {% endfor %}
    </div>
  </dd>
  <dd class="accordion-navigation">
    <a href="#options">Options</a>
    <div id="options" class="content">
      {% for list in options %}
      <div style="display:table-row;">
        <div style="display:table-cell;"> 
          <font size="3"> {{list}}</font> 
        </div>
        {% get_input_fields class_structure|get_dict_item:list list %}
      </div>
      {% endfor %}
    </div>
  </dd>
</dl>
</div>

<input type="submit" name="submit" class="button" id="save-node-type" value="Submit">
</form>
<!-- {% if translate %}    -->
<!-- <div class="text-right small-9"> -->
<!-- {% if node %} -->
<!--    Languages -->
<!--       <br></br> -->
<!--       {% get_possible_translations node as tran %} -->
<!--       {% for each in tran %} -->
<!--         {% for k,v in each.items %} -->
<!--         <li><a href="{% url 'adminDesignerDashboardClassEdit' class_name k %}?translate=True">{{v}}</a></li> -->
<!--         {% endfor %} -->
<!--       {% endfor %} -->
<!-- {% endif %} -->
<!-- </div> -->

<!-- {% endif %}lan -->

{% endblock %}

{% block script %}
{% autoescape off %}
  var required_fields = [];
  required_fields = {{ required_fields }}
  var index = required_fields.indexOf('_type');
  if(index>-1){
     required_fields.splice(index, 1);
  }
  var flag = 0;
  
  {% endautoescape %}
  
  $("form").submit(function(event) {
    flag = 0;
    for(each in type_list){
      eval(type_list[each] + "()");
    }
    for(reqfields in required_fields){
      if($("#definitionlist [name = "+required_fields[reqfields]+" ]").val()){
        $("#"+required_fields[reqfields]+"_required").hide();
      }
      else{
        flag = 1;
        $("#"+required_fields[reqfields]+"_required").show();
      }
    }
  
    <!-- if(flag == 1) -->
    <!-- { -->
    <!--   alert("* mandatory fields requiredss"); -->
    <!--   event.preventDefault(); -->
    <!-- } -->
  });

{% endblock %}	

{% block head %} 
<script type="text/javascript">
var type_list = []
</script>
{% endblock %}