Skip to content

Commit

Permalink
Added tag editing and viewing to UI and PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
donker committed Apr 18, 2015
1 parent 683f188 commit 89aab15
Show file tree
Hide file tree
Showing 18 changed files with 71 additions and 5 deletions.
6 changes: 6 additions & 0 deletions App_LocalResources/SharedResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,10 @@
<data name="Audit.Text" xml:space="preserve">
<value>This project was added by {0} on {1}. It was last modified by {2} on {3}.</value>
</data>
<data name="Tags.Help" xml:space="preserve">
<value>Specify some meaningful tags for the project</value>
</data>
<data name="Tags.Text" xml:space="preserve">
<value>Tags</value>
</data>
</root>
4 changes: 4 additions & 0 deletions Common/ModuleBase.vb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ Namespace Common
If Context.Items("ServiceAdded") Is Nothing Then

' Announce at DNN
DotNetNuke.Framework.jQuery.RequestRegistration()
DotNetNuke.Framework.jQuery.RequestDnnPluginsRegistration()
DotNetNuke.Framework.jQuery.RequestUIRegistration()
DotNetNuke.Framework.ServicesFramework.Instance.RequestAjaxScriptSupport()
DotNetNuke.Framework.ServicesFramework.Instance.RequestAjaxAntiForgerySupport()

Expand All @@ -55,9 +57,11 @@ Namespace Common
AddJavascriptFile("es5-sham.min.js", 70)
AddJavascriptFile("angular-file-upload.min.js", 70)
AddJavascriptFile("jquery.colorbox.js", 70)
AddJavascriptFile("ng-tags-input.min.js", 70)

' Css
AddCssFile("colorbox.css")
AddCssFile("ng-tags-input.min.css")

Context.Items("ServiceAdded") = True
End If
Expand Down
10 changes: 8 additions & 2 deletions Common/RouteMapper.vb
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@ Namespace Common
mapRouteManager.MapHttpRoute("Connect/Projects", "Projects1", "{controller}/{action}/{id}", Nothing, New With {.id = "\d*"}, New String() {
"Connect.DNN.Modules.Projects.Controllers",
"Connect.DNN.Modules.Projects.Controllers.Projects",
"Connect.DNN.Modules.Projects.Controllers.ProjectTags",
"Connect.DNN.Modules.Projects.Controllers.ProjectTypes",
"Connect.DNN.Modules.Projects.Controllers.LicenseTypes",
"Connect.DNN.Modules.Projects.Controllers.PTypes"})
"Connect.DNN.Modules.Projects.Controllers.PTypes",
"Connect.DNN.Modules.Projects.Controllers.Terms",
"Connect.DNN.Modules.Projects.Controllers.Urls"})
mapRouteManager.MapHttpRoute("Connect/Projects", "Projects2", "{controller}/{action}", Nothing, Nothing, New String() {
"Connect.DNN.Modules.Projects.Controllers",
"Connect.DNN.Modules.Projects.Controllers.Projects",
"Connect.DNN.Modules.Projects.Controllers.ProjectTags",
"Connect.DNN.Modules.Projects.Controllers.ProjectTypes",
"Connect.DNN.Modules.Projects.Controllers.LicenseTypes",
"Connect.DNN.Modules.Projects.Controllers.PTypes"})
"Connect.DNN.Modules.Projects.Controllers.PTypes",
"Connect.DNN.Modules.Projects.Controllers.Terms",
"Connect.DNN.Modules.Projects.Controllers.Urls"})
End Sub
#End Region

