Project

General

Profile

« Previous | Next » 

Revision 9561

Added by Chris Jones over 8 years ago

Add project-level rendering into the eml-dataset XSLT. Convert the older table-based layout to use the Bootstrap 2.x classes for labels and divs.

refs https://github.nceas.ucsb.edu/KNB/arctic-data/issues/42

View differences:

eml-project.xsl
38 38

  
39 39

  
40 40
   <xsl:template name="project">
41
      <xsl:param name="projectfirstColStyle"/>
42
      <table class="{$tabledefaultStyle}">
43 41
        <xsl:choose>
44 42
         <xsl:when test="references!=''">
45 43
          <xsl:variable name="ref_id" select="references"/>
46 44
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
47 45
          <xsl:for-each select="$references">
48
            <xsl:call-template name="projectcommon">
49
             <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
50
            </xsl:call-template>
46
            <div class="row-fluid project" data-content="project">
47
              <xsl:call-template name="projectcommon" />
48
            </div>
51 49
          </xsl:for-each>
52 50
        </xsl:when>
53 51
        <xsl:otherwise>
54
          <xsl:call-template name="projectcommon">
55
             <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
56
           </xsl:call-template>
52
          <div class="row-fluid project" data-content="project" id="project">
53
            <xsl:call-template name="projectcommon" />
54
          </div>
57 55
        </xsl:otherwise>
58 56
      </xsl:choose>
59
      </table>
60 57
  </xsl:template>
61 58

  
62 59

  
63 60

  
64 61
  <xsl:template name="projectcommon">
65
    <xsl:param name="projectfirstColStyle"/>
66
    <xsl:call-template name="projecttitle">
67
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
68
    </xsl:call-template>
69
    <xsl:call-template name="projectpersonnel">
70
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
71
    </xsl:call-template>
72
    <xsl:call-template name="projectabstract">
73
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
74
    </xsl:call-template>
75
    <xsl:call-template name="projectfunding">
76
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
77
    </xsl:call-template>
78
   <xsl:call-template name="projectstudyareadescription">
79
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
80
    </xsl:call-template>
81
    <xsl:call-template name="projectdesigndescription">
82
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
83
    </xsl:call-template>
84
    <xsl:call-template name="projectrelatedproject">
85
      <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
86
    </xsl:call-template>
62
    <xsl:call-template name="projecttitle" />
63
    <xsl:call-template name="projectpersonnel" />
64
    <xsl:call-template name="projectabstract" />
65
    <xsl:call-template name="projectfunding" />
66
    <xsl:call-template name="projectstudyareadescription" />
67
    <xsl:call-template name="projectdesigndescription" />
68
    <xsl:call-template name="projectrelatedproject" />
87 69
  </xsl:template>
88 70

  
89 71

  
90 72

  
91 73
   <xsl:template name="projecttitle">
92
     <xsl:param name="projectfirstColStyle"/>
93 74
     <xsl:for-each select="title">
94
        <tr><td class="{$projectfirstColStyle}">
95
             Title:
96
             </td>
97
             <td class="{$secondColStyle}" >
98
              <xsl:value-of select="../title"/>
99
             </td>
100
       </tr>
75
	   <div class="control-group">
76
	     <label class="control-label projectTitle">Title:</label>
77
	   	 <div class="controls controls-well">
78
		   <xsl:value-of select="../title" />
79
	   	 </div>
80
	   </div>
101 81
     </xsl:for-each>
102 82
  </xsl:template>
103 83

  
104 84

  
105 85

  
106 86
  <xsl:template name="projectpersonnel">
107
     <xsl:param name="projectfirstColStyle"/>
108
     <tr><td class="{$projectfirstColStyle}">
109
          Personnel:
110
          </td>
111
          <td>
112
             <table>
113
                 <xsl:for-each select="personnel">
114
                       <tr><td colspan="2">
115
                              <xsl:call-template name="party">
116
                                 <xsl:with-param name="partyfirstColStyle" select="$projectfirstColStyle"/>
117
                              </xsl:call-template>
118
                       </td></tr>
119
                       <xsl:for-each select="role">
