Add a relation between IDF_Project and IDF_Tag (again), this time
its a many-to-many. We store project tags in IDF_Tag with a project id "0" (this has minimal to no impact on existing code) and therefor only need to ensure that the new relation table exists in the migration. Then just the project summary configuration and the admin's project create and project update forms and views needed to be adapted to be able to render, create and update project tags.
This commit is contained in:
@@ -37,6 +37,17 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{$form.f.label1.labelTag}:</th>
|
||||
<td>
|
||||
{if $form.f.label1.errors}{$form.f.label1.fieldErrors}{/if}{$form.f.label1|unsafe}
|
||||
{if $form.f.label2.errors}{$form.f.label2.fieldErrors}{/if}{$form.f.label2|unsafe}
|
||||
{if $form.f.label3.errors}{$form.f.label3.fieldErrors}{/if}{$form.f.label3|unsafe}<br />
|
||||
{if $form.f.label4.errors}{$form.f.label4.fieldErrors}{/if}{$form.f.label4|unsafe}
|
||||
{if $form.f.label5.errors}{$form.f.label5.fieldErrors}{/if}{$form.f.label5|unsafe}
|
||||
{if $form.f.label6.errors}{$form.f.label6.fieldErrors}{/if}{$form.f.label6|unsafe}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><strong>{trans 'Current logo'}:</strong></th>
|
||||
<td>
|
||||
{if $logo}
|
||||
@@ -66,6 +77,7 @@
|
||||
</td>
|
||||
</table>
|
||||
</form>
|
||||
{include 'idf/project/js-autocomplete.html'}{/block}
|
||||
{/block}
|
||||
|
||||
{block context}
|
||||
|
@@ -37,7 +37,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><strong>{$form.f.external_project_url.labelTag}:</strong></th>
|
||||
<th>{$form.f.external_project_url.labelTag}:</th>
|
||||
<td>{if $form.f.external_project_url.errors}{$form.f.external_project_url.fieldErrors}{/if}
|
||||
{$form.f.external_project_url|unsafe}
|
||||
</td>
|
||||
@@ -81,6 +81,17 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="no-template">
|
||||
<th>{$form.f.label1.labelTag}:</th>
|
||||
<td>
|
||||
{if $form.f.label1.errors}{$form.f.label1.fieldErrors}{/if}{$form.f.label1|unsafe}
|
||||
{if $form.f.label2.errors}{$form.f.label2.fieldErrors}{/if}{$form.f.label2|unsafe}<br />
|
||||
{if $form.f.label3.errors}{$form.f.label3.fieldErrors}{/if}{$form.f.label3|unsafe}
|
||||
{if $form.f.label4.errors}{$form.f.label4.fieldErrors}{/if}{$form.f.label4|unsafe}<br />
|
||||
{if $form.f.label5.errors}{$form.f.label5.fieldErrors}{/if}{$form.f.label5|unsafe}
|
||||
{if $form.f.label6.errors}{$form.f.label6.fieldErrors}{/if}{$form.f.label6|unsafe}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="no-template">
|
||||
<th><strong>{$form.f.owners.labelTag}:</strong></th>
|
||||
<td>
|
||||
{if $form.f.owners.errors}{$form.f.owners.fieldErrors}{/if}
|
||||
@@ -109,7 +120,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
{include 'idf/project/js-autocomplete.html'}{/block}
|
||||
{/block}
|
||||
|
||||
{block context}
|
||||
@@ -157,7 +168,7 @@ $(document).ready(function() {
|
||||
}
|
||||
|
||||
});
|
||||
// Hide if not svn
|
||||
// Hide if not templated
|
||||
if ($("#id_template option:selected").val() == "--") {
|
||||
$(".no-template").show();
|
||||
} else {
|
||||
|
@@ -26,7 +26,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><strong>{$form.f.external_project_url.labelTag}:</strong></th>
|
||||
<th>{$form.f.external_project_url.labelTag}:</th>
|
||||
<td>{if $form.f.external_project_url.errors}{$form.f.external_project_url.fieldErrors}{/if}
|
||||
{$form.f.external_project_url|unsafe}
|
||||
</td>
|
||||
@@ -41,6 +41,17 @@
|
||||
</tr>
|
||||
{/if}
|
||||
<tr>
|
||||
<th>{$form.f.label1.labelTag}:</th>
|
||||
<td>
|
||||
{if $form.f.label1.errors}{$form.f.label1.fieldErrors}{/if}{$form.f.label1|unsafe}
|
||||
{if $form.f.label2.errors}{$form.f.label2.fieldErrors}{/if}{$form.f.label2|unsafe}<br />
|
||||
{if $form.f.label3.errors}{$form.f.label3.fieldErrors}{/if}{$form.f.label3|unsafe}
|
||||
{if $form.f.label4.errors}{$form.f.label4.fieldErrors}{/if}{$form.f.label4|unsafe}<br />
|
||||
{if $form.f.label5.errors}{$form.f.label5.fieldErrors}{/if}{$form.f.label5|unsafe}
|
||||
{if $form.f.label6.errors}{$form.f.label6.fieldErrors}{/if}{$form.f.label6|unsafe}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><strong>{$form.f.owners.labelTag}:</strong></th>
|
||||
<td>
|
||||
{if $form.f.owners.errors}{$form.f.owners.fieldErrors}{/if}
|
||||
@@ -66,7 +77,9 @@
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
{include 'idf/project/js-autocomplete.html'}{/block}
|
||||
{/block}
|
||||
|
||||
{block context}
|
||||
<div class="issue-submit-info">
|
||||
{blocktrans}
|
||||
|
25
src/IDF/templates/idf/project/js-autocomplete.html
Normal file
25
src/IDF/templates/idf/project/js-autocomplete.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<script type="text/javascript" src="{media '/idf/js/jquery.bgiframe.min.js'}"></script>
|
||||
<script type="text/javascript" src="{media '/idf/js/jquery.autocomplete.min.js'}"></script>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
// <!-- {literal}
|
||||
$(document).ready(function(){
|
||||
var auto_labels = [{/literal}{$auto_labels|safe}{literal}];
|
||||
|
||||
for (j=1;j<7;j++) {
|
||||
$("#id_label"+j).autocomplete(auto_labels, {
|
||||
minChars: 0,
|
||||
width: 310,
|
||||
matchContains: true,
|
||||
max: 50,
|
||||
highlightItem: false,
|
||||
formatItem: function(row, i, max, term) {
|
||||
return row.to.replace(new RegExp("(" + term + ")", "gi"), "<strong>$1</strong>") + " <span style='font-size: 80%;'>" + row.name + "</span>";
|
||||
},
|
||||
formatResult: function(row) {
|
||||
return row.to;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
{/literal} //-->
|
||||
</script>
|
Reference in New Issue
Block a user