Revision: 5930
          
http://languagetool.svn.sourceforge.net/languagetool/?rev=5930&view=rev
Author:   dnaber
Date:     2011-11-18 23:22:43 +0000 (Fri, 18 Nov 2011)
Log Message:
-----------
link from rule details to Wikipedia rule matches (if there are matches for that 
rule)

Modified Paths:
--------------
    
trunk/ltcommunity/grails-app/controllers/org/languagetool/RuleController.groovy
    trunk/ltcommunity/grails-app/i18n/messages.properties
    trunk/ltcommunity/grails-app/views/rule/show.gsp

Modified: 
trunk/ltcommunity/grails-app/controllers/org/languagetool/RuleController.groovy
===================================================================
--- 
trunk/ltcommunity/grails-app/controllers/org/languagetool/RuleController.groovy 
    2011-11-18 22:51:24 UTC (rev 5929)
+++ 
trunk/ltcommunity/grails-app/controllers/org/languagetool/RuleController.groovy 
    2011-11-18 23:22:43 UTC (rev 5930)
@@ -273,8 +273,14 @@
     if (params.textToCheck) {
       textToCheck = params.textToCheck
     }
+    def matchCriteria = CorpusMatch.createCriteria()
+    def corpusMatchCount = matchCriteria.count {
+      eq('ruleID', selectedRule.id)
+      eq('languageCode', lang)
+      eq('isVisible', true)
+    }
     render(view:'show', model: [ rule: selectedRule, isDisabled: disableId != 
-1, disableId: disableId,
-      isUserRule: isUserRule, ruleId: params.id, textToCheck: textToCheck ],
+      isUserRule: isUserRule, ruleId: params.id, textToCheck: textToCheck, 
corpusMatchCount: corpusMatchCount],
                                  contentType: "text/html", encoding: "utf-8")
     
   }

Modified: trunk/ltcommunity/grails-app/i18n/messages.properties
===================================================================
--- trunk/ltcommunity/grails-app/i18n/messages.properties       2011-11-18 
22:51:24 UTC (rev 5929)
+++ trunk/ltcommunity/grails-app/i18n/messages.properties       2011-11-18 
23:22:43 UTC (rev 5930)
@@ -75,6 +75,8 @@
 ltc.rule.show.correct.sentences=Correct sentences for comparison:
 ltc.rule.show.no.examples=[no examples found]
 ltc.rule.show.check.text=Check the following text against just this rule:
+ltc.rule.show.corpus.link=There are {0} matches of this rule in our Wikipedia 
check result.
+ltc.rule.show.corpus.link.show=Show those matches
 
 ltc.rule.browse.title=Browse Rules: {0} matches
 ltc.rule.browse.active=Active?

Modified: trunk/ltcommunity/grails-app/views/rule/show.gsp
===================================================================
--- trunk/ltcommunity/grails-app/views/rule/show.gsp    2011-11-18 22:51:24 UTC 
(rev 5929)
+++ trunk/ltcommunity/grails-app/views/rule/show.gsp    2011-11-18 23:22:43 UTC 
(rev 5930)
@@ -138,6 +138,13 @@
                 <g:render template="/ruleMatches"/>
             </g:if>
             
+            <p style="margin-top:10px">
+            <g:message code="ltc.rule.show.corpus.link" 
args="${[corpusMatchCount]}"/>
+            <g:if test="${corpusMatchCount > 0}">
+                <g:link controller="corpusMatch" action="list" 
params="${[lang: params.lang, filter: ruleId]}"><g:message 
code="ltc.rule.show.corpus.link.show"/></g:link>
+            </g:if>
+            </p>
+            
         </div>
     </body>
 </html>

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Languagetool-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-cvs

Reply via email to