120
                          <tr><td class="{$projectfirstColStyle}">
121
                                 Role:
122
                               </td>
123
                               <td>
124
                                 <table class="{$tablepartyStyle}">
125
                                     <tr>
126
                                         <td class="{$secondColStyle}">
127
                                            <xsl:value-of select="."/>
128
                                          </td>
129
                                      </tr>
130
                                  </table>
131
                               </td>
132
                          </tr>
133
                      </xsl:for-each>
134
                </xsl:for-each>
135
             </table>
136
         </td>
137
     </tr>
87
	<div class="control-group">
88
		<label class="control-label projectPersonnel">Personnel:</label>
89
		<div class="controls control-well">
90
			<xsl:for-each select="personnel">
91

  
92
				<xsl:call-template name="party" />
93

  
94
				<xsl:for-each select="role">
95
					<label class="control-label projectRole">Role:</label>
96
					<div class="controls controls-well">
97
						<xsl:value-of select="." />
98
					</div>
99
				</xsl:for-each>
100

  
101
			</xsl:for-each>
102
		</div>
103
	</div>
138 104
  </xsl:template>
139 105

  
140 106

  
141 107
   <xsl:template name="projectabstract">
142
     <xsl:param name="projectfirstColStyle"/>
143 108
     <xsl:for-each select="abstract">
144
       <tr><td class="{$projectfirstColStyle}">
145
          Abstract:
146
          </td>
147
          <td>
148
             <xsl:call-template name="text">
149
                <xsl:with-param name="textfirstColStyle" select="$projectfirstColStyle"/>
150
             </xsl:call-template>
151
         </td>
152
       </tr>
109
       <div class="control-group">
110
         <label class="control-label projectAbstract">Abstract:</label>
111
         <xsl:call-template name="text" />
112
       </div>
153 113
     </xsl:for-each>
154 114
  </xsl:template>
155 115

  
156 116
  <xsl:template name="projectfunding">
157
     <xsl:param name="projectfirstColStyle"/>
158 117
     <xsl:for-each select="funding">
159
       <tr><td class="{$projectfirstColStyle}">
160
          Funding:
161
          </td>
162
          <td>
163
              <xsl:call-template name="text">
164
                 <xsl:with-param name="textfirstColStyle" select="$projectfirstColStyle"/>
165
              </xsl:call-template>
166
         </td>
167
       </tr>
118
	   <div class="control-group">
119
	     <label class="control-label projectFunding">Funding:</label>
120
	     <div class="controls controls-well projectFundingValue" >
121
	       <xsl:call-template name="text" />
122
	     </div>
123
	   </div>
168 124
    </xsl:for-each>
169 125
  </xsl:template>
170 126

  
171 127

  
172 128

  
173 129
   <xsl:template name="projectstudyareadescription">
174
     <xsl:param name="projectfirstColStyle"/>
175 130
     <xsl:for-each select="studyAreaDescription">
176
       <tr><td class="{$projectfirstColStyle}">
177
           <xsl:text>Study Area:</xsl:text>
178
          </td>
179
          <td>
180
              <table class="{$tabledefaultStyle}">
131
       <label class="control-label projectStudyAreaDescription"><xsl:text>Study Area:</xsl:text></label>
132
              <div class="control-group">
181 133
                  <xsl:for-each select="descriptor">
182 134
                      <xsl:for-each select="descriptorValue">
183
                      <tr><td class="{$projectfirstColStyle}">
184
                            <xsl:value-of select="../@name"/>
185
                          </td>
186
                          <td class="{$secondColStyle}">
135
                      <label class="control-label"><xsl:value-of select="../@name"/></label>
136
                          <div class="controls controls-well">
187 137
                             <xsl:choose>
188 138
                                <xsl:when test="./@citableClassificationSystem">
189 139
                                  <xsl:value-of select="."/>&#160;<xsl:value-of select="./@name_or_id"/>
......
192 142
                                  <xsl:value-of select="."/>&#160;<xsl:value-of select="./@name_or_id"/>&#160;(No Citable Classification System)
193 143
                                </xsl:otherwise>
194 144
                              </xsl:choose>
