@@ -126,7 +126,7 @@ protected IEnumerable<IDocument> GetDocuments (IEnumerable<IDocument> documents)
126
126
_signatureColumnHeader ?? ( _signatureColumnHeader =
127
127
Localization . GetString ( "DocumentSignature_Column.Text" , Context . LocalResourceFile ) ) ;
128
128
129
- string FormatDocumentsLinkWithData ( IEnumerable < IDocument > documents , string columnSlug , string microdata = "" ,
129
+ string RenderDocumentsLinkWithData ( IEnumerable < IDocument > documents , string columnSlug , string microdata = "" ,
130
130
string noLinksText = "-" )
131
131
{
132
132
var microdataAttrs = ! string . IsNullOrEmpty ( microdata ) ? " " + microdata : string . Empty ;
@@ -141,7 +141,7 @@ string FormatDocumentsLinkWithData (IEnumerable<IDocument> documents, string col
141
141
) ;
142
142
143
143
foreach ( var document in documents ) {
144
- GenerateDocumentsTableRow ( table , document ) ;
144
+ RenderDocumentsTableRow ( table , document ) ;
145
145
}
146
146
147
147
table . Append ( "</tbody></table></span>" ) ;
@@ -151,17 +151,18 @@ string FormatDocumentsLinkWithData (IEnumerable<IDocument> documents, string col
151
151
return $ "<span{ microdataAttrs } >{ noLinksText } </span>";
152
152
}
153
153
154
- void GenerateDocumentsTableRow ( StringBuilder table , IDocument document )
154
+ void RenderDocumentsTableRow ( StringBuilder table , IDocument document )
155
155
{
156
156
var docTitle = ! string . IsNullOrEmpty ( document . Title )
157
157
? document . Title
158
158
: Localization . GetString ( "LinkOpen.Text" , Context . LocalResourceFile ) ;
159
- var docUrl =
160
- UniversityUrlHelper . LinkClick ( document . Url , Context . Module . TabId , Context . Module . ModuleId ) ;
161
159
162
- var sigFile =
163
- UniversityFileHelper . Instance . GetSignatureFile (
164
- UniversityFileHelper . Instance . GetFileByUrl ( document . Url ) ) ;
160
+ var docUrl = UniversityUrlHelper . LinkClick ( document . Url , Context . Module . TabId , Context . Module . ModuleId ) ;
161
+
162
+ var docFile = UniversityFileHelper . Instance . GetFileByUrl ( document . Url ) ;
163
+
164
+ var sigFile = docFile != null ? UniversityFileHelper . Instance . GetSignatureFile ( docFile ) : null ;
165
+
165
166
var sigUrl = sigFile != null
166
167
? UniversityUrlHelper . LinkClickFile ( sigFile . FileId , Context . Module . TabId ,
167
168
Context . Module . ModuleId )
@@ -173,7 +174,7 @@ void GenerateDocumentsTableRow (StringBuilder table, IDocument document)
173
174
174
175
table . Append ( $ "<tr{ rowCssClassAttr } >") ;
175
176
table . Append ( $ "<td><a href=\" { docUrl } \" target=\" _blank\" >{ docTitle } </a></td>") ;
176
- if ( sigFile != null ) {
177
+ if ( ! string . IsNullOrEmpty ( sigUrl ) ) {
177
178
table . Append ( $ "<td><a href=\" { sigUrl } \" ><i class=\" fas fa-signature\" title=\" { Context . LocalizeString ( "Signature.Text" ) } \" ></i></a></td>") ;
178
179
}
179
180
else {
@@ -189,7 +190,7 @@ string GetEduProgramLinks ()
189
190
UniversityFormatHelper . FormatEduProfileTitle ( EduProgram . Title , ProfileCode , ProfileTitle )
190
191
. Append ( IsAdopted ? Context . LocalizeString ( "IsAdopted.Text" ) : null , " - " )
191
192
+ " "
192
- + FormatDocumentsLinkWithData (
193
+ + RenderDocumentsLinkWithData (
193
194
GetDocuments ( EduProfile . GetDocumentsOfType ( SystemDocumentType . EduProgram ) ) ,
194
195
"oop" ,
195
196
IsAdopted ? "itemprop=\" adOpMain\" " : "itemprop=\" opMain\" " ,
@@ -199,7 +200,7 @@ string GetEduProgramLinks ()
199
200
200
201
string GetEduPlanLinks ( )
201
202
{
202
- return FormatDocumentsLinkWithData (
203
+ return RenderDocumentsLinkWithData (
203
204
GetDocuments ( EduProfile . GetDocumentsOfType ( SystemDocumentType . EduPlan ) ) ,
204
205
"epl" ,
205
206
IsAdopted ? "itemprop=\" adEducationPlan\" " : "itemprop=\" educationPlan\" "
@@ -208,7 +209,7 @@ string GetEduPlanLinks ()
208
209
209
210
string GetEduScheduleLinks ( )
210
211
{
211
- return FormatDocumentsLinkWithData (
212
+ return RenderDocumentsLinkWithData (
212
213
GetDocuments ( EduProfile . GetDocumentsOfType ( SystemDocumentType . EduSchedule ) ) ,
213
214
"esh" ,
214
215
IsAdopted ? "itemprop=\" adEducationShedule\" " : "itemprop=\" educationShedule\" "
@@ -217,7 +218,7 @@ string GetEduScheduleLinks ()
217
218
218
219
string GetWorkProgramAnnotationLinks ( )
219
220
{
220
- return FormatDocumentsLinkWithData (
221
+ return RenderDocumentsLinkWithData (
221
222
GetDocuments ( EduProfile . GetDocumentsOfType ( SystemDocumentType . WorkProgramAnnotation ) ) ,
222
223
"wpa" ,
223
224
IsAdopted ? "itemprop=\" adEducationAnnotation\" " : "itemprop=\" educationAnnotation\" "
@@ -226,7 +227,7 @@ string GetWorkProgramAnnotationLinks ()
226
227
227
228
string GetEduMaterialLinks ( )
228
229
{
229
- return FormatDocumentsLinkWithData (
230
+ return RenderDocumentsLinkWithData (
230
231
GetDocuments ( EduProfile . GetDocumentsOfType ( SystemDocumentType . EduMaterial ) ) ,
231
232
"met" ,
232
233
IsAdopted ? "itemprop=\" adMethodology\" " : "itemprop=\" methodology\" "
@@ -235,7 +236,7 @@ string GetEduMaterialLinks ()
235
236
236
237
string GetWorkProgramLinks ( )
237
238
{
238
- return FormatDocumentsLinkWithData (
239
+ return RenderDocumentsLinkWithData (
239
240
GetDocuments ( EduProfile . GetDocumentsOfType ( SystemDocumentType . WorkProgram ) ) ,
240
241
"wp" ,
241
242
// TODO: This related to obsolete WorkProgramOfPractice document type
0 commit comments