erichexter / twitter.bootstrap.mvc

nuget package to make bootstrap easy with mvc4
Apache License 2.0
248 stars 134 forks source link

Add support for adding Bootstrap Glyphs to action links #38

Closed serra closed 11 years ago

serra commented 11 years ago

Please review the api d417fe45e4aea023ecd8f91a2604e8504dd55695:

<li>@Html.ActionLinkWithGlyphIcon(Url.Action("Delete", routevalues),
            "Delete",
            GlyphIcons.remove)</li> 

I would have liked something similar to:

<li>@Html.ActionLink("Delete", "Delete", routevalues)
                   .WithGlyph(GlyphIcons.remove))</li> 

But couldn't figure out to achieve that without some horrible string manipulation (or including html agility pack).

erichexter commented 11 years ago

im kind of on the fence about creating strongly typed helpers for rendering html... there is another project called bootstrap extensions that is targeting this.. If we were to start doing this, I would probably want to keep all of these type of view helper extensions in a separate nuget package, that would be totally optional.

erichexter commented 11 years ago

Can you move this into a new extensions file. and create a new package nuspec for this?

Eric Hexter

blog | http://Hex.LosTechies.com info | http://www.linkedin.com/in/erichexter

On Wed, Dec 19, 2012 at 10:10 AM, Marijn van der Zee < notifications@github.com> wrote:

Please review the api d417fe4https://github.com/erichexter/twitter.bootstrap.mvc/commit/d417fe45e4aea023ecd8f91a2604e8504dd55695 :

  • @Html.ActionLinkWithGlyphIcon(Url.Action("Delete", routevalues), "Delete", GlyphIcons.remove)
  • I would have liked something similar to:

  • @Html.ActionLink("Delete", "Delete", routevalues) .WithGlyph(GlyphIcons.remove))
  • But couldn't figure out to achieve that without some horrible string

    manipulation (or including html agility pack).

    You can merge this Pull Request by running:

    git pull https://github.com/serra/twitter.bootstrap.mvc glyphs

    Or view, comment on, or merge it at:

    https://github.com/erichexter/twitter.bootstrap.mvc/pull/38 Commit Summary

    • Helper method for adding anchor with glyph
    • Add helper class with all bootstrap glyphicons
    • Example of using glyphs in Index table

    File Changes

    • M src/BootstrapSupport/ViewHelperExtensions.cs (181)
    • M src/Views/Shared/Index.cshtml (14)

    Patch Links

    serra commented 11 years ago

    I see your point. I did a quick search for the extension project you mention, but couldn't really find it. Got a link, so I can check it out? Probably better to use that project instead of rolling out something similar, especially since I consider myself somewhat novice in this particular area.

    erichexter commented 11 years ago

    I just saw a nuget, ill look for the project.. but for now, we can build them into this project, we just need to build them as a separate feature.. which means a separate folder, namespace and nuget package.. if you put the code in, i will do the rest.

    Eric Hexter

    blog | http://Hex.LosTechies.com info | http://www.linkedin.com/in/erichexter

    On Sun, Dec 23, 2012 at 7:34 AM, Marijn van der Zee < notifications@github.com> wrote:

    I see your point. I did a quick search for the extension project you mention, but couldn't really find it. Got a link, so I can check it out? Probably better to use that project instead of rolling out something similar, especially since I consider myself somewhat novice in this particular area.

    — Reply to this email directly or view it on GitHubhttps://github.com/erichexter/twitter.bootstrap.mvc/pull/38#issuecomment-11646159.

    serra commented 11 years ago

    https://github.com/advancedrei/BootstrapForRazor / http://nuget.org/packages/BootstrapForRazor2 ?

    serra commented 11 years ago

    I'll put this in a separate folder and send a new pull request when done.