195
                          </td>
196
                      </tr>
145
                          </div>
197 146
                      </xsl:for-each>
147
                      
198 148
                      <xsl:for-each select="citation">
199
                        <tr><td class="{$projectfirstColStyle}">
200
                              Citation:
201
                            </td>
202
                            <td>
203
                             <xsl:call-template name="citation">
204
                                  <xsl:with-param name="citationfirstColStyle" select="projectfirstColStyle"/>
205
                             </xsl:call-template>
206
                           </td>
207
                       </tr>
149
                        <label class="control-label projectCitation">Citation:</label>
150
                        <div class="controls controls-well">
151
                          <xsl:call-template name="citation" />
152
                        </div>
208 153
                    </xsl:for-each>
154
                    
209 155
               </xsl:for-each>
210
            </table>
211
         </td>
212
       </tr>
156
            </div>
213 157

  
214 158
       <xsl:for-each select="citation">
215
         <tr><td class="{$projectfirstColStyle}">
216
          Study Area Citation:
217
          </td>
218
          <td>
219
              <xsl:call-template name="citation">
220
                   <xsl:with-param name="citationfirstColStyle" select="projectfirstColStyle"/>
221
               </xsl:call-template>
222
          </td>
223
        </tr>
159
          <div class="control-group">
160
			<label class="control-label projectCitation">Study Area Citation:</label>
161
            <div class="controls controls-well">
162
              <xsl:call-template name="citation" />
163
            </div>
164
          </div>
165
          
224 166
      </xsl:for-each>
225 167

  
226 168
       <xsl:for-each select="coverage">
227
        <tr><td class="{$projectfirstColStyle}">
228
          Study Area Coverage:
229
          </td>
230
          <td>
231
             <xsl:call-template name="coverage"/>
232
          </td>
233
        </tr>
169
         <div class="control-group">
170
           <label class="control-label">Study Area Coverage:</label>
171
           <div class="controls controls-well">
172
             <xsl:call-template name="coverage" />
173
           </div>
174
         </div>
234 175
      </xsl:for-each>
235 176
    </xsl:for-each>
236 177
   </xsl:template>
......
238 179

  
239 180

  
240 181
  <xsl:template name="projectdesigndescription">
241
    <xsl:param name="projectfirstColStyle"/>
242 182
    <xsl:for-each select="designDescription">
243 183
       <xsl:for-each select="description">
244
        <tr><td class="{$projectfirstColStyle}">
245
          Design Description:
246
          </td>
247
          <td>
184
         <div class="control-group">
185
           <label class="control-label">Design Description:</label>
186
           <div class="controls controls-well">
248 187
             <xsl:call-template name="text"/>
249
         </td>
250
       </tr>
188
           </div>
189
         </div>
251 190
      </xsl:for-each>
252 191
      <xsl:for-each select="citation">
253
        <tr><td class="{$projectfirstColStyle}">
254
          Design Citation:
255
          </td>
256
          <td >
192
        <div class="control-group">
193
          <label class="control-label">Design Citation:</label>
194
          <div class="controls controls-well">
257 195
             <xsl:call-template name="citation"/>
258
         </td>
259
       </tr>
196
          </div>
197
       </div>
260 198
      </xsl:for-each>
261 199
    </xsl:for-each>
262 200
  </xsl:template>
......
264 202

  
265 203

  
266 204
  <xsl:template name="projectrelatedproject">
267
    <xsl:param name="projectfirstColStyle"/>
268 205
    <xsl:for-each select="relatedProject">
269
       <tr><td class="{$projectfirstColStyle}">
270
          Related Project:
271
          </td>
272
          <td>
273
            <xsl:call-template name="project">
274
              <xsl:with-param name="projectfirstColStyle" select="$projectfirstColStyle"/>
275
            </xsl:call-template>
276
         </td>
277
       </tr>
206
       <div class="control-group">
207
       <label class="control-label">Related Project:</label>
208
          <div>
209
            <xsl:call-template name="project" />
210
         </div>
211
       </div>
278 212
    </xsl:for-each>
279 213
  </xsl:template>
280 214

  

Also available in: Unified diff