Localisation of school form

Issue #175 closed
Brian Lewis repo owner created an issue

RMI requires some extra tabs. In principal how do we support this.

The issue is : how do we account for minor changes or extensions from system to system, but keep a common core that is not individually maintained.

Comments (6)

  1. Brian Lewis reporter
    • edited description

    The 'polymorphism' that is implicit in the MVC folder search hierarchy (ie forst look in the context folder, then the default folder) will form the basis of any server side localisation. But this can be combined with other templating techniques in Razor.

    The branch RenderActionTest shows a possible solution to the specific question of having addtional tabs in the school form.

    The school template has been change to include

    @{html.RenderAction("contextTabs")};
    

    This forces razor to evaluate the Action contextTabs on controller School. The point of this ( and why this is better than a partial view) is that it forces a search through the folder search hierarchy again, so even using the default SchoolItem.cshtml, we will pick up a context-specific contextTabs.cshtml if it exists.

    You'll see the difference in this example by changing context to kemis in web.config.

  2. Brian Lewis reporter

    Another way to exploit the current context when creating a razor view is to use the method

    IsInstanceContext(contextName)

    This is available inside the view page like so:

    @if (IsInstanceContext("miemis"))
    {
        // stuff specific to miemis
    
            <div class="panel panel-primary">stuff</div>
    }
    

    This is available because Softwords.Web subclasses the RazorBasePage.

    But - the first approach based on RenderAction looks better as you do not get context-specific material polluting the default.

  3. Brian Lewis reporter

    Using RenderAction in this way begs the question - what happens if we need additional client-side functionality to support these additional tabs?

    I'd suggest in principle than that the context-specific markup refers to an angular component.

  4. Ghislain Hachey

    Well it will just have to be added, I don't think there is a way around this. But as you suggest, with the Angular component this should be made quite clear and hopefully maybe even useful in other countries would need/like a similar feature in their context. Anyway, got this ready for review and merge.

  5. Ghislain Hachey

    chore(QuarterlyReports): refactoring work

    • refactor quarterly reports tab to be componentized
    • move RMI quarterly reports tab into its context specific Views

    Closes: #175

    → <<cset 5c42f985dd4f>>

  6. Brian Lewis reporter

    chore(QuarterlyReports): refactoring work

    • refactor quarterly reports tab to be componentized
    • move RMI quarterly reports tab into its context specific Views

    Closes: #175

    → <<cset 5c42f985dd4f>>

  7. Log in to comment