1 | {% extends "BaseDisplayHomePage.htm" %} |
---|
2 | {% load i18n plmapp_tags highlight %} |
---|
3 | |
---|
4 | <!-- Manage html display of the home page --> |
---|
5 | |
---|
6 | {% block LoggedPersonBlock %} |
---|
7 | {% get_current_language as LANGUAGE_CODE %} |
---|
8 | <a href="/user/{{user}}/">{{user.get_full_name}}</a> | {{current_date|date:"D j N Y, G:i"}} |
---|
9 | <form id="SetLangForm" action="/i18n/setlang/" method="post"> |
---|
10 | <ul> |
---|
11 | <li> |
---|
12 | <select name="language"> |
---|
13 | |
---|
14 | {% for lang in LANGUAGES %} |
---|
15 | <option value="{{ lang.0 }}" {% ifequal LANGUAGE_CODE lang.0 %} selected="selected"{% endifequal %} > |
---|
16 | {{ lang.1 }} |
---|
17 | </option> |
---|
18 | {% endfor %} |
---|
19 | </select> |
---|
20 | </li> |
---|
21 | <li> |
---|
22 | <input type="submit" class="{{"Button"|button}}" value="{% trans "Go" %}" /> |
---|
23 | </li> |
---|
24 | </ul> |
---|
25 | </form> |
---|
26 | {% endblock %} |
---|
27 | |
---|
28 | {% block SearchBlock %} |
---|
29 | <div> |
---|
30 | <form id="search_form" method="get" action="." enctype="text/plain"> |
---|
31 | <table id="search_table"> |
---|
32 | {{search_form.as_table}} |
---|
33 | </table> |
---|
34 | <div style="text-align:center"><input id="search_button" type="submit" class="{{"Button"|button}}" value="{% trans "SEARCH !" %}"/></div> |
---|
35 | </form> |
---|
36 | </div> |
---|
37 | {% endblock %} |
---|
38 | |
---|
39 | {% block ResultBlock %} |
---|
40 | {% if link_creation %} |
---|
41 | {% trans "Results for link creation:" %} |
---|
42 | {% endif %} |
---|
43 | <div class="Result"> |
---|
44 | {% for result in results %} |
---|
45 | |
---|
46 | {% if forloop.first %} |
---|
47 | <p> |
---|
48 | {% trans "Results" %} |
---|
49 | <span id="numresults"> |
---|
50 | {% blocktrans with results|length as count and search_count as total %} |
---|
51 | (1 - {{count}} on {{total}}) |
---|
52 | {% endblocktrans %} |
---|
53 | </span> |
---|
54 | </p> |
---|
55 | <ul class="Result"> |
---|
56 | {% endif %} |
---|
57 | |
---|
58 | <li class="Result"> |
---|
59 | {% if navigate_bool %} |
---|
60 | {% if result.object.is_part or result.object.is_document %} |
---|
61 | <div class="toolbar"> |
---|
62 | <button class="attach">{% trans "Attach" %}</button> |
---|
63 | <button class="add_child">{% trans "Add child" %}</button> |
---|
64 | </div> |
---|
65 | {% endif %} |
---|
66 | {% endif %} |
---|
67 | <div class="reference"> |
---|
68 | {{result.rendered|safe}} |
---|
69 | </div> |
---|
70 | <div class="summary"> |
---|
71 | {{ result.highlighted.text|safe }} |
---|
72 | </div> |
---|
73 | {% if link_creation or navigate_bool %} |
---|
74 | <form method="post" action="." enctype="multipart/form-data"> |
---|
75 | {{result.rendered_add|safe}} |
---|
76 | {% if link_creation and result.object|can_add:attach %} |
---|
77 | <input type="submit" class="{{"Button"|button}}" value="{% trans "ADD" %}"/> |
---|
78 | {% endif %} |
---|
79 | </form> |
---|
80 | |
---|
81 | {% endif %} |
---|
82 | </li> |
---|
83 | |
---|
84 | {% if forloop.last %} |
---|
85 | </ul> |
---|
86 | {% endif %} |
---|
87 | |
---|
88 | {% empty %} |
---|
89 | <p>{% trans "No result matching given query" %}</p> |
---|
90 | {% endfor %} |
---|
91 | </div> |
---|
92 | {% endblock %} |
---|
93 | |
---|
94 | {% block CreationBlock %} |
---|
95 | {% if user.get_profile.is_contributor %} |
---|
96 | <form method="get" action="/object/create/" enctype="text/plain"> |
---|
97 | <ul id="createbar"> |
---|
98 | {% with type_form4creation.visible_fields.0 as field %} |
---|
99 | <span id="select_type">{{field.label }}</span> |
---|
100 | <li> |
---|
101 | {{ field }} |
---|
102 | {% endwith %} |
---|
103 | <input id="create_button" type="submit" |
---|
104 | class="{{"Button"|button}}" |
---|
105 | title="{% trans "Click here to create a new object." %}" |
---|
106 | value="{% trans "CREATE !" %}"/> |
---|
107 | </li> |
---|
108 | </ul> |
---|
109 | <ul id="importbar"> |
---|
110 | <li class="{{"Button"|button}}" id="ImportButton"> |
---|
111 | <a href="/import/csv/"> |
---|
112 | <span class="ui-button-text">{% trans "Import" %}</span> |
---|
113 | </a> |
---|
114 | </li> |
---|
115 | <li class="{{"Button"|button}}" id="ImportBOMButton"> |
---|
116 | <a href="/import/bom/"> |
---|
117 | <span class="ui-button-text">{% trans "Import a BOM" %}</span> |
---|
118 | </a> |
---|
119 | </li> |
---|
120 | </ul> |
---|
121 | </form> |
---|
122 | {% else %} |
---|
123 | <p>{% trans "You can not create an object since you are not a contributor."%}</p> |
---|
124 | {% endif %} |
---|
125 | {% endblock %} |
---|
126 | |
---|
127 | |
---|
128 | |
---|
129 | |
---|