Expand Down
5 changes: 5 additions & 0 deletions Connect.Projects.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@
<Compile Include="Controllers\ProjectTypes\ProjectTypesController_Services.vb" />
<Compile Include="Controllers\PTypes\PTypesController.vb" />
<Compile Include="Controllers\PTypes\PTypesController_Services.vb" />
<Compile Include="Controllers\Terms\TermsController.vb" />
<Compile Include="Controllers\Terms\TermsController_Services.vb" />
<Compile Include="Controllers\Urls\UrlsController.vb" />
<Compile Include="Controllers\Urls\UrlsController_Services.vb" />
<Compile Include="Data\RepositoryImpl.vb" />
Expand Down Expand Up @@ -196,6 +198,8 @@
<Compile Include="Models\PTypes\PTypeBase_Methods.vb" />
<Compile Include="Models\PTypes\PTypeBase_Properties.vb" />
<Compile Include="Models\PTypes\PTypeSelect.vb" />
<Compile Include="Models\Terms\Term_Methods.vb" />
<Compile Include="Models\Terms\Term_Properties.vb" />
<Compile Include="Models\Urls\Url.vb" />
<Compile Include="Models\Urls\UrlBase_Methods.vb" />
<Compile Include="Models\Urls\UrlBase_Properties.vb" />
Expand All @@ -212,6 +216,7 @@
<Compile Include="Repositories\ProjectTypesRepository.vb" />
<Compile Include="Repositories\PTypesBaseRepository.vb" />
<Compile Include="Repositories\PTypesRepository.vb" />
<Compile Include="Repositories\TermsRepository.vb" />
<Compile Include="Repositories\UrlsBaseRepository.vb" />
<Compile Include="Repositories\UrlsRepository.vb" />
<Compile Include="Services\UrlCheckService.vb" />
Expand Down
Binary file modified Controllers/ProjectTags/ProjectTagsController.vb
Binary file not shown.
Binary file modified Controllers/ProjectTags/ProjectTagsController_Services.vb
Binary file not shown.
Binary file modified Controllers/Projects/ProjectsController_Services.vb
Binary file not shown.
Binary file added Controllers/Terms/TermsController.vb
Binary file not shown.
Binary file added Controllers/Terms/TermsController_Services.vb
Binary file not shown.
7 changes: 7 additions & 0 deletions Documents/ProjectDocument.vb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ Namespace Documents
Dim types As String = String.Join(", ", projectTypes.Select(Function(t) t.TypeDescription))
DrawTextBlock(types, GetCourier(bodyFontSize, False), Color.Black, y, 10.0F, 130.0F)
y += distanceToNextHeading
If project.ProjectTags.Count > 0 Then
DrawTextBlock("Project Tags", GetHelvetica(titleFontSize, False), projectColor, y, 10.0F, 130.0F)
y += paddingUnderTitle
Dim tags As String = String.Join(", ", project.ProjectTags.Select(Function(t) t.Name))
DrawTextBlock(tags, GetCourier(bodyFontSize, False), Color.Black, y, 10.0F, 130.0F)
y += distanceToNextHeading
End If
DrawTextBlock("License Type", GetHelvetica(titleFontSize, False), projectColor, y, 10.0F, 130.0F)
y += paddingUnderTitle
DrawTextBlock(project.LicenseType, GetCourier(bodyFontSize, False), Color.Black, y, 10.0F, 130.0F)
Expand Down
Binary file added Models/Terms/Term_Methods.vb
Binary file not shown.
Binary file added Models/Terms/Term_Properties.vb
Binary file not shown.
Binary file added Repositories/TermsRepository.vb
Binary file not shown.
16 changes: 16 additions & 0 deletions Views/Partials/EditProject.vbhtml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@
</ul>
</div>
</div>
<div class="dnnFormItem">
<div class="dnnLabel">
<label>
<span>@Html.GetLocalizedString("Tags")</span>
</label>
<a href="#" class="dnnFormHelp" tabindex="-1"></a>
<div class="dnnTooltip" style="position: absolute; right: -29%; top: -102px;">
<div class="dnnFormHelpContent dnnClear" style="visibility: hidden;">
<span class="dnnHelpText">@Html.GetLocalizedString("Tags.Help")</span>
</div>
</div>
</div>
<tags-input data-ng-model="project.ProjectTags" display-property="Name" key-property="TermId">
<auto-complete source="loadTags($query)" display-property="Name" min-length="2"></auto-complete>
</tags-input>
</div>
<div class="dnnFormItem" show-errors>
<div class="dnnLabel">
<label>
Expand Down
5 changes: 5 additions & 0 deletions Views/Partials/ProjectDetails.vbhtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
<span data-ng-repeat="pt in project.ProjectTypes | filter:{IsSelected: true}" class="cp_tag">{{pt.TypeDescription}}</span>
</dd>
<div style="clear:both"></div>
<dt>@Html.GetLocalizedString("Tags")</dt>
<dd>
<span data-ng-repeat="t in project.ProjectTags" class="cp_tag">{{t.Name}}</span>
</dd>
<div style="clear:both"></div>
<dt>@Html.GetLocalizedString("LicenseType")</dt>
<dd>{{project.LicenseType}}&nbsp;</dd>
<div style="clear:both"></div>
Expand Down
1 change: 1 addition & 0 deletions css/ng-tags-input.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 18 additions & 3 deletions js/connect.projects.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var mod = angular.module('projectsModule', ['ngRoute', 'angularFileUpload', 'stringFormatterModule']);
var mod = angular.module('projectsModule', ['ngRoute', 'angularFileUpload', 'stringFormatterModule', 'ngTagsInput']);

mod.config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/Projects', {
Expand Down Expand Up @@ -45,12 +45,16 @@ mod.factory('projectsFactory', [function () {
});
}

var dataCall = function (moduleId, controller, action, data, success, fail) {
var dataCall = function (moduleId, controller, action, data, success, fail, async) {
if (async == undefined) {
async = true;
};
$.ajax({
type: "GET",
url: $.dnnSF(moduleId).getServiceRoot('Connect/Projects') + controller + '/' + action,
beforeSend: $.dnnSF(moduleId).setModuleHeaders,
data: data
data: data,
async: async
}).done(function (retdata) {
if (success != undefined) {
success(retdata);
Expand Down Expand Up @@ -120,6 +124,13 @@ mod.factory('projectsFactory', [function () {
},
commitFile: function (moduleId, projectId, fileName, success, fail) {
dataCall(moduleId, 'Album', 'CommitFile', { id: projectId, fileName: fileName }, success, fail);
},
loadTags: function (moduleId, query) {
var res;
dataCall(moduleId, 'Terms', 'Search', { query: query }, function(data) {
res = data;
}, null, false);
return res;
}
}
}]);
Expand Down Expand Up @@ -246,6 +257,10 @@ mod.controller('ProjectDetailCtrl', ['$scope', '$filter', '$routeParams', 'proje
$scope.$apply();
}
}
$scope.loadTags = function (query) {
var res = projectsFactory.loadTags($scope.moduleId, query);
return res;
}
}]);

mod.directive('showErrors', function () {
Expand Down
Loading

0 comments on commit 89aab15

Please sign in to